diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2006-10-01 02:29:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:30 -0400 |
commit | d8c76e6f45c111c32a4b3e50a2adc9210737b0d8 (patch) | |
tree | 25521b59d48c6d8c9aec1af54dbe5008ad4b215b /fs/ocfs2 | |
parent | 9a53c3a783c2fa9b969628e65695c11c3e51e673 (diff) |
[PATCH] r/o bind mount prepwork: inc_nlink() helper
This is mostly included for parity with dec_nlink(), where we will have some
more hooks. This one should stay pretty darn straightforward for now.
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/ocfs2')
-rw-r--r-- | fs/ocfs2/dlm/dlmfs.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/namei.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index 0368c6402182..16b8d1ba7066 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c | |||
@@ -338,7 +338,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) | |||
338 | inode->i_blocks = 0; | 338 | inode->i_blocks = 0; |
339 | inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; | 339 | inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; |
340 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 340 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
341 | inode->i_nlink++; | 341 | inc_nlink(inode); |
342 | 342 | ||
343 | inode->i_fop = &simple_dir_operations; | 343 | inode->i_fop = &simple_dir_operations; |
344 | inode->i_op = &dlmfs_root_inode_operations; | 344 | inode->i_op = &dlmfs_root_inode_operations; |
@@ -395,7 +395,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, | |||
395 | 395 | ||
396 | /* directory inodes start off with i_nlink == | 396 | /* directory inodes start off with i_nlink == |
397 | * 2 (for "." entry) */ | 397 | * 2 (for "." entry) */ |
398 | inode->i_nlink++; | 398 | inc_nlink(inode); |
399 | break; | 399 | break; |
400 | } | 400 | } |
401 | 401 | ||
@@ -449,7 +449,7 @@ static int dlmfs_mkdir(struct inode * dir, | |||
449 | } | 449 | } |
450 | ip->ip_dlm = dlm; | 450 | ip->ip_dlm = dlm; |
451 | 451 | ||
452 | dir->i_nlink++; | 452 | inc_nlink(dir); |
453 | d_instantiate(dentry, inode); | 453 | d_instantiate(dentry, inode); |
454 | dget(dentry); /* Extra count - pin the dentry in core */ | 454 | dget(dentry); /* Extra count - pin the dentry in core */ |
455 | 455 | ||
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 40f83f53053a..8c370a39e0c1 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -429,7 +429,7 @@ static int ocfs2_mknod(struct inode *dir, | |||
429 | mlog_errno(status); | 429 | mlog_errno(status); |
430 | goto leave; | 430 | goto leave; |
431 | } | 431 | } |
432 | dir->i_nlink++; | 432 | inc_nlink(dir); |
433 | } | 433 | } |
434 | 434 | ||
435 | status = ocfs2_add_entry(handle, dentry, inode, | 435 | status = ocfs2_add_entry(handle, dentry, inode, |
@@ -730,7 +730,7 @@ static int ocfs2_link(struct dentry *old_dentry, | |||
730 | goto bail; | 730 | goto bail; |
731 | } | 731 | } |
732 | 732 | ||
733 | inode->i_nlink++; | 733 | inc_nlink(inode); |
734 | inode->i_ctime = CURRENT_TIME; | 734 | inode->i_ctime = CURRENT_TIME; |
735 | fe->i_links_count = cpu_to_le16(inode->i_nlink); | 735 | fe->i_links_count = cpu_to_le16(inode->i_nlink); |
736 | fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); | 736 | fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); |
@@ -952,7 +952,7 @@ static int ocfs2_unlink(struct inode *dir, | |||
952 | parent_node_bh); | 952 | parent_node_bh); |
953 | if (status < 0) { | 953 | if (status < 0) { |
954 | mlog_errno(status); | 954 | mlog_errno(status); |
955 | dir->i_nlink++; | 955 | inc_nlink(dir); |
956 | } | 956 | } |
957 | } | 957 | } |
958 | 958 | ||
@@ -1382,7 +1382,7 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1382 | if (new_inode) { | 1382 | if (new_inode) { |
1383 | new_inode->i_nlink--; | 1383 | new_inode->i_nlink--; |
1384 | } else { | 1384 | } else { |
1385 | new_dir->i_nlink++; | 1385 | inc_nlink(new_dir); |
1386 | mark_inode_dirty(new_dir); | 1386 | mark_inode_dirty(new_dir); |
1387 | } | 1387 | } |
1388 | } | 1388 | } |