Skip to content

Commit 9afa2fb

Browse files
Erez ZadokAl Viro
authored andcommitted
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>
1 parent cb59861 commit 9afa2fb

5 files changed

Lines changed: 9 additions & 22 deletions

File tree

‎fs/ecryptfs/dentry.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
6262
struct inode *lower_inode =
6363
ecryptfs_inode_to_lower(dentry->d_inode);
6464

65-
fsstack_copy_attr_all(dentry->d_inode, lower_inode, NULL);
65+
fsstack_copy_attr_all(dentry->d_inode, lower_inode);
6666
}
6767
out:
6868
return rc;

‎fs/ecryptfs/inode.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
626626
lower_new_dir_dentry->d_inode, lower_new_dentry);
627627
if (rc)
628628
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);
630630
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);
632632
out_lock:
633633
unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
634634
dput(lower_new_dentry->d_parent);
@@ -967,7 +967,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
967967
rc = notify_change(lower_dentry, ia);
968968
mutex_unlock(&lower_dentry->d_inode->i_mutex);
969969
out:
970-
fsstack_copy_attr_all(inode, lower_inode, NULL);
970+
fsstack_copy_attr_all(inode, lower_inode);
971971
return rc;
972972
}
973973

‎fs/ecryptfs/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
189189
init_special_inode(inode, lower_inode->i_mode,
190190
lower_inode->i_rdev);
191191
dentry->d_op = &ecryptfs_dops;
192-
fsstack_copy_attr_all(inode, lower_inode, NULL);
192+
fsstack_copy_attr_all(inode, lower_inode);
193193
/* This size will be overwritten for real files w/ headers and
194194
* other metadata */
195195
fsstack_copy_inode_size(inode, lower_inode);

‎fs/stack.c‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ void fsstack_copy_inode_size(struct inode *dst, const struct inode *src)
1414
}
1515
EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
1616

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)
2219
{
2320
dest->i_mode = src->i_mode;
2421
dest->i_uid = src->i_uid;
@@ -29,14 +26,6 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
2926
dest->i_ctime = src->i_ctime;
3027
dest->i_blkbits = src->i_blkbits;
3128
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;
4130
}
4231
EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);

‎include/linux/fs_stack.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
#include <linux/fs.h>
99

1010
/* 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);
1412
extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
1513

1614
/* inlines */

0 commit comments

Comments
 (0)