Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 935
b: refs/heads/master
c: 5fcbab3
h: refs/heads/master
i:
  933: d61ba04
  931: cab1f72
  927: e92eb24
v: v3
  • Loading branch information
Dean Roehrich authored and Christoph Hellwig committed May 5, 2005
1 parent ee827fc commit dd934d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9effd8e62570c6e47b91734770e6122002c33ed5
refs/heads/master: 5fcbab355e1528545671a5221666ef640b8250c8
1 change: 1 addition & 0 deletions trunk/fs/xfs/linux-2.6/xfs_vnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ static inline int VN_BAD(struct vnode *vp)
#define ATTR_DMI 0x08 /* invocation from a DMI function */
#define ATTR_LAZY 0x80 /* set/get attributes lazily */
#define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */
#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */

/*
* Flags to VOP_FSYNC and VOP_RECLAIM.
Expand Down
11 changes: 9 additions & 2 deletions trunk/fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ xfs_setattr(
int mandlock_before, mandlock_after;
struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2;
int file_owner;
int need_iolock = (flags & ATTR_DMI) == 0;
int need_iolock = 1;

vp = BHV_TO_VNODE(bdp);
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
Expand Down Expand Up @@ -384,6 +384,9 @@ xfs_setattr(
*/
tp = NULL;
lock_flags = XFS_ILOCK_EXCL;
ASSERT(flags & ATTR_NOLOCK ? flags & ATTR_DMI : 1);
if (flags & ATTR_NOLOCK)
need_iolock = 0;
if (!(mask & XFS_AT_SIZE)) {
if ((mask != (XFS_AT_CTIME|XFS_AT_ATIME|XFS_AT_MTIME)) ||
(mp->m_flags & XFS_MOUNT_WSYNC)) {
Expand Down Expand Up @@ -4320,7 +4323,7 @@ xfs_free_file_space(
int rt;
xfs_fileoff_t startoffset_fsb;
xfs_trans_t *tp;
int need_iolock = (attr_flags & ATTR_DMI) == 0;
int need_iolock = 1;

vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address);
mp = ip->i_mount;
Expand Down Expand Up @@ -4348,8 +4351,12 @@ xfs_free_file_space(
return(error);
}

ASSERT(attr_flags & ATTR_NOLOCK ? attr_flags & ATTR_DMI : 1);
if (attr_flags & ATTR_NOLOCK)
need_iolock = 0;
if (need_iolock)
xfs_ilock(ip, XFS_IOLOCK_EXCL);

rounding = MAX((__uint8_t)(1 << mp->m_sb.sb_blocklog),
(__uint8_t)NBPP);
ilen = len + (offset & (rounding - 1));
Expand Down

0 comments on commit dd934d1

Please sign in to comment.