]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
kill f_dentry uses
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 Oct 2014 05:22:04 +0000 (01:22 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Nov 2014 18:01:25 +0000 (13:01 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
19 files changed:
drivers/block/drbd/drbd_debugfs.c
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/staging/lustre/lustre/llite/file.c
fs/ceph/dir.c
fs/ceph/file.c
fs/cifs/readdir.c
fs/ecryptfs/crypto.c
fs/ecryptfs/mmap.c
fs/efivarfs/file.c
fs/sync.c
include/linux/cgroup.h
kernel/auditsc.c
kernel/events/core.c
kernel/taskstats.c
mm/memcontrol.c
security/commoncap.c
security/integrity/ima/ima_api.c
security/integrity/ima/ima_appraise.c
security/integrity/ima/ima_template_lib.c

index 900d4d3272d1af3d2caee19093b196f6b8971eb1..9a950022ff885d40ba539438f0ff529c34152a47 100644 (file)
@@ -419,7 +419,7 @@ static int in_flight_summary_show(struct seq_file *m, void *pos)
        return 0;
 }
 
-/* simple_positive(file->f_dentry) respectively debugfs_positive(),
+/* simple_positive(file->f_path.dentry) respectively debugfs_positive(),
  * but neither is "reachable" from here.
  * So we have our own inline version of it above.  :-( */
 static inline int debugfs_positive(struct dentry *dentry)
@@ -437,14 +437,14 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
 
        /* Are we still linked,
         * or has debugfs_remove() already been called? */
-       parent = file->f_dentry->d_parent;
+       parent = file->f_path.dentry->d_parent;
        /* not sure if this can happen: */
        if (!parent || !parent->d_inode)
                goto out;
        /* serialize with d_delete() */
        mutex_lock(&parent->d_inode->i_mutex);
        /* Make sure the object is still alive */
-       if (debugfs_positive(file->f_dentry)
+       if (debugfs_positive(file->f_path.dentry)
        && kref_get_unless_zero(kref))
                ret = 0;
        mutex_unlock(&parent->d_inode->i_mutex);
index 1311ab15243e6e9bf8ac1853a73f1d4fe9f73d8e..5633e7dadc084cc93cc11347aa831ae358910e5f 100644 (file)
@@ -1011,7 +1011,7 @@ static ssize_t
 lpfc_debugfs_dif_err_read(struct file *file, char __user *buf,
        size_t nbytes, loff_t *ppos)
 {
-       struct dentry *dent = file->f_dentry;
+       struct dentry *dent = file->f_path.dentry;
        struct lpfc_hba *phba = file->private_data;
        char cbuf[32];
        uint64_t tmp = 0;
@@ -1052,7 +1052,7 @@ static ssize_t
 lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf,
        size_t nbytes, loff_t *ppos)
 {
-       struct dentry *dent = file->f_dentry;
+       struct dentry *dent = file->f_path.dentry;
        struct lpfc_hba *phba = file->private_data;
        char dstbuf[32];
        uint64_t tmp = 0;
index c99b74117152ebc9285da1de50c372d4172d9241..08e77492da8fef55677702bcbe694ebd18024827 100644 (file)
@@ -2092,7 +2092,7 @@ putgl:
        rc = 0;
        if (llss->ia2.ia_valid != 0) {
                mutex_lock(&llss->inode1->i_mutex);
-               rc = ll_setattr(file1->f_dentry, &llss->ia2);
+               rc = ll_setattr(file1->f_path.dentry, &llss->ia2);
                mutex_unlock(&llss->inode1->i_mutex);
        }
 
@@ -2100,7 +2100,7 @@ putgl:
                int rc1;
 
                mutex_lock(&llss->inode2->i_mutex);
-               rc1 = ll_setattr(file2->f_dentry, &llss->ia1);
+               rc1 = ll_setattr(file2->f_path.dentry, &llss->ia1);
                mutex_unlock(&llss->inode2->i_mutex);
                if (rc == 0)
                        rc = rc1;
@@ -2185,7 +2185,7 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
 
        mutex_lock(&inode->i_mutex);
 
-       rc = ll_setattr_raw(file->f_dentry, attr, true);
+       rc = ll_setattr_raw(file->f_path.dentry, attr, true);
        if (rc == -ENODATA)
                rc = 0;
 
@@ -2622,12 +2622,6 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
        return result;
 }
 
-/*
- * When dentry is provided (the 'else' case), *file->f_dentry may be
- * null and dentry must be used directly rather than pulled from
- * *file->f_dentry as is done otherwise.
- */
-
 int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync)
 {
        struct dentry *dentry = file->f_dentry;
index 766ec35f988e0cd4f70d75d0d2242b6174d53bb1..681a8537b64f821c443a29af4c64a0c8c8a38a36 100644 (file)
@@ -123,7 +123,7 @@ static int __dcache_readdir(struct file *file,  struct dir_context *ctx,
                            u32 shared_gen)
 {
        struct ceph_file_info *fi = file->private_data;
-       struct dentry *parent = file->f_dentry;
+       struct dentry *parent = file->f_path.dentry;
        struct inode *dir = parent->d_inode;
        struct list_head *p;
        struct dentry *dentry, *last;
@@ -274,7 +274,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx)
                off = 1;
        }
        if (ctx->pos == 1) {
-               ino_t ino = parent_ino(file->f_dentry);
+               ino_t ino = parent_ino(file->f_path.dentry);
                dout("readdir off 1 -> '..'\n");
                if (!dir_emit(ctx, "..", 2,
                            ceph_translate_ino(inode->i_sb, ino),
@@ -337,7 +337,7 @@ more:
                }
                req->r_inode = inode;
                ihold(inode);
-               req->r_dentry = dget(file->f_dentry);
+               req->r_dentry = dget(file->f_path.dentry);
                /* hints to request -> mds selection code */
                req->r_direct_mode = USE_AUTH_MDS;
                req->r_direct_hash = ceph_frag_value(frag);
index db2c967950f77e49aca84c27018135d4ddfbfd63..9f8e3572040e98ab3c30be96ae3bd68d7f9b0900 100644 (file)
@@ -211,7 +211,7 @@ int ceph_open(struct inode *inode, struct file *file)
 
        req->r_num_caps = 1;
        if (flags & O_CREAT)
-               parent_inode = ceph_get_dentry_parent_inode(file->f_dentry);
+               parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
        err = ceph_mdsc_do_request(mdsc, parent_inode, req);
        iput(parent_inode);
        if (!err)
index d19f1996a6ea3424b31601c43a4f3e3ee2305406..d116ca8ce4c0284d3a55a18fc3941bf192e4a790 100644 (file)
@@ -753,7 +753,7 @@ static int cifs_filldir(char *find_entry, struct file *file,
                 */
                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);
index 2f6735dbf1a9ded47999ebc97590221b16eb6925..c2d6604667b052bf343febc88969f60f57568290 100644 (file)
@@ -1373,7 +1373,7 @@ out:
 int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode)
 {
        struct dentry *lower_dentry =
-               ecryptfs_inode_to_private(ecryptfs_inode)->lower_file->f_dentry;
+               ecryptfs_inode_to_private(ecryptfs_inode)->lower_file->f_path.dentry;
        ssize_t size;
        int rc = 0;
 
index 564a1fa34b9941a4672d3b455db928ebcd4e4fa1..4626976794e75284b2665cfdb99b38092fecfd93 100644 (file)
@@ -419,7 +419,7 @@ static int ecryptfs_write_inode_size_to_xattr(struct inode *ecryptfs_inode)
        ssize_t size;
        void *xattr_virt;
        struct dentry *lower_dentry =
-               ecryptfs_inode_to_private(ecryptfs_inode)->lower_file->f_dentry;
+               ecryptfs_inode_to_private(ecryptfs_inode)->lower_file->f_path.dentry;
        struct inode *lower_inode = lower_dentry->d_inode;
        int rc;
 
index cdb2971192a53fbfe2e340feb9819b7454f8ffa2..90001da9abfdfe98b01a0eacdb5381425234b126 100644 (file)
@@ -47,8 +47,8 @@ static ssize_t efivarfs_file_write(struct file *file,
 
        if (bytes == -ENOENT) {
                drop_nlink(inode);
-               d_delete(file->f_dentry);
-               dput(file->f_dentry);
+               d_delete(file->f_path.dentry);
+               dput(file->f_path.dentry);
        } else {
                mutex_lock(&inode->i_mutex);
                i_size_write(inode, datasize + sizeof(attributes));
index bdc729d80e5e4eb863ad4fcf849aa6ea886a7519..01d9f18a70b5188a4b74ab718868ad6468b33b76 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -154,7 +154,7 @@ SYSCALL_DEFINE1(syncfs, int, fd)
 
        if (!f.file)
                return -EBADF;
-       sb = f.file->f_dentry->d_sb;
+       sb = f.file->f_path.dentry->d_sb;
 
        down_read(&sb->s_umount);
        ret = sync_filesystem(sb);
index 1d51968890480bdbca29d576769a6565ba7544a2..27b0c9105da56e89a7bcf423e7953eef5820304a 100644 (file)
@@ -367,8 +367,8 @@ struct css_set {
  * struct cftype: handler definitions for cgroup control files
  *
  * When reading/writing to a file:
- *     - the cgroup to use is file->f_dentry->d_parent->d_fsdata
- *     - the 'cftype' of the file is file->f_dentry->d_fsdata
+ *     - the cgroup to use is file->f_path.dentry->d_parent->d_fsdata
+ *     - the 'cftype' of the file is file->f_path.dentry->d_fsdata
  */
 
 /* cftype->flags */
index e420a0c41b5f605b0f4ead982eac279e066ffee2..06820657c8ca93fab1661f30d6cb6884ada77e48 100644 (file)
@@ -2373,7 +2373,7 @@ int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
        ax->d.next = context->aux;
        context->aux = (void *)ax;
 
-       dentry = dget(bprm->file->f_dentry);
+       dentry = dget(bprm->file->f_path.dentry);
        get_vfs_caps_from_disk(dentry, &vcaps);
        dput(dentry);
 
index 1425d07018de50987b5373dec88bff3438787426..446fbeefad1c1bfeee5822dfecce883f0029f027 100644 (file)
@@ -614,7 +614,7 @@ static inline int perf_cgroup_connect(int fd, struct perf_event *event,
        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);
index b312fcc730243054a295e717460b3d61e710a26b..670fff88a9613e07ac52d70a5365875d93e1e29c 100644 (file)
@@ -459,7 +459,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
        stats = nla_data(na);
        memset(stats, 0, sizeof(*stats));
 
-       rc = cgroupstats_build(stats, f.file->f_dentry);
+       rc = cgroupstats_build(stats, f.file->f_path.dentry);
        if (rc < 0) {
                nlmsg_free(rep_skb);
                goto err;
index 23976fd885fd588a7687bf5631f98ea38f2235b4..8c3385181b1633c6a03884436fc5b92c5bffcf20 100644 (file)
@@ -5055,7 +5055,7 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
         *
         * DO NOT ADD NEW FILES.
         */
-       name = cfile.file->f_dentry->d_name.name;
+       name = cfile.file->f_path.dentry->d_name.name;
 
        if (!strcmp(name, "memory.usage_in_bytes")) {
                event->register_event = mem_cgroup_usage_register_event;
@@ -5079,7 +5079,7 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
         * automatically removed on cgroup destruction but the removal is
         * asynchronous, so take an extra ref on @css.
         */
-       cfile_css = css_tryget_online_from_dir(cfile.file->f_dentry->d_parent,
+       cfile_css = css_tryget_online_from_dir(cfile.file->f_path.dentry->d_parent,
                                               &memory_cgrp_subsys);
        ret = -EINVAL;
        if (IS_ERR(cfile_css))
index bab0611afc1eed309a04f9cf2ee05575ea98fc9d..2915d8503054c0e41e5bc4de2103f0dad4026371 100644 (file)
@@ -446,7 +446,7 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_c
        if (bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID)
                return 0;
 
-       dentry = dget(bprm->file->f_dentry);
+       dentry = dget(bprm->file->f_path.dentry);
 
        rc = get_vfs_caps_from_disk(dentry, &vcaps);
        if (rc < 0) {
index 86885979918c187fef5298c86ba9de7a97ab968b..f92be1b14089fb7abd1d64215c7ddeecace17e95 100644 (file)
@@ -196,7 +196,7 @@ int ima_collect_measurement(struct integrity_iint_cache *iint,
 {
        const char *audit_cause = "failed";
        struct inode *inode = file_inode(file);
-       const char *filename = file->f_dentry->d_name.name;
+       const char *filename = file->f_path.dentry->d_name.name;
        int result = 0;
        struct {
                struct ima_digest_data hdr;
@@ -204,7 +204,7 @@ int ima_collect_measurement(struct integrity_iint_cache *iint,
        } hash;
 
        if (xattr_value)
-               *xattr_len = ima_read_xattr(file->f_dentry, xattr_value);
+               *xattr_len = ima_read_xattr(file->f_path.dentry, xattr_value);
 
        if (!(iint->flags & IMA_COLLECTED)) {
                u64 i_version = file_inode(file)->i_version;
index 922685483bd3625355af6202bb435728ac62c11f..c2f203accbd12e6936526c3d986f11a2a80348ae 100644 (file)
@@ -189,7 +189,7 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint,
 {
        static const char op[] = "appraise_data";
        char *cause = "unknown";
-       struct dentry *dentry = file->f_dentry;
+       struct dentry *dentry = file->f_path.dentry;
        struct inode *inode = dentry->d_inode;
        enum integrity_status status = INTEGRITY_UNKNOWN;
        int rc = xattr_len, hash_start = 0;
@@ -289,7 +289,7 @@ out:
  */
 void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file)
 {
-       struct dentry *dentry = file->f_dentry;
+       struct dentry *dentry = file->f_path.dentry;
        int rc = 0;
 
        /* do not collect and update hash for digital signatures */
index 1506f02485726e18e3f6ba5c8c057da9e00e296a..bcfc36cbde6ae9120f9e0380dcd04e458a752f5a 100644 (file)
@@ -284,7 +284,7 @@ static int ima_eventname_init_common(struct integrity_iint_cache *iint,
        }
 
        if (file) {
-               cur_filename = file->f_dentry->d_name.name;
+               cur_filename = file->f_path.dentry->d_name.name;
                cur_filename_len = strlen(cur_filename);
        } else
                /*