aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/namei.c
diff options
context:
space:
mode:
authorDave Hansen <haveblue@us.ibm.com>2006-10-01 02:29:03 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:30 -0400
commit9a53c3a783c2fa9b969628e65695c11c3e51e673 (patch)
tree5a6115e18ee105246d46e3db3d5b07749d232f5b /fs/reiserfs/namei.c
parentaab520e2f6c80160cabd187a8d0292d1cec8ff68 (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/reiserfs/namei.c')
-rw-r--r--fs/reiserfs/namei.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index c61710e49c62..c76d427e027b 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -20,7 +20,7 @@
20#include <linux/quotaops.h> 20#include <linux/quotaops.h>
21 21
22#define INC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) { i->i_nlink++; if (i->i_nlink >= REISERFS_LINK_MAX) i->i_nlink=1; } 22#define INC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) { i->i_nlink++; if (i->i_nlink >= REISERFS_LINK_MAX) i->i_nlink=1; }
23#define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) i->i_nlink--; 23#define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) drop_nlink(i);
24 24
25// directory item contains array of entry headers. This performs 25// directory item contains array of entry headers. This performs
26// binary search through that array 26// binary search through that array
@@ -994,7 +994,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
994 inode->i_nlink = 1; 994 inode->i_nlink = 1;
995 } 995 }
996 996
997 inode->i_nlink--; 997 drop_nlink(inode);
998 998
999 /* 999 /*
1000 * we schedule before doing the add_save_link call, save the link 1000 * we schedule before doing the add_save_link call, save the link
@@ -1475,7 +1475,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1475 if (S_ISDIR(new_dentry_inode->i_mode)) { 1475 if (S_ISDIR(new_dentry_inode->i_mode)) {
1476 new_dentry_inode->i_nlink = 0; 1476 new_dentry_inode->i_nlink = 0;
1477 } else { 1477 } else {
1478 new_dentry_inode->i_nlink--; 1478 drop_nlink(new_dentry_inode);
1479 } 1479 }
1480 new_dentry_inode->i_ctime = ctime; 1480 new_dentry_inode->i_ctime = ctime;
1481 savelink = new_dentry_inode->i_nlink; 1481 savelink = new_dentry_inode->i_nlink;