]> Git Repo - linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <[email protected]>
Thu, 11 Dec 2014 00:10:49 +0000 (16:10 -0800)
committerLinus Torvalds <[email protected]>
Thu, 11 Dec 2014 00:10:49 +0000 (16:10 -0800)
Pull VFS changes from Al Viro:
 "First pile out of several (there _definitely_ will be more).  Stuff in
  this one:

   - unification of d_splice_alias()/d_materialize_unique()

   - iov_iter rewrite

   - killing a bunch of ->f_path.dentry users (and f_dentry macro).

     Getting that completed will make life much simpler for
     unionmount/overlayfs, since then we'll be able to limit the places
     sensitive to file _dentry_ to reasonably few.  Which allows to have
     file_inode(file) pointing to inode in a covered layer, with dentry
     pointing to (negative) dentry in union one.

     Still not complete, but much closer now.

   - crapectomy in lustre (dead code removal, mostly)

   - "let's make seq_printf return nothing" preparations

   - assorted cleanups and fixes

  There _definitely_ will be more piles"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
  copy_from_iter_nocache()
  new helper: iov_iter_kvec()
  csum_and_copy_..._iter()
  iov_iter.c: handle ITER_KVEC directly
  iov_iter.c: convert copy_to_iter() to iterate_and_advance
  iov_iter.c: convert copy_from_iter() to iterate_and_advance
  iov_iter.c: get rid of bvec_copy_page_{to,from}_iter()
  iov_iter.c: convert iov_iter_zero() to iterate_and_advance
  iov_iter.c: convert iov_iter_get_pages_alloc() to iterate_all_kinds
  iov_iter.c: convert iov_iter_get_pages() to iterate_all_kinds
  iov_iter.c: convert iov_iter_npages() to iterate_all_kinds
  iov_iter.c: iterate_and_advance
  iov_iter.c: macros for iterating over iov_iter
  kill f_dentry macro
  dcache: fix kmemcheck warning in switch_names
  new helper: audit_file()
  nfsd_vfs_write(): use file_inode()
  ncpfs: use file_inode()
  kill f_dentry uses
  lockd: get rid of ->f_path.dentry->d_sb
  ...

1  2 
fs/cifs/readdir.c
include/linux/fs.h
kernel/events/core.c

