Page MenuHomeFreeBSD

D32227.diff
No OneTemporary

D32227.diff

diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c
--- a/stand/common/dev_net.c
+++ b/stand/common/dev_net.c
@@ -114,7 +114,7 @@
/*
* Called by devopen after it sets f->f_dev to our devsw entry.
- * This opens the low-level device and sets f->f_devdata.
+ * This opens the low-level device and sets dev->d_opendata.
* This is declared with variable arguments...
*/
static int
@@ -193,20 +193,22 @@
}
netdev_opens++;
- f->f_devdata = &netdev_sock;
+ dev->d_opendata = &netdev_sock;
return (error);
}
static int
net_close(struct open_file *f)
{
+ struct devdesc *dev;
#ifdef NETIF_DEBUG
if (debug)
printf("%s: opens=%d\n", __func__, netdev_opens);
#endif
- f->f_devdata = NULL;
+ dev = f->f_devdata;
+ dev->d_opendata = NULL;
return (0);
}
diff --git a/stand/libsa/nfs.c b/stand/libsa/nfs.c
--- a/stand/libsa/nfs.c
+++ b/stand/libsa/nfs.c
@@ -464,6 +464,7 @@
int
nfs_open(const char *upath, struct open_file *f)
{
+ struct devdesc *dev;
struct iodesc *desc;
struct nfs_iodesc *currfd = NULL;
char buf[2 * NFS_V3MAXFHSIZE + 3];
@@ -484,6 +485,7 @@
if (netproto != NET_NFS)
return (EINVAL);
+ dev = f->f_devdata;
#ifdef NFS_DEBUG
if (debug)
printf("nfs_open: %s (rootip=%s rootpath=%s)\n", upath,
@@ -497,7 +499,7 @@
if (f->f_dev->dv_type != DEVT_NET)
return (EINVAL);
- if (!(desc = socktodesc(*(int *)(f->f_devdata))))
+ if (!(desc = socktodesc(*(int *)(dev->d_opendata))))
return (EINVAL);
/* Bind to a reserved port. */
diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c
--- a/stand/libsa/tftp.c
+++ b/stand/libsa/tftp.c
@@ -37,7 +37,8 @@
/*
* Simple TFTP implementation for libsa.
* Assumes:
- * - socket descriptor (int) at open_file->f_devdata
+ * - socket descriptor (int) at dev->d_opendata, dev stored at
+ * open_file->f_devdata
* - server host IP in global rootip
* Restrictions:
* - read only
@@ -432,6 +433,7 @@
static int
tftp_open(const char *path, struct open_file *f)
{
+ struct devdesc *dev;
struct tftp_handle *tftpfile;
struct iodesc *io;
int res;
@@ -452,7 +454,8 @@
return (ENOMEM);
tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE;
- tftpfile->iodesc = io = socktodesc(*(int *)(f->f_devdata));
+ dev = f->f_devdata;
+ tftpfile->iodesc = io = socktodesc(*(int *)(dev->d_opendata));
if (io == NULL) {
free(tftpfile);
return (EINVAL);

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 7, 4:03 AM (2 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40336023
Default Alt Text
D32227.diff (2 KB)

Event Timeline