aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2011-10-28 08:13:29 -0400
committerChristoph Hellwig <hch@serles.lst.de>2011-11-02 07:53:43 -0400
commitbfe8684869601dacfcb2cd69ef8cfd9045f62170 (patch)
tree4e213aaa766b26f43f0f9ec7998a7745239d9377 /fs/reiserfs
parent6d6b77f163c7eabedbba00ed2abb7d4a570bff76 (diff)
filesystems: add set_nlink()
Replace remaining direct i_nlink updates with a new set_nlink() updater function. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/inode.c6
-rw-r--r--fs/reiserfs/namei.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index c425441c6942..950f13af0951 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -1154,7 +1154,7 @@ static void init_inode(struct inode *inode, struct treepath *path)
1154 set_inode_item_key_version(inode, KEY_FORMAT_3_5); 1154 set_inode_item_key_version(inode, KEY_FORMAT_3_5);
1155 set_inode_sd_version(inode, STAT_DATA_V1); 1155 set_inode_sd_version(inode, STAT_DATA_V1);
1156 inode->i_mode = sd_v1_mode(sd); 1156 inode->i_mode = sd_v1_mode(sd);
1157 inode->i_nlink = sd_v1_nlink(sd); 1157 set_nlink(inode, sd_v1_nlink(sd));
1158 inode->i_uid = sd_v1_uid(sd); 1158 inode->i_uid = sd_v1_uid(sd);
1159 inode->i_gid = sd_v1_gid(sd); 1159 inode->i_gid = sd_v1_gid(sd);
1160 inode->i_size = sd_v1_size(sd); 1160 inode->i_size = sd_v1_size(sd);
@@ -1199,7 +1199,7 @@ static void init_inode(struct inode *inode, struct treepath *path)
1199 struct stat_data *sd = (struct stat_data *)B_I_PITEM(bh, ih); 1199 struct stat_data *sd = (struct stat_data *)B_I_PITEM(bh, ih);
1200 1200
1201 inode->i_mode = sd_v2_mode(sd); 1201 inode->i_mode = sd_v2_mode(sd);
1202 inode->i_nlink = sd_v2_nlink(sd); 1202 set_nlink(inode, sd_v2_nlink(sd));
1203 inode->i_uid = sd_v2_uid(sd); 1203 inode->i_uid = sd_v2_uid(sd);
1204 inode->i_size = sd_v2_size(sd); 1204 inode->i_size = sd_v2_size(sd);
1205 inode->i_gid = sd_v2_gid(sd); 1205 inode->i_gid = sd_v2_gid(sd);
@@ -1832,7 +1832,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1832#endif 1832#endif
1833 1833
1834 /* fill stat data */ 1834 /* fill stat data */
1835 inode->i_nlink = (S_ISDIR(mode) ? 2 : 1); 1835 set_nlink(inode, (S_ISDIR(mode) ? 2 : 1));
1836 1836
1837 /* uid and gid must already be set by the caller for quota init */ 1837 /* uid and gid must already be set by the caller for quota init */
1838 1838
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 6ce332821633..80058e8ce361 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -19,7 +19,7 @@
19#include <linux/reiserfs_xattr.h> 19#include <linux/reiserfs_xattr.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) { inc_nlink(i); 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) set_nlink(i, 1); }
23#define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) drop_nlink(i); 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
@@ -964,7 +964,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
964 reiserfs_warning(inode->i_sb, "reiserfs-7042", 964 reiserfs_warning(inode->i_sb, "reiserfs-7042",
965 "deleting nonexistent file (%lu), %d", 965 "deleting nonexistent file (%lu), %d",
966 inode->i_ino, inode->i_nlink); 966 inode->i_ino, inode->i_nlink);
967 inode->i_nlink = 1; 967 set_nlink(inode, 1);
968 } 968 }
969 969
970 drop_nlink(inode); 970 drop_nlink(inode);