]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Merge tag 'locks-v3.20-2' of git://git.samba.org/jlayton/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Feb 2015 18:21:47 +0000 (10:21 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Feb 2015 18:21:47 +0000 (10:21 -0800)
Pull file locking fixes from Jeff Layton:
 "A small set of patches to fix problems with the recent file locking
  changes that we discussed earlier this week"
"

* tag 'locks-v3.20-2' of git://git.samba.org/jlayton/linux:
  locks: fix list insertion when lock is split in two
  locks: remove conditional lock release in middle of flock_lock_file
  locks: only remove leases associated with the file being closed
  Revert "locks: keep a count of locks on the flctx lists"

1  2 
include/linux/fs.h

diff --combined include/linux/fs.h
index 447932aed1e194d7e258bd632bd69eee5d040c8e,a5a303e8a33c5d9a814e01fa611205f8bda93e6c..b4d71b5e1ff23a2d3f3ec5c481937edd571ead4d
@@@ -51,7 -51,6 +51,7 @@@ struct swap_info_struct
  struct seq_file;
  struct workqueue_struct;
  struct iov_iter;
 +struct vm_fault;
  
  extern void __init inode_init(void);
  extern void __init inode_init_early(void);
@@@ -362,6 -361,8 +362,6 @@@ struct address_space_operations 
        int (*releasepage) (struct page *, gfp_t);
        void (*freepage)(struct page *);
        ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
 -      int (*get_xip_mem)(struct address_space *, pgoff_t, int,
 -                                              void **, unsigned long *);
        /*
         * migrate the contents of a page to the specified target. If
         * migrate_mode is MIGRATE_ASYNC, it must not block.
@@@ -968,9 -969,6 +968,6 @@@ struct file_lock_context 
        struct list_head        flc_flock;
        struct list_head        flc_posix;
        struct list_head        flc_lease;
-       int                     flc_flock_cnt;
-       int                     flc_posix_cnt;
-       int                     flc_lease_cnt;
  };
  
  /* The following constant reflects the upper bound of the file/locking space */
@@@ -1676,11 -1674,6 +1673,11 @@@ struct super_operations 
  #define S_IMA         1024    /* Inode has an associated IMA struct */
  #define S_AUTOMOUNT   2048    /* Automount/referral quasi-directory */
  #define S_NOSEC               4096    /* no suid or xattr security attributes */
 +#ifdef CONFIG_FS_DAX
 +#define S_DAX         8192    /* Direct Access, avoiding the page cache */
 +#else
 +#define S_DAX         0       /* Make all the DAX code disappear */
 +#endif
  
  /*
   * Note that nosuid etc flags are inode-specific: setting some file-system
  #define IS_IMA(inode)         ((inode)->i_flags & S_IMA)
  #define IS_AUTOMOUNT(inode)   ((inode)->i_flags & S_AUTOMOUNT)
  #define IS_NOSEC(inode)               ((inode)->i_flags & S_NOSEC)
 +#define IS_DAX(inode)         ((inode)->i_flags & S_DAX)
  
  #define IS_WHITEOUT(inode)    (S_ISCHR(inode->i_mode) && \
                                 (inode)->i_rdev == WHITEOUT_DEV)
  #define __I_DIO_WAKEUP                9
  #define I_DIO_WAKEUP          (1 << I_DIO_WAKEUP)
  #define I_LINKABLE            (1 << 10)
 +#define I_DIRTY_TIME          (1 << 11)
 +#define __I_DIRTY_TIME_EXPIRED        12
 +#define I_DIRTY_TIME_EXPIRED  (1 << __I_DIRTY_TIME_EXPIRED)
  
  #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
 +#define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME)
  
  extern void __mark_inode_dirty(struct inode *, int);
  static inline void mark_inode_dirty(struct inode *inode)
@@@ -1958,7 -1946,6 +1955,7 @@@ extern int current_umask(void)
  
  extern void ihold(struct inode * inode);
  extern void iput(struct inode *);
 +extern int generic_update_time(struct inode *, struct timespec *, int);
  
  static inline struct inode *file_inode(const struct file *f)
  {
@@@ -2146,7 -2133,6 +2143,7 @@@ struct filename 
        const char              *name;  /* pointer to actual string */
        const __user char       *uptr;  /* original userland pointer */
        struct audit_names      *aname;
 +      int                     refcnt;
        bool                    separate; /* should "name" be freed? */
  };
  
@@@ -2168,7 -2154,6 +2165,7 @@@ extern int filp_close(struct file *, fl
  extern struct filename *getname_flags(const char __user *, int, int *);
  extern struct filename *getname(const char __user *);
  extern struct filename *getname_kernel(const char *);
 +extern void putname(struct filename *name);
  
  enum {
        FILE_CREATED = 1,
@@@ -2189,8 -2174,15 +2186,8 @@@ extern void __init vfs_caches_init(unsi
  
  extern struct kmem_cache *names_cachep;
  
 -extern void final_putname(struct filename *name);
 -
  #define __getname()           kmem_cache_alloc(names_cachep, GFP_KERNEL)
  #define __putname(name)               kmem_cache_free(names_cachep, (void *)(name))
 -#ifndef CONFIG_AUDITSYSCALL
 -#define putname(name)         final_putname(name)
 -#else
 -extern void putname(struct filename *name);
 -#endif
  
  #ifdef CONFIG_BLOCK
  extern int register_blkdev(unsigned int, const char *);
@@@ -2497,11 -2489,6 +2494,11 @@@ extern struct inode *ilookup(struct sup
  
  extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
  extern struct inode * iget_locked(struct super_block *, unsigned long);
 +extern struct inode *find_inode_nowait(struct super_block *,
 +                                     unsigned long,
 +                                     int (*match)(struct inode *,
 +                                                  unsigned long, void *),
 +                                     void *data);
  extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
  extern int insert_inode_locked(struct inode *);
  #ifdef CONFIG_DEBUG_LOCK_ALLOC
@@@ -2558,9 -2545,6 +2555,9 @@@ extern ssize_t do_sync_write(struct fil
  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);
 +
  /* fs/block_dev.c */
  extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to);
  extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from);
@@@ -2594,13 -2578,19 +2591,13 @@@ extern loff_t fixed_size_llseek(struct 
  extern int generic_file_open(struct inode * inode, struct file * filp);
  extern int nonseekable_open(struct inode * inode, struct file * filp);
  
 -#ifdef CONFIG_FS_XIP
 -extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
 -                           loff_t *ppos);
 -extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma);
 -extern ssize_t xip_file_write(struct file *filp, const char __user *buf,
 -                            size_t len, loff_t *ppos);
 -extern int xip_truncate_page(struct address_space *mapping, loff_t from);
 -#else
 -static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
 -{
 -      return 0;
 -}
 -#endif
 +ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *,
 +              loff_t, get_block_t, dio_iodone_t, int flags);
 +int dax_clear_blocks(struct inode *, sector_t block, long size);
 +int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
 +int dax_truncate_page(struct inode *, loff_t from, get_block_t);
 +int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);
 +#define dax_mkwrite(vma, vmf, gb)     dax_fault(vma, vmf, gb)
  
  #ifdef CONFIG_BLOCK
  typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
@@@ -2757,11 -2747,6 +2754,11 @@@ extern int generic_show_options(struct 
  extern void save_mount_options(struct super_block *sb, char *options);
  extern void replace_mount_options(struct super_block *sb, char *options);
  
 +static inline bool io_is_direct(struct file *filp)
 +{
 +      return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp));
 +}
 +
  static inline ino_t parent_ino(struct dentry *dentry)
  {
        ino_t res;