diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-10-28 08:13:29 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@serles.lst.de> | 2011-11-02 07:53:43 -0400 |
commit | bfe8684869601dacfcb2cd69ef8cfd9045f62170 (patch) | |
tree | 4e213aaa766b26f43f0f9ec7998a7745239d9377 /fs/jffs2 | |
parent | 6d6b77f163c7eabedbba00ed2abb7d4a570bff76 (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/jffs2')
-rw-r--r-- | fs/jffs2/dir.c | 6 | ||||
-rw-r--r-- | fs/jffs2/fs.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 9659b7c00468..be6169bd8acd 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -245,7 +245,7 @@ static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry) | |||
245 | ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, | 245 | ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, |
246 | dentry->d_name.len, dead_f, now); | 246 | dentry->d_name.len, dead_f, now); |
247 | if (dead_f->inocache) | 247 | if (dead_f->inocache) |
248 | dentry->d_inode->i_nlink = dead_f->inocache->pino_nlink; | 248 | set_nlink(dentry->d_inode, dead_f->inocache->pino_nlink); |
249 | if (!ret) | 249 | if (!ret) |
250 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 250 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); |
251 | return ret; | 251 | return ret; |
@@ -278,7 +278,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de | |||
278 | 278 | ||
279 | if (!ret) { | 279 | if (!ret) { |
280 | mutex_lock(&f->sem); | 280 | mutex_lock(&f->sem); |
281 | old_dentry->d_inode->i_nlink = ++f->inocache->pino_nlink; | 281 | set_nlink(old_dentry->d_inode, ++f->inocache->pino_nlink); |
282 | mutex_unlock(&f->sem); | 282 | mutex_unlock(&f->sem); |
283 | d_instantiate(dentry, old_dentry->d_inode); | 283 | d_instantiate(dentry, old_dentry->d_inode); |
284 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 284 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); |
@@ -497,7 +497,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode) | |||
497 | f = JFFS2_INODE_INFO(inode); | 497 | f = JFFS2_INODE_INFO(inode); |
498 | 498 | ||
499 | /* Directories get nlink 2 at start */ | 499 | /* Directories get nlink 2 at start */ |
500 | inode->i_nlink = 2; | 500 | set_nlink(inode, 2); |
501 | /* but ic->pino_nlink is the parent ino# */ | 501 | /* but ic->pino_nlink is the parent ino# */ |
502 | f->inocache->pino_nlink = dir_i->i_ino; | 502 | f->inocache->pino_nlink = dir_i->i_ino; |
503 | 503 | ||
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index bbcb9755dd2b..7286e44ac665 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -278,7 +278,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
278 | inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime)); | 278 | inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime)); |
279 | inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); | 279 | inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); |
280 | 280 | ||
281 | inode->i_nlink = f->inocache->pino_nlink; | 281 | set_nlink(inode, f->inocache->pino_nlink); |
282 | 282 | ||
283 | inode->i_blocks = (inode->i_size + 511) >> 9; | 283 | inode->i_blocks = (inode->i_size + 511) >> 9; |
284 | 284 | ||
@@ -291,7 +291,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
291 | case S_IFDIR: | 291 | case S_IFDIR: |
292 | { | 292 | { |
293 | struct jffs2_full_dirent *fd; | 293 | struct jffs2_full_dirent *fd; |
294 | inode->i_nlink = 2; /* parent and '.' */ | 294 | set_nlink(inode, 2); /* parent and '.' */ |
295 | 295 | ||
296 | for (fd=f->dents; fd; fd = fd->next) { | 296 | for (fd=f->dents; fd; fd = fd->next) { |
297 | if (fd->type == DT_DIR && fd->ino) | 297 | if (fd->type == DT_DIR && fd->ino) |
@@ -453,7 +453,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r | |||
453 | iput(inode); | 453 | iput(inode); |
454 | return ERR_PTR(ret); | 454 | return ERR_PTR(ret); |
455 | } | 455 | } |
456 | inode->i_nlink = 1; | 456 | set_nlink(inode, 1); |
457 | inode->i_ino = je32_to_cpu(ri->ino); | 457 | inode->i_ino = je32_to_cpu(ri->ino); |
458 | inode->i_mode = jemode_to_cpu(ri->mode); | 458 | inode->i_mode = jemode_to_cpu(ri->mode); |
459 | inode->i_gid = je16_to_cpu(ri->gid); | 459 | inode->i_gid = je16_to_cpu(ri->gid); |