summaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorDave Hansen <haveblue@us.ibm.com>2006-09-30 23:29:03 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 00:39:30 -0700
commit9a53c3a783c2fa9b969628e65695c11c3e51e673 (patch)
tree5a6115e18ee105246d46e3db3d5b07749d232f5b /fs/jffs2
parentaab520e2f6c80160cabd187a8d0292d1cec8ff68 (diff)
downloadop-kernel-dev-9a53c3a783c2fa9b969628e65695c11c3e51e673.zip
op-kernel-dev-9a53c3a783c2fa9b969628e65695c11c3e51e673.tar.gz
[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')
-rw-r--r--fs/jffs2/dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index edd8371..a5e9f22 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)
}
ret = jffs2_unlink(dir_i, dentry);
if (!ret)
- dir_i->i_nlink--;
+ drop_nlink(dir_i);
return ret;
}
@@ -823,7 +823,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
if (victim_f) {
/* There was a victim. Kill it off nicely */
- new_dentry->d_inode->i_nlink--;
+ drop_nlink(new_dentry->d_inode);
/* Don't oops if the victim was a dirent pointing to an
inode which didn't exist. */
if (victim_f->inocache) {
@@ -862,7 +862,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
}
if (S_ISDIR(old_dentry->d_inode->i_mode))
- old_dir_i->i_nlink--;
+ drop_nlink(old_dir_i);
new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now);
OpenPOWER on IntegriCloud