diff options
author | kib <kib@FreeBSD.org> | 2008-06-16 17:34:59 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-06-16 17:34:59 +0000 |
commit | eecc60305f3565e1e1bb12659d2fec4ea09ebbf1 (patch) | |
tree | 8e320b542868d0439ab549cd9da52c45bb24aabf /sys/fs/devfs/devfs_devs.c | |
parent | 4c48f0aa48a663c0fbd8b13ab1334deff50098f0 (diff) | |
download | FreeBSD-src-eecc60305f3565e1e1bb12659d2fec4ea09ebbf1.zip FreeBSD-src-eecc60305f3565e1e1bb12659d2fec4ea09ebbf1.tar.gz |
Struct cdev is always the member of the struct cdev_priv. When devfs
needed to promote cdev to cdev_priv, the si_priv pointer was followed.
Use member2struct() to calculate address of the wrapping cdev_priv.
Rename si_priv to __si_reserved.
Tested by: pho
Reviewed by: ed
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/devfs/devfs_devs.c')
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index 1d5e3c9..45f8d58 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -125,7 +125,6 @@ devfs_alloc(void) cdp->cdp_maxdirent = 0; cdev = &cdp->cdp_c; - cdev->si_priv = cdp; cdev->si_name = cdev->__si_namebuf; LIST_INIT(&cdev->si_children); @@ -137,7 +136,7 @@ devfs_free(struct cdev *cdev) { struct cdev_priv *cdp; - cdp = cdev->si_priv; + cdp = cdev2priv(cdev); if (cdev->si_cred != NULL) crfree(cdev->si_cred); if (cdp->cdp_inode > 0) @@ -510,7 +509,7 @@ devfs_create(struct cdev *dev) struct cdev_priv *cdp; mtx_assert(&devmtx, MA_OWNED); - cdp = dev->si_priv; + cdp = cdev2priv(dev); cdp->cdp_flags |= CDP_ACTIVE; cdp->cdp_inode = alloc_unrl(devfs_inos); dev_refl(dev); @@ -524,7 +523,7 @@ devfs_destroy(struct cdev *dev) struct cdev_priv *cdp; mtx_assert(&devmtx, MA_OWNED); - cdp = dev->si_priv; + cdp = cdev2priv(dev); cdp->cdp_flags &= ~CDP_ACTIVE; devfs_generation++; } |