Merge branches 'work.namei', 'work.dcache' and 'work.iov_iter' into for-linus
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 15 Dec 2016 06:07:29 +0000 (01:07 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 15 Dec 2016 06:07:29 +0000 (01:07 -0500)
1  2  3  4 
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/super.c

diff --combined fs/ceph/file.c
@@@@@ -351,10 -351,10 -351,6 -351,10 +351,6 @@@@@ int ceph_atomic_open(struct inode *dir
        if (dentry->d_name.len > NAME_MAX)
                return -ENAMETOOLONG;
    
-- -    err = ceph_init_dentry(dentry);
-- -    if (err < 0)
-- -            return err;
-- -
        if (flags & O_CREAT) {
                err = ceph_pre_init_acls(dir, &mode, &acls);
                if (err < 0)
                statret = __ceph_do_getattr(inode, page,
                                            CEPH_STAT_CAP_INLINE_DATA, !!page);
                if (statret < 0) {
  -                      __free_page(page);
  +                     if (page)
  +                             __free_page(page);
                        if (statret == -ENODATA) {
                                BUG_ON(retry_op != READ_INLINE);
                                goto again;
@@@@@ -1770,6 -1770,6 -1765,7 -1770,6 +1766,6 @@@@@ const struct file_operations ceph_file_
        .fsync = ceph_fsync,
        .lock = ceph_lock,
        .flock = ceph_flock,
  -     .splice_read = generic_file_splice_read,
        .splice_write = iter_file_splice_write,
        .unlocked_ioctl = ceph_ioctl,
        .compat_ioctl   = ceph_ioctl,
diff --combined fs/ceph/inode.c
@@@@@ -1023,16 -1023,16 -1023,17 -1023,16 +1023,17 @@@@@ static void update_dentry_lease(struct 
        long unsigned half_ttl = from_time + (duration * HZ / 2) / 1000;
        struct inode *dir;
    
-- -    /* only track leases on regular dentries */
-- -    if (dentry->d_op != &ceph_dentry_ops)
-- -            return;
-- -
        spin_lock(&dentry->d_lock);
        dout("update_dentry_lease %p duration %lu ms ttl %lu\n",
             dentry, duration, ttl);
    
        /* make lease_rdcache_gen match directory */
        dir = d_inode(dentry->d_parent);
++ +
++ +    /* only track leases on regular dentries */
++ +    if (ceph_snap(dir) != CEPH_NOSNAP)
++ +            goto out_unlock;
++ +
        di->lease_shared_gen = ceph_inode(dir)->i_shared_gen;
    
        if (duration == 0)
@@@@@ -1202,12 -1202,12 -1203,7 -1202,12 +1203,7 @@@@@ retry_lookup
                                        err = -ENOMEM;
                                        goto done;
                                }
-- -                            err = ceph_init_dentry(dn);
-- -                            if (err < 0) {
-- -                                    dput(dn);
-- -                                    dput(parent);
-- -                                    goto done;
-- -                            }
++ +                            err = 0;
                        } else if (d_really_is_positive(dn) &&
                                   (ceph_ino(d_inode(dn)) != vino.ino ||
                                    ceph_snap(d_inode(dn)) != vino.snap)) {
@@@@@ -1511,8 -1511,8 -1507,7 -1511,8 +1507,8 @@@@@ int ceph_readdir_prepopulate(struct cep
                        ceph_fill_dirfrag(d_inode(parent), rinfo->dir_dir);
        }
    
  -     if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2) {
  +     if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2 &&
  +         !(rinfo->hash_order && req->r_path2)) {
                /* note dir version at start of readdir so we can tell
                 * if any dentries get dropped */
                req->r_dir_release_cnt = atomic64_read(&ci->i_release_count);
@@@@@ -1561,12 -1561,12 -1556,6 -1561,12 +1557,6 @@@@@ retry_lookup
                                err = -ENOMEM;
                                goto out;
                        }
-- -                    ret = ceph_init_dentry(dn);
-- -                    if (ret < 0) {
-- -                            dput(dn);
-- -                            err = ret;
-- -                            goto out;
-- -                    }
                } else if (d_really_is_positive(dn) &&
                           (ceph_ino(d_inode(dn)) != vino.ino ||
                            ceph_snap(d_inode(dn)) != vino.snap)) {
diff --combined fs/ceph/super.c
@@@@@ -795,7 -795,7 -795,6 -795,7 +795,6 @@@@@ static struct dentry *open_root_dentry(
                        root = ERR_PTR(-ENOMEM);
                        goto out;
                }
-- -            ceph_init_dentry(root);
                dout("open_root_inode success, root dentry is %p\n", root);
        } else {
                root = ERR_PTR(err);
@@@@@ -845,8 -845,8 -844,6 -845,8 +844,8 @@@@@ static struct dentry *ceph_real_mount(s
                err = ceph_fs_debugfs_init(fsc);
                if (err < 0)
                        goto fail;
  +     } else {
  +             root = dget(fsc->sb->s_root);
        }
    
        fsc->mount_state = CEPH_MOUNT_MOUNTED;
@@@@@ -879,6 -879,6 -876,7 -879,6 +878,7 @@@@@ static int ceph_set_super(struct super_
        fsc->sb = s;
    
        s->s_op = &ceph_super_ops;
++ +    s->s_d_op = &ceph_dentry_ops;
        s->s_export_op = &ceph_export_ops;
    
        s->s_time_gran = 1000;  /* 1000 ns == 1 us */