diff options
Diffstat (limited to 'fs/reiserfs/namei.c')
-rw-r--r-- | fs/reiserfs/namei.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index c61710e49c62..16e9cff8f15d 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -19,8 +19,8 @@ | |||
19 | #include <linux/smp_lock.h> | 19 | #include <linux/smp_lock.h> |
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) { inc_nlink(i); 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 |
@@ -913,7 +913,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
913 | reiserfs_warning(inode->i_sb, "%s: empty directory has nlink " | 913 | reiserfs_warning(inode->i_sb, "%s: empty directory has nlink " |
914 | "!= 2 (%d)", __FUNCTION__, inode->i_nlink); | 914 | "!= 2 (%d)", __FUNCTION__, inode->i_nlink); |
915 | 915 | ||
916 | inode->i_nlink = 0; | 916 | clear_nlink(inode); |
917 | inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; | 917 | inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; |
918 | reiserfs_update_sd(&th, inode); | 918 | reiserfs_update_sd(&th, inode); |
919 | 919 | ||
@@ -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 |
@@ -1006,7 +1006,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) | |||
1006 | reiserfs_cut_from_item(&th, &path, &(de.de_entry_key), dir, NULL, | 1006 | reiserfs_cut_from_item(&th, &path, &(de.de_entry_key), dir, NULL, |
1007 | 0); | 1007 | 0); |
1008 | if (retval < 0) { | 1008 | if (retval < 0) { |
1009 | inode->i_nlink++; | 1009 | inc_nlink(inode); |
1010 | goto end_unlink; | 1010 | goto end_unlink; |
1011 | } | 1011 | } |
1012 | inode->i_ctime = CURRENT_TIME_SEC; | 1012 | inode->i_ctime = CURRENT_TIME_SEC; |
@@ -1143,7 +1143,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, | |||
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | /* inc before scheduling so reiserfs_unlink knows we are here */ | 1145 | /* inc before scheduling so reiserfs_unlink knows we are here */ |
1146 | inode->i_nlink++; | 1146 | inc_nlink(inode); |
1147 | 1147 | ||
1148 | retval = journal_begin(&th, dir->i_sb, jbegin_count); | 1148 | retval = journal_begin(&th, dir->i_sb, jbegin_count); |
1149 | if (retval) { | 1149 | if (retval) { |
@@ -1473,9 +1473,9 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1473 | if (new_dentry_inode) { | 1473 | if (new_dentry_inode) { |
1474 | // adjust link number of the victim | 1474 | // adjust link number of the victim |
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 | clear_nlink(new_dentry_inode); |
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; |