diff options
author | kib <kib@FreeBSD.org> | 2008-10-28 12:00:28 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-10-28 12:00:28 +0000 |
commit | 19fb7eaf9faed3abf045ff604c41ccb8dfc240af (patch) | |
tree | 44bce348c587a5d91119e7dbd1757336b5dab00c /sys/ufs | |
parent | a2129bd144d95f5685e28f05aec7ce6f4efa6b04 (diff) | |
download | FreeBSD-src-19fb7eaf9faed3abf045ff604c41ccb8dfc240af.zip FreeBSD-src-19fb7eaf9faed3abf045ff604c41ccb8dfc240af.tar.gz |
Provide an explanation for getinoquota() call in the ufs_access vop.
MFC after: 3 days
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 40304bc..eb851cf 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -330,7 +330,18 @@ ufs_access(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); #ifdef QUOTA + /* + * Inode is accounted in the quotas only if struct + * dquot is attached to it. VOP_ACCESS() is called + * from vn_open_cred() and provides a convenient + * point to call getinoquota(). + */ if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + + /* + * Upgrade vnode lock, since getinoquota() + * requires exclusive lock to modify inode. + */ relocked = 1; vhold(vp); vn_lock(vp, LK_UPGRADE | LK_RETRY); |