mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[PATCH] r/o bind mount prepwork: inc_nlink() helper
This is mostly included for parity with dec_nlink(), where we will have some more hooks. This one should stay pretty darn straightforward for now. Signed-off-by: Dave Hansen <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
9a53c3a783
commit
d8c76e6f45
37 changed files with 80 additions and 75 deletions
|
|
@ -377,7 +377,7 @@ static int cpuset_fill_super(struct super_block *sb, void *unused_data,
|
|||
inode->i_op = &simple_dir_inode_operations;
|
||||
inode->i_fop = &simple_dir_operations;
|
||||
/* directories start off with i_nlink == 2 (for "." entry) */
|
||||
inode->i_nlink++;
|
||||
inc_nlink(inode);
|
||||
} else {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
@ -1565,7 +1565,7 @@ static int cpuset_create_file(struct dentry *dentry, int mode)
|
|||
inode->i_fop = &simple_dir_operations;
|
||||
|
||||
/* start off with i_nlink == 2 (for "." entry) */
|
||||
inode->i_nlink++;
|
||||
inc_nlink(inode);
|
||||
} else if (S_ISREG(mode)) {
|
||||
inode->i_size = 0;
|
||||
inode->i_fop = &cpuset_file_operations;
|
||||
|
|
@ -1598,7 +1598,7 @@ static int cpuset_create_dir(struct cpuset *cs, const char *name, int mode)
|
|||
error = cpuset_create_file(dentry, S_IFDIR | mode);
|
||||
if (!error) {
|
||||
dentry->d_fsdata = cs;
|
||||
parent->d_inode->i_nlink++;
|
||||
inc_nlink(parent->d_inode);
|
||||
cs->dentry = dentry;
|
||||
}
|
||||
dput(dentry);
|
||||
|
|
@ -2033,7 +2033,7 @@ int __init cpuset_init(void)
|
|||
}
|
||||
root = cpuset_mount->mnt_sb->s_root;
|
||||
root->d_fsdata = &top_cpuset;
|
||||
root->d_inode->i_nlink++;
|
||||
inc_nlink(root->d_inode);
|
||||
top_cpuset.dentry = root;
|
||||
root->d_inode->i_op = &cpuset_dir_inode_operations;
|
||||
number_of_cpusets = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue