]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/kernfs/dir.c
Merge branch 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
[mirror_ubuntu-bionic-kernel.git] / fs / kernfs / dir.c
index 939684ebff1e5a363ddd135db7e1f308c07c1d5c..78f3403300afd5d825ab833964a443953d58f995 100644 (file)
@@ -191,7 +191,7 @@ static unsigned int kernfs_name_hash(const char *name, const void *ns)
        hash = (end_name_hash(hash) ^ hash_ptr((void *)ns, 31));
        hash &= 0x7fffffffU;
        /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
-       if (hash < 1)
+       if (hash < 2)
                hash += 2;
        if (hash >= INT_MAX)
                hash = INT_MAX - 1;
@@ -501,7 +501,7 @@ const struct dentry_operations kernfs_dops = {
  */
 struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry)
 {
-       if (dentry->d_op == &kernfs_dops)
+       if (dentry->d_sb->s_op == &kernfs_sops)
                return dentry->d_fsdata;
        return NULL;
 }
@@ -1296,7 +1296,7 @@ int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
 
        spin_unlock_irq(&kernfs_rename_lock);
 
-       kn->hash = kernfs_name_hash(new_name, new_ns);
+       kn->hash = kernfs_name_hash(kn->name, kn->ns);
        kernfs_link_sibling(kn);
 
        kernfs_put(old_parent);