Merge branch 'for-3.1' of git://linux-nfs.org/~bfields/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 05:49:19 +0000 (22:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 05:49:19 +0000 (22:49 -0700)
* 'for-3.1' of git://linux-nfs.org/~bfields/linux:
  nfsd: don't break lease on CLAIM_DELEGATE_CUR
  locks: rename lock-manager ops
  nfsd4: update nfsv4.1 implementation notes
  nfsd: turn on reply cache for NFSv4
  nfsd4: call nfsd4_release_compoundargs from pc_release
  nfsd41: Deny new lock before RECLAIM_COMPLETE done
  fs: locks: remove init_once
  nfsd41: check the size of request
  nfsd41: error out when client sets maxreq_sz or maxresp_sz too small
  nfsd4: fix file leak on open_downgrade
  nfsd4: remember to put RW access on stateid destruction
  NFSD: Added TEST_STATEID operation
  NFSD: added FREE_STATEID operation
  svcrpc: fix list-corrupting race on nfsd shutdown
  rpc: allow autoloading of gss mechanisms
  svcauth_unix.c: quiet sparse noise
  svcsock.c: include sunrpc.h to quiet sparse noise
  nfsd: Remove deprecated nfsctl system call and related code.
  NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND

Fix up trivial conflicts in Documentation/feature-removal-schedule.txt

1  2 
Documentation/feature-removal-schedule.txt
Documentation/filesystems/Locking
fs/fuse/file.c
include/linux/fs.h

@@@ -184,7 -184,7 +184,7 @@@ Why:       /proc/<pid>/oom_adj allows userspa
  
        A much more powerful interface, /proc/<pid>/oom_score_adj, was
        introduced with the oom killer rewrite that allows users to increase or
 -      decrease the badness() score linearly.  This interface will replace
 +      decrease the badness score linearly.  This interface will replace
        /proc/<pid>/oom_adj.
  
        A warning will be emitted to the kernel log if an application uses this
@@@ -199,7 -199,7 +199,7 @@@ Files:     drivers/staging/cs5535_gpio/
  Check:        drivers/staging/cs5535_gpio/cs5535_gpio.c
  Why:  A newer driver replaces this; it is drivers/gpio/cs5535-gpio.c, and
        integrates with the Linux GPIO subsystem.  The old driver has been
 -      moved to staging, and will be removed altogether around 2.6.40.
 +      moved to staging, and will be removed altogether around 3.0.
        Please test the new driver, and ensure that the functionality you
        need and any bugfixes from the old driver are available in the new
        one.
@@@ -294,7 -294,7 +294,7 @@@ When:      The schedule was July 2008, but i
  Why:  The support code for the old firmware hurts code readability/maintainability
        and slightly hurts runtime performance. Bugfixes for the old firmware
        are not provided by Broadcom anymore.
 -Who:  Michael Buesch <mb@bu3sch.de>
 +Who:  Michael Buesch <m@bues.ch>
  
  ---------------------------
  
@@@ -430,7 -430,7 +430,7 @@@ Who:       Avi Kivity <avi@redhat.com
  ----------------------------
  
  What: iwlwifi 50XX module parameters
 -When: 2.6.40
 +When: 3.0
  Why:  The "..50" modules parameters were used to configure 5000 series and
        up devices; different set of module parameters also available for 4965
        with same functionalities. Consolidate both set into single place
@@@ -441,7 -441,7 +441,7 @@@ Who:       Wey-Yi Guy <wey-yi.w.guy@intel.com
  ----------------------------
  
  What: iwl4965 alias support
 -When: 2.6.40
 +When: 3.0
  Why:  Internal alias support has been present in module-init-tools for some
        time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed
        with no impact.
@@@ -482,7 -482,7 +482,7 @@@ Who:       FUJITA Tomonori <fujita.tomonori@l
  ----------------------------
  
  What: iwlwifi disable_hw_scan module parameters
 -When: 2.6.40
 +When: 3.0
  Why:  Hareware scan is the prefer method for iwlwifi devices for
        scanning operation. Remove software scan support for all the
        iwlwifi devices.
@@@ -491,16 -491,16 +491,6 @@@ Who:     Wey-Yi Guy <wey-yi.w.guy@intel.com
  
  ----------------------------
  
