Commit 9afa2fb6c13501e5b3536d15344fce4e5442c469

Authored by Erez Zadok
Committed by Al Viro
1 parent cb59861f03

fsstack/ecryptfs: remove unused get_nlinks param to fsstack_copy_attr_all

This get_nlinks parameter was never used by the only mainline user,
ecryptfs; and it has never been used by unionfs or wrapfs either.

Acked-by: Dustin Kirkland <kirkland@canonical.com>
Acked-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 5 changed files with 9 additions and 22 deletions Side-by-side Diff

fs/ecryptfs/dentry.c
... ... @@ -62,7 +62,7 @@
62 62 struct inode *lower_inode =
63 63 ecryptfs_inode_to_lower(dentry->d_inode);
64 64  
65   - fsstack_copy_attr_all(dentry->d_inode, lower_inode, NULL);
  65 + fsstack_copy_attr_all(dentry->d_inode, lower_inode);
66 66 }
67 67 out:
68 68 return rc;
... ... @@ -626,9 +626,9 @@
626 626 lower_new_dir_dentry->d_inode, lower_new_dentry);
627 627 if (rc)
628 628 goto out_lock;
629   - fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode, NULL);
  629 + fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode);
630 630 if (new_dir != old_dir)
631   - fsstack_copy_attr_all(old_dir, lower_old_dir_dentry->d_inode, NULL);
  631 + fsstack_copy_attr_all(old_dir, lower_old_dir_dentry->d_inode);
632 632 out_lock:
633 633 unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
634 634 dput(lower_new_dentry->d_parent);
... ... @@ -967,7 +967,7 @@
967 967 rc = notify_change(lower_dentry, ia);
968 968 mutex_unlock(&lower_dentry->d_inode->i_mutex);
969 969 out:
970   - fsstack_copy_attr_all(inode, lower_inode, NULL);
  970 + fsstack_copy_attr_all(inode, lower_inode);
971 971 return rc;
972 972 }
973 973  
... ... @@ -189,7 +189,7 @@
189 189 init_special_inode(inode, lower_inode->i_mode,
190 190 lower_inode->i_rdev);
191 191 dentry->d_op = &ecryptfs_dops;
192   - fsstack_copy_attr_all(inode, lower_inode, NULL);
  192 + fsstack_copy_attr_all(inode, lower_inode);
193 193 /* This size will be overwritten for real files w/ headers and
194 194 * other metadata */
195 195 fsstack_copy_inode_size(inode, lower_inode);
... ... @@ -14,11 +14,8 @@
14 14 }
15 15 EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
16 16  
17   -/* copy all attributes; get_nlinks is optional way to override the i_nlink
18   - * copying
19   - */
20   -void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
21   - int (*get_nlinks)(struct inode *))
  17 +/* copy all attributes */
  18 +void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
22 19 {
23 20 dest->i_mode = src->i_mode;
24 21 dest->i_uid = src->i_uid;
... ... @@ -29,15 +26,7 @@
29 26 dest->i_ctime = src->i_ctime;
30 27 dest->i_blkbits = src->i_blkbits;
31 28 dest->i_flags = src->i_flags;
32   -
33   - /*
34   - * Update the nlinks AFTER updating the above fields, because the
35   - * get_links callback may depend on them.
36   - */
37   - if (!get_nlinks)
38   - dest->i_nlink = src->i_nlink;
39   - else
40   - dest->i_nlink = (*get_nlinks)(dest);
  29 + dest->i_nlink = src->i_nlink;
41 30 }
42 31 EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
include/linux/fs_stack.h
... ... @@ -8,9 +8,7 @@
8 8 #include <linux/fs.h>
9 9  
10 10 /* externs for fs/stack.c */
11   -extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
12   - int (*get_nlinks)(struct inode *));
13   -
  11 +extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src);
14 12 extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
15 13  
16 14 /* inlines */