diff options
author | Len Brown <len.brown@intel.com> | 2009-04-05 02:14:15 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-05 02:14:15 -0400 |
commit | 478c6a43fcbc6c11609f8cee7c7b57223907754f (patch) | |
tree | a7f7952099da60d33032aed6de9c0c56c9f8779e /include/linux/reiserfs_fs.h | |
parent | 8a3f257c704e02aee9869decd069a806b45be3f1 (diff) | |
parent | 6bb597507f9839b13498781e481f5458aea33620 (diff) |
Merge branch 'linus' into release
Conflicts:
arch/x86/kernel/cpu/cpufreq/longhaul.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 218 |
1 files changed, 125 insertions, 93 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index bc5114d35e99..2245c78d5876 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -28,8 +28,6 @@ | |||
28 | #include <linux/reiserfs_fs_sb.h> | 28 | #include <linux/reiserfs_fs_sb.h> |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | struct fid; | ||
32 | |||
33 | /* | 31 | /* |
34 | * include/linux/reiser_fs.h | 32 | * include/linux/reiser_fs.h |
35 | * | 33 | * |
@@ -37,6 +35,31 @@ struct fid; | |||
37 | * | 35 | * |
38 | */ | 36 | */ |
39 | 37 | ||
38 | /* ioctl's command */ | ||
39 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) | ||
40 | /* define following flags to be the same as in ext2, so that chattr(1), | ||
41 | lsattr(1) will work with us. */ | ||
42 | #define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS | ||
43 | #define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS | ||
44 | #define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION | ||
45 | #define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION | ||
46 | |||
47 | #ifdef __KERNEL__ | ||
48 | /* the 32 bit compat definitions with int argument */ | ||
49 | #define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int) | ||
50 | #define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
51 | #define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
52 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
53 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
54 | |||
55 | /* Locking primitives */ | ||
56 | /* Right now we are still falling back to (un)lock_kernel, but eventually that | ||
57 | would evolve into real per-fs locks */ | ||
58 | #define reiserfs_write_lock( sb ) lock_kernel() | ||
59 | #define reiserfs_write_unlock( sb ) unlock_kernel() | ||
60 | |||
61 | struct fid; | ||
62 | |||
40 | /* 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 |
41 | the following abbreviations: | 64 | the following abbreviations: |
42 | 65 | ||
@@ -79,15 +102,21 @@ struct fid; | |||
79 | */ | 102 | */ |
80 | #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 */ |
81 | 104 | ||
82 | 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) | ||
83 | /* assertions handling */ | 109 | /* assertions handling */ |
84 | 110 | ||
85 | /** always check a condition and panic if it's false. */ | 111 | /** always check a condition and panic if it's false. */ |
86 | #define __RASSERT( cond, scond, format, args... ) \ | 112 | #define __RASSERT(cond, scond, format, args...) \ |
87 | if( !( cond ) ) \ | 113 | do { \ |
88 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ | 114 | if (!(cond)) \ |
89 | __FILE__ ":%i:%s: " format "\n", \ | 115 | reiserfs_panic(NULL, "assertion failure", "(" #cond ") at " \ |
90 | 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) | ||
91 | 120 | ||
92 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | 121 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) |
93 | 122 | ||
@@ -171,7 +200,11 @@ struct reiserfs_super_block { | |||
171 | __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 */ |
172 | unsigned char s_uuid[16]; /* filesystem unique identifier */ | 201 | unsigned char s_uuid[16]; /* filesystem unique identifier */ |
173 | unsigned char s_label[16]; /* filesystem volume label */ | 202 | unsigned char s_label[16]; /* filesystem volume label */ |
174 | 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 | ||
175 | * reiserfs_convert_objectid_map_v1() | 208 | * reiserfs_convert_objectid_map_v1() |
176 | * so any additions must be updated | 209 | * so any additions must be updated |
177 | * there as well. */ | 210 | * there as well. */ |
@@ -553,10 +586,8 @@ static inline int uniqueness2type(__u32 uniqueness) | |||
553 | return TYPE_DIRECT; | 586 | return TYPE_DIRECT; |
554 | case V1_DIRENTRY_UNIQUENESS: | 587 | case V1_DIRENTRY_UNIQUENESS: |
555 | return TYPE_DIRENTRY; | 588 | return TYPE_DIRENTRY; |
556 | default: | ||
557 | reiserfs_warning(NULL, "vs-500: unknown uniqueness %d", | ||
558 | uniqueness); | ||
559 | case V1_ANY_UNIQUENESS: | 589 | case V1_ANY_UNIQUENESS: |
590 | default: | ||
560 | return TYPE_ANY; | 591 | return TYPE_ANY; |
561 | } | 592 | } |
562 | } | 593 | } |
@@ -573,9 +604,8 @@ static inline __u32 type2uniqueness(int type) | |||
573 | return V1_DIRECT_UNIQUENESS; | 604 | return V1_DIRECT_UNIQUENESS; |
574 | case TYPE_DIRENTRY: | 605 | case TYPE_DIRENTRY: |
575 | return V1_DIRENTRY_UNIQUENESS; | 606 | return V1_DIRENTRY_UNIQUENESS; |
576 | default: | ||
577 | reiserfs_warning(NULL, "vs-501: unknown type %d", type); | ||
578 | case TYPE_ANY: | 607 | case TYPE_ANY: |
608 | default: | ||
579 | return V1_ANY_UNIQUENESS; | 609 | return V1_ANY_UNIQUENESS; |
580 | } | 610 | } |
581 | } | 611 | } |
@@ -687,9 +717,9 @@ static inline void cpu_key_k_offset_dec(struct cpu_key *key) | |||
687 | #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))) |
688 | #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))) |
689 | 719 | ||
690 | #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) \ |
691 | ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \ | 721 | (!COMP_SHORT_KEYS(ih, key) && \ |
692 | 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)) |
693 | 723 | ||
694 | /* maximal length of item */ | 724 | /* maximal length of item */ |
695 | #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) |
@@ -698,6 +728,7 @@ static inline void cpu_key_k_offset_dec(struct cpu_key *key) | |||
698 | /* object identifier for root dir */ | 728 | /* object identifier for root dir */ |
699 | #define REISERFS_ROOT_OBJECTID 2 | 729 | #define REISERFS_ROOT_OBJECTID 2 |
700 | #define REISERFS_ROOT_PARENT_OBJECTID 1 | 730 | #define REISERFS_ROOT_PARENT_OBJECTID 1 |
731 | |||
701 | extern struct reiserfs_key root_key; | 732 | extern struct reiserfs_key root_key; |
702 | 733 | ||
703 | /* | 734 | /* |
@@ -744,25 +775,25 @@ struct block_head { | |||
744 | #define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */ | 775 | #define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */ |
745 | 776 | ||
746 | /* 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. */ |
747 | #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)) |
748 | /* Number of items that are in buffer. */ | 779 | /* Number of items that are in buffer. */ |
749 | #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))) |
750 | #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))) |
751 | #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))) |
752 | 783 | ||
753 | #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) |
754 | #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) |
755 | #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) |
756 | 787 | ||
757 | /* Get right delimiting key. -- little endian */ | 788 | /* Get right delimiting key. -- little endian */ |
758 | #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)))) |
759 | 790 | ||
760 | /* Does the buffer contain a disk leaf. */ | 791 | /* Does the buffer contain a disk leaf. */ |
761 | #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) |
762 | 793 | ||
763 | /* Does the buffer contain a disk internal node */ | 794 | /* Does the buffer contain a disk internal node */ |
764 | #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 \ |
765 | && B_LEVEL(p_s_bh) <= MAX_HEIGHT) | 796 | && B_LEVEL(bh) <= MAX_HEIGHT) |
766 | 797 | ||
767 | /***************************************************************************/ | 798 | /***************************************************************************/ |
768 | /* STAT DATA */ | 799 | /* STAT DATA */ |
@@ -1112,12 +1143,13 @@ struct disk_child { | |||
1112 | #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) |
1113 | 1144 | ||
1114 | /* 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. */ |
1115 | #define B_N_CHILD(p_s_bh,n_pos) ((struct disk_child *)\ | 1146 | #define B_N_CHILD(bh, n_pos) ((struct disk_child *)\ |
1116 | ((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))) |
1117 | 1148 | ||
1118 | /* 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. */ |
1119 | #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))) |
1120 | #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)) | ||
1121 | 1153 | ||
1122 | /* maximal value of field child_size in structure disk_child */ | 1154 | /* maximal value of field child_size in structure disk_child */ |
1123 | /* 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 */ |
@@ -1188,33 +1220,33 @@ struct treepath { | |||
1188 | struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} | 1220 | struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} |
1189 | 1221 | ||
1190 | /* Get path element by path and path position. */ | 1222 | /* Get path element by path and path position. */ |
1191 | #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)) |
1192 | 1224 | ||
1193 | /* Get buffer header at the path by path and path position. */ | 1225 | /* Get buffer header at the path by path and path position. */ |
1194 | #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) |
1195 | 1227 | ||
1196 | /* 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. */ |
1197 | #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) |
1198 | 1230 | ||
1199 | #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)) |
1200 | /* you know, to the person who didn't | 1232 | /* you know, to the person who didn't |
1201 | write this the macro name does not | 1233 | write this the macro name does not |
1202 | at first suggest what it does. | 1234 | at first suggest what it does. |
1203 | Maybe POSITION_FROM_PATH_END? Or | 1235 | Maybe POSITION_FROM_PATH_END? Or |
1204 | maybe we should just focus on | 1236 | maybe we should just focus on |
1205 | dumping paths... -Hans */ | 1237 | dumping paths... -Hans */ |
1206 | #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)) |
1207 | 1239 | ||
1208 | #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)) |
1209 | 1241 | ||
1210 | /* 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, |
1211 | 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 */ |
1212 | #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] */ |
1213 | #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 */ |
1214 | #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)) |
1215 | #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 */ |
1216 | 1248 | ||
1217 | #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)) |
1218 | 1250 | ||
1219 | #define get_last_bh(path) PATH_PLAST_BUFFER(path) | 1251 | #define get_last_bh(path) PATH_PLAST_BUFFER(path) |
1220 | #define get_ih(path) PATH_PITEM_HEAD(path) | 1252 | #define get_ih(path) PATH_PITEM_HEAD(path) |
@@ -1444,6 +1476,16 @@ struct buffer_info { | |||
1444 | int bi_position; | 1476 | int bi_position; |
1445 | }; | 1477 | }; |
1446 | 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 | |||
1447 | /* 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. |
1448 | +-------------------+------------+--------------+------------+ | 1490 | +-------------------+------------+--------------+------------+ |
1449 | | | k_offset | k_uniqueness | mergeable? | | 1491 | | | k_offset | k_uniqueness | mergeable? | |
@@ -1494,7 +1536,7 @@ extern struct item_operations *item_ops[TYPE_ANY + 1]; | |||
1494 | #define COMP_SHORT_KEYS comp_short_keys | 1536 | #define COMP_SHORT_KEYS comp_short_keys |
1495 | 1537 | ||
1496 | /* number of blocks pointed to by the indirect item */ | 1538 | /* number of blocks pointed to by the indirect item */ |
1497 | #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) |
1498 | 1540 | ||
1499 | /* 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 */ |
1500 | #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)) |
@@ -1540,7 +1582,6 @@ struct reiserfs_iget_args { | |||
1540 | /* FUNCTION DECLARATIONS */ | 1582 | /* FUNCTION DECLARATIONS */ |
1541 | /***************************************************************************/ | 1583 | /***************************************************************************/ |
1542 | 1584 | ||
1543 | /*#ifdef __KERNEL__*/ | ||
1544 | #define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12) | 1585 | #define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12) |
1545 | 1586 | ||
1546 | #define journal_trans_half(blocksize) \ | 1587 | #define journal_trans_half(blocksize) \ |
@@ -1598,6 +1639,10 @@ struct reiserfs_journal_header { | |||
1598 | #define JOURNAL_MAX_COMMIT_AGE 30 | 1639 | #define JOURNAL_MAX_COMMIT_AGE 30 |
1599 | #define JOURNAL_MAX_TRANS_AGE 30 | 1640 | #define JOURNAL_MAX_TRANS_AGE 30 |
1600 | #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 | |||
1601 | #ifdef CONFIG_QUOTA | 1646 | #ifdef CONFIG_QUOTA |
1602 | /* We need to update data and inode (atime) */ | 1647 | /* We need to update data and inode (atime) */ |
1603 | #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) |
@@ -1672,7 +1717,7 @@ struct reiserfs_transaction_handle { | |||
1672 | int t_refcount; | 1717 | int t_refcount; |
1673 | int t_blocks_logged; /* number of blocks this writer has logged */ | 1718 | int t_blocks_logged; /* number of blocks this writer has logged */ |
1674 | int t_blocks_allocated; /* number of blocks this writer allocated */ | 1719 | int t_blocks_allocated; /* number of blocks this writer allocated */ |
1675 | 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 */ |
1676 | void *t_handle_save; /* save existing current->journal_info */ | 1721 | void *t_handle_save; /* save existing current->journal_info */ |
1677 | 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 |
1678 | should be displaced from others */ | 1723 | should be displaced from others */ |
@@ -1748,13 +1793,13 @@ int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *, | |||
1748 | int journal_mark_freed(struct reiserfs_transaction_handle *, | 1793 | int journal_mark_freed(struct reiserfs_transaction_handle *, |
1749 | struct super_block *, b_blocknr_t blocknr); | 1794 | struct super_block *, b_blocknr_t blocknr); |
1750 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); | 1795 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); |
1751 | 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, |
1752 | int bit_nr, int searchall, b_blocknr_t *next); | 1797 | int bit_nr, int searchall, b_blocknr_t *next); |
1753 | int journal_begin(struct reiserfs_transaction_handle *, | 1798 | int journal_begin(struct reiserfs_transaction_handle *, |
1754 | struct super_block *p_s_sb, unsigned long); | 1799 | struct super_block *sb, unsigned long); |
1755 | int journal_join_abort(struct reiserfs_transaction_handle *, | 1800 | int journal_join_abort(struct reiserfs_transaction_handle *, |
1756 | struct super_block *p_s_sb, unsigned long); | 1801 | struct super_block *sb, unsigned long); |
1757 | void reiserfs_journal_abort(struct super_block *sb, int errno); | 1802 | void reiserfs_abort_journal(struct super_block *sb, int errno); |
1758 | 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, ...); |
1759 | int reiserfs_allocate_list_bitmaps(struct super_block *s, | 1804 | int reiserfs_allocate_list_bitmaps(struct super_block *s, |
1760 | struct reiserfs_list_bitmap *, unsigned int); | 1805 | struct reiserfs_list_bitmap *, unsigned int); |
@@ -1771,8 +1816,8 @@ int reiserfs_convert_objectid_map_v1(struct super_block *); | |||
1771 | 1816 | ||
1772 | /* stree.c */ | 1817 | /* stree.c */ |
1773 | int B_IS_IN_TREE(const struct buffer_head *); | 1818 | int B_IS_IN_TREE(const struct buffer_head *); |
1774 | extern void copy_item_head(struct item_head *p_v_to, | 1819 | extern void copy_item_head(struct item_head *to, |
1775 | const struct item_head *p_v_from); | 1820 | const struct item_head *from); |
1776 | 1821 | ||
1777 | // first key is in cpu form, second - le | 1822 | // first key is in cpu form, second - le |
1778 | extern int comp_short_keys(const struct reiserfs_key *le_key, | 1823 | extern int comp_short_keys(const struct reiserfs_key *le_key, |
@@ -1807,20 +1852,20 @@ static inline void copy_key(struct reiserfs_key *to, | |||
1807 | memcpy(to, from, KEY_SIZE); | 1852 | memcpy(to, from, KEY_SIZE); |
1808 | } | 1853 | } |
1809 | 1854 | ||
1810 | 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); |
1811 | 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, |
1812 | const struct super_block *p_s_sb); | 1857 | const struct super_block *sb); |
1813 | int search_by_key(struct super_block *, const struct cpu_key *, | 1858 | int search_by_key(struct super_block *, const struct cpu_key *, |
1814 | struct treepath *, int); | 1859 | struct treepath *, int); |
1815 | #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) |
1816 | int search_for_position_by_key(struct super_block *p_s_sb, | 1861 | int search_for_position_by_key(struct super_block *sb, |
1817 | const struct cpu_key *p_s_cpu_key, | 1862 | const struct cpu_key *cpu_key, |
1818 | struct treepath *p_s_search_path); | 1863 | struct treepath *search_path); |
1819 | extern void decrement_bcount(struct buffer_head *p_s_bh); | 1864 | extern void decrement_bcount(struct buffer_head *bh); |
1820 | void decrement_counters_in_path(struct treepath *p_s_search_path); | 1865 | void decrement_counters_in_path(struct treepath *search_path); |
1821 | void pathrelse(struct treepath *p_s_search_path); | 1866 | void pathrelse(struct treepath *search_path); |
1822 | int reiserfs_check_path(struct treepath *p); | 1867 | int reiserfs_check_path(struct treepath *p); |
1823 | 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); |
1824 | 1869 | ||
1825 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | 1870 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, |
1826 | struct treepath *path, | 1871 | struct treepath *path, |
@@ -1843,14 +1888,14 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | |||
1843 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, | 1888 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, |
1844 | struct treepath *path, | 1889 | struct treepath *path, |
1845 | const struct cpu_key *key, | 1890 | const struct cpu_key *key, |
1846 | struct inode *inode, struct buffer_head *p_s_un_bh); | 1891 | struct inode *inode, struct buffer_head *un_bh); |
1847 | 1892 | ||
1848 | void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, | 1893 | void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, |
1849 | struct inode *inode, struct reiserfs_key *key); | 1894 | struct inode *inode, struct reiserfs_key *key); |
1850 | int reiserfs_delete_object(struct reiserfs_transaction_handle *th, | 1895 | int reiserfs_delete_object(struct reiserfs_transaction_handle *th, |
1851 | struct inode *p_s_inode); | 1896 | struct inode *inode); |
1852 | int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, | 1897 | int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, |
1853 | struct inode *p_s_inode, struct page *, | 1898 | struct inode *inode, struct page *, |
1854 | int update_timestamps); | 1899 | int update_timestamps); |
1855 | 1900 | ||
1856 | #define i_block_size(inode) ((inode)->i_sb->s_blocksize) | 1901 | #define i_block_size(inode) ((inode)->i_sb->s_blocksize) |
@@ -1894,10 +1939,12 @@ void make_le_item_head(struct item_head *ih, const struct cpu_key *key, | |||
1894 | loff_t offset, int type, int length, int entry_count); | 1939 | loff_t offset, int type, int length, int entry_count); |
1895 | 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); |
1896 | 1941 | ||
1942 | struct reiserfs_security_handle; | ||
1897 | int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | 1943 | int reiserfs_new_inode(struct reiserfs_transaction_handle *th, |
1898 | struct inode *dir, int mode, | 1944 | struct inode *dir, int mode, |
1899 | const char *symname, loff_t i_size, | 1945 | const char *symname, loff_t i_size, |
1900 | struct dentry *dentry, struct inode *inode); | 1946 | struct dentry *dentry, struct inode *inode, |
1947 | struct reiserfs_security_handle *security); | ||
1901 | 1948 | ||
1902 | void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, | 1949 | void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, |
1903 | struct inode *inode, loff_t size); | 1950 | struct inode *inode, loff_t size); |
@@ -1955,7 +2002,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | |||
1955 | #define PROC_INFO_MAX( sb, field, value ) VOID_V | 2002 | #define PROC_INFO_MAX( sb, field, value ) VOID_V |
1956 | #define PROC_INFO_INC( sb, field ) VOID_V | 2003 | #define PROC_INFO_INC( sb, field ) VOID_V |
1957 | #define PROC_INFO_ADD( sb, field, val ) VOID_V | 2004 | #define PROC_INFO_ADD( sb, field, val ) VOID_V |
1958 | #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 |
1959 | #endif | 2006 | #endif |
1960 | 2007 | ||
1961 | /* dir.c */ | 2008 | /* dir.c */ |
@@ -1963,6 +2010,7 @@ extern const struct inode_operations reiserfs_dir_inode_operations; | |||
1963 | extern const struct inode_operations reiserfs_symlink_inode_operations; | 2010 | extern const struct inode_operations reiserfs_symlink_inode_operations; |
1964 | extern const struct inode_operations reiserfs_special_inode_operations; | 2011 | extern const struct inode_operations reiserfs_special_inode_operations; |
1965 | 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 *); | ||
1966 | 2014 | ||
1967 | /* tail_conversion.c */ | 2015 | /* tail_conversion.c */ |
1968 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, | 2016 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, |
@@ -1979,13 +2027,20 @@ extern const struct address_space_operations reiserfs_address_space_operations; | |||
1979 | 2027 | ||
1980 | /* fix_nodes.c */ | 2028 | /* fix_nodes.c */ |
1981 | 2029 | ||
1982 | 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, |
1983 | struct item_head *p_s_ins_ih, const void *); | 2031 | struct item_head *ins_ih, const void *); |
1984 | void unfix_nodes(struct tree_balance *); | 2032 | void unfix_nodes(struct tree_balance *); |
1985 | 2033 | ||
1986 | /* prints.c */ | 2034 | /* prints.c */ |
1987 | 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, ...) | ||
1988 | __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) | ||
1989 | void reiserfs_info(struct super_block *s, const char *fmt, ...); | 2044 | void reiserfs_info(struct super_block *s, const char *fmt, ...); |
1990 | 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, ...); |
1991 | void print_indirect_item(struct buffer_head *bh, int item_num); | 2046 | void print_indirect_item(struct buffer_head *bh, int item_num); |
@@ -2022,7 +2077,7 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num, | |||
2022 | int zeros_number); | 2077 | int zeros_number); |
2023 | 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, |
2024 | int pos_in_item, int cut_size); | 2079 | int pos_in_item, int cut_size); |
2025 | 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, |
2026 | int new_entry_count, struct reiserfs_de_head *new_dehs, | 2081 | int new_entry_count, struct reiserfs_de_head *new_dehs, |
2027 | const char *records, int paste_size); | 2082 | const char *records, int paste_size); |
2028 | /* ibalance.c */ | 2083 | /* ibalance.c */ |
@@ -2178,29 +2233,6 @@ long reiserfs_compat_ioctl(struct file *filp, | |||
2178 | unsigned int cmd, unsigned long arg); | 2233 | unsigned int cmd, unsigned long arg); |
2179 | int reiserfs_unpack(struct inode *inode, struct file *filp); | 2234 | int reiserfs_unpack(struct inode *inode, struct file *filp); |
2180 | 2235 | ||
2181 | /* ioctl's command */ | 2236 | #endif /* __KERNEL__ */ |
2182 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) | ||
2183 | /* define following flags to be the same as in ext2, so that chattr(1), | ||
2184 | lsattr(1) will work with us. */ | ||
2185 | #define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS | ||
2186 | #define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS | ||
2187 | #define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION | ||
2188 | #define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION | ||
2189 | |||
2190 | /* the 32 bit compat definitions with int argument */ | ||
2191 | #define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int) | ||
2192 | #define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
2193 | #define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
2194 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
2195 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
2196 | |||
2197 | /* Locking primitives */ | ||
2198 | /* Right now we are still falling back to (un)lock_kernel, but eventually that | ||
2199 | would evolve into real per-fs locks */ | ||
2200 | #define reiserfs_write_lock( sb ) lock_kernel() | ||
2201 | #define reiserfs_write_unlock( sb ) unlock_kernel() | ||
2202 | |||
2203 | /* xattr stuff */ | ||
2204 | #define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem) | ||
2205 | 2237 | ||
2206 | #endif /* _LINUX_REISER_FS_H */ | 2238 | #endif /* _LINUX_REISER_FS_H */ |