diff options
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 168 |
1 files changed, 99 insertions, 69 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index e356c99f0659..2245c78d5876 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -58,8 +58,6 @@ | |||
58 | #define reiserfs_write_lock( sb ) lock_kernel() | 58 | #define reiserfs_write_lock( sb ) lock_kernel() |
59 | #define reiserfs_write_unlock( sb ) unlock_kernel() | 59 | #define reiserfs_write_unlock( sb ) unlock_kernel() |
60 | 60 | ||
61 | /* xattr stuff */ | ||
62 | #define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem) | ||
63 | struct fid; | 61 | struct fid; |
64 | 62 | ||
65 | /* in reading the #defines, it may help to understand that they employ | 63 | /* in reading the #defines, it may help to understand that they employ |
@@ -104,15 +102,21 @@ struct fid; | |||
104 | */ | 102 | */ |
105 | #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ | 103 | #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ |
106 | 104 | ||
107 | void reiserfs_warning(struct super_block *s, const char *fmt, ...); | 105 | void __reiserfs_warning(struct super_block *s, const char *id, |
106 | const char *func, const char *fmt, ...); | ||
107 | #define reiserfs_warning(s, id, fmt, args...) \ | ||
108 | __reiserfs_warning(s, id, __func__, fmt, ##args) | ||
108 | /* assertions handling */ | 109 | /* assertions handling */ |
109 | 110 | ||
110 | /** always check a condition and panic if it's false. */ | 111 | /** always check a condition and panic if it's false. */ |
111 | #define __RASSERT( cond, scond, format, args... ) \ | 112 | #define __RASSERT(cond, scond, format, args...) \ |
112 | if( !( cond ) ) \ | 113 | do { \ |
113 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ | 114 | if (!(cond)) \ |
114 | __FILE__ ":%i:%s: " format "\n", \ | 115 | reiserfs_panic(NULL, "assertion failure", "(" #cond ") at " \ |
115 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args ) | 116 | __FILE__ ":%i:%s: " format "\n", \ |
117 | in_interrupt() ? -1 : task_pid_nr(current), \ | ||
118 | __LINE__, __func__ , ##args); \ | ||
119 | } while (0) | ||
116 | 120 | ||
117 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | 121 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) |
118 | 122 | ||
@@ -196,7 +200,11 @@ struct reiserfs_super_block { | |||
196 | __le32 s_flags; /* Right now used only by inode-attributes, if enabled */ | 200 | __le32 s_flags; /* Right now used only by inode-attributes, if enabled */ |
197 | unsigned char s_uuid[16]; /* filesystem unique identifier */ | 201 | unsigned char s_uuid[16]; /* filesystem unique identifier */ |
198 | unsigned char s_label[16]; /* filesystem volume label */ | 202 | unsigned char s_label[16]; /* filesystem volume label */ |
199 | char s_unused[88]; /* zero filled by mkreiserfs and | 203 | __le16 s_mnt_count; /* Count of mounts since last fsck */ |
204 | __le16 s_max_mnt_count; /* Maximum mounts before check */ | ||
205 | __le32 s_lastcheck; /* Timestamp of last fsck */ | ||
206 | __le32 s_check_interval; /* Interval between checks */ | ||
207 | char s_unused[76]; /* zero filled by mkreiserfs and | ||
200 | * reiserfs_convert_objectid_map_v1() | 208 | * reiserfs_convert_objectid_map_v1() |
201 | * so any additions must be updated | 209 | * so any additions must be updated |
202 | * there as well. */ | 210 | * there as well. */ |
@@ -578,10 +586,8 @@ static inline int uniqueness2type(__u32 uniqueness) | |||
578 | return TYPE_DIRECT; | 586 | return TYPE_DIRECT; |
579 | case V1_DIRENTRY_UNIQUENESS: | 587 | case V1_DIRENTRY_UNIQUENESS: |
580 | return TYPE_DIRENTRY; | 588 | return TYPE_DIRENTRY; |
581 | default: | ||
582 | reiserfs_warning(NULL, "vs-500: unknown uniqueness %d", | ||
583 | uniqueness); | ||
584 | case V1_ANY_UNIQUENESS: | 589 | case V1_ANY_UNIQUENESS: |
590 | default: | ||
585 | return TYPE_ANY; | 591 | return TYPE_ANY; |
586 | } | 592 | } |
587 | } | 593 | } |
@@ -598,9 +604,8 @@ static inline __u32 type2uniqueness(int type) | |||
598 | return V1_DIRECT_UNIQUENESS; | 604 | return V1_DIRECT_UNIQUENESS; |
599 | case TYPE_DIRENTRY: | 605 | case TYPE_DIRENTRY: |
600 | return V1_DIRENTRY_UNIQUENESS; | 606 | return V1_DIRENTRY_UNIQUENESS; |
601 | default: | ||
602 | reiserfs_warning(NULL, "vs-501: unknown type %d", type); | ||
603 | case TYPE_ANY: | 607 | case TYPE_ANY: |
608 | default: | ||
604 | return V1_ANY_UNIQUENESS; | 609 | return V1_ANY_UNIQUENESS; |
605 | } | 610 | } |
606 | } | 611 | } |
@@ -712,9 +717,9 @@ static inline void cpu_key_k_offset_dec(struct cpu_key *key) | |||
712 | #define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key))) | 717 | #define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key))) |
713 | #define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key))) | 718 | #define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key))) |
714 | 719 | ||
715 | #define I_K_KEY_IN_ITEM(p_s_ih, p_s_key, n_blocksize) \ | 720 | #define I_K_KEY_IN_ITEM(ih, key, n_blocksize) \ |
716 | ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \ | 721 | (!COMP_SHORT_KEYS(ih, key) && \ |
717 | I_OFF_BYTE_IN_ITEM(p_s_ih, k_offset (p_s_key), n_blocksize) ) | 722 | I_OFF_BYTE_IN_ITEM(ih, k_offset(key), n_blocksize)) |
718 | 723 | ||
719 | /* maximal length of item */ | 724 | /* maximal length of item */ |
720 | #define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE) | 725 | #define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE) |
@@ -770,25 +775,25 @@ struct block_head { | |||
770 | #define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */ | 775 | #define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */ |
771 | 776 | ||
772 | /* Given the buffer head of a formatted node, resolve to the block head of that node. */ | 777 | /* Given the buffer head of a formatted node, resolve to the block head of that node. */ |
773 | #define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data)) | 778 | #define B_BLK_HEAD(bh) ((struct block_head *)((bh)->b_data)) |
774 | /* Number of items that are in buffer. */ | 779 | /* Number of items that are in buffer. */ |
775 | #define B_NR_ITEMS(p_s_bh) (blkh_nr_item(B_BLK_HEAD(p_s_bh))) | 780 | #define B_NR_ITEMS(bh) (blkh_nr_item(B_BLK_HEAD(bh))) |
776 | #define B_LEVEL(p_s_bh) (blkh_level(B_BLK_HEAD(p_s_bh))) | 781 | #define B_LEVEL(bh) (blkh_level(B_BLK_HEAD(bh))) |
777 | #define B_FREE_SPACE(p_s_bh) (blkh_free_space(B_BLK_HEAD(p_s_bh))) | 782 | #define B_FREE_SPACE(bh) (blkh_free_space(B_BLK_HEAD(bh))) |
778 | 783 | ||
779 | #define PUT_B_NR_ITEMS(p_s_bh,val) do { set_blkh_nr_item(B_BLK_HEAD(p_s_bh),val); } while (0) | 784 | #define PUT_B_NR_ITEMS(bh, val) do { set_blkh_nr_item(B_BLK_HEAD(bh), val); } while (0) |
780 | #define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0) | 785 | #define PUT_B_LEVEL(bh, val) do { set_blkh_level(B_BLK_HEAD(bh), val); } while (0) |
781 | #define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0) | 786 | #define PUT_B_FREE_SPACE(bh, val) do { set_blkh_free_space(B_BLK_HEAD(bh), val); } while (0) |
782 | 787 | ||
783 | /* Get right delimiting key. -- little endian */ | 788 | /* Get right delimiting key. -- little endian */ |
784 | #define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh)))) | 789 | #define B_PRIGHT_DELIM_KEY(bh) (&(blk_right_delim_key(B_BLK_HEAD(bh)))) |
785 | 790 | ||
786 | /* Does the buffer contain a disk leaf. */ | 791 | /* Does the buffer contain a disk leaf. */ |
787 | #define B_IS_ITEMS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) == DISK_LEAF_NODE_LEVEL) | 792 | #define B_IS_ITEMS_LEVEL(bh) (B_LEVEL(bh) == DISK_LEAF_NODE_LEVEL) |
788 | 793 | ||
789 | /* Does the buffer contain a disk internal node */ | 794 | /* Does the buffer contain a disk internal node */ |
790 | #define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \ | 795 | #define B_IS_KEYS_LEVEL(bh) (B_LEVEL(bh) > DISK_LEAF_NODE_LEVEL \ |
791 | && B_LEVEL(p_s_bh) <= MAX_HEIGHT) | 796 | && B_LEVEL(bh) <= MAX_HEIGHT) |
792 | 797 | ||
793 | /***************************************************************************/ | 798 | /***************************************************************************/ |
794 | /* STAT DATA */ | 799 | /* STAT DATA */ |
@@ -1138,12 +1143,13 @@ struct disk_child { | |||
1138 | #define put_dc_size(dc_p, val) do { (dc_p)->dc_size = cpu_to_le16(val); } while(0) | 1143 | #define put_dc_size(dc_p, val) do { (dc_p)->dc_size = cpu_to_le16(val); } while(0) |
1139 | 1144 | ||
1140 | /* Get disk child by buffer header and position in the tree node. */ | 1145 | /* Get disk child by buffer header and position in the tree node. */ |
1141 | #define B_N_CHILD(p_s_bh,n_pos) ((struct disk_child *)\ | 1146 | #define B_N_CHILD(bh, n_pos) ((struct disk_child *)\ |
1142 | ((p_s_bh)->b_data+BLKH_SIZE+B_NR_ITEMS(p_s_bh)*KEY_SIZE+DC_SIZE*(n_pos))) | 1147 | ((bh)->b_data + BLKH_SIZE + B_NR_ITEMS(bh) * KEY_SIZE + DC_SIZE * (n_pos))) |
1143 | 1148 | ||
1144 | /* Get disk child number by buffer header and position in the tree node. */ | 1149 | /* Get disk child number by buffer header and position in the tree node. */ |
1145 | #define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos))) | 1150 | #define B_N_CHILD_NUM(bh, n_pos) (dc_block_number(B_N_CHILD(bh, n_pos))) |
1146 | #define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val )) | 1151 | #define PUT_B_N_CHILD_NUM(bh, n_pos, val) \ |
1152 | (put_dc_block_number(B_N_CHILD(bh, n_pos), val)) | ||
1147 | 1153 | ||
1148 | /* maximal value of field child_size in structure disk_child */ | 1154 | /* maximal value of field child_size in structure disk_child */ |
1149 | /* child size is the combined size of all items and their headers */ | 1155 | /* child size is the combined size of all items and their headers */ |
@@ -1214,33 +1220,33 @@ struct treepath { | |||
1214 | struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} | 1220 | struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} |
1215 | 1221 | ||
1216 | /* Get path element by path and path position. */ | 1222 | /* Get path element by path and path position. */ |
1217 | #define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) | 1223 | #define PATH_OFFSET_PELEMENT(path, n_offset) ((path)->path_elements + (n_offset)) |
1218 | 1224 | ||
1219 | /* Get buffer header at the path by path and path position. */ | 1225 | /* Get buffer header at the path by path and path position. */ |
1220 | #define PATH_OFFSET_PBUFFER(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_buffer) | 1226 | #define PATH_OFFSET_PBUFFER(path, n_offset) (PATH_OFFSET_PELEMENT(path, n_offset)->pe_buffer) |
1221 | 1227 | ||
1222 | /* Get position in the element at the path by path and path position. */ | 1228 | /* Get position in the element at the path by path and path position. */ |
1223 | #define PATH_OFFSET_POSITION(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_position) | 1229 | #define PATH_OFFSET_POSITION(path, n_offset) (PATH_OFFSET_PELEMENT(path, n_offset)->pe_position) |
1224 | 1230 | ||
1225 | #define PATH_PLAST_BUFFER(p_s_path) (PATH_OFFSET_PBUFFER((p_s_path), (p_s_path)->path_length)) | 1231 | #define PATH_PLAST_BUFFER(path) (PATH_OFFSET_PBUFFER((path), (path)->path_length)) |
1226 | /* you know, to the person who didn't | 1232 | /* you know, to the person who didn't |
1227 | write this the macro name does not | 1233 | write this the macro name does not |
1228 | at first suggest what it does. | 1234 | at first suggest what it does. |
1229 | Maybe POSITION_FROM_PATH_END? Or | 1235 | Maybe POSITION_FROM_PATH_END? Or |
1230 | maybe we should just focus on | 1236 | maybe we should just focus on |
1231 | dumping paths... -Hans */ | 1237 | dumping paths... -Hans */ |
1232 | #define PATH_LAST_POSITION(p_s_path) (PATH_OFFSET_POSITION((p_s_path), (p_s_path)->path_length)) | 1238 | #define PATH_LAST_POSITION(path) (PATH_OFFSET_POSITION((path), (path)->path_length)) |
1233 | 1239 | ||
1234 | #define PATH_PITEM_HEAD(p_s_path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_path),PATH_LAST_POSITION(p_s_path)) | 1240 | #define PATH_PITEM_HEAD(path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(path), PATH_LAST_POSITION(path)) |
1235 | 1241 | ||
1236 | /* in do_balance leaf has h == 0 in contrast with path structure, | 1242 | /* in do_balance leaf has h == 0 in contrast with path structure, |
1237 | where root has level == 0. That is why we need these defines */ | 1243 | where root has level == 0. That is why we need these defines */ |
1238 | #define PATH_H_PBUFFER(p_s_path, h) PATH_OFFSET_PBUFFER (p_s_path, p_s_path->path_length - (h)) /* tb->S[h] */ | 1244 | #define PATH_H_PBUFFER(path, h) PATH_OFFSET_PBUFFER (path, path->path_length - (h)) /* tb->S[h] */ |
1239 | #define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */ | 1245 | #define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */ |
1240 | #define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h)) | 1246 | #define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h)) |
1241 | #define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */ | 1247 | #define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */ |
1242 | 1248 | ||
1243 | #define PATH_H_PATH_OFFSET(p_s_path, n_h) ((p_s_path)->path_length - (n_h)) | 1249 | #define PATH_H_PATH_OFFSET(path, n_h) ((path)->path_length - (n_h)) |
1244 | 1250 | ||
1245 | #define get_last_bh(path) PATH_PLAST_BUFFER(path) | 1251 | #define get_last_bh(path) PATH_PLAST_BUFFER(path) |
1246 | #define get_ih(path) PATH_PITEM_HEAD(path) | 1252 | #define get_ih(path) PATH_PITEM_HEAD(path) |
@@ -1470,6 +1476,16 @@ struct buffer_info { | |||
1470 | int bi_position; | 1476 | int bi_position; |
1471 | }; | 1477 | }; |
1472 | 1478 | ||
1479 | static inline struct super_block *sb_from_tb(struct tree_balance *tb) | ||
1480 | { | ||
1481 | return tb ? tb->tb_sb : NULL; | ||
1482 | } | ||
1483 | |||
1484 | static inline struct super_block *sb_from_bi(struct buffer_info *bi) | ||
1485 | { | ||
1486 | return bi ? sb_from_tb(bi->tb) : NULL; | ||
1487 | } | ||
1488 | |||
1473 | /* there are 4 types of items: stat data, directory item, indirect, direct. | 1489 | /* there are 4 types of items: stat data, directory item, indirect, direct. |
1474 | +-------------------+------------+--------------+------------+ | 1490 | +-------------------+------------+--------------+------------+ |
1475 | | | k_offset | k_uniqueness | mergeable? | | 1491 | | | k_offset | k_uniqueness | mergeable? | |
@@ -1520,7 +1536,7 @@ extern struct item_operations *item_ops[TYPE_ANY + 1]; | |||
1520 | #define COMP_SHORT_KEYS comp_short_keys | 1536 | #define COMP_SHORT_KEYS comp_short_keys |
1521 | 1537 | ||
1522 | /* number of blocks pointed to by the indirect item */ | 1538 | /* number of blocks pointed to by the indirect item */ |
1523 | #define I_UNFM_NUM(p_s_ih) ( ih_item_len(p_s_ih) / UNFM_P_SIZE ) | 1539 | #define I_UNFM_NUM(ih) (ih_item_len(ih) / UNFM_P_SIZE) |
1524 | 1540 | ||
1525 | /* the used space within the unformatted node corresponding to pos within the item pointed to by ih */ | 1541 | /* the used space within the unformatted node corresponding to pos within the item pointed to by ih */ |
1526 | #define I_POS_UNFM_SIZE(ih,pos,size) (((pos) == I_UNFM_NUM(ih) - 1 ) ? (size) - ih_free_space(ih) : (size)) | 1542 | #define I_POS_UNFM_SIZE(ih,pos,size) (((pos) == I_UNFM_NUM(ih) - 1 ) ? (size) - ih_free_space(ih) : (size)) |
@@ -1623,6 +1639,10 @@ struct reiserfs_journal_header { | |||
1623 | #define JOURNAL_MAX_COMMIT_AGE 30 | 1639 | #define JOURNAL_MAX_COMMIT_AGE 30 |
1624 | #define JOURNAL_MAX_TRANS_AGE 30 | 1640 | #define JOURNAL_MAX_TRANS_AGE 30 |
1625 | #define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) | 1641 | #define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) |
1642 | #define JOURNAL_BLOCKS_PER_OBJECT(sb) (JOURNAL_PER_BALANCE_CNT * 3 + \ | ||
1643 | 2 * (REISERFS_QUOTA_INIT_BLOCKS(sb) + \ | ||
1644 | REISERFS_QUOTA_TRANS_BLOCKS(sb))) | ||
1645 | |||
1626 | #ifdef CONFIG_QUOTA | 1646 | #ifdef CONFIG_QUOTA |
1627 | /* We need to update data and inode (atime) */ | 1647 | /* We need to update data and inode (atime) */ |
1628 | #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0) | 1648 | #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0) |
@@ -1697,7 +1717,7 @@ struct reiserfs_transaction_handle { | |||
1697 | int t_refcount; | 1717 | int t_refcount; |
1698 | int t_blocks_logged; /* number of blocks this writer has logged */ | 1718 | int t_blocks_logged; /* number of blocks this writer has logged */ |
1699 | int t_blocks_allocated; /* number of blocks this writer allocated */ | 1719 | int t_blocks_allocated; /* number of blocks this writer allocated */ |
1700 | unsigned long t_trans_id; /* sanity check, equals the current trans id */ | 1720 | unsigned int t_trans_id; /* sanity check, equals the current trans id */ |
1701 | void *t_handle_save; /* save existing current->journal_info */ | 1721 | void *t_handle_save; /* save existing current->journal_info */ |
1702 | unsigned displace_new_blocks:1; /* if new block allocation occurres, that block | 1722 | unsigned displace_new_blocks:1; /* if new block allocation occurres, that block |
1703 | should be displaced from others */ | 1723 | should be displaced from others */ |
@@ -1773,13 +1793,13 @@ int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *, | |||
1773 | int journal_mark_freed(struct reiserfs_transaction_handle *, | 1793 | int journal_mark_freed(struct reiserfs_transaction_handle *, |
1774 | struct super_block *, b_blocknr_t blocknr); | 1794 | struct super_block *, b_blocknr_t blocknr); |
1775 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); | 1795 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); |
1776 | int reiserfs_in_journal(struct super_block *p_s_sb, unsigned int bmap_nr, | 1796 | int reiserfs_in_journal(struct super_block *sb, unsigned int bmap_nr, |
1777 | int bit_nr, int searchall, b_blocknr_t *next); | 1797 | int bit_nr, int searchall, b_blocknr_t *next); |
1778 | int journal_begin(struct reiserfs_transaction_handle *, | 1798 | int journal_begin(struct reiserfs_transaction_handle *, |
1779 | struct super_block *p_s_sb, unsigned long); | 1799 | struct super_block *sb, unsigned long); |
1780 | int journal_join_abort(struct reiserfs_transaction_handle *, | 1800 | int journal_join_abort(struct reiserfs_transaction_handle *, |
1781 | struct super_block *p_s_sb, unsigned long); | 1801 | struct super_block *sb, unsigned long); |
1782 | void reiserfs_journal_abort(struct super_block *sb, int errno); | 1802 | void reiserfs_abort_journal(struct super_block *sb, int errno); |
1783 | void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...); | 1803 | void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...); |
1784 | int reiserfs_allocate_list_bitmaps(struct super_block *s, | 1804 | int reiserfs_allocate_list_bitmaps(struct super_block *s, |
1785 | struct reiserfs_list_bitmap *, unsigned int); | 1805 | struct reiserfs_list_bitmap *, unsigned int); |
@@ -1796,8 +1816,8 @@ int reiserfs_convert_objectid_map_v1(struct super_block *); | |||
1796 | 1816 | ||
1797 | /* stree.c */ | 1817 | /* stree.c */ |
1798 | int B_IS_IN_TREE(const struct buffer_head *); | 1818 | int B_IS_IN_TREE(const struct buffer_head *); |
1799 | extern void copy_item_head(struct item_head *p_v_to, | 1819 | extern void copy_item_head(struct item_head *to, |
1800 | const struct item_head *p_v_from); | 1820 | const struct item_head *from); |
1801 | 1821 | ||
1802 | // first key is in cpu form, second - le | 1822 | // first key is in cpu form, second - le |
1803 | extern int comp_short_keys(const struct reiserfs_key *le_key, | 1823 | extern int comp_short_keys(const struct reiserfs_key *le_key, |
@@ -1832,20 +1852,20 @@ static inline void copy_key(struct reiserfs_key *to, | |||
1832 | memcpy(to, from, KEY_SIZE); | 1852 | memcpy(to, from, KEY_SIZE); |
1833 | } | 1853 | } |
1834 | 1854 | ||
1835 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path); | 1855 | int comp_items(const struct item_head *stored_ih, const struct treepath *path); |
1836 | const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, | 1856 | const struct reiserfs_key *get_rkey(const struct treepath *chk_path, |
1837 | const struct super_block *p_s_sb); | 1857 | const struct super_block *sb); |
1838 | int search_by_key(struct super_block *, const struct cpu_key *, | 1858 | int search_by_key(struct super_block *, const struct cpu_key *, |
1839 | struct treepath *, int); | 1859 | struct treepath *, int); |
1840 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) | 1860 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) |
1841 | int search_for_position_by_key(struct super_block *p_s_sb, | 1861 | int search_for_position_by_key(struct super_block *sb, |
1842 | const struct cpu_key *p_s_cpu_key, | 1862 | const struct cpu_key *cpu_key, |
1843 | struct treepath *p_s_search_path); | 1863 | struct treepath *search_path); |
1844 | extern void decrement_bcount(struct buffer_head *p_s_bh); | 1864 | extern void decrement_bcount(struct buffer_head *bh); |
1845 | void decrement_counters_in_path(struct treepath *p_s_search_path); | 1865 | void decrement_counters_in_path(struct treepath *search_path); |
1846 | void pathrelse(struct treepath *p_s_search_path); | 1866 | void pathrelse(struct treepath *search_path); |
1847 | int reiserfs_check_path(struct treepath *p); | 1867 | int reiserfs_check_path(struct treepath *p); |
1848 | void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path); | 1868 | void pathrelse_and_restore(struct super_block *s, struct treepath *search_path); |
1849 | 1869 | ||
1850 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | 1870 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, |
1851 | struct treepath *path, | 1871 | struct treepath *path, |
@@ -1868,14 +1888,14 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | |||
1868 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, | 1888 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, |
1869 | struct treepath *path, | 1889 | struct treepath *path, |
1870 | const struct cpu_key *key, | 1890 | const struct cpu_key *key, |
1871 | struct inode *inode, struct buffer_head *p_s_un_bh); | 1891 | struct inode *inode, struct buffer_head *un_bh); |
1872 | 1892 | ||
1873 | void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, | 1893 | void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, |
1874 | struct inode *inode, struct reiserfs_key *key); | 1894 | struct inode *inode, struct reiserfs_key *key); |
1875 | int reiserfs_delete_object(struct reiserfs_transaction_handle *th, | 1895 | int reiserfs_delete_object(struct reiserfs_transaction_handle *th, |
1876 | struct inode *p_s_inode); | 1896 | struct inode *inode); |
1877 | int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, | 1897 | int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, |
1878 | struct inode *p_s_inode, struct page *, | 1898 | struct inode *inode, struct page *, |
1879 | int update_timestamps); | 1899 | int update_timestamps); |
1880 | 1900 | ||
1881 | #define i_block_size(inode) ((inode)->i_sb->s_blocksize) | 1901 | #define i_block_size(inode) ((inode)->i_sb->s_blocksize) |
@@ -1919,10 +1939,12 @@ void make_le_item_head(struct item_head *ih, const struct cpu_key *key, | |||
1919 | loff_t offset, int type, int length, int entry_count); | 1939 | loff_t offset, int type, int length, int entry_count); |
1920 | struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key); | 1940 | struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key); |
1921 | 1941 | ||
1942 | struct reiserfs_security_handle; | ||
1922 | int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | 1943 | int reiserfs_new_inode(struct reiserfs_transaction_handle *th, |
1923 | struct inode *dir, int mode, | 1944 | struct inode *dir, int mode, |
1924 | const char *symname, loff_t i_size, | 1945 | const char *symname, loff_t i_size, |
1925 | struct dentry *dentry, struct inode *inode); | 1946 | struct dentry *dentry, struct inode *inode, |
1947 | struct reiserfs_security_handle *security); | ||
1926 | 1948 | ||
1927 | void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, | 1949 | void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, |
1928 | struct inode *inode, loff_t size); | 1950 | struct inode *inode, loff_t size); |
@@ -1980,7 +2002,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | |||
1980 | #define PROC_INFO_MAX( sb, field, value ) VOID_V | 2002 | #define PROC_INFO_MAX( sb, field, value ) VOID_V |
1981 | #define PROC_INFO_INC( sb, field ) VOID_V | 2003 | #define PROC_INFO_INC( sb, field ) VOID_V |
1982 | #define PROC_INFO_ADD( sb, field, val ) VOID_V | 2004 | #define PROC_INFO_ADD( sb, field, val ) VOID_V |
1983 | #define PROC_INFO_BH_STAT( p_s_sb, p_s_bh, n_node_level ) VOID_V | 2005 | #define PROC_INFO_BH_STAT(sb, bh, n_node_level) VOID_V |
1984 | #endif | 2006 | #endif |
1985 | 2007 | ||
1986 | /* dir.c */ | 2008 | /* dir.c */ |
@@ -1988,6 +2010,7 @@ extern const struct inode_operations reiserfs_dir_inode_operations; | |||
1988 | extern const struct inode_operations reiserfs_symlink_inode_operations; | 2010 | extern const struct inode_operations reiserfs_symlink_inode_operations; |
1989 | extern const struct inode_operations reiserfs_special_inode_operations; | 2011 | extern const struct inode_operations reiserfs_special_inode_operations; |
1990 | extern const struct file_operations reiserfs_dir_operations; | 2012 | extern const struct file_operations reiserfs_dir_operations; |
2013 | int reiserfs_readdir_dentry(struct dentry *, void *, filldir_t, loff_t *); | ||
1991 | 2014 | ||
1992 | /* tail_conversion.c */ | 2015 | /* tail_conversion.c */ |
1993 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, | 2016 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, |
@@ -2004,13 +2027,20 @@ extern const struct address_space_operations reiserfs_address_space_operations; | |||
2004 | 2027 | ||
2005 | /* fix_nodes.c */ | 2028 | /* fix_nodes.c */ |
2006 | 2029 | ||
2007 | int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, | 2030 | int fix_nodes(int n_op_mode, struct tree_balance *tb, |
2008 | struct item_head *p_s_ins_ih, const void *); | 2031 | struct item_head *ins_ih, const void *); |
2009 | void unfix_nodes(struct tree_balance *); | 2032 | void unfix_nodes(struct tree_balance *); |
2010 | 2033 | ||
2011 | /* prints.c */ | 2034 | /* prints.c */ |
2012 | void reiserfs_panic(struct super_block *s, const char *fmt, ...) | 2035 | void __reiserfs_panic(struct super_block *s, const char *id, |
2036 | const char *function, const char *fmt, ...) | ||
2013 | __attribute__ ((noreturn)); | 2037 | __attribute__ ((noreturn)); |
2038 | #define reiserfs_panic(s, id, fmt, args...) \ | ||
2039 | __reiserfs_panic(s, id, __func__, fmt, ##args) | ||
2040 | void __reiserfs_error(struct super_block *s, const char *id, | ||
2041 | const char *function, const char *fmt, ...); | ||
2042 | #define reiserfs_error(s, id, fmt, args...) \ | ||
2043 | __reiserfs_error(s, id, __func__, fmt, ##args) | ||
2014 | void reiserfs_info(struct super_block *s, const char *fmt, ...); | 2044 | void reiserfs_info(struct super_block *s, const char *fmt, ...); |
2015 | void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...); | 2045 | void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...); |
2016 | void print_indirect_item(struct buffer_head *bh, int item_num); | 2046 | void print_indirect_item(struct buffer_head *bh, int item_num); |
@@ -2047,7 +2077,7 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num, | |||
2047 | int zeros_number); | 2077 | int zeros_number); |
2048 | void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num, | 2078 | void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num, |
2049 | int pos_in_item, int cut_size); | 2079 | int pos_in_item, int cut_size); |
2050 | void leaf_paste_entries(struct buffer_head *bh, int item_num, int before, | 2080 | void leaf_paste_entries(struct buffer_info *bi, int item_num, int before, |
2051 | int new_entry_count, struct reiserfs_de_head *new_dehs, | 2081 | int new_entry_count, struct reiserfs_de_head *new_dehs, |
2052 | const char *records, int paste_size); | 2082 | const char *records, int paste_size); |
2053 | /* ibalance.c */ | 2083 | /* ibalance.c */ |
@@ -2203,6 +2233,6 @@ long reiserfs_compat_ioctl(struct file *filp, | |||
2203 | unsigned int cmd, unsigned long arg); | 2233 | unsigned int cmd, unsigned long arg); |
2204 | int reiserfs_unpack(struct inode *inode, struct file *filp); | 2234 | int reiserfs_unpack(struct inode *inode, struct file *filp); |
2205 | 2235 | ||
2206 | |||
2207 | #endif /* __KERNEL__ */ | 2236 | #endif /* __KERNEL__ */ |
2237 | |||
2208 | #endif /* _LINUX_REISER_FS_H */ | 2238 | #endif /* _LINUX_REISER_FS_H */ |