Merge tag 'for-linus-v3.6-rc1' of git://oss.sgi.com/xfs/xfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Jul 2012 20:37:53 +0000 (13:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Jul 2012 20:37:53 +0000 (13:37 -0700)
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
  ...

1  2 
fs/xfs/xfs_iops.c

diff --combined fs/xfs/xfs_iops.c
@@@ -179,7 -179,7 +179,7 @@@ xfs_vn_create
        struct inode    *dir,
        struct dentry   *dentry,
        umode_t         mode,
 -      struct nameidata *nd)
 +      bool            flags)
  {
        return xfs_vn_mknod(dir, dentry, mode, 0);
  }
@@@ -197,7 -197,7 +197,7 @@@ STATIC struct dentry 
  xfs_vn_lookup(
        struct inode    *dir,
        struct dentry   *dentry,
 -      struct nameidata *nd)
 +      unsigned int flags)
  {
        struct xfs_inode *cip;
        struct xfs_name name;
@@@ -222,7 -222,7 +222,7 @@@ STATIC struct dentry 
  xfs_vn_ci_lookup(
        struct inode    *dir,
        struct dentry   *dentry,
 -      struct nameidata *nd)
 +      unsigned int flags)
  {
        struct xfs_inode *ip;
        struct xfs_name xname;
@@@ -897,6 -897,47 +897,47 @@@ xfs_vn_setattr
        return -xfs_setattr_nonsize(XFS_I(dentry->d_inode), iattr, 0);
  }
  
+ STATIC int
+ xfs_vn_update_time(
+       struct inode            *inode,
+       struct timespec         *now,
+       int                     flags)
+ {
+       struct xfs_inode        *ip = XFS_I(inode);
+       struct xfs_mount        *mp = ip->i_mount;
+       struct xfs_trans        *tp;
+       int                     error;
+       trace_xfs_update_time(ip);
+       tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
+       error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
+       if (error) {
+               xfs_trans_cancel(tp, 0);
+               return -error;
+       }
+       xfs_ilock(ip, XFS_ILOCK_EXCL);
+       if (flags & S_CTIME) {
+               inode->i_ctime = *now;
+               ip->i_d.di_ctime.t_sec = (__int32_t)now->tv_sec;
+               ip->i_d.di_ctime.t_nsec = (__int32_t)now->tv_nsec;
+       }
+       if (flags & S_MTIME) {
+               inode->i_mtime = *now;
+               ip->i_d.di_mtime.t_sec = (__int32_t)now->tv_sec;
+               ip->i_d.di_mtime.t_nsec = (__int32_t)now->tv_nsec;
+       }
+       if (flags & S_ATIME) {
+               inode->i_atime = *now;
+               ip->i_d.di_atime.t_sec = (__int32_t)now->tv_sec;
+               ip->i_d.di_atime.t_nsec = (__int32_t)now->tv_nsec;
+       }
+       xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+       xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP);
+       return -xfs_trans_commit(tp, 0);
+ }
  #define XFS_FIEMAP_FLAGS      (FIEMAP_FLAG_SYNC|FIEMAP_FLAG_XATTR)
  
  /*
@@@ -991,6 -1032,7 +1032,7 @@@ static const struct inode_operations xf
        .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
        .fiemap                 = xfs_vn_fiemap,
+       .update_time            = xfs_vn_update_time,
  };
  
  static const struct inode_operations xfs_dir_inode_operations = {
        .getxattr               = generic_getxattr,
        .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
+       .update_time            = xfs_vn_update_time,
  };
  
  static const struct inode_operations xfs_dir_ci_inode_operations = {
        .getxattr               = generic_getxattr,
        .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
+       .update_time            = xfs_vn_update_time,
  };
  
  static const struct inode_operations xfs_symlink_inode_operations = {
        .getxattr               = generic_getxattr,
        .removexattr            = generic_removexattr,
        .listxattr              = xfs_vn_listxattr,
+       .update_time            = xfs_vn_update_time,
  };
  
  STATIC void