diff --combined fs/cifs/readdir.c
index 803030c9ab688fca0093df005ee4558926adcea5,d116ca8ce4c0284d3a55a18fc3941bf192e4a790..8eaf20a806494c71002a668a3e49b159b1b66d71
@@@ -123,7 -123,7 +123,7 @@@ cifs_prime_dcache(struct dentry *parent
        if (!inode)
                goto out;
  
-       alias = d_materialise_unique(dentry, inode);
+       alias = d_splice_alias(inode, dentry);
        if (alias && !IS_ERR(alias))
                dput(alias);
  out:
@@@ -261,7 -261,7 +261,7 @@@ initiate_cifs_search(const unsigned in
        int rc = 0;
        char *full_path = NULL;
        struct cifsFileInfo *cifsFile;
-       struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
        struct tcon_link *tlink = NULL;
        struct cifs_tcon *tcon;
        struct TCP_Server_Info *server;
@@@ -561,7 -561,7 +561,7 @@@ find_cifs_entry(const unsigned int xid
        loff_t first_entry_in_buffer;
        loff_t index_to_find = pos;
        struct cifsFileInfo *cfile = file->private_data;
-       struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
        struct TCP_Server_Info *server = tcon->ses->server;
        /* check if index in the buffer */
  
@@@ -679,7 -679,7 +679,7 @@@ static int cifs_filldir(char *find_entr
                char *scratch_buf, unsigned int max_len)
  {
        struct cifsFileInfo *file_info = file->private_data;
-       struct super_block *sb = file->f_path.dentry->d_sb;
+       struct super_block *sb = file_inode(file)->i_sb;
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
        struct cifs_dirent de = { NULL, };
        struct cifs_fattr fattr;
                 */
                fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
  
-       cifs_prime_dcache(file->f_dentry, &name, &fattr);
+       cifs_prime_dcache(file->f_path.dentry, &name, &fattr);
  
        ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
        return !dir_emit(ctx, name.name, name.len, ino, fattr.cf_dtype);
@@@ -794,6 -794,10 +794,6 @@@ int cifs_readdir(struct file *file, str
                if it before then restart search
                if after then keep searching till find it */
  
 -      if (file->private_data == NULL) {
 -              rc = -EINVAL;
 -              goto rddir2_exit;
 -      }
        cifsFile = file->private_data;
        if (cifsFile->srch_inf.endOfSearch) {
                if (cifsFile->srch_inf.emptyDir) {
diff --combined include/linux/fs.h
index f21b15804917848dfb28809d6d3f8de962a84ba9,2beddc284bc205cf8d6bae580d21c9f6da0bb012..bb29b02d9bb6646c5d96c8d4d5c084a83f7efefe
@@@ -606,6 -606,9 +606,6 @@@ struct inode 
        const struct file_operations    *i_fop; /* former ->i_op->default_file_ops */
        struct file_lock        *i_flock;
        struct address_space    i_data;
 -#ifdef CONFIG_QUOTA
 -      struct dquot            *i_dquot[MAXQUOTAS];
 -#endif
        struct list_head        i_devices;
        union {
                struct pipe_inode_info  *i_pipe;
@@@ -786,7 -789,6 +786,6 @@@ struct file 
                struct rcu_head         fu_rcuhead;
        } f_u;
        struct path             f_path;
- #define f_dentry      f_path.dentry
        struct inode            *f_inode;       /* cached value */
        const struct file_operations    *f_op;
  
@@@ -1221,7 -1223,6 +1220,7 @@@ struct super_block 
        struct backing_dev_info *s_bdi;
        struct mtd_info         *s_mtd;
        struct hlist_node       s_instances;
 +      unsigned int            s_quota_types;  /* Bitmask of supported quota types */
        struct quota_info       s_dquot;        /* Diskquota specific options */
  
        struct sb_writers       s_writers;
@@@ -1465,7 -1466,10 +1464,10 @@@ int fiemap_check_flags(struct fiemap_ex
   * This allows the kernel to read directories into kernel space or
   * to have different dirent layouts depending on the binary type.
   */
- typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
+ struct dir_context;
+ typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
+                        unsigned);
  struct dir_context {
        const filldir_t actor;
        loff_t pos;
@@@ -1511,7 -1515,7 +1513,7 @@@ struct file_operations 
        int (*setlease)(struct file *, long, struct file_lock **, void **);
        long (*fallocate)(struct file *file, int mode, loff_t offset,
                          loff_t len);
-       int (*show_fdinfo)(struct seq_file *m, struct file *f);
+       void (*show_fdinfo)(struct seq_file *m, struct file *f);
  };
  
  struct inode_operations {
@@@ -1575,9 -1579,7 +1577,9 @@@ struct super_operations 
        void (*evict_inode) (struct inode *);
        void (*put_super) (struct super_block *);
        int (*sync_fs)(struct super_block *sb, int wait);
 +      int (*freeze_super) (struct super_block *);
        int (*freeze_fs) (struct super_block *);
 +      int (*thaw_super) (struct super_block *);
        int (*unfreeze_fs) (struct super_block *);
        int (*statfs) (struct dentry *, struct kstatfs *);
        int (*remount_fs) (struct super_block *, int *, char *);
  #ifdef CONFIG_QUOTA
        ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
        ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
 +      struct dquot **(*get_dquots)(struct inode *);
  #endif
        int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
        long (*nr_cached_objects)(struct super_block *, int);
@@@ -2787,6 -2788,11 +2789,11 @@@ static inline void inode_has_no_xattr(s
                inode->i_flags |= S_NOSEC;
  }
  
+ static inline bool is_root_inode(struct inode *inode)
+ {
+       return inode == inode->i_sb->s_root->d_inode;
+ }
  static inline bool dir_emit(struct dir_context *ctx,
                            const char *name, int namelen,
                            u64 ino, unsigned type)
diff --combined kernel/events/core.c
index 3e19d3ebc29c33b6b1f3883c10f30f017c1aaca2,e56923026dd87f459b3ab746cfdcfca167586474..113b837470cd65e32038396e7c9fa5af821db03d
@@@ -614,7 -614,7 +614,7 @@@ static inline int perf_cgroup_connect(i
        if (!f.file)
                return -EBADF;
  
-       css = css_tryget_online_from_dir(f.file->f_dentry,
+       css = css_tryget_online_from_dir(f.file->f_path.dentry,
                                         &perf_event_cgrp_subsys);
        if (IS_ERR(css)) {
                ret = PTR_ERR(css);
@@@ -4460,7 -4460,7 +4460,7 @@@ perf_output_sample_regs(struct perf_out
        }
  }
  
 -static void perf_sample_regs_user(struct perf_regs_user *regs_user,
 +static void perf_sample_regs_user(struct perf_regs *regs_user,
                                  struct pt_regs *regs)
  {
        if (!user_mode(regs)) {
        }
  
        if (regs) {
 -              regs_user->regs = regs;
                regs_user->abi  = perf_reg_abi(current);
 +              regs_user->regs = regs;
 +      } else {
 +              regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE;
 +              regs_user->regs = NULL;
        }
  }
  
 +static void perf_sample_regs_intr(struct perf_regs *regs_intr,
 +                                struct pt_regs *regs)
 +{
 +      regs_intr->regs = regs;
 +      regs_intr->abi  = perf_reg_abi(current);
 +}
 +
 +
  /*
   * Get remaining task size from user stack pointer.
   *
@@@ -4868,23 -4857,6 +4868,23 @@@ void perf_output_sample(struct perf_out
        if (sample_type & PERF_SAMPLE_TRANSACTION)
                perf_output_put(handle, data->txn);
  
 +      if (sample_type & PERF_SAMPLE_REGS_INTR) {
 +              u64 abi = data->regs_intr.abi;
 +              /*
 +               * If there are no regs to dump, notice it through
 +               * first u64 being zero (PERF_SAMPLE_REGS_ABI_NONE).
 +               */
 +              perf_output_put(handle, abi);
 +
 +              if (abi) {
 +                      u64 mask = event->attr.sample_regs_intr;
 +
 +                      perf_output_sample_regs(handle,
 +                                              data->regs_intr.regs,
 +                                              mask);
 +              }
 +      }
 +
        if (!event->attr.watermark) {
                int wakeup_events = event->attr.wakeup_events;
  
@@@ -4950,13 -4922,12 +4950,13 @@@ void perf_prepare_sample(struct perf_ev
                header->size += size;
        }
  
 +      if (sample_type & (PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER))
 +              perf_sample_regs_user(&data->regs_user, regs);
 +
        if (sample_type & PERF_SAMPLE_REGS_USER) {
                /* regs dump ABI info */
                int size = sizeof(u64);
  
 -              perf_sample_regs_user(&data->regs_user, regs);
 -
                if (data->regs_user.regs) {
                        u64 mask = event->attr.sample_regs_user;
                        size += hweight64(mask) * sizeof(u64);
                 * in case new sample type is added, because we could eat
                 * up the rest of the sample size.
                 */
 -              struct perf_regs_user *uregs = &data->regs_user;
                u16 stack_size = event->attr.sample_stack_user;
                u16 size = sizeof(u64);
  
 -              if (!uregs->abi)
 -                      perf_sample_regs_user(uregs, regs);
 -
                stack_size = perf_sample_ustack_size(stack_size, header->size,
 -                                                   uregs->regs);
 +                                                   data->regs_user.regs);
  
                /*
                 * If there is something to dump, add space for the dump
                data->stack_user_size = stack_size;
                header->size += size;
        }
 +
 +      if (sample_type & PERF_SAMPLE_REGS_INTR) {
 +              /* regs dump ABI info */
 +              int size = sizeof(u64);
 +
 +              perf_sample_regs_intr(&data->regs_intr, regs);
 +
 +              if (data->regs_intr.regs) {
 +                      u64 mask = event->attr.sample_regs_intr;
 +
 +                      size += hweight64(mask) * sizeof(u64);
 +              }
 +
 +              header->size += size;
 +      }
  }
  
  static void perf_event_output(struct perf_event *event,
@@@ -7191,8 -7151,6 +7191,8 @@@ static int perf_copy_attr(struct perf_e
                        ret = -EINVAL;
        }
  
 +      if (attr->sample_type & PERF_SAMPLE_REGS_INTR)
 +              ret = perf_reg_validate(attr->sample_regs_intr);
  out:
        return ret;
  
This page took 0.184018 seconds and 4 git commands to generate.