aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iops.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 16:37:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 16:37:53 -0400
commit37cd9600a9e20359b0283983c9e3a55d84347168 (patch)
treefea12ce0ecbaf417b0d835b3cbee14e973103fad /fs/xfs/xfs_iops.c
parent95b18e69950ca7fd9acfa55964e929f58bec9379 (diff)
parent9a57fa8ee7c29e11c2a29ce058573ba99157eda7 (diff)
Merge tag 'for-linus-v3.6-rc1' of git://oss.sgi.com/xfs/xfs
Pull xfs update from Ben Myers: "Numerous cleanups and several bug fixes. Here are some highlights: - Discontiguous directory buffer support - Inode allocator refactoring - Removal of the IO lock in inode reclaim - Implementation of .update_time - Fix for handling of EOF in xfs_vm_writepage - Fix for races in xfsaild, and idle mode is re-enabled - Fix for a crash in xfs_buf completion handlers on unmount." Fix up trivial conflicts in fs/xfs/{xfs_buf.c,xfs_log.c,xfs_log_priv.h} due to duplicate patches that had already been merged for 3.5. * tag 'for-linus-v3.6-rc1' of git://oss.sgi.com/xfs/xfs: (44 commits) xfs: wait for the write the superblock on unmount xfs: re-enable xfsaild idle mode and fix associated races xfs: remove iolock lock classes xfs: avoid the iolock in xfs_free_eofblocks for evicted inodes xfs: do not take the iolock in xfs_inactive xfs: remove xfs_inactive_attrs xfs: clean up xfs_inactive xfs: do not read the AGI buffer in xfs_dialloc until nessecary xfs: refactor xfs_ialloc_ag_select xfs: add a short cut to xfs_dialloc for the non-NULL agbp case xfs: remove the alloc_done argument to xfs_dialloc xfs: split xfs_dialloc xfs: remove xfs_ialloc_find_free Prefix IO_XX flags with XFS_IO_XX to avoid namespace colision. xfs: remove xfs_inotobp xfs: merge xfs_itobp into xfs_imap_to_bp xfs: handle EOF correctly in xfs_vm_writepage xfs: implement ->update_time xfs: fix comment typo of struct xfs_da_blkinfo. xfs: do not call xfs_bdstrat_cb in xfs_buf_iodone_callbacks ...
Diffstat (limited to 'fs/xfs/xfs_iops.c')
-rw-r--r--fs/xfs/xfs_iops.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 9c4340f5c3e0..4e00cf091d2c 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -897,6 +897,47 @@ xfs_vn_setattr(
897 return -xfs_setattr_nonsize(XFS_I(dentry->d_inode), iattr, 0); 897 return -xfs_setattr_nonsize(XFS_I(dentry->d_inode), iattr, 0);
898} 898}
899 899
900STATIC int
901xfs_vn_update_time(
902 struct inode *inode,
903 struct timespec *now,
904 int flags)
905{
906 struct xfs_inode *ip = XFS_I(inode);
907 struct xfs_mount *mp = ip->i_mount;
908 struct xfs_trans *tp;
909 int error;
910
911 trace_xfs_update_time(ip);
912
913 tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
914 error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
915 if (error) {
916 xfs_trans_cancel(tp, 0);
917 return -error;
918 }
919
920 xfs_ilock(ip, XFS_ILOCK_EXCL);
921 if (flags & S_CTIME) {
922 inode->i_ctime = *now;
923 ip->i_d.di_ctime.t_sec = (__int32_t)now->tv_sec;
924 ip->i_d.di_ctime.t_nsec = (__int32_t)now->tv_nsec;
925 }
926 if (flags & S_MTIME) {
927 inode->i_mtime = *now;
928 ip->i_d.di_mtime.t_sec = (__int32_t)now->tv_sec;
929 ip->i_d.di_mtime.t_nsec = (__int32_t)now->tv_nsec;
930 }
931 if (flags & S_ATIME) {
932 inode->i_atime = *now;
933 ip->i_d.di_atime.t_sec = (__int32_t)now->tv_sec;
934 ip->i_d.di_atime.t_nsec = (__int32_t)now->tv_nsec;
935 }
936 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
937 xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP);
938 return -xfs_trans_commit(tp, 0);
939}
940
900#define XFS_FIEMAP_FLAGS (FIEMAP_FLAG_SYNC|FIEMAP_FLAG_XATTR) 941#define XFS_FIEMAP_FLAGS (FIEMAP_FLAG_SYNC|FIEMAP_FLAG_XATTR)
901 942
902/* 943/*
@@ -991,6 +1032,7 @@ static const struct inode_operations xfs_inode_operations = {
991 .removexattr = generic_removexattr, 1032 .removexattr = generic_removexattr,
992 .listxattr = xfs_vn_listxattr, 1033 .listxattr = xfs_vn_listxattr,
993 .fiemap = xfs_vn_fiemap, 1034 .fiemap = xfs_vn_fiemap,
1035 .update_time = xfs_vn_update_time,
994}; 1036};
995 1037
996static const struct inode_operations xfs_dir_inode_operations = { 1038static const struct inode_operations xfs_dir_inode_operations = {
@@ -1016,6 +1058,7 @@ static const struct inode_operations xfs_dir_inode_operations = {
1016 .getxattr = generic_getxattr, 1058 .getxattr = generic_getxattr,
1017 .removexattr = generic_removexattr, 1059 .removexattr = generic_removexattr,
1018 .listxattr = xfs_vn_listxattr, 1060 .listxattr = xfs_vn_listxattr,
1061 .update_time = xfs_vn_update_time,
1019}; 1062};
1020 1063
1021static const struct inode_operations xfs_dir_ci_inode_operations = { 1064static const struct inode_operations xfs_dir_ci_inode_operations = {
@@ -1041,6 +1084,7 @@ static const struct inode_operations xfs_dir_ci_inode_operations = {
1041 .getxattr = generic_getxattr, 1084 .getxattr = generic_getxattr,
1042 .removexattr = generic_removexattr, 1085 .removexattr = generic_removexattr,
1043 .listxattr = xfs_vn_listxattr, 1086 .listxattr = xfs_vn_listxattr,
1087 .update_time = xfs_vn_update_time,
1044}; 1088};
1045 1089
1046static const struct inode_operations xfs_symlink_inode_operations = { 1090static const struct inode_operations xfs_symlink_inode_operations = {
@@ -1054,6 +1098,7 @@ static const struct inode_operations xfs_symlink_inode_operations = {
1054 .getxattr = generic_getxattr, 1098 .getxattr = generic_getxattr,
1055 .removexattr = generic_removexattr, 1099 .removexattr = generic_removexattr,
1056 .listxattr = xfs_vn_listxattr, 1100 .listxattr = xfs_vn_listxattr,
1101 .update_time = xfs_vn_update_time,
1057}; 1102};
1058 1103
1059STATIC void 1104STATIC void