diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2006-10-01 02:29:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:30 -0400 |
commit | 9a53c3a783c2fa9b969628e65695c11c3e51e673 (patch) | |
tree | 5a6115e18ee105246d46e3db3d5b07749d232f5b /fs/jffs2/dir.c | |
parent | aab520e2f6c80160cabd187a8d0292d1cec8ff68 (diff) |
[PATCH] r/o bind mounts: unlink: monitor i_nlink
When a filesystem decrements i_nlink to zero, it means that a write must be
performed in order to drop the inode from the filesystem.
We're shortly going to have keep filesystems from being remounted r/o between
the time that this i_nlink decrement and that write occurs.
So, add a little helper function to do the decrements. We'll tie into it in a
bit to note when i_nlink hits zero.
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r-- | fs/jffs2/dir.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index edd8371fc6a5..a5e9f2205b33 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -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) { |
@@ -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 | ||