path: root/sys/gnu/fs/xfs/FreeBSD
diff options
authorTor Egge <tegge@FreeBSD.org>2007-03-13 01:50:27 +0000
committerTor Egge <tegge@FreeBSD.org>2007-03-13 01:50:27 +0000
commit61b9d89ff0a7d4c7bcea7fd083db918e16de41a5 (patch)
tree6dca3f2c99e6dcb6402e1486118e56eb8d5e871b /sys/gnu/fs/xfs/FreeBSD
parent06e83c7e86824a2bf64e797dca3cf56e60ac3e85 (diff)
Make insmntque() externally visibile and allow it to fail (e.g. during
late stages of unmount). On failure, the vnode is recycled. Add insmntque1(), to allow for file system specific cleanup when recycling vnode on failure. Change getnewvnode() to no longer call insmntque(). Previously, embryonic vnodes were put onto the list of vnode belonging to a file system, which is unsafe for a file system marked MPSAFE. Change vfs_hash_insert() to no longer lock the vnode. The caller now has that responsibility. Change most file systems to lock the vnode and call insmntque() or insmntque1() after a new vnode has been sufficiently setup. Handle failed insmntque*() calls by propagating errors to callers, possibly after some file system specific cleanup. Approved by: re (kensmith) Reviewed by: kib In collaboration with: kib
Notes: svn path=/head/; revision=167497
Diffstat (limited to 'sys/gnu/fs/xfs/FreeBSD')
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c b/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
index de5284c5747f..7145b9497a4b 100644
--- a/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
+++ b/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
@@ -391,6 +391,11 @@ xfs_vn_allocate(xfs_mount_t *mp, xfs_inode_t *ip, struct xfs_vnode **vpp)
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
+ error = insmntque(vp, XVFSTOMNT(XFS_MTOVFS(mp)));
+ if (error != 0) {
+ kmem_free(vdata, sizeof(*vdata));
+ return (error);
+ }
vp->v_data = (void *)vdata;
vdata->v_number= 0;