diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-10-28 08:13:29 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@serles.lst.de> | 2011-11-02 07:53:43 -0400 |
commit | bfe8684869601dacfcb2cd69ef8cfd9045f62170 (patch) | |
tree | 4e213aaa766b26f43f0f9ec7998a7745239d9377 /fs/hpfs | |
parent | 6d6b77f163c7eabedbba00ed2abb7d4a570bff76 (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/hpfs')
-rw-r--r-- | fs/hpfs/dir.c | 2 | ||||
-rw-r--r-- | fs/hpfs/inode.c | 8 | ||||
-rw-r--r-- | fs/hpfs/namei.c | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index 96a8ed91cedd..2fa0089a02a8 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c | |||
@@ -247,7 +247,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name | |||
247 | result->i_mode &= ~0111; | 247 | result->i_mode &= ~0111; |
248 | result->i_op = &hpfs_file_iops; | 248 | result->i_op = &hpfs_file_iops; |
249 | result->i_fop = &hpfs_file_ops; | 249 | result->i_fop = &hpfs_file_ops; |
250 | result->i_nlink = 1; | 250 | set_nlink(result, 1); |
251 | } | 251 | } |
252 | unlock_new_inode(result); | 252 | unlock_new_inode(result); |
253 | } | 253 | } |
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index dfe800c8ae38..3b2cec29972b 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c | |||
@@ -77,7 +77,7 @@ void hpfs_read_inode(struct inode *i) | |||
77 | i->i_mode = S_IFLNK | 0777; | 77 | i->i_mode = S_IFLNK | 0777; |
78 | i->i_op = &page_symlink_inode_operations; | 78 | i->i_op = &page_symlink_inode_operations; |
79 | i->i_data.a_ops = &hpfs_symlink_aops; | 79 | i->i_data.a_ops = &hpfs_symlink_aops; |
80 | i->i_nlink = 1; | 80 | set_nlink(i, 1); |
81 | i->i_size = ea_size; | 81 | i->i_size = ea_size; |
82 | i->i_blocks = 1; | 82 | i->i_blocks = 1; |
83 | brelse(bh); | 83 | brelse(bh); |
@@ -101,7 +101,7 @@ void hpfs_read_inode(struct inode *i) | |||
101 | } | 101 | } |
102 | if (S_ISBLK(mode) || S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { | 102 | if (S_ISBLK(mode) || S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { |
103 | brelse(bh); | 103 | brelse(bh); |
104 | i->i_nlink = 1; | 104 | set_nlink(i, 1); |
105 | i->i_size = 0; | 105 | i->i_size = 0; |
106 | i->i_blocks = 1; | 106 | i->i_blocks = 1; |
107 | init_special_inode(i, mode, | 107 | init_special_inode(i, mode, |
@@ -125,13 +125,13 @@ void hpfs_read_inode(struct inode *i) | |||
125 | hpfs_count_dnodes(i->i_sb, hpfs_inode->i_dno, &n_dnodes, &n_subdirs, NULL); | 125 | hpfs_count_dnodes(i->i_sb, hpfs_inode->i_dno, &n_dnodes, &n_subdirs, NULL); |
126 | i->i_blocks = 4 * n_dnodes; | 126 | i->i_blocks = 4 * n_dnodes; |
127 | i->i_size = 2048 * n_dnodes; | 127 | i->i_size = 2048 * n_dnodes; |
128 | i->i_nlink = 2 + n_subdirs; | 128 | set_nlink(i, 2 + n_subdirs); |
129 | } else { | 129 | } else { |
130 | i->i_mode |= S_IFREG; | 130 | i->i_mode |= S_IFREG; |
131 | if (!hpfs_inode->i_ea_mode) i->i_mode &= ~0111; | 131 | if (!hpfs_inode->i_ea_mode) i->i_mode &= ~0111; |
132 | i->i_op = &hpfs_file_iops; | 132 | i->i_op = &hpfs_file_iops; |
133 | i->i_fop = &hpfs_file_ops; | 133 | i->i_fop = &hpfs_file_ops; |
134 | i->i_nlink = 1; | 134 | set_nlink(i, 1); |
135 | i->i_size = le32_to_cpu(fnode->file_size); | 135 | i->i_size = le32_to_cpu(fnode->file_size); |
136 | i->i_blocks = ((i->i_size + 511) >> 9) + 1; | 136 | i->i_blocks = ((i->i_size + 511) >> 9) + 1; |
137 | i->i_data.a_ops = &hpfs_aops; | 137 | i->i_data.a_ops = &hpfs_aops; |
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 2df69e2f07cf..ea91fcb0ef9b 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
@@ -56,7 +56,7 @@ static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
56 | result->i_fop = &hpfs_dir_ops; | 56 | result->i_fop = &hpfs_dir_ops; |
57 | result->i_blocks = 4; | 57 | result->i_blocks = 4; |
58 | result->i_size = 2048; | 58 | result->i_size = 2048; |
59 | result->i_nlink = 2; | 59 | set_nlink(result, 2); |
60 | if (dee.read_only) | 60 | if (dee.read_only) |
61 | result->i_mode &= ~0222; | 61 | result->i_mode &= ~0222; |
62 | 62 | ||
@@ -150,7 +150,7 @@ static int hpfs_create(struct inode *dir, struct dentry *dentry, int mode, struc | |||
150 | result->i_mode &= ~0111; | 150 | result->i_mode &= ~0111; |
151 | result->i_op = &hpfs_file_iops; | 151 | result->i_op = &hpfs_file_iops; |
152 | result->i_fop = &hpfs_file_ops; | 152 | result->i_fop = &hpfs_file_ops; |
153 | result->i_nlink = 1; | 153 | set_nlink(result, 1); |
154 | hpfs_i(result)->i_parent_dir = dir->i_ino; | 154 | hpfs_i(result)->i_parent_dir = dir->i_ino; |
155 | result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); | 155 | result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); |
156 | result->i_ctime.tv_nsec = 0; | 156 | result->i_ctime.tv_nsec = 0; |
@@ -242,7 +242,7 @@ static int hpfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t | |||
242 | hpfs_i(result)->i_ea_size = 0; | 242 | hpfs_i(result)->i_ea_size = 0; |
243 | result->i_uid = current_fsuid(); | 243 | result->i_uid = current_fsuid(); |
244 | result->i_gid = current_fsgid(); | 244 | result->i_gid = current_fsgid(); |
245 | result->i_nlink = 1; | 245 | set_nlink(result, 1); |
246 | result->i_size = 0; | 246 | result->i_size = 0; |
247 | result->i_blocks = 1; | 247 | result->i_blocks = 1; |
248 | init_special_inode(result, mode, rdev); | 248 | init_special_inode(result, mode, rdev); |
@@ -318,7 +318,7 @@ static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *sy | |||
318 | result->i_uid = current_fsuid(); | 318 | result->i_uid = current_fsuid(); |
319 | result->i_gid = current_fsgid(); | 319 | result->i_gid = current_fsgid(); |
320 | result->i_blocks = 1; | 320 | result->i_blocks = 1; |
321 | result->i_nlink = 1; | 321 | set_nlink(result, 1); |
322 | result->i_size = strlen(symlink); | 322 | result->i_size = strlen(symlink); |
323 | result->i_op = &page_symlink_inode_operations; | 323 | result->i_op = &page_symlink_inode_operations; |
324 | result->i_data.a_ops = &hpfs_symlink_aops; | 324 | result->i_data.a_ops = &hpfs_symlink_aops; |