diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/dir.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/dlmglue.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/inode.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/namei.c | 18 | ||||
-rw-r--r-- | fs/ocfs2/super.h | 14 |
5 files changed, 19 insertions, 23 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8582e3f4f120..e2878b5895fb 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -2292,7 +2292,7 @@ static int ocfs2_fill_new_dir_id(struct ocfs2_super *osb, | |||
2292 | ocfs2_journal_dirty(handle, di_bh); | 2292 | ocfs2_journal_dirty(handle, di_bh); |
2293 | 2293 | ||
2294 | i_size_write(inode, size); | 2294 | i_size_write(inode, size); |
2295 | inode->i_nlink = 2; | 2295 | set_nlink(inode, 2); |
2296 | inode->i_blocks = ocfs2_inode_sector_count(inode); | 2296 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
2297 | 2297 | ||
2298 | ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); | 2298 | ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); |
@@ -2354,7 +2354,7 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb, | |||
2354 | ocfs2_journal_dirty(handle, new_bh); | 2354 | ocfs2_journal_dirty(handle, new_bh); |
2355 | 2355 | ||
2356 | i_size_write(inode, inode->i_sb->s_blocksize); | 2356 | i_size_write(inode, inode->i_sb->s_blocksize); |
2357 | inode->i_nlink = 2; | 2357 | set_nlink(inode, 2); |
2358 | inode->i_blocks = ocfs2_inode_sector_count(inode); | 2358 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
2359 | status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); | 2359 | status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); |
2360 | if (status < 0) { | 2360 | if (status < 0) { |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 7642d7ca73e5..e1ed5e502ff2 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -2092,7 +2092,7 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) | |||
2092 | inode->i_uid = be32_to_cpu(lvb->lvb_iuid); | 2092 | inode->i_uid = be32_to_cpu(lvb->lvb_iuid); |
2093 | inode->i_gid = be32_to_cpu(lvb->lvb_igid); | 2093 | inode->i_gid = be32_to_cpu(lvb->lvb_igid); |
2094 | inode->i_mode = be16_to_cpu(lvb->lvb_imode); | 2094 | inode->i_mode = be16_to_cpu(lvb->lvb_imode); |
2095 | inode->i_nlink = be16_to_cpu(lvb->lvb_inlink); | 2095 | set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); |
2096 | ocfs2_unpack_timespec(&inode->i_atime, | 2096 | ocfs2_unpack_timespec(&inode->i_atime, |
2097 | be64_to_cpu(lvb->lvb_iatime_packed)); | 2097 | be64_to_cpu(lvb->lvb_iatime_packed)); |
2098 | ocfs2_unpack_timespec(&inode->i_mtime, | 2098 | ocfs2_unpack_timespec(&inode->i_mtime, |
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index b4c8bb6b8d28..a22d2c098890 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -291,7 +291,7 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, | |||
291 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 291 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
292 | (unsigned long long)le64_to_cpu(fe->i_blkno)); | 292 | (unsigned long long)le64_to_cpu(fe->i_blkno)); |
293 | 293 | ||
294 | inode->i_nlink = ocfs2_read_links_count(fe); | 294 | set_nlink(inode, ocfs2_read_links_count(fe)); |
295 | 295 | ||
296 | trace_ocfs2_populate_inode(OCFS2_I(inode)->ip_blkno, | 296 | trace_ocfs2_populate_inode(OCFS2_I(inode)->ip_blkno, |
297 | le32_to_cpu(fe->i_flags)); | 297 | le32_to_cpu(fe->i_flags)); |
@@ -1290,7 +1290,7 @@ void ocfs2_refresh_inode(struct inode *inode, | |||
1290 | OCFS2_I(inode)->ip_dyn_features = le16_to_cpu(fe->i_dyn_features); | 1290 | OCFS2_I(inode)->ip_dyn_features = le16_to_cpu(fe->i_dyn_features); |
1291 | ocfs2_set_inode_flags(inode); | 1291 | ocfs2_set_inode_flags(inode); |
1292 | i_size_write(inode, le64_to_cpu(fe->i_size)); | 1292 | i_size_write(inode, le64_to_cpu(fe->i_size)); |
1293 | inode->i_nlink = ocfs2_read_links_count(fe); | 1293 | set_nlink(inode, ocfs2_read_links_count(fe)); |
1294 | inode->i_uid = le32_to_cpu(fe->i_uid); | 1294 | inode->i_uid = le32_to_cpu(fe->i_uid); |
1295 | inode->i_gid = le32_to_cpu(fe->i_gid); | 1295 | inode->i_gid = le32_to_cpu(fe->i_gid); |
1296 | inode->i_mode = le16_to_cpu(fe->i_mode); | 1296 | inode->i_mode = le16_to_cpu(fe->i_mode); |
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 53aa41ed7bf3..a8b2bfea574e 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -199,9 +199,7 @@ static struct inode *ocfs2_get_init_inode(struct inode *dir, int mode) | |||
199 | * these are used by the support functions here and in | 199 | * these are used by the support functions here and in |
200 | * callers. */ | 200 | * callers. */ |
201 | if (S_ISDIR(mode)) | 201 | if (S_ISDIR(mode)) |
202 | inode->i_nlink = 2; | 202 | set_nlink(inode, 2); |
203 | else | ||
204 | inode->i_nlink = 1; | ||
205 | inode_init_owner(inode, dir, mode); | 203 | inode_init_owner(inode, dir, mode); |
206 | dquot_initialize(inode); | 204 | dquot_initialize(inode); |
207 | return inode; | 205 | return inode; |
@@ -1379,7 +1377,7 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1379 | } | 1377 | } |
1380 | 1378 | ||
1381 | if (new_inode) { | 1379 | if (new_inode) { |
1382 | new_inode->i_nlink--; | 1380 | drop_nlink(new_inode); |
1383 | new_inode->i_ctime = CURRENT_TIME; | 1381 | new_inode->i_ctime = CURRENT_TIME; |
1384 | } | 1382 | } |
1385 | old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; | 1383 | old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; |
@@ -1387,9 +1385,9 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1387 | if (update_dot_dot) { | 1385 | if (update_dot_dot) { |
1388 | status = ocfs2_update_entry(old_inode, handle, | 1386 | status = ocfs2_update_entry(old_inode, handle, |
1389 | &old_inode_dot_dot_res, new_dir); | 1387 | &old_inode_dot_dot_res, new_dir); |
1390 | old_dir->i_nlink--; | 1388 | drop_nlink(old_dir); |
1391 | if (new_inode) { | 1389 | if (new_inode) { |
1392 | new_inode->i_nlink--; | 1390 | drop_nlink(new_inode); |
1393 | } else { | 1391 | } else { |
1394 | inc_nlink(new_dir); | 1392 | inc_nlink(new_dir); |
1395 | mark_inode_dirty(new_dir); | 1393 | mark_inode_dirty(new_dir); |
@@ -2018,7 +2016,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
2018 | orphan_fe = (struct ocfs2_dinode *) orphan_dir_bh->b_data; | 2016 | orphan_fe = (struct ocfs2_dinode *) orphan_dir_bh->b_data; |
2019 | if (S_ISDIR(inode->i_mode)) | 2017 | if (S_ISDIR(inode->i_mode)) |
2020 | ocfs2_add_links_count(orphan_fe, 1); | 2018 | ocfs2_add_links_count(orphan_fe, 1); |
2021 | orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); | 2019 | set_nlink(orphan_dir_inode, ocfs2_read_links_count(orphan_fe)); |
2022 | ocfs2_journal_dirty(handle, orphan_dir_bh); | 2020 | ocfs2_journal_dirty(handle, orphan_dir_bh); |
2023 | 2021 | ||
2024 | status = __ocfs2_add_entry(handle, orphan_dir_inode, name, | 2022 | status = __ocfs2_add_entry(handle, orphan_dir_inode, name, |
@@ -2116,7 +2114,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
2116 | orphan_fe = (struct ocfs2_dinode *) orphan_dir_bh->b_data; | 2114 | orphan_fe = (struct ocfs2_dinode *) orphan_dir_bh->b_data; |
2117 | if (S_ISDIR(inode->i_mode)) | 2115 | if (S_ISDIR(inode->i_mode)) |
2118 | ocfs2_add_links_count(orphan_fe, -1); | 2116 | ocfs2_add_links_count(orphan_fe, -1); |
2119 | orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); | 2117 | set_nlink(orphan_dir_inode, ocfs2_read_links_count(orphan_fe)); |
2120 | ocfs2_journal_dirty(handle, orphan_dir_bh); | 2118 | ocfs2_journal_dirty(handle, orphan_dir_bh); |
2121 | 2119 | ||
2122 | leave: | 2120 | leave: |
@@ -2282,7 +2280,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir, | |||
2282 | goto leave; | 2280 | goto leave; |
2283 | } | 2281 | } |
2284 | 2282 | ||
2285 | inode->i_nlink = 0; | 2283 | clear_nlink(inode); |
2286 | /* do the real work now. */ | 2284 | /* do the real work now. */ |
2287 | status = __ocfs2_mknod_locked(dir, inode, | 2285 | status = __ocfs2_mknod_locked(dir, inode, |
2288 | 0, &new_di_bh, parent_di_bh, handle, | 2286 | 0, &new_di_bh, parent_di_bh, handle, |
@@ -2437,7 +2435,7 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir, | |||
2437 | di = (struct ocfs2_dinode *)di_bh->b_data; | 2435 | di = (struct ocfs2_dinode *)di_bh->b_data; |
2438 | le32_add_cpu(&di->i_flags, -OCFS2_ORPHANED_FL); | 2436 | le32_add_cpu(&di->i_flags, -OCFS2_ORPHANED_FL); |
2439 | di->i_orphaned_slot = 0; | 2437 | di->i_orphaned_slot = 0; |
2440 | inode->i_nlink = 1; | 2438 | set_nlink(inode, 1); |
2441 | ocfs2_set_links_count(di, inode->i_nlink); | 2439 | ocfs2_set_links_count(di, inode->i_nlink); |
2442 | ocfs2_journal_dirty(handle, di_bh); | 2440 | ocfs2_journal_dirty(handle, di_bh); |
2443 | 2441 | ||
diff --git a/fs/ocfs2/super.h b/fs/ocfs2/super.h index 40c7de084c10..74ff74cf78fe 100644 --- a/fs/ocfs2/super.h +++ b/fs/ocfs2/super.h | |||
@@ -31,17 +31,15 @@ extern struct workqueue_struct *ocfs2_wq; | |||
31 | int ocfs2_publish_get_mount_state(struct ocfs2_super *osb, | 31 | int ocfs2_publish_get_mount_state(struct ocfs2_super *osb, |
32 | int node_num); | 32 | int node_num); |
33 | 33 | ||
34 | void __ocfs2_error(struct super_block *sb, | 34 | __printf(3, 4) |
35 | const char *function, | 35 | void __ocfs2_error(struct super_block *sb, const char *function, |
36 | const char *fmt, ...) | 36 | const char *fmt, ...); |
37 | __attribute__ ((format (printf, 3, 4))); | ||
38 | 37 | ||
39 | #define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args) | 38 | #define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args) |
40 | 39 | ||
41 | void __ocfs2_abort(struct super_block *sb, | 40 | __printf(3, 4) |
42 | const char *function, | 41 | void __ocfs2_abort(struct super_block *sb, const char *function, |
43 | const char *fmt, ...) | 42 | const char *fmt, ...); |
44 | __attribute__ ((format (printf, 3, 4))); | ||
45 | 43 | ||
46 | #define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args) | 44 | #define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args) |
47 | 45 | ||