summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/inode.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2014-04-23 10:00:35 -0400
committerJan Kara <jack@suse.cz>2014-05-06 16:51:44 -0400
commit4cf5f7addf18ecae2ea49b11944976cbd26d5281 (patch)
tree52aa9ebf68e7951bacbdc708f1d19467736187bc /fs/reiserfs/inode.c
parent797d9016ceca69879bb273218810fa0beef46aac (diff)
reiserfs: cleanup, rename key and item accessors to more friendly names
This patch does a quick search and replace: B_N_PITEM_HEAD() -> item_head() B_N_PDELIM_KEY() -> internal_key() B_N_PKEY() -> leaf_key() B_N_PITEM() -> item_body() And the item_head version: B_I_PITEM() -> ih_item_body() I_ENTRY_COUNT() -> ih_entry_count() And the treepath variants: get_ih() -> tp_item_head() PATH_PITEM_HEAD() -> tp_item_head() get_item() -> tp_item_body() ... which makes the code much easier on the eyes. I've also removed a few unused macros. Checkpatch will complain about the 80 character limit for do_balan.c. I've addressed that in a later patchset to split up balance_leaf(). Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r--fs/reiserfs/inode.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index bc8b8009897d..b8d3ffb1f722 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -295,9 +295,9 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
295 } 295 }
296 // 296 //
297 bh = get_last_bh(&path); 297 bh = get_last_bh(&path);
298 ih = get_ih(&path); 298 ih = tp_item_head(&path);
299 if (is_indirect_le_ih(ih)) { 299 if (is_indirect_le_ih(ih)) {
300 __le32 *ind_item = (__le32 *) B_I_PITEM(bh, ih); 300 __le32 *ind_item = (__le32 *) ih_item_body(bh, ih);
301 301
302 /* FIXME: here we could cache indirect item or part of it in 302 /* FIXME: here we could cache indirect item or part of it in
303 the inode to avoid search_by_key in case of subsequent 303 the inode to avoid search_by_key in case of subsequent
@@ -383,7 +383,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
383 } else { 383 } else {
384 chars = ih_item_len(ih) - path.pos_in_item; 384 chars = ih_item_len(ih) - path.pos_in_item;
385 } 385 }
386 memcpy(p, B_I_PITEM(bh, ih) + path.pos_in_item, chars); 386 memcpy(p, ih_item_body(bh, ih) + path.pos_in_item, chars);
387 387
388 if (done) 388 if (done)
389 break; 389 break;
@@ -404,7 +404,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
404 // i/o error most likely 404 // i/o error most likely
405 break; 405 break;
406 bh = get_last_bh(&path); 406 bh = get_last_bh(&path);
407 ih = get_ih(&path); 407 ih = tp_item_head(&path);
408 } while (1); 408 } while (1);
409 409
410 flush_dcache_page(bh_result->b_page); 410 flush_dcache_page(bh_result->b_page);
@@ -684,8 +684,8 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
684 } 684 }
685 685
686 bh = get_last_bh(&path); 686 bh = get_last_bh(&path);
687 ih = get_ih(&path); 687 ih = tp_item_head(&path);
688 item = get_item(&path); 688 item = tp_item_body(&path);
689 pos_in_item = path.pos_in_item; 689 pos_in_item = path.pos_in_item;
690 690
691 fs_gen = get_generation(inode->i_sb); 691 fs_gen = get_generation(inode->i_sb);
@@ -1031,8 +1031,8 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
1031 goto failure; 1031 goto failure;
1032 } 1032 }
1033 bh = get_last_bh(&path); 1033 bh = get_last_bh(&path);
1034 ih = get_ih(&path); 1034 ih = tp_item_head(&path);
1035 item = get_item(&path); 1035 item = tp_item_body(&path);
1036 pos_in_item = path.pos_in_item; 1036 pos_in_item = path.pos_in_item;
1037 } while (1); 1037 } while (1);
1038 1038
@@ -1133,7 +1133,7 @@ static void init_inode(struct inode *inode, struct treepath *path)
1133 //int version = ITEM_VERSION_1; 1133 //int version = ITEM_VERSION_1;
1134 1134
1135 bh = PATH_PLAST_BUFFER(path); 1135 bh = PATH_PLAST_BUFFER(path);
1136 ih = PATH_PITEM_HEAD(path); 1136 ih = tp_item_head(path);
1137 1137
1138 copy_key(INODE_PKEY(inode), &(ih->ih_key)); 1138 copy_key(INODE_PKEY(inode), &(ih->ih_key));
1139 1139
@@ -1147,7 +1147,7 @@ static void init_inode(struct inode *inode, struct treepath *path)
1147 1147
1148 if (stat_data_v1(ih)) { 1148 if (stat_data_v1(ih)) {
1149 struct stat_data_v1 *sd = 1149 struct stat_data_v1 *sd =
1150 (struct stat_data_v1 *)B_I_PITEM(bh, ih); 1150 (struct stat_data_v1 *)ih_item_body(bh, ih);
1151 unsigned long blocks; 1151 unsigned long blocks;
1152 1152
1153 set_inode_item_key_version(inode, KEY_FORMAT_3_5); 1153 set_inode_item_key_version(inode, KEY_FORMAT_3_5);
@@ -1195,7 +1195,7 @@ static void init_inode(struct inode *inode, struct treepath *path)
1195 } else { 1195 } else {
1196 // new stat data found, but object may have old items 1196 // new stat data found, but object may have old items
1197 // (directories and symlinks) 1197 // (directories and symlinks)
1198 struct stat_data *sd = (struct stat_data *)B_I_PITEM(bh, ih); 1198 struct stat_data *sd = (struct stat_data *)ih_item_body(bh, ih);
1199 1199
1200 inode->i_mode = sd_v2_mode(sd); 1200 inode->i_mode = sd_v2_mode(sd);
1201 set_nlink(inode, sd_v2_nlink(sd)); 1201 set_nlink(inode, sd_v2_nlink(sd));
@@ -1307,7 +1307,7 @@ static void update_stat_data(struct treepath *path, struct inode *inode,
1307 struct item_head *ih; 1307 struct item_head *ih;
1308 1308
1309 bh = PATH_PLAST_BUFFER(path); 1309 bh = PATH_PLAST_BUFFER(path);
1310 ih = PATH_PITEM_HEAD(path); 1310 ih = tp_item_head(path);
1311 1311
1312 if (!is_statdata_le_ih(ih)) 1312 if (!is_statdata_le_ih(ih))
1313 reiserfs_panic(inode->i_sb, "vs-13065", "key %k, found item %h", 1313 reiserfs_panic(inode->i_sb, "vs-13065", "key %k, found item %h",
@@ -1315,9 +1315,9 @@ static void update_stat_data(struct treepath *path, struct inode *inode,
1315 1315
1316 if (stat_data_v1(ih)) { 1316 if (stat_data_v1(ih)) {
1317 // path points to old stat data 1317 // path points to old stat data
1318 inode2sd_v1(B_I_PITEM(bh, ih), inode, size); 1318 inode2sd_v1(ih_item_body(bh, ih), inode, size);
1319 } else { 1319 } else {
1320 inode2sd(B_I_PITEM(bh, ih), inode, size); 1320 inode2sd(ih_item_body(bh, ih), inode, size);
1321 } 1321 }
1322 1322
1323 return; 1323 return;
@@ -1368,7 +1368,7 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
1368 ** search if the stat data item has moved 1368 ** search if the stat data item has moved
1369 */ 1369 */
1370 bh = get_last_bh(&path); 1370 bh = get_last_bh(&path);
1371 ih = get_ih(&path); 1371 ih = tp_item_head(&path);
1372 copy_item_head(&tmp_ih, ih); 1372 copy_item_head(&tmp_ih, ih);
1373 fs_gen = get_generation(inode->i_sb); 1373 fs_gen = get_generation(inode->i_sb);
1374 reiserfs_prepare_for_journal(inode->i_sb, bh, 1); 1374 reiserfs_prepare_for_journal(inode->i_sb, bh, 1);
@@ -2232,8 +2232,8 @@ static int map_block_for_writepage(struct inode *inode,
2232 } 2232 }
2233 2233
2234 bh = get_last_bh(&path); 2234 bh = get_last_bh(&path);
2235 ih = get_ih(&path); 2235 ih = tp_item_head(&path);
2236 item = get_item(&path); 2236 item = tp_item_body(&path);
2237 pos_in_item = path.pos_in_item; 2237 pos_in_item = path.pos_in_item;
2238 2238
2239 /* we've found an unformatted node */ 2239 /* we've found an unformatted node */
@@ -2281,7 +2281,7 @@ static int map_block_for_writepage(struct inode *inode,
2281 goto research; 2281 goto research;
2282 } 2282 }
2283 2283
2284 memcpy(B_I_PITEM(bh, ih) + pos_in_item, p + bytes_copied, 2284 memcpy(ih_item_body(bh, ih) + pos_in_item, p + bytes_copied,
2285 copy_size); 2285 copy_size);
2286 2286
2287 journal_mark_dirty(&th, inode->i_sb, bh); 2287 journal_mark_dirty(&th, inode->i_sb, bh);