diff options
author | mckusick <mckusick@FreeBSD.org> | 2002-03-17 01:25:47 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2002-03-17 01:25:47 +0000 |
commit | 14dd08fd153468502c32dc2d9c1e25a6c2d761d1 (patch) | |
tree | ee06559e7b5061e6fc6cf074dfca793dd31c681b /sys/ufs/ifs | |
parent | 34dcf8975d103d034d7e8b6788c0645cc93af254 (diff) | |
download | FreeBSD-src-14dd08fd153468502c32dc2d9c1e25a6c2d761d1.zip FreeBSD-src-14dd08fd153468502c32dc2d9c1e25a6c2d761d1.tar.gz |
Add a flags parameter to VFS_VGET to pass through the desired
locking flags when acquiring a vnode. The immediate purpose is
to allow polling lock requests (LK_NOWAIT) needed by soft updates
to avoid deadlock when enlisting other processes to help with
the background cleanup. For the future it will allow the use of
shared locks for read access to vnodes. This change touches a
lot of files as it affects most filesystems within the system.
It has been well tested on FFS, loopback, and CD-ROM filesystems.
only lightly on the others, so if you find a problem there, please
let me (mckusick@mckusick.com) know.
Diffstat (limited to 'sys/ufs/ifs')
-rw-r--r-- | sys/ufs/ifs/ifs_lookup.c | 2 | ||||
-rw-r--r-- | sys/ufs/ifs/ifs_vfsops.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/ufs/ifs/ifs_lookup.c b/sys/ufs/ifs/ifs_lookup.c index c6e5873..510b02b 100644 --- a/sys/ufs/ifs/ifs_lookup.c +++ b/sys/ufs/ifs/ifs_lookup.c @@ -242,7 +242,7 @@ ifs_lookup(ap) return ENOENT; } /* Now, we can get the vnode */ - error = VFS_VGET(vdp->v_mount, (long)inodenum, &tdp); + error = VFS_VGET(vdp->v_mount, (long)inodenum, LK_EXCLUSIVE, &tdp); if (error) return (error); if (!lockparent || !(flags & ISLASTCN)) diff --git a/sys/ufs/ifs/ifs_vfsops.c b/sys/ufs/ifs/ifs_vfsops.c index 7eade14..b86048f 100644 --- a/sys/ufs/ifs/ifs_vfsops.c +++ b/sys/ufs/ifs/ifs_vfsops.c @@ -71,7 +71,7 @@ static MALLOC_DEFINE(M_IFSNODE, "IFS node", "IFS vnode private part"); static int ifs_init (struct vfsconf *); static int ifs_mount (struct mount *, char *, caddr_t, struct nameidata *, struct thread *); -extern int ifs_vget (struct mount *, ino_t, struct vnode **); +extern int ifs_vget (struct mount *, ino_t, int, struct vnode **); @@ -151,9 +151,10 @@ ifs_init(vfsp) } int -ifs_vget(mp, ino, vpp) +ifs_vget(mp, ino, flags, vpp) struct mount *mp; ino_t ino; + int flags; struct vnode **vpp; { struct fs *fs; @@ -167,9 +168,10 @@ ifs_vget(mp, ino, vpp) ump = VFSTOUFS(mp); dev = ump->um_dev; restart: - if ((*vpp = ufs_ihashget(dev, ino)) != NULL) { + if ((error = ufs_ihashget(dev, ino, flags, vpp)) != 0) + return (error); + if (*vpp != NULL) return (0); - } /* * Lock out the creation of new entries in the FFS hash table in |