Skip to content

Commit

Permalink
MFC r184408:
Browse files Browse the repository at this point in the history
Provide an explanation for getinoquota() call in the ufs_access vop.

Approved by:	re (kensmith)
  • Loading branch information
kostikbel committed Nov 3, 2008
1 parent 0cc3eaf commit beb135c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sys/ufs/ufs/ufs_vnops.c
Expand Up @@ -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, ap->a_td) != LK_EXCLUSIVE) {

/*
* Upgrade vnode lock, since getinoquota()
* requires exclusive lock to modify inode.
*/
relocked = 1;
vhold(vp);
vn_lock(vp, LK_UPGRADE | LK_RETRY, ap->a_td);
Expand Down

0 comments on commit beb135c

Please sign in to comment.