Merge tag 'locks-v4.1-1' of git://git.samba.org/jlayton/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 21:22:45 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 21:22:45 +0000 (14:22 -0700)
Pull file locking related changes from Jeff Layton:
 "This set is mostly minor cleanups to the overhaul that went in last
  cycle.  The other noticeable items are the changes to the lm_get_owner
  and lm_put_owner prototypes, and the fact that we no longer need to
  use the i_lock to protect the i_flctx pointer"

* tag 'locks-v4.1-1' of git://git.samba.org/jlayton/linux:
  locks: use cmpxchg to assign i_flctx pointer
  locks: get rid of WE_CAN_BREAK_LSLK_NOW dead code
  locks: change lm_get_owner and lm_put_owner prototypes
  locks: don't allocate a lock context for an F_UNLCK request
  locks: Add lockdep assertion for blocked_lock_lock
  locks: remove extraneous IS_POSIX and IS_FLOCK tests
  locks: Remove unnecessary IS_POSIX test

1  2 
include/linux/fs.h

diff --combined include/linux/fs.h
index 4d9acc91de12c24f3f0308a1aefea6888ca0648c,e4111a29697e1991d21f340ef0f14f3b97c28466..90a1207231eaeffa7f59de6c13122a6a9f5d6237
@@@ -314,28 -314,6 +314,28 @@@ struct page
  struct address_space;
  struct writeback_control;
  
 +#define IOCB_EVENTFD          (1 << 0)
 +
 +struct kiocb {
 +      struct file             *ki_filp;
 +      loff_t                  ki_pos;
 +      void (*ki_complete)(struct kiocb *iocb, long ret, long ret2);
 +      void                    *private;
 +      int                     ki_flags;
 +};
 +
 +static inline bool is_sync_kiocb(struct kiocb *kiocb)
 +{
 +      return kiocb->ki_complete == NULL;
 +}
 +
 +static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
 +{
 +      *kiocb = (struct kiocb) {
 +              .ki_filp = filp,
 +      };
 +}
 +
  /*
   * "descriptor" for what we're up to with a read.
   * This allows us to use the same read code yet
@@@ -915,8 -893,8 +915,8 @@@ struct file_lock_operations 
  struct lock_manager_operations {
        int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
        unsigned long (*lm_owner_key)(struct file_lock *);
-       void (*lm_get_owner)(struct file_lock *, struct file_lock *);
-       void (*lm_put_owner)(struct file_lock *);
+       fl_owner_t (*lm_get_owner)(fl_owner_t);
+       void (*lm_put_owner)(fl_owner_t);
        void (*lm_notify)(struct file_lock *);  /* unblock callback */
        int (*lm_grant)(struct file_lock *, int);
        bool (*lm_break)(struct file_lock *);
@@@ -1562,6 -1540,8 +1562,6 @@@ struct file_operations 
        loff_t (*llseek) (struct file *, loff_t, int);
        ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
        ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
 -      ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
 -      ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
        ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
        ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
        int (*iterate) (struct file *, struct dir_context *);
        long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
        long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
        int (*mmap) (struct file *, struct vm_area_struct *);
 -      void (*mremap)(struct file *, struct vm_area_struct *);
 +      int (*mremap)(struct file *, struct vm_area_struct *);
        int (*open) (struct inode *, struct file *);
        int (*flush) (struct file *, fl_owner_t id);
        int (*release) (struct inode *, struct file *);
@@@ -1637,7 -1617,6 +1637,7 @@@ ssize_t rw_copy_check_uvector(int type
                              struct iovec **ret_pointer);
  
  extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
 +extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *);
  extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
  extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
  extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
@@@ -2166,7 -2145,7 +2166,7 @@@ struct filename 
        const __user char       *uptr;  /* original userland pointer */
        struct audit_names      *aname;
        int                     refcnt;
 -      bool                    separate; /* should "name" be freed? */
 +      const char              iname[];
  };
  
  extern long vfs_truncate(struct path *, loff_t);
@@@ -2572,6 -2551,10 +2572,6 @@@ extern ssize_t __generic_file_write_ite
  extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *);
  extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t);
  extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
 -extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
 -extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
 -extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
 -extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
  
  ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos);
  ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos);