diff options
author | phk <phk@FreeBSD.org> | 2003-10-15 20:00:59 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-15 20:00:59 +0000 |
commit | c7ba6f536adf4c67536ab613240ae450eaa2a104 (patch) | |
tree | 5d0915f32e1ed1b8c902b03abb06392accc0f5b2 /sys/fs/specfs | |
parent | 58d350029a56f925db4006cb25d59dfae3bdeb66 (diff) | |
download | FreeBSD-src-c7ba6f536adf4c67536ab613240ae450eaa2a104.zip FreeBSD-src-c7ba6f536adf4c67536ab613240ae450eaa2a104.tar.gz |
Introduce a new optional memberfunction for cdevsw, fdopen() which
passes the fdidx from VOP_OPEN down.
This is for all I know the final API for this functionality, but
the locking semantics for messing with the filedescriptor from
the device driver are not settled at this time.
Diffstat (limited to 'sys/fs/specfs')
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index ff09a7a..8b5d2a5 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -196,9 +196,14 @@ spec_open(ap) VOP_UNLOCK(vp, 0, td); if(dsw->d_flags & D_NOGIANT) { DROP_GIANT(); - error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); + if (dsw->d_fdopen != NULL) + error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx); + else + error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); PICKUP_GIANT(); - } else + } else if (dsw->d_fdopen != NULL) + error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx); + else error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); |