Skip to content

Commit fec6d05

Browse files
Josef "Jeff" SipekLinus Torvalds
authored andcommitted
[PATCH] struct path: rename Reiserfs's struct path
Rename Reiserfs's struct path to struct treepath to prevent name collision between it and struct path from fs/namei.c. Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu> Cc: <reiserfs-dev@namesys.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 0cc72dc commit fec6d05

7 files changed

Lines changed: 58 additions & 58 deletions

File tree

‎fs/reiserfs/bitmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static void oid_groups(reiserfs_blocknr_hint_t * hint)
708708
*/
709709
static int get_left_neighbor(reiserfs_blocknr_hint_t * hint)
710710
{
711-
struct path *path;
711+
struct treepath *path;
712712
struct buffer_head *bh;
713713
struct item_head *ih;
714714
int pos_in_item;

‎fs/reiserfs/fix_node.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ static int get_far_parent(struct tree_balance *p_s_tb,
957957
{
958958
struct buffer_head *p_s_parent;
959959
INITIALIZE_PATH(s_path_to_neighbor_father);
960-
struct path *p_s_path = p_s_tb->tb_path;
960+
struct treepath *p_s_path = p_s_tb->tb_path;
961961
struct cpu_key s_lr_father_key;
962962
int n_counter,
963963
n_position = INT_MAX,
@@ -1074,7 +1074,7 @@ static int get_far_parent(struct tree_balance *p_s_tb,
10741074
*/
10751075
static int get_parents(struct tree_balance *p_s_tb, int n_h)
10761076
{
1077-
struct path *p_s_path = p_s_tb->tb_path;
1077+
struct treepath *p_s_path = p_s_tb->tb_path;
10781078
int n_position,
10791079
n_ret_value,
10801080
n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
@@ -1885,7 +1885,7 @@ static int check_balance(int mode,
18851885
static int get_direct_parent(struct tree_balance *p_s_tb, int n_h)
18861886
{
18871887
struct buffer_head *p_s_bh;
1888-
struct path *p_s_path = p_s_tb->tb_path;
1888+
struct treepath *p_s_path = p_s_tb->tb_path;
18891889
int n_position,
18901890
n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
18911891

‎fs/reiserfs/inode.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int file_capable(struct inode *inode, long block)
207207
}
208208

209209
/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th,
210-
struct inode *inode, struct path *path)
210+
struct inode *inode, struct treepath *path)
211211
{
212212
struct super_block *s = th->t_super;
213213
int len = th->t_blocks_allocated;
@@ -570,7 +570,7 @@ static inline int _allocate_block(struct reiserfs_transaction_handle *th,
570570
long block,
571571
struct inode *inode,
572572
b_blocknr_t * allocated_block_nr,
573-
struct path *path, int flags)
573+
struct treepath *path, int flags)
574574
{
575575
BUG_ON(!th->t_trans_id);
576576

@@ -1107,7 +1107,7 @@ static inline ulong to_fake_used_blocks(struct inode *inode, int sd_size)
11071107
//
11081108

11091109
// called by read_locked_inode
1110-
static void init_inode(struct inode *inode, struct path *path)
1110+
static void init_inode(struct inode *inode, struct treepath *path)
11111111
{
11121112
struct buffer_head *bh;
11131113
struct item_head *ih;
@@ -1284,7 +1284,7 @@ static void inode2sd_v1(void *sd, struct inode *inode, loff_t size)
12841284
/* NOTE, you must prepare the buffer head before sending it here,
12851285
** and then log it after the call
12861286
*/
1287-
static void update_stat_data(struct path *path, struct inode *inode,
1287+
static void update_stat_data(struct treepath *path, struct inode *inode,
12881288
loff_t size)
12891289
{
12901290
struct buffer_head *bh;
@@ -1653,7 +1653,7 @@ int reiserfs_write_inode(struct inode *inode, int do_sync)
16531653
containing "." and ".." entries */
16541654
static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
16551655
struct inode *inode,
1656-
struct item_head *ih, struct path *path,
1656+
struct item_head *ih, struct treepath *path,
16571657
struct inode *dir)
16581658
{
16591659
struct super_block *sb = th->t_super;
@@ -1712,7 +1712,7 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
17121712
containing the body of symlink */
17131713
static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct inode *inode, /* Inode of symlink */
17141714
struct item_head *ih,
1715-
struct path *path, const char *symname,
1715+
struct treepath *path, const char *symname,
17161716
int item_len)
17171717
{
17181718
struct super_block *sb = th->t_super;

‎fs/reiserfs/namei.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int bin_search_in_dir_item(struct reiserfs_dir_entry *de, loff_t off)
5454

5555
// comment? maybe something like set de to point to what the path points to?
5656
static inline void set_de_item_location(struct reiserfs_dir_entry *de,
57-
struct path *path)
57+
struct treepath *path)
5858
{
5959
de->de_bh = get_last_bh(path);
6060
de->de_ih = get_ih(path);
@@ -113,7 +113,7 @@ entry position in the item
113113

114114
/* The function is NOT SCHEDULE-SAFE! */
115115
int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
116-
struct path *path, struct reiserfs_dir_entry *de)
116+
struct treepath *path, struct reiserfs_dir_entry *de)
117117
{
118118
int retval;
119119

@@ -282,7 +282,7 @@ static int linear_search_in_dir_item(struct cpu_key *key,
282282
// may return NAME_FOUND, NAME_FOUND_INVISIBLE, NAME_NOT_FOUND
283283
// FIXME: should add something like IOERROR
284284
static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen,
285-
struct path *path_to_entry,
285+
struct treepath *path_to_entry,
286286
struct reiserfs_dir_entry *de)
287287
{
288288
struct cpu_key key_to_search;

‎fs/reiserfs/stree.c‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static const struct reiserfs_key MAX_KEY = {
244244
of the path, and going upwards. We must check the path's validity at each step. If the key is not in
245245
the path, there is no delimiting key in the tree (buffer is first or last buffer in tree), and in this
246246
case we return a special key, either MIN_KEY or MAX_KEY. */
247-
static inline const struct reiserfs_key *get_lkey(const struct path
247+
static inline const struct reiserfs_key *get_lkey(const struct treepath
248248
*p_s_chk_path,
249249
const struct super_block
250250
*p_s_sb)
@@ -290,7 +290,7 @@ static inline const struct reiserfs_key *get_lkey(const struct path
290290
}
291291

292292
/* Get delimiting key of the buffer at the path and its right neighbor. */
293-
inline const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path,
293+
inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
294294
const struct super_block *p_s_sb)
295295
{
296296
int n_position, n_path_offset = p_s_chk_path->path_length;
@@ -337,7 +337,7 @@ inline const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path,
337337
the path. These delimiting keys are stored at least one level above that buffer in the tree. If the
338338
buffer is the first or last node in the tree order then one of the delimiting keys may be absent, and in
339339
this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */
340-
static inline int key_in_buffer(struct path *p_s_chk_path, /* Path which should be checked. */
340+
static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which should be checked. */
341341
const struct cpu_key *p_s_key, /* Key which should be checked. */
342342
struct super_block *p_s_sb /* Super block pointer. */
343343
)
@@ -374,7 +374,7 @@ inline void decrement_bcount(struct buffer_head *p_s_bh)
374374
}
375375

376376
/* Decrement b_count field of the all buffers in the path. */
377-
void decrement_counters_in_path(struct path *p_s_search_path)
377+
void decrement_counters_in_path(struct treepath *p_s_search_path)
378378
{
379379
int n_path_offset = p_s_search_path->path_length;
380380

@@ -391,7 +391,7 @@ void decrement_counters_in_path(struct path *p_s_search_path)
391391
p_s_search_path->path_length = ILLEGAL_PATH_ELEMENT_OFFSET;
392392
}
393393

394-
int reiserfs_check_path(struct path *p)
394+
int reiserfs_check_path(struct treepath *p)
395395
{
396396
RFALSE(p->path_length != ILLEGAL_PATH_ELEMENT_OFFSET,
397397
"path not properly relsed");
@@ -403,7 +403,7 @@ int reiserfs_check_path(struct path *p)
403403
**
404404
** only called from fix_nodes()
405405
*/
406-
void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path)
406+
void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path)
407407
{
408408
int n_path_offset = p_s_search_path->path_length;
409409

@@ -421,7 +421,7 @@ void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path)
421421
}
422422

423423
/* Release all buffers in the path. */
424-
void pathrelse(struct path *p_s_search_path)
424+
void pathrelse(struct treepath *p_s_search_path)
425425
{
426426
int n_path_offset = p_s_search_path->path_length;
427427

@@ -602,7 +602,7 @@ static void search_by_key_reada(struct super_block *s,
602602
correctness of the bottom of the path */
603603
/* The function is NOT SCHEDULE-SAFE! */
604604
int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* Key to search. */
605-
struct path *p_s_search_path, /* This structure was
605+
struct treepath *p_s_search_path,/* This structure was
606606
allocated and initialized
607607
by the calling
608608
function. It is filled up
@@ -813,7 +813,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
813813
/* The function is NOT SCHEDULE-SAFE! */
814814
int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the super block. */
815815
const struct cpu_key *p_cpu_key, /* Key to search (cpu variable) */
816-
struct path *p_s_search_path /* Filled up by this function. */
816+
struct treepath *p_s_search_path /* Filled up by this function. */
817817
)
818818
{
819819
struct item_head *p_le_ih; /* pointer to on-disk structure */
@@ -884,7 +884,7 @@ int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the sup
884884
}
885885

886886
/* Compare given item and item pointed to by the path. */
887-
int comp_items(const struct item_head *stored_ih, const struct path *p_s_path)
887+
int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path)
888888
{
889889
struct buffer_head *p_s_bh;
890890
struct item_head *ih;
@@ -911,7 +911,7 @@ int comp_items(const struct item_head *stored_ih, const struct path *p_s_path)
911911
#define block_in_use(bh) (buffer_locked(bh) || (held_by_others(bh)))
912912

913913
// prepare for delete or cut of direct item
914-
static inline int prepare_for_direct_item(struct path *path,
914+
static inline int prepare_for_direct_item(struct treepath *path,
915915
struct item_head *le_ih,
916916
struct inode *inode,
917917
loff_t new_file_length, int *cut_size)
@@ -952,7 +952,7 @@ static inline int prepare_for_direct_item(struct path *path,
952952
return M_CUT; /* Cut from this item. */
953953
}
954954

955-
static inline int prepare_for_direntry_item(struct path *path,
955+
static inline int prepare_for_direntry_item(struct treepath *path,
956956
struct item_head *le_ih,
957957
struct inode *inode,
958958
loff_t new_file_length,
@@ -987,7 +987,7 @@ static inline int prepare_for_direntry_item(struct path *path,
987987
In case of file truncate calculate whether this item must be deleted/truncated or last
988988
unformatted node of this item will be converted to a direct item.
989989
This function returns a determination of what balance mode the calling function should employ. */
990-
static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, struct inode *inode, struct path *p_s_path, const struct cpu_key *p_s_item_key, int *p_n_removed, /* Number of unformatted nodes which were removed
990+
static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, struct inode *inode, struct treepath *p_s_path, const struct cpu_key *p_s_item_key, int *p_n_removed, /* Number of unformatted nodes which were removed
991991
from end of the file. */
992992
int *p_n_cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */
993993
)
@@ -1125,7 +1125,7 @@ static int calc_deleted_bytes_number(struct tree_balance *p_s_tb, char c_mode)
11251125
static void init_tb_struct(struct reiserfs_transaction_handle *th,
11261126
struct tree_balance *p_s_tb,
11271127
struct super_block *p_s_sb,
1128-
struct path *p_s_path, int n_size)
1128+
struct treepath *p_s_path, int n_size)
11291129
{
11301130

11311131
BUG_ON(!th->t_trans_id);
@@ -1176,7 +1176,7 @@ char head2type(struct item_head *ih)
11761176
#endif
11771177

11781178
/* Delete object item. */
1179-
int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct path *p_s_path, /* Path to the deleted item. */
1179+
int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath *p_s_path, /* Path to the deleted item. */
11801180
const struct cpu_key *p_s_item_key, /* Key to search for the deleted item. */
11811181
struct inode *p_s_inode, /* inode is here just to update i_blocks and quotas */
11821182
struct buffer_head *p_s_un_bh)
@@ -1468,7 +1468,7 @@ static void unmap_buffers(struct page *page, loff_t pos)
14681468
static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th,
14691469
struct inode *p_s_inode,
14701470
struct page *page,
1471-
struct path *p_s_path,
1471+
struct treepath *p_s_path,
14721472
const struct cpu_key *p_s_item_key,
14731473
loff_t n_new_file_size, char *p_c_mode)
14741474
{
@@ -1503,7 +1503,7 @@ static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th,
15031503
pointer being converted. Therefore we have to delete inserted
15041504
direct item(s) */
15051505
static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th,
1506-
struct inode *inode, struct path *path)
1506+
struct inode *inode, struct treepath *path)
15071507
{
15081508
struct cpu_key tail_key;
15091509
int tail_len;
@@ -1545,7 +1545,7 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th,
15451545

15461546
/* (Truncate or cut entry) or delete object item. Returns < 0 on failure */
15471547
int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1548-
struct path *p_s_path,
1548+
struct treepath *p_s_path,
15491549
struct cpu_key *p_s_item_key,
15501550
struct inode *p_s_inode,
15511551
struct page *page, loff_t n_new_file_size)
@@ -1920,7 +1920,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p
19201920

19211921
#ifdef CONFIG_REISERFS_CHECK
19221922
// this makes sure, that we __append__, not overwrite or add holes
1923-
static void check_research_for_paste(struct path *path,
1923+
static void check_research_for_paste(struct treepath *path,
19241924
const struct cpu_key *p_s_key)
19251925
{
19261926
struct item_head *found_ih = get_ih(path);
@@ -1954,7 +1954,7 @@ static void check_research_for_paste(struct path *path,
19541954
#endif /* config reiserfs check */
19551955

19561956
/* Paste bytes to the existing item. Returns bytes number pasted into the item. */
1957-
int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct path *p_s_search_path, /* Path to the pasted item. */
1957+
int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct treepath *p_s_search_path, /* Path to the pasted item. */
19581958
const struct cpu_key *p_s_key, /* Key to search for the needed item. */
19591959
struct inode *inode, /* Inode item belongs to */
19601960
const char *p_c_body, /* Pointer to the bytes to paste. */
@@ -2036,7 +2036,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct path
20362036
}
20372037

20382038
/* Insert new item into the buffer at the path. */
2039-
int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct path *p_s_path, /* Path to the inserteded item. */
2039+
int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath *p_s_path, /* Path to the inserteded item. */
20402040
const struct cpu_key *key, struct item_head *p_s_ih, /* Pointer to the item header to insert. */
20412041
struct inode *inode, const char *p_c_body)
20422042
{ /* Pointer to the bytes to insert. */

‎fs/reiserfs/tail_conversion.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/* path points to first direct item of the file regarless of how many of
1616
them are there */
1717
int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode,
18-
struct path *path, struct buffer_head *unbh,
18+
struct treepath *path, struct buffer_head *unbh,
1919
loff_t tail_offset)
2020
{
2121
struct super_block *sb = inode->i_sb;
@@ -171,7 +171,7 @@ void reiserfs_unmap_buffer(struct buffer_head *bh)
171171
what we expect from it (number of cut bytes). But when tail remains
172172
in the unformatted node, we set mode to SKIP_BALANCING and unlock
173173
inode */
174-
int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_inode, struct page *page, struct path *p_s_path, /* path to the indirect item. */
174+
int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_inode, struct page *page, struct treepath *p_s_path, /* path to the indirect item. */
175175
const struct cpu_key *p_s_item_key, /* Key to look for unformatted node pointer to be cut. */
176176
loff_t n_new_file_size, /* New file size. */
177177
char *p_c_mode)

0 commit comments

Comments
 (0)