- What:   access to nfsd auth cache through sys_nfsservctl or '.' files
-         in the 'nfsd' filesystem.
- When:   3.0
- Why:    This is a legacy interface which have been replaced by a more
-         dynamic cache.  Continuing to maintain this interface is an
-         unnecessary burden.
- Who:    NeilBrown <neilb@suse.de>
 -What: cancel_rearming_delayed_work[queue]()
 -When: 2.6.39
 -
 -Why:  The functions have been superceded by cancel_delayed_work_sync()
 -      quite some time ago.  The conversion is trivial and there is no
 -      in-kernel user left.
 -Who:  Tejun Heo <tj@kernel.org>
--
------------------------------
--
  What: Legacy, non-standard chassis intrusion detection interface.
  When: June 2011
  Why:  The adm9240, w83792d and w83793 hardware monitoring drivers have
@@@ -518,6 -518,22 +508,6 @@@ Files:    net/netfilter/xt_connlimit.
  
  ----------------------------
  
 -What: noswapaccount kernel command line parameter
 -When: 2.6.40
 -Why:  The original implementation of memsw feature enabled by
 -      CONFIG_CGROUP_MEM_RES_CTLR_SWAP could be disabled by the noswapaccount
 -      kernel parameter (introduced in 2.6.29-rc1). Later on, this decision
 -      turned out to be not ideal because we cannot have the feature compiled
 -      in and disabled by default and let only interested to enable it
 -      (e.g. general distribution kernels might need it). Therefore we have
 -      added swapaccount[=0|1] parameter (introduced in 2.6.37) which provides
 -      the both possibilities. If we remove noswapaccount we will have
 -      less command line parameters with the same functionality and we
 -      can also cleanup the parameter handling a bit ().
 -Who:  Michal Hocko <mhocko@suse.cz>
 -
 -----------------------------
 -
  What: ipt_addrtype match include file
  When: 2012
  Why:  superseded by xt_addrtype
@@@ -536,7 -552,7 +526,7 @@@ Who:       Jean Delvare <khali@linux-fr.org
  ----------------------------
  
  What: Support for UVCIOC_CTRL_ADD in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  The information passed to the driver by this ioctl is now queried
        dynamically from the device.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  ----------------------------
  
  What: Support for UVCIOC_CTRL_MAP_OLD in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  Used only by applications compiled against older driver versions.
        Superseded by UVCIOC_CTRL_MAP which supports V4L2 menu controls.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  ----------------------------
  
  What: Support for UVCIOC_CTRL_GET and UVCIOC_CTRL_SET in the uvcvideo driver
 -When: 2.6.42
 +When: 3.2
  Why:  Superseded by the UVCIOC_CTRL_QUERY ioctl.
  Who:  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  
@@@ -52,7 -52,7 +52,7 @@@ ata *)
        void (*put_link) (struct dentry *, struct nameidata *, void *);
        void (*truncate) (struct inode *);
        int (*permission) (struct inode *, int, unsigned int);
 -      int (*check_acl)(struct inode *, int, unsigned int);
 +      int (*get_acl)(struct inode *, int);
        int (*setattr) (struct dentry *, struct iattr *);
        int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
        int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
@@@ -80,7 -80,7 +80,7 @@@ put_link:     n
  truncate:     yes             (see below)
  setattr:      yes
  permission:   no (may not block if called in rcu-walk mode)
 -check_acl:    no
 +get_acl:      no
  getattr:      no
  setxattr:     yes
  getxattr:     no
@@@ -338,21 -338,21 +338,21 @@@ fl_release_private:     maybe           n
  
  ----------------------- lock_manager_operations ---------------------------
  prototypes:
-       int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
-       void (*fl_notify)(struct file_lock *);  /* unblock callback */
-       int (*fl_grant)(struct file_lock *, struct file_lock *, int);
-       void (*fl_release_private)(struct file_lock *);
-       void (*fl_break)(struct file_lock *); /* break_lease callback */
-       int (*fl_change)(struct file_lock **, int);
+       int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
+       void (*lm_notify)(struct file_lock *);  /* unblock callback */
+       int (*lm_grant)(struct file_lock *, struct file_lock *, int);
+       void (*lm_release_private)(struct file_lock *);
+       void (*lm_break)(struct file_lock *); /* break_lease callback */
+       int (*lm_change)(struct file_lock **, int);
  
  locking rules:
                        file_lock_lock  may block
