Commit c4ed4243 authored by Christoph Hellwig's avatar Christoph Hellwig

xfs: split xfs_setattr

Split up xfs_setattr into two functions, one for the complex truncate
handling, and one for the trivial attribute updates.  Also move both
new routines to xfs_iops.c as they are fairly Linux-specific.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent dec58f1d
...@@ -264,7 +264,7 @@ xfs_set_mode(struct inode *inode, mode_t mode) ...@@ -264,7 +264,7 @@ xfs_set_mode(struct inode *inode, mode_t mode)
iattr.ia_mode = mode; iattr.ia_mode = mode;
iattr.ia_ctime = current_fs_time(inode->i_sb); iattr.ia_ctime = current_fs_time(inode->i_sb);
error = -xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_NOACL); error = -xfs_setattr_nonsize(XFS_I(inode), &iattr, XFS_ATTR_NOACL);
} }
return error; return error;
......
...@@ -944,7 +944,7 @@ xfs_file_fallocate( ...@@ -944,7 +944,7 @@ xfs_file_fallocate(
iattr.ia_valid = ATTR_SIZE; iattr.ia_valid = ATTR_SIZE;
iattr.ia_size = new_size; iattr.ia_size = new_size;
error = -xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK); error = -xfs_setattr_size(ip, &iattr, XFS_ATTR_NOLOCK);
} }
out_unlock: out_unlock:
......
This diff is collapsed.
This diff is collapsed.
...@@ -13,7 +13,8 @@ struct xfs_inode; ...@@ -13,7 +13,8 @@ struct xfs_inode;
struct xfs_iomap; struct xfs_iomap;
int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags); int xfs_setattr_nonsize(struct xfs_inode *ip, struct iattr *vap, int flags);
int xfs_setattr_size(struct xfs_inode *ip, struct iattr *vap, int flags);
#define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */ #define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */
#define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */ #define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */
#define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */ #define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment