aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2011-10-28 08:13:29 -0400
committerChristoph Hellwig <hch@serles.lst.de>2011-11-02 07:53:43 -0400
commitbfe8684869601dacfcb2cd69ef8cfd9045f62170 (patch)
tree4e213aaa766b26f43f0f9ec7998a7745239d9377 /fs/proc
parent6d6b77f163c7eabedbba00ed2abb7d4a570bff76 (diff)
filesystems: add set_nlink()
Replace remaining direct i_nlink updates with a new set_nlink() updater function. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c12
-rw-r--r--fs/proc/generic.c2
-rw-r--r--fs/proc/inode.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 8f0087e20e16..851ba3dcdc29 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2248,7 +2248,7 @@ static struct dentry *proc_pident_instantiate(struct inode *dir,
2248 ei = PROC_I(inode); 2248 ei = PROC_I(inode);
2249 inode->i_mode = p->mode; 2249 inode->i_mode = p->mode;
2250 if (S_ISDIR(inode->i_mode)) 2250 if (S_ISDIR(inode->i_mode))
2251 inode->i_nlink = 2; /* Use getattr to fix if necessary */ 2251 set_nlink(inode, 2); /* Use getattr to fix if necessary */
2252 if (p->iop) 2252 if (p->iop)
2253 inode->i_op = p->iop; 2253 inode->i_op = p->iop;
2254 if (p->fop) 2254 if (p->fop)
@@ -2642,7 +2642,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir,
2642 2642
2643 inode->i_mode = p->mode; 2643 inode->i_mode = p->mode;
2644 if (S_ISDIR(inode->i_mode)) 2644 if (S_ISDIR(inode->i_mode))
2645 inode->i_nlink = 2; 2645 set_nlink(inode, 2);
2646 if (S_ISLNK(inode->i_mode)) 2646 if (S_ISLNK(inode->i_mode))
2647 inode->i_size = 64; 2647 inode->i_size = 64;
2648 if (p->iop) 2648 if (p->iop)
@@ -2981,8 +2981,8 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
2981 inode->i_fop = &proc_tgid_base_operations; 2981 inode->i_fop = &proc_tgid_base_operations;
2982 inode->i_flags|=S_IMMUTABLE; 2982 inode->i_flags|=S_IMMUTABLE;
2983 2983
2984 inode->i_nlink = 2 + pid_entry_count_dirs(tgid_base_stuff, 2984 set_nlink(inode, 2 + pid_entry_count_dirs(tgid_base_stuff,
2985 ARRAY_SIZE(tgid_base_stuff)); 2985 ARRAY_SIZE(tgid_base_stuff)));
2986 2986
2987 d_set_d_op(dentry, &pid_dentry_operations); 2987 d_set_d_op(dentry, &pid_dentry_operations);
2988 2988
@@ -3233,8 +3233,8 @@ static struct dentry *proc_task_instantiate(struct inode *dir,
3233 inode->i_fop = &proc_tid_base_operations; 3233 inode->i_fop = &proc_tid_base_operations;
3234 inode->i_flags|=S_IMMUTABLE; 3234 inode->i_flags|=S_IMMUTABLE;
3235 3235
3236 inode->i_nlink = 2 + pid_entry_count_dirs(tid_base_stuff, 3236 set_nlink(inode, 2 + pid_entry_count_dirs(tid_base_stuff,
3237 ARRAY_SIZE(tid_base_stuff)); 3237 ARRAY_SIZE(tid_base_stuff)));
3238 3238
3239 d_set_d_op(dentry, &pid_dentry_operations); 3239 d_set_d_op(dentry, &pid_dentry_operations);
3240 3240
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 9d99131d0d65..10090d9c7ad5 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -283,7 +283,7 @@ static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry,
283 struct inode *inode = dentry->d_inode; 283 struct inode *inode = dentry->d_inode;
284 struct proc_dir_entry *de = PROC_I(inode)->pde; 284 struct proc_dir_entry *de = PROC_I(inode)->pde;
285 if (de && de->nlink) 285 if (de && de->nlink)
286 inode->i_nlink = de->nlink; 286 set_nlink(inode, de->nlink);
287 287
288 generic_fillattr(inode, stat); 288 generic_fillattr(inode, stat);
289 return 0; 289 return 0;
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 7ed72d6c1c6f..7737c5468a40 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -445,7 +445,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
445 if (de->size) 445 if (de->size)
446 inode->i_size = de->size; 446 inode->i_size = de->size;
447 if (de->nlink) 447 if (de->nlink)
448 inode->i_nlink = de->nlink; 448 set_nlink(inode, de->nlink);
449 if (de->proc_iops) 449 if (de->proc_iops)
450 inode->i_op = de->proc_iops; 450 inode->i_op = de->proc_iops;
451 if (de->proc_fops) { 451 if (de->proc_fops) {