fl_compare_owner:     yes             no
fl_notify:            yes             no
fl_grant:             no              no
fl_release_private:   maybe           no
fl_break:             yes             no
fl_change             yes             no
lm_compare_owner:     yes             no
lm_notify:            yes             no
lm_grant:             no              no
lm_release_private:   maybe           no
lm_break:             yes             no
lm_change             yes             no
  
  --------------------------- buffer_head -----------------------------------
  prototypes:
@@@ -412,7 -412,7 +412,7 @@@ prototypes
        int (*open) (struct inode *, struct file *);
        int (*flush) (struct file *);
        int (*release) (struct inode *, struct file *);
 -      int (*fsync) (struct file *, int datasync);
 +      int (*fsync) (struct file *, loff_t start, loff_t end, int datasync);
        int (*aio_fsync) (struct kiocb *, int datasync);
        int (*fasync) (int, struct file *, int);
        int (*lock) (struct file *, int, struct file_lock *);
  
  locking rules:
        All may block except for ->setlease.
 -      No VFS locks held on entry except for ->fsync and ->setlease.
 -
 -->fsync() has i_mutex on inode.
 +      No VFS locks held on entry except for ->setlease.
  
  ->setlease has the file_list_lock held and must not sleep.
  
diff --combined fs/fuse/file.c
@@@ -400,8 -400,7 +400,8 @@@ static void fuse_sync_writes(struct ino
        fuse_release_nowrite(inode);
  }
  
 -int fuse_fsync_common(struct file *file, int datasync, int isdir)
 +int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
 +                    int datasync, int isdir)
  {
        struct inode *inode = file->f_mapping->host;
        struct fuse_conn *fc = get_fuse_conn(inode);
        if (is_bad_inode(inode))
                return -EIO;
  
 +      err = filemap_write_and_wait_range(inode->i_mapping, start, end);
 +      if (err)
 +              return err;
 +
        if ((!isdir && fc->no_fsync) || (isdir && fc->no_fsyncdir))
                return 0;
  
 +      mutex_lock(&inode->i_mutex);
 +
        /*
         * Start writeback against all dirty pages of the inode, then
         * wait for all outstanding writes, before sending the FSYNC
         */
        err = write_inode_now(inode, 0);
        if (err)
 -              return err;
 +              goto out;
  
        fuse_sync_writes(inode);
  
        req = fuse_get_req(fc);
 -      if (IS_ERR(req))
 -              return PTR_ERR(req);
 +      if (IS_ERR(req)) {
 +              err = PTR_ERR(req);
 +              goto out;
 +      }
  
        memset(&inarg, 0, sizeof(inarg));
        inarg.fh = ff->fh;
                        fc->no_fsync = 1;
                err = 0;
        }
 +out:
 +      mutex_unlock(&inode->i_mutex);
        return err;
  }
  
 -static int fuse_fsync(struct file *file, int datasync)
 +static int fuse_fsync(struct file *file, loff_t start, loff_t end,
 +                    int datasync)
  {
 -      return fuse_fsync_common(file, datasync, 0);
 +      return fuse_fsync_common(file, start, end, datasync, 0);
  }
  
  void fuse_read_fill(struct fuse_req *req, struct file *file, loff_t pos,
@@@ -1507,7 -1495,7 +1507,7 @@@ static int fuse_setlk(struct file *file
        pid_t pid = fl->fl_type != F_UNLCK ? current->tgid : 0;
        int err;
  
-       if (fl->fl_lmops && fl->fl_lmops->fl_grant) {
+       if (fl->fl_lmops && fl->fl_lmops->lm_grant) {
                /* NLM needs asynchronous locks, which we don't support yet */
                return -ENOLCK;
        }
@@@ -1612,32 -1600,15 +1612,32 @@@ static loff_t fuse_file_llseek(struct f
        struct inode *inode = file->f_path.dentry->d_inode;
  
        mutex_lock(&inode->i_mutex);
 -      switch (origin) {
 -      case SEEK_END:
 +      if (origin != SEEK_CUR || origin != SEEK_SET) {
                retval = fuse_update_attributes(inode, NULL, file, NULL);
                if (retval)
                        goto exit;
 +      }
 +
 +      switch (origin) {
 +      case SEEK_END:
                offset += i_size_read(inode);
                break;
        case SEEK_CUR:
                offset += file->f_pos;
 +              break;
 +      case SEEK_DATA:
 +              if (offset >= i_size_read(inode)) {
 +                      retval = -ENXIO;
 +                      goto exit;
 +              }
 +              break;
 +      case SEEK_HOLE:
 +              if (offset >= i_size_read(inode)) {
 +                      retval = -ENXIO;
 +                      goto exit;
 +              }
 +              offset = i_size_read(inode);
 +              break;
        }
        retval = -EINVAL;
        if (offset >= 0 && offset <= inode->i_sb->s_maxbytes) {
diff --combined include/linux/fs.h
@@@ -32,9 -32,7 +32,9 @@@
  #define SEEK_SET      0       /* seek relative to beginning of file */
  #define SEEK_CUR      1       /* seek relative to current file position */
  #define SEEK_END      2       /* seek relative to end of file */
 -#define SEEK_MAX      SEEK_END
 +#define SEEK_DATA     3       /* seek to the next data */
 +#define SEEK_HOLE     4       /* seek to the next hole */
 +#define SEEK_MAX      SEEK_HOLE
  
  struct fstrim_range {
        __u64 start;
@@@ -65,7 -63,6 +65,7 @@@ struct inodes_stat_t 
  #define MAY_ACCESS 16
  #define MAY_OPEN 32
  #define MAY_CHDIR 64
 +#define MAY_NOT_BLOCK 128     /* called from RCU mode, don't block */
  
  /*
   * flags in file.f_mode.  Note that FMODE_READ and FMODE_WRITE must correspond
  
  #include <linux/linkage.h>
  #include <linux/wait.h>
 -#include <linux/types.h>
  #include <linux/kdev_t.h>
  #include <linux/dcache.h>
  #include <linux/path.h>
  #include <linux/semaphore.h>
  #include <linux/fiemap.h>
  #include <linux/rculist_bl.h>
 +#include <linux/shrinker.h>
 +#include <linux/atomic.h>
  
 -#include <asm/atomic.h>
  #include <asm/byteorder.h>
  
  struct export_operations;
@@@ -780,7 -777,7 +780,7 @@@ struct inode 
        struct timespec         i_ctime;
        blkcnt_t                i_blocks;
        unsigned short          i_bytes;
 -      struct rw_semaphore     i_alloc_sem;
 +      atomic_t                i_dio_count;
        const struct file_operations    *i_fop; /* former ->i_op->default_file_ops */
        struct file_lock        *i_flock;
        struct address_space    *i_mapping;
@@@ -1072,12 -1069,12 +1072,12 @@@ struct file_lock_operations 
  };
  
  struct lock_manager_operations {
-       int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
-       void (*fl_notify)(struct file_lock *);  /* unblock callback */
-       int (*fl_grant)(struct file_lock *, struct file_lock *, int);
-       void (*fl_release_private)(struct file_lock *);
-       void (*fl_break)(struct file_lock *);
-       int (*fl_change)(struct file_lock **, int);
+       int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
+       void (*lm_notify)(struct file_lock *);  /* unblock callback */
+       int (*lm_grant)(struct file_lock *, struct file_lock *, int);
+       void (*lm_release_private)(struct file_lock *);
+       void (*lm_break)(struct file_lock *);
+       int (*lm_change)(struct file_lock **, int);
  };
  
  struct lock_manager {
@@@ -1399,11 -1396,6 +1399,11 @@@ struct super_block 
        struct list_head        s_dentry_lru;   /* unused dentry lru */
        int                     s_nr_dentry_unused;     /* # of dentry on lru */
  
 +      /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */
 +      spinlock_t              s_inode_lru_lock ____cacheline_aligned_in_smp;
 +      struct list_head        s_inode_lru;            /* unused inode lru */
 +      int                     s_nr_inodes_unused;     /* # of inodes on lru */
 +
        struct block_device     *s_bdev;
        struct backing_dev_info *s_bdi;
        struct mtd_info         *s_mtd;
         * Saved pool identifier for cleancache (-1 means none)
         */
        int cleancache_poolid;
 +
 +      struct shrinker s_shrink;       /* per-sb shrinker handle */
  };
  
 +/* superblock cache pruning functions */
 +extern void prune_icache_sb(struct super_block *sb, int nr_to_scan);
 +extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan);
 +
  extern struct timespec current_fs_time(struct super_block *sb);
  
  /*
@@@ -1468,6 -1454,10 +1468,6 @@@ enum 
  #define vfs_check_frozen(sb, level) \
        wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
  
 -#define get_fs_excl() atomic_inc(&current->fs_excl)
 -#define put_fs_excl() atomic_dec(&current->fs_excl)
 -#define has_fs_excl() atomic_read(&current->fs_excl)
 -
  /*
   * until VFS tracks user namespaces for inodes, just make all files
   * belong to init_user_ns
@@@ -1500,6 -1490,7 +1500,6 @@@ extern void dentry_unhash(struct dentr
  /*
   * VFS file helper functions.
   */
 -extern int file_permission(struct file *, int);
  extern void inode_init_owner(struct inode *inode, const struct inode *dir,
                        mode_t mode);
  /*
@@@ -1547,6 -1538,11 +1547,6 @@@ struct block_device_operations
  #define HAVE_COMPAT_IOCTL 1
  #define HAVE_UNLOCKED_IOCTL 1
  
 -/*
 - * NOTE:
 - * all file operations except setlease can be called without
 - * the big kernel lock held in all filesystems.
 - */
  struct file_operations {
        struct module *owner;
        loff_t (*llseek) (struct file *, loff_t, int);
        int (*open) (struct inode *, struct file *);
        int (*flush) (struct file *, fl_owner_t id);
        int (*release) (struct inode *, struct file *);
 -      int (*fsync) (struct file *, int datasync);
 +      int (*fsync) (struct file *, loff_t, loff_t, int datasync);
        int (*aio_fsync) (struct kiocb *, int datasync);
        int (*fasync) (int, struct file *, int);
        int (*lock) (struct file *, int, struct file_lock *);
                          loff_t len);
  };
  
 -#define IPERM_FLAG_RCU        0x0001
 -
  struct inode_operations {
        struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
        void * (*follow_link) (struct dentry *, struct nameidata *);
 -      int (*permission) (struct inode *, int, unsigned int);
 -      int (*check_acl)(struct inode *, int, unsigned int);
 +      int (*permission) (struct inode *, int);
 +      struct posix_acl * (*get_acl)(struct inode *, int);
  
        int (*readlink) (struct dentry *, char __user *,int);
        void (*put_link) (struct dentry *, struct nameidata *, void *);
@@@ -1647,8 -1645,6 +1647,8 @@@ struct super_operations 
        ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
  #endif
        int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
 +      int (*nr_cached_objects)(struct super_block *);
 +      void (*free_cached_objects)(struct super_block *, int);
  };
  
  /*
   *                    set during data writeback, and cleared with a wakeup
   *                    on the bit address once it is done.
   *
 + * I_REFERENCED               Marks the inode as recently references on the LRU list.
 + *
 + * I_DIO_WAKEUP               Never set.  Only used as a key for wait_on_bit().
 + *
   * Q: What is the difference between I_WILL_FREE and I_FREEING?
   */
  #define I_DIRTY_SYNC          (1 << 0)
  #define __I_SYNC              7
  #define I_SYNC                        (1 << __I_SYNC)
  #define I_REFERENCED          (1 << 8)
 +#define __I_DIO_WAKEUP                9
 +#define I_DIO_WAKEUP          (1 << I_DIO_WAKEUP)
  
  #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
  
@@@ -1826,6 -1816,7 +1826,6 @@@ struct file_system_type 
        struct lock_class_key i_lock_key;
        struct lock_class_key i_mutex_key;
        struct lock_class_key i_mutex_dir_key;
 -      struct lock_class_key i_alloc_sem_key;
  };
  
  extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
@@@ -1846,8 -1837,6 +1846,8 @@@ void kill_litter_super(struct super_blo
  void deactivate_super(struct super_block *sb);
  void deactivate_locked_super(struct super_block *sb);
  int set_anon_super(struct super_block *s, void *data);
 +int get_anon_bdev(dev_t *);
 +void free_anon_bdev(dev_t);
  struct super_block *sget(struct file_system_type *type,
                        int (*test)(struct super_block *,void *),
                        int (*set)(struct super_block *,void *),
@@@ -1880,7 -1869,6 +1880,7 @@@ extern int register_filesystem(struct f
  extern int unregister_filesystem(struct file_system_type *);
  extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
  #define kern_mount(type) kern_mount_data(type, NULL)
 +extern void kern_unmount(struct vfsmount *mnt);
  extern int may_umount_tree(struct vfsmount *);
  extern int may_umount(struct vfsmount *);
  extern long do_mount(char *, char *, char *, unsigned long, void *);
@@@ -2200,38 -2188,16 +2200,38 @@@ extern sector_t bmap(struct inode *, se
  #endif
  extern int notify_change(struct dentry *, struct iattr *);
  extern int inode_permission(struct inode *, int);
 -extern int generic_permission(struct inode *, int, unsigned int,
 -              int (*check_acl)(struct inode *, int, unsigned int));
 +extern int generic_permission(struct inode *, int);
  
  static inline bool execute_ok(struct inode *inode)
  {
        return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode);
  }
  
 -extern int get_write_access(struct inode *);
 -extern int deny_write_access(struct file *);
 +/*
 + * get_write_access() gets write permission for a file.
 + * put_write_access() releases this write permission.
 + * This is used for regular files.
 + * We cannot support write (and maybe mmap read-write shared) accesses and
 + * MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode
 + * can have the following values:
 + * 0: no writers, no VM_DENYWRITE mappings
 + * < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist
 + * > 0: (i_writecount) users are writing to the file.
 + *
 + * Normally we operate on that counter with atomic_{inc,dec} and it's safe
 + * except for the cases where we don't hold i_writecount yet. Then we need to
 + * use {get,deny}_write_access() - these functions check the sign and refuse
 + * to do the change if sign is wrong.
 + */
 +static inline int get_write_access(struct inode *inode)
 +{
 +      return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -ETXTBSY;
 +}
 +static inline int deny_write_access(struct file *file)
 +{
 +      struct inode *inode = file->f_path.dentry->d_inode;
 +      return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY;
 +}
  static inline void put_write_access(struct inode * inode)
  {
        atomic_dec(&inode->i_writecount);
@@@ -2351,8 -2317,7 +2351,8 @@@ extern int generic_segment_checks(cons
  /* fs/block_dev.c */
  extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
                                unsigned long nr_segs, loff_t pos);
 -extern int blkdev_fsync(struct file *filp, int datasync);
 +extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
 +                      int datasync);
  
  /* fs/splice.c */
  extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@@ -2403,8 -2368,6 +2403,8 @@@ enum 
  };
  
  void dio_end_io(struct bio *bio, int error);
 +void inode_dio_wait(struct inode *inode);
 +void inode_dio_done(struct inode *inode);
  
  ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
        struct block_device *bdev, const struct iovec *iov, loff_t offset,
        dio_submit_t submit_io, int flags);
  
  static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
 -      struct inode *inode, struct block_device *bdev, const struct iovec *iov,
 -      loff_t offset, unsigned long nr_segs, get_block_t get_block,
 -      dio_iodone_t end_io)
 +              struct inode *inode, const struct iovec *iov, loff_t offset,
 +              unsigned long nr_segs, get_block_t get_block)
  {
 -      return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
 -                                  nr_segs, get_block, end_io, NULL,
 +      return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
 +                                  offset, nr_segs, get_block, NULL, NULL,
                                    DIO_LOCKING | DIO_SKIP_HOLES);
  }
 +#else
 +static inline void inode_dio_wait(struct inode *inode)
 +{
 +}
  #endif
  
  extern const struct file_operations generic_ro_fops;
@@@ -2472,8 -2432,6 +2472,8 @@@ extern struct super_block *get_active_s
  extern struct super_block *user_get_super(dev_t);
  extern void drop_super(struct super_block *sb);
  extern void iterate_supers(void (*)(struct super_block *, void *), void *);
 +extern void iterate_supers_type(struct file_system_type *,
 +                              void (*)(struct super_block *, void *), void *);
  
  extern int dcache_dir_open(struct inode *, struct file *);
  extern int dcache_dir_close(struct inode *, struct file *);
@@@ -2486,7 -2444,7 +2486,7 @@@ extern int simple_link(struct dentry *
  extern int simple_unlink(struct inode *, struct dentry *);
  extern int simple_rmdir(struct inode *, struct dentry *);
  extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
 -extern int noop_fsync(struct file *, int);
 +extern int noop_fsync(struct file *, loff_t, loff_t, int);
  extern int simple_empty(struct dentry *);
  extern int simple_readpage(struct file *file, struct page *page);
  extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@@ -2511,7 -2469,7 +2511,7 @@@ extern ssize_t simple_read_from_buffer(
  extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
                const void __user *from, size_t count);
  
 -extern int generic_file_fsync(struct file *, int);
 +extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
  
  extern int generic_check_addressable(unsigned, u64);