diff options
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r-- | fs/jffs2/dir.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index edd8371fc6a5..9def6adf4a5d 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -588,7 +588,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode) | |||
588 | } | 588 | } |
589 | 589 | ||
590 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 590 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); |
591 | dir_i->i_nlink++; | 591 | inc_nlink(dir_i); |
592 | 592 | ||
593 | jffs2_free_raw_dirent(rd); | 593 | jffs2_free_raw_dirent(rd); |
594 | 594 | ||
@@ -615,7 +615,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry) | |||
615 | } | 615 | } |
616 | ret = jffs2_unlink(dir_i, dentry); | 616 | ret = jffs2_unlink(dir_i, dentry); |
617 | if (!ret) | 617 | if (!ret) |
618 | dir_i->i_nlink--; | 618 | drop_nlink(dir_i); |
619 | return ret; | 619 | return ret; |
620 | } | 620 | } |
621 | 621 | ||
@@ -823,7 +823,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
823 | 823 | ||
824 | if (victim_f) { | 824 | if (victim_f) { |
825 | /* There was a victim. Kill it off nicely */ | 825 | /* There was a victim. Kill it off nicely */ |
826 | new_dentry->d_inode->i_nlink--; | 826 | drop_nlink(new_dentry->d_inode); |
827 | /* Don't oops if the victim was a dirent pointing to an | 827 | /* Don't oops if the victim was a dirent pointing to an |
828 | inode which didn't exist. */ | 828 | inode which didn't exist. */ |
829 | if (victim_f->inocache) { | 829 | if (victim_f->inocache) { |
@@ -836,7 +836,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
836 | /* If it was a directory we moved, and there was no victim, | 836 | /* If it was a directory we moved, and there was no victim, |
837 | increase i_nlink on its new parent */ | 837 | increase i_nlink on its new parent */ |
838 | if (S_ISDIR(old_dentry->d_inode->i_mode) && !victim_f) | 838 | if (S_ISDIR(old_dentry->d_inode->i_mode) && !victim_f) |
839 | new_dir_i->i_nlink++; | 839 | inc_nlink(new_dir_i); |
840 | 840 | ||
841 | /* Unlink the original */ | 841 | /* Unlink the original */ |
842 | ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), | 842 | ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), |
@@ -848,7 +848,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
848 | /* Oh shit. We really ought to make a single node which can do both atomically */ | 848 | /* Oh shit. We really ought to make a single node which can do both atomically */ |
849 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode); | 849 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode); |
850 | down(&f->sem); | 850 | down(&f->sem); |
851 | old_dentry->d_inode->i_nlink++; | 851 | inc_nlink(old_dentry->d_inode); |
852 | if (f->inocache) | 852 | if (f->inocache) |
853 | f->inocache->nlink++; | 853 | f->inocache->nlink++; |
854 | up(&f->sem); | 854 | up(&f->sem); |
@@ -862,7 +862,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
862 | } | 862 | } |
863 | 863 | ||
864 | if (S_ISDIR(old_dentry->d_inode->i_mode)) | 864 | if (S_ISDIR(old_dentry->d_inode->i_mode)) |
865 | old_dir_i->i_nlink--; | 865 | drop_nlink(old_dir_i); |
866 | 866 | ||
867 | new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); | 867 | new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); |
868 | 868 | ||