aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
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/nfs
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/nfs')
-rw-r--r--fs/nfs/dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 7432f1a43f3d..26eecb86f9b0 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -843,7 +843,7 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
843 nfs_inode_return_delegation(inode); 843 nfs_inode_return_delegation(inode);
844 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { 844 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
845 lock_kernel(); 845 lock_kernel();
846 inode->i_nlink--; 846 drop_nlink(inode);
847 nfs_complete_unlink(dentry); 847 nfs_complete_unlink(dentry);
848 unlock_kernel(); 848 unlock_kernel();
849 } 849 }
@@ -1401,7 +1401,7 @@ static int nfs_safe_remove(struct dentry *dentry)
1401 error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); 1401 error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
1402 /* The VFS may want to delete this inode */ 1402 /* The VFS may want to delete this inode */
1403 if (error == 0) 1403 if (error == 0)
1404 inode->i_nlink--; 1404 drop_nlink(inode);
1405 nfs_mark_for_revalidate(inode); 1405 nfs_mark_for_revalidate(inode);
1406 nfs_end_data_update(inode); 1406 nfs_end_data_update(inode);
1407 } else 1407 } else
@@ -1639,7 +1639,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1639 goto out; 1639 goto out;
1640 } 1640 }
1641 } else 1641 } else
1642 new_inode->i_nlink--; 1642 drop_nlink(new_inode);
1643 1643
1644go_ahead: 1644go_ahead:
1645 /* 1645 /*