Unionfs: namei fixes and misc
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 24 Nov 2013 05:14:47 +0000 (00:14 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 02:42:52 +0000 (21:42 -0500)
Updated lookup_one_len_nd(), update MAINTAINERS, remove old comments and
copyrights.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
MAINTAINERS
fs/namei.c
fs/stack.c
include/linux/fs_stack.h

index def7d942a5e4e38e0490b6adb1ad3c17980b4bdc..fab113fc2d99e141a73b952d173cea4e4bef8b7c 100644 (file)
@@ -6884,13 +6884,15 @@ F:      Documentation/cdrom/
 F:     drivers/cdrom/cdrom.c
 F:     include/linux/cdrom.h
 
-UNIONFS
+UNION FILE SYSTEM
 P:     Erez Zadok
 M:     ezk@cs.sunysb.edu
 L:     unionfs@filesystems.org
 W:     http://unionfs.filesystems.org/
-T:     git git.kernel.org/pub/scm/linux/kernel/git/ezk/unionfs.git
+T:     git git://git.fsl.cs.sunysb.edu/unionfs-latest.git
 S:     Maintained
+F:     Documentation/filesystems/unionfs/
+F:     fs/unionfs/
 
 UNSORTED BLOCK IMAGES (UBI)
 M:     Artem Bityutskiy <dedekind1@gmail.com>
index de81292d953455d877ac97f26c6bc03a5ad0df35..c116a85f830832dda29e53d2d557980d1d427634 100644 (file)
@@ -1850,38 +1850,7 @@ static struct dentry *lookup_hash(struct nameidata *nd)
  */
 struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
 {
-       struct qstr this;
-       unsigned int c;
-       int err;
-
-       WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex));
-
-       this.name = name;
-       this.len = len;
-       this.hash = full_name_hash(name, len);
-       if (!len)
-               return ERR_PTR(-EACCES);
-
-       while (len--) {
-               c = *(const unsigned char *)name++;
-               if (c == '/' || c == '\0')
-                       return ERR_PTR(-EACCES);
-       }
-       /*
-        * See if the low-level filesystem might want
-        * to use its own hash..
-        */
-       if (base->d_flags & DCACHE_OP_HASH) {
-               int err = base->d_op->d_hash(base, base->d_inode, &this);
-               if (err < 0)
-                       return ERR_PTR(err);
-       }
-
-       err = inode_permission(base->d_inode, MAY_EXEC);
-       if (err)
-               return ERR_PTR(err);
-
-       return __lookup_hash(&this, base, NULL);
+       return lookup_one_len_nd(name, base, len, NULL);
 }
 
 /* pass nameidata from caller (useful for NFS) */
@@ -1889,24 +1858,22 @@ struct dentry *lookup_one_len_nd(const char *name, struct dentry *base,
                                 int len, struct nameidata *nd)
 {
        struct qstr this;
-       unsigned long hash;
        unsigned int c;
+       int err;
 
        WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex));
 
        this.name = name;
        this.len = len;
+       this.hash = full_name_hash(name, len);
        if (!len)
                return ERR_PTR(-EACCES);
 
-       hash = init_name_hash();
        while (len--) {
                c = *(const unsigned char *)name++;
                if (c == '/' || c == '\0')
                        return ERR_PTR(-EACCES);
-               hash = partial_name_hash(c, hash);
        }
-       this.hash = end_name_hash(hash);
        /*
         * See if the low-level filesystem might want
         * to use its own hash..
@@ -1917,6 +1884,10 @@ struct dentry *lookup_one_len_nd(const char *name, struct dentry *base,
                        return ERR_PTR(err);
        }
 
+       err = inode_permission(base->d_inode, MAY_EXEC);
+       if (err)
+               return ERR_PTR(err);
+
        return __lookup_hash(&this, base, nd);
 }
 
index 098ef57ef558b143f5a869b9beee191cb80e1499..5b5388250e29351a66b60cd7658832586eb80771 100644 (file)
@@ -2,8 +2,7 @@
 #include <linux/fs.h>
 #include <linux/fs_stack.h>
 
-/*
- * does _NOT_ require i_mutex to be held.
+/* does _NOT_ require i_mutex to be held.
  *
  * This function cannot be inlined since i_size_{read,write} is rather
  * heavy-weight on 32-bit systems
index 64f1ced6de09f3a7f85df43d17cc589b7e5de494..da317c7163ab55c4ff6e3552c58ecb7db916ce7e 100644 (file)
@@ -1,19 +1,7 @@
-/*
- * Copyright (c) 2006-2009 Erez Zadok
- * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
- * Copyright (c) 2006-2009 Stony Brook University
- * Copyright (c) 2006-2009 The Research Foundation of SUNY
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
 #ifndef _LINUX_FS_STACK_H
 #define _LINUX_FS_STACK_H
 
-/*
- * This file defines generic functions used primarily by stackable
+/* This file defines generic functions used primarily by stackable
  * filesystems; none of these functions require i_mutex to be held.
  */