diff -rup linux-2.4.7-ac1/fs/reiserfs/buffer2.c linux-2.4.7-ac1.patched/fs/reiserfs/buffer2.c
--- linux-2.4.7-ac1/fs/reiserfs/buffer2.c Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/buffer2.c Fri Jul 27 22:27:14 2001
@@ -33,7 +33,7 @@
hold we did free all buffers in tree balance structure
(get_empty_nodes and get_nodes_for_preserving) or in path structure
only (get_new_buffer) just before calling this */
-void wait_buffer_until_released (struct buffer_head * bh)
+void wait_buffer_until_released (const struct buffer_head * bh)
{
int repeat_counter = 0;
/* buffer is in current transaction */
-inline int buffer_journaled(struct buffer_head *bh) {
+inline int buffer_journaled(const struct buffer_head *bh) {
if (bh)
- return test_bit(BH_JDirty, &bh->b_state) ;
+ return test_bit(BH_JDirty, ( struct buffer_head * ) &bh->b_state) ;
else
return 0 ;
}
@@ -385,9 +385,9 @@ inline int buffer_journaled(struct buffe
/* disk block was taken off free list before being in a finished transation, or written to disk
** journal_new blocks can be reused immediately, for any purpose
*/
-inline int buffer_journal_new(struct buffer_head *bh) {
+inline int buffer_journal_new(const struct buffer_head *bh) {
if (bh)
- return test_bit(BH_JNew, &bh->b_state) ;
+ return test_bit(BH_JNew, ( struct buffer_head * )&bh->b_state) ;
else
return 0 ;
}
@@ -731,8 +731,8 @@ reiserfs_panic(s, "journal-539: flush_co
retry_count++ ;
goto retry;
}
- reiserfs_panic(s, "journal-563: flush_commit_list: BAD, j_commit_left is %lu, should be 1\n",
- atomic_read(&(jl->j_commit_left)));
+ reiserfs_panic(s, "journal-563: flush_commit_list: BAD, j_commit_left is %u, should be 1\n",
+ atomic_read(&(jl->j_commit_left)));
}
mark_buffer_dirty(jl->j_commit_bh) ;
@@ -861,7 +861,7 @@ static int flush_older_journal_lists(str
static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate) {
if (buffer_journaled(bh)) {
- reiserfs_warning("clm-2084: pinned buffer %u:%s sent to disk\n",
+ reiserfs_warning("clm-2084: pinned buffer %lu:%s sent to disk\n",
bh->b_blocknr, kdevname(bh->b_dev)) ;
}
mark_buffer_uptodate(bh, uptodate) ;
@@ -2102,7 +2102,7 @@ int journal_mark_dirty(struct reiserfs_t
}
if (th->t_trans_id != SB_JOURNAL(p_s_sb)->j_trans_id) {
- reiserfs_panic(th->t_super, "journal-1577: handle trans id %d != current trans id %d\n",
+ reiserfs_panic(th->t_super, "journal-1577: handle trans id %ld != current trans id %ld\n",
th->t_trans_id, SB_JOURNAL(p_s_sb)->j_trans_id);
}
p_s_sb->s_dirt = 1 ;
@@ -2440,7 +2440,7 @@ static int check_journal_end(struct reis
int wait_on_commit = flags & WAIT ;
if (th->t_trans_id != SB_JOURNAL(p_s_sb)->j_trans_id) {
- reiserfs_panic(th->t_super, "journal-1577: handle trans id %d != current trans id %d\n",
+ reiserfs_panic(th->t_super, "journal-1577: handle trans id %ld != current trans id %ld\n",
th->t_trans_id, SB_JOURNAL(p_s_sb)->j_trans_id);
}
@@ -2511,7 +2511,7 @@ static int check_journal_end(struct reis
}
if (SB_JOURNAL(p_s_sb)->j_start > JOURNAL_BLOCK_COUNT) {
- reiserfs_panic(p_s_sb, "journal-003: journal_end: j_start (%d) is too high\n", SB_JOURNAL(p_s_sb)->j_start) ;
+ reiserfs_panic(p_s_sb, "journal-003: journal_end: j_start (%ld) is too high\n", SB_JOURNAL(p_s_sb)->j_start) ;
}
return 1 ;
}
diff -rup linux-2.4.7-ac1/fs/reiserfs/lbalance.c linux-2.4.7-ac1.patched/fs/reiserfs/lbalance.c
--- linux-2.4.7-ac1/fs/reiserfs/lbalance.c Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/lbalance.c Fri Jul 27 22:27:14 2001
@@ -215,7 +215,8 @@ static int leaf_copy_boundary_item (stru
/* merge to right only part of item */
RFALSE( le16_to_cpu (ih->ih_item_len) <= bytes_or_entries,
"vs-10060: no so much bytes %lu (needed %lu)",
- ih->ih_item_len, bytes_or_entries);
+ ( long unsigned ) ih->ih_item_len,
+ ( long unsigned ) bytes_or_entries);
/* change first item key of the DEST */
if ( is_direct_le_ih (dih) ) {
@@ -318,7 +319,7 @@ static void leaf_copy_items_entirely (st
if (dest_bi->bi_parent) {
RFALSE( B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number != dest->b_blocknr,
"vs-10160: block number in bh does not match to field in disk_child structure %lu and %lu",
- dest->b_blocknr, B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number);
+ ( long unsigned ) dest->b_blocknr, ( long unsigned ) B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number);
B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_size +=
j - last_inserted_loc + IH_SIZE * cpy_num;
@@ -354,7 +355,7 @@ static void leaf_item_bottle (struct buf
RFALSE( cpy_bytes == le16_to_cpu (ih->ih_item_len) &&
get_ih_free_space (ih),
"vs-10180: when whole indirect item is bottle to left neighbor, it must have free_space==0 (not %lu)",
- get_ih_free_space (ih));
+ ( long unsigned ) get_ih_free_space (ih));
set_ih_free_space (&n_ih, 0);
}
@@ -979,7 +980,9 @@ void leaf_cut_from_buffer (struct buffer
RFALSE( pos_in_item &&
pos_in_item + cut_size != le16_to_cpu (ih->ih_item_len),
"invalid offset (%lu) or trunc_size (%lu) or ih_item_len (%lu)",
- pos_in_item, cut_size, le16_to_cpu (ih->ih_item_len));
+ ( long unsigned ) pos_in_item,
+ ( long unsigned ) cut_size,
+ ( long unsigned ) le16_to_cpu (ih->ih_item_len));
/* shift item body to left if cut is from the head of item */
if (pos_in_item == 0) {
diff -rup linux-2.4.7-ac1/fs/reiserfs/namei.c linux-2.4.7-ac1.patched/fs/reiserfs/namei.c
--- linux-2.4.7-ac1/fs/reiserfs/namei.c Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/namei.c Fri Jul 27 22:27:14 2001
@@ -125,7 +125,7 @@ entry position in the item
*/
/* The function is NOT SCHEDULE-SAFE! */
-int search_by_entry_key (struct super_block * sb, struct cpu_key * key,
+int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
struct path * path, struct reiserfs_dir_entry * de)
{
int retval;
diff -rup linux-2.4.7-ac1/fs/reiserfs/objectid.c linux-2.4.7-ac1.patched/fs/reiserfs/objectid.c
--- linux-2.4.7-ac1/fs/reiserfs/objectid.c Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/objectid.c Fri Jul 27 22:27:14 2001
@@ -21,7 +21,7 @@ static void check_objectid_map (struct s
{
if (le32_to_cpu (map[0]) != 1)
reiserfs_panic (s, "vs-15010: check_objectid_map: map corrupted: %lx",
- le32_to_cpu (map[0]));
+ ( long unsigned int ) le32_to_cpu (map[0]));
// FIXME: add something else here
}
@@ -161,7 +161,7 @@ void reiserfs_release_objectid (struct r
}
reiserfs_warning ("vs-15010: reiserfs_release_objectid: tried to free free object id (%lu)",
- objectid_to_release);
+ ( long unsigned ) objectid_to_release);
}
/* Does the buffer contain a disk block which is in the tree. */
-inline int B_IS_IN_TREE (struct buffer_head * p_s_bh)
+inline int B_IS_IN_TREE (const struct buffer_head * p_s_bh)
{
// this does not say which one is bigger, it only returns 1 if keys
// are not equal, 0 otherwise
-inline int comp_le_keys (struct key * k1, struct key * k2)
+inline int comp_le_keys (const struct key * k1, const struct key * k2)
{
return memcmp (k1, k2, sizeof (struct key));
}
@@ -255,8 +258,8 @@ inline int comp_le_keys (struct key * k1
cut the number of possible items it could be by one more than half rounded down,
or we find it. */
inline int bin_search (
- void * p_v_key, /* Key to search for. */
- void * p_v_base, /* First item in the array. */
+ const void * p_v_key, /* Key to search for. */
+ const void * p_v_base,/* First item in the array. */
int p_n_num, /* Number of items in the array. */
int p_n_width, /* Item size in the array.
searched. Lest the reader be
@@ -290,19 +293,19 @@ extern struct tree_balance * cur_tb;
/* Minimal possible key. It is never in the tree. */
-struct key MIN_KEY = {0, 0, {{0, 0},}};
+const struct key MIN_KEY = {0, 0, {{0, 0},}};
/* Maximal possible key. It is never in the tree. */
-struct key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}};
+const struct key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}};
/* Get delimiting key of the buffer by looking for it in the buffers in the path, starting from the bottom
of the path, and going upwards. We must check the path's validity at each step. If the key is not in
the path, there is no delimiting key in the tree (buffer is first or last buffer in tree), and in this
case we return a special key, either MIN_KEY or MAX_KEY. */
-inline struct key * get_lkey (
- struct path * p_s_chk_path,
- struct super_block * p_s_sb
+inline const struct key * get_lkey (
+ const struct path * p_s_chk_path,
+ const struct super_block * p_s_sb
) {
int n_position, n_path_offset = p_s_chk_path->path_length;
struct buffer_head * p_s_parent;
@@ -339,9 +342,9 @@ inline struct key * get_lkey (
/* Get delimiting key of the buffer at the path and its right neighbor. */
-inline struct key * get_rkey (
- struct path * p_s_chk_path,
- struct super_block * p_s_sb
+inline const struct key * get_rkey (
+ const struct path * p_s_chk_path,
+ const struct super_block * p_s_sb
) {
int n_position,
n_path_offset = p_s_chk_path->path_length;
@@ -384,7 +387,7 @@ inline struct key * get_rkey (
this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */
static inline int key_in_buffer (
struct path * p_s_chk_path, /* Path which should be checked. */
- struct cpu_key * p_s_key, /* Key which should be checked. */
+ const struct cpu_key * p_s_key, /* Key which should be checked. */
struct super_block * p_s_sb /* Super block pointer. */
) {
@@ -635,7 +638,7 @@ static void search_by_key_reada (struct
correctness of the bottom of the path */
/* The function is NOT SCHEDULE-SAFE! */
int search_by_key (struct super_block * p_s_sb,
- struct cpu_key * p_s_key, /* Key to search. */
+ const struct cpu_key * p_s_key, /* Key to search. */
struct path * p_s_search_path, /* This structure was
allocated and initialized
by the calling
@@ -729,7 +732,8 @@ int search_by_key (struct super_block *
// certain level
if (!is_tree_node (p_s_bh, expected_level)) {
reiserfs_warning ("vs-5150: search_by_key: "
- "invalid format found in block %d. Fsck?\n", p_s_bh->b_blocknr);
+ "invalid format found in block %ld. Fsck?\n",
+ p_s_bh->b_blocknr);
pathrelse (p_s_search_path);
return IO_ERROR;
}
@@ -738,7 +742,7 @@ int search_by_key (struct super_block *
n_node_level = B_LEVEL (p_s_bh);
RFALSE( n_node_level < n_stop_level,
- "vs-5152: tree level is less than stop level (%d)",
+ "vs-5152: tree level (%d) is less than stop level (%d)",
n_node_level, n_stop_level);
/* The function is NOT SCHEDULE-SAFE! */
int search_for_position_by_key (struct super_block * p_s_sb, /* Pointer to the super block. */
- struct cpu_key * p_cpu_key, /* Key to search (cpu variable) */
+ const struct cpu_key * p_cpu_key, /* Key to search (cpu variable) */
struct path * p_s_search_path /* Filled up by this function. */
) {
struct item_head * p_le_ih; /* pointer to on-disk structure */
@@ -855,7 +859,7 @@ int search_for_position_by_key (struct s
/* Compare given item and item pointed to by the path. */
-int comp_items (struct item_head * stored_ih, struct path * p_s_path)
+int comp_items (const struct item_head * stored_ih, const struct path * p_s_path)
{
struct buffer_head * p_s_bh;
struct item_head * ih;
@@ -871,23 +875,6 @@ int comp_items (struct item_head * store
/* we need only to know, whether it is the same item */
ih = get_ih (p_s_path);
return memcmp (stored_ih, ih, IH_SIZE);
-
-#if 0
- /* Get item at the path. */
- p_s_path_item = PATH_PITEM_HEAD(p_s_path);
- /* Compare keys. */
- if ( COMP_KEYS(&(p_s_path_item->ih_key), &(p_cpu_ih->ih_key)) )
- return 1;
-
- /* Compare other items fields. */
- if ( le16_to_cpu (p_s_path_item->u.ih_entry_count) != p_cpu_ih->u.ih_entry_count ||
- le16_to_cpu (p_s_path_item->ih_item_len) != p_cpu_ih->ih_item_len ||
- le16_to_cpu ( p_s_path_item->ih_item_location) != p_cpu_ih->ih_item_location )
- return 1;
-
- /* Items are equal. */
- return 0;
-#endif
}
@@ -983,7 +970,7 @@ static char prepare_for_delete_or_cut(
struct reiserfs_transaction_handle *th,
struct inode * inode,
struct path * p_s_path,
- struct cpu_key * p_s_item_key,
+ const struct cpu_key * p_s_item_key,
int * p_n_removed, /* Number of unformatted nodes which were removed
from end of the file. */
int * p_n_cut_size,
@@ -1277,7 +1264,7 @@ void padd_item (char * item, int total_l
/* Delete object item. */
int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
struct path * p_s_path, /* Path to the deleted item. */
- struct cpu_key * p_s_item_key, /* Key to search for the deleted item. */
+ const struct cpu_key * p_s_item_key, /* Key to search for the deleted item. */
struct inode * p_s_inode,/* inode is here just to update i_blocks */
struct buffer_head * p_s_un_bh) /* NULL or unformatted node pointer. */
{
@@ -1475,7 +1462,7 @@ static int maybe_indirect_to_direct (str
struct inode * p_s_inode,
struct page *page,
struct path * p_s_path,
- struct cpu_key * p_s_item_key,
+ const struct cpu_key * p_s_item_key,
loff_t n_new_file_size,
char * p_c_mode
) {
@@ -1635,7 +1622,7 @@ int reiserfs_cut_from_item (struct reise
indirect_to_direct_roll_back (th, p_s_inode, p_s_path);
}
if (n_ret_value == NO_DISK_SPACE)
- reiserfs_warning ("");
+ reiserfs_warning ("NO_DISK_SPACE");
unfix_nodes (&s_cut_balance);
return -EIO;
}
@@ -1674,7 +1661,7 @@ int reiserfs_cut_from_item (struct reise
if (c_mode == M_DELETE && le16_to_cpu (le_ih->ih_item_len) != UNFM_P_SIZE)
reiserfs_panic (p_s_sb, "vs-5653: reiserfs_cut_from_item: "
- "completing indirect2direct conversion indirect item %h"
+ "completing indirect2direct conversion indirect item %h "
"being deleted must be of 4 byte long", le_ih);
#ifdef CONFIG_REISERFS_CHECK
// this makes sure, that we __append__, not overwrite or add holes
-static void check_research_for_paste (struct path * path, struct cpu_key * p_s_key)
+static void check_research_for_paste (struct path * path,
+ const struct cpu_key * p_s_key)
{
struct item_head * found_ih = get_ih (path);
@@ -1871,7 +1859,7 @@ static void check_research_for_paste (st
/* Paste bytes to the existing item. Returns bytes number pasted into the item. */
int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th,
struct path * p_s_search_path, /* Path to the pasted item. */
- struct cpu_key * p_s_key, /* Key to search for the needed item.*/
+ const struct cpu_key * p_s_key, /* Key to search for the needed item.*/
const char * p_c_body, /* Pointer to the bytes to paste. */
int n_pasted_size) /* Size of pasted bytes. */
{
@@ -1915,7 +1903,7 @@ error_out:
/* Insert new item into the buffer at the path. */
int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
struct path * p_s_path, /* Path to the inserteded item. */
- struct cpu_key * key,
+ const struct cpu_key * key,
struct item_head * p_s_ih, /* Pointer to the item header to insert.*/
const char * p_c_body) /* Pointer to the bytes to insert. */
{
diff -rup linux-2.4.7-ac1/fs/reiserfs/super.c linux-2.4.7-ac1.patched/fs/reiserfs/super.c
--- linux-2.4.7-ac1/fs/reiserfs/super.c Fri Jul 27 22:16:50 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/super.c Fri Jul 27 22:27:14 2001
@@ -26,13 +26,8 @@
#define REISERFS_SUPER_MAGIC_STRING_OFFSET_NJ 20
-#if 0
-// this one is not used currently
-inline void reiserfs_mark_buffer_dirty (struct buffer_head * bh, int flag)
-{
- mark_buffer_dirty (bh, flag);
-}
-#endif
+char reiserfs_super_magic_string[] = REISERFS_SUPER_MAGIC_STRING;
+char reiser2fs_super_magic_string[] = REISER2FS_SUPER_MAGIC_STRING;
//
// a portion of this function, particularly the VFS interface portion,
diff -rup linux-2.4.7-ac1/fs/reiserfs/tail_conversion.c linux-2.4.7-ac1.patched/fs/reiserfs/tail_conversion.c
--- linux-2.4.7-ac1/fs/reiserfs/tail_conversion.c Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/tail_conversion.c Fri Jul 27 22:27:14 2001
@@ -189,7 +189,7 @@ int indirect2direct (struct reiserfs_tra
struct inode * p_s_inode,
struct page *page,
struct path * p_s_path, /* path to the indirect item. */
- struct cpu_key * p_s_item_key, /* Key to look for unformatted node pointer to be cut. */
+ const struct cpu_key * p_s_item_key, /* Key to look for unformatted node pointer to be cut. */
loff_t n_new_file_size, /* New file size. */
char * p_c_mode)
{
diff -rup linux-2.4.7-ac1/include/linux/reiserfs_fs.h linux-2.4.7-ac1.patched/include/linux/reiserfs_fs.h
--- linux-2.4.7-ac1/include/linux/reiserfs_fs.h Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/include/linux/reiserfs_fs.h Fri Jul 27 22:27:14 2001
@@ -114,6 +114,7 @@ if( !( cond ) ) \
#define RFALSE( cond, format, args... ) do {;} while( 0 )
#endif
/* ReiserFS leaves the first 64k unused,
@@ -198,41 +202,11 @@ struct unfm_nodeinfo {
*/
#define MIN_PACK_ON_CLOSE 512
-/* the defines below say, that if file size is >=
- DIRECT_TAIL_SUPPRESSION_SIZE * blocksize, then if tail is longer
- than MAX_BYTES_SUPPRESS_DIRECT_TAIL, it will be stored in
- unformatted node */
-#define DIRECT_TAIL_SUPPRESSION_SIZE 1024
-#define MAX_BYTES_SUPPRESS_DIRECT_TAIL 1024
-
-#if 0
-
-//
-#define mark_file_with_tail(inode,offset) \
-{\
-inode->u.reiserfs_i.i_has_tail = 1;\
-}
-
-#define mark_file_without_tail(inode) \
-{\
-inode->u.reiserfs_i.i_has_tail = 0;\
-}
-
-#endif
-
// this says about version of all items (but stat data) the object
// consists of
#define inode_items_version(inode) ((inode)->u.reiserfs_i.i_version)
-/* We store tail in unformatted node if it is too big to fit into a
- formatted node or if DIRECT_TAIL_SUPPRESSION_SIZE,
- MAX_BYTES_SUPPRESS_DIRECT_TAIL and file size say that. */
-/* #define STORE_TAIL_IN_UNFM(n_file_size,n_tail_size,n_block_size) \ */
-/* ( ((n_tail_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) || \ */
-/* ( ( (n_file_size) >= (n_block_size) * DIRECT_TAIL_SUPPRESSION_SIZE ) && \ */
-/* ( (n_tail_size) >= MAX_BYTES_SUPPRESS_DIRECT_TAIL ) ) ) */
-
/* This is an aggressive tail suppression policy, I am hoping it
improves our benchmarks. The principle behind it is that
percentage space saving is what matters, not absolute space
@@ -423,7 +397,7 @@ struct item_head
// FIXME: now would that work for other than i386 archs
-#define unreachable_item(ih) (ih->ih_version & (1 << 15))
+#define unreachable_item(ih) (ih_version (ih) & (1 << 15))
@@ -1153,7 +1129,7 @@ struct path var = {ILLEGAL_PATH_ELEMENT_
// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
#define U32_MAX (~(__u32)0)
-extern inline loff_t max_reiserfs_offset (struct inode * inode)
+extern inline loff_t max_reiserfs_offset (const struct inode * inode)
{
if (inode_items_version (inode) == ITEM_VERSION_1)
return (loff_t)U32_MAX;
@@ -1322,41 +1298,6 @@ struct tree_balance
see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */
} ;
-
-#if 0
- /* when balancing we potentially affect a 3 node wide column of nodes
- in the tree (the top of the column may be tapered). C is the nodes
- at the center of this column, and L and R are the nodes to the
- left and right. */
- struct seal * L_path_seals[MAX_HEIGHT];
- struct seal * C_path_seals[MAX_HEIGHT];
- struct seal * R_path_seals[MAX_HEIGHT];
- char L_path_lock_types[MAX_HEIGHT]; /* 'r', 'w', or 'n' for read, write, or none */
- char C_path_lock_types[MAX_HEIGHT];
- char R_path_lock_types[MAX_HEIGHT];
-
-
- struct seal_list_elem * C_seal[MAX_HEIGHT]; /* array of seals on nodes in the path */
- struct seal_list_elem * L_seal[MAX_HEIGHT]; /* array of seals on left neighbors of nodes in the path */
- struct seal_list_elem * R_seal[MAX_HEIGHT]; /* array of seals on right neighbors of nodes in the path*/
- struct seal_list_elem * FL_seal[MAX_HEIGHT]; /* array of seals on fathers of the left neighbors */
- struct seal_list_elem * FR_seal[MAX_HEIGHT]; /* array of seals on fathers of the right neighbors */
- struct seal_list_elem * CFL_seal[MAX_HEIGHT]; /* array of seals on common parents of center node and its left neighbor */
- struct seal_list_elem * CFR_seal[MAX_HEIGHT]; /* array of seals on common parents of center node and its right neighbor */
-
- struct char C_desired_lock_type[MAX_HEIGHT]; /* 'r', 'w', or 'n' for read, write, or none */
- struct char L_desired_lock_type[MAX_HEIGHT];
- struct char R_desired_lock_type[MAX_HEIGHT];
- struct char FL_desired_lock_type[MAX_HEIGHT];
- struct char FR_desired_lock_type[MAX_HEIGHT];
- struct char CFL_desired_lock_type[MAX_HEIGHT];
- struct char CFR_desired_lock_type[MAX_HEIGHT];
-#endif
-
-
-
-
-
/* These are modes of balancing */
/* When inserting an item. */
@@ -1497,28 +1438,6 @@ extern struct item_operations * item_ops
#define B_I_POS_UNFM_POINTER(bh,ih,pos) (*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)))
#define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0)
-/* Reiserfs buffer cache statistics. */
-#ifdef REISERFS_CACHE_STAT
- struct reiserfs_cache_stat
- {
- int nr_reiserfs_ll_r_block; /* Number of block reads. */
- int nr_reiserfs_ll_w_block; /* Number of block writes. */
- int nr_reiserfs_schedule; /* Number of locked buffers waits. */
- unsigned long nr_reiserfs_bread; /* Number of calls to reiserfs_bread function */
- unsigned long nr_returns; /* Number of breads of buffers that were hoped to contain a key but did not after bread completed
- (usually due to object shifting while bread was executing.)
- In the code this manifests as the number
- of times that the repeat variable is nonzero in search_by_key.*/
- unsigned long nr_fixed; /* number of calls of fix_nodes function */
- unsigned long nr_failed; /* number of calls of fix_nodes in which schedule occurred while the function worked */
- unsigned long nr_find1; /* How many times we access a child buffer using its direct pointer from an internal node.*/
- unsigned long nr_find2; /* Number of times there is neither a direct pointer to
- nor any entry in the child list pointing to the buffer. */
- unsigned long nr_find3; /* When parent is locked (meaning that there are no direct pointers)
- or parent is leaf and buffer to be found is an unformatted node. */
- } cache_stat;
-#endif
-
struct reiserfs_iget4_args {
__u32 objectid ;
} ;
@@ -1623,7 +1542,7 @@ void flush_async_commits(struct super_bl
int remove_from_transaction(struct super_block *p_s_sb, unsigned long blocknr, int already_cleaned) ;
int remove_from_journal_list(struct super_block *s, struct reiserfs_journal_list *jl, struct buffer_head *bh, int remove_freed) ;
-int buffer_journaled(struct buffer_head *bh) ;
+int buffer_journaled(const struct buffer_head *bh) ;
int mark_buffer_journal_new(struct buffer_head *bh) ;
int reiserfs_sync_all_buffers(kdev_t dev, int wait) ;
int reiserfs_sync_buffers(kdev_t dev, int wait) ;
@@ -1635,17 +1554,17 @@ int reiserfs_remove_page_from_flush_list
int reiserfs_allocate_list_bitmaps(struct super_block *s, struct reiserfs_list_bitmap *, int) ;
/* why is this kerplunked right here? */
-static inline int reiserfs_buffer_prepared(struct buffer_head *bh) {
- if (bh && test_bit(BH_JPrepared, &bh->b_state))
+static inline int reiserfs_buffer_prepared(const struct buffer_head *bh) {
+ if (bh && test_bit(BH_JPrepared, ( struct buffer_head * ) &bh->b_state))
return 1 ;
else
return 0 ;
}
/* buffer was journaled, waiting to get to disk */
-static inline int buffer_journal_dirty(struct buffer_head *bh) {
+static inline int buffer_journal_dirty(const struct buffer_head *bh) {
if (bh)
- return test_bit(BH_JDirty_wait, &bh->b_state) ;
+ return test_bit(BH_JDirty_wait, ( struct buffer_head * ) &bh->b_state) ;
else
return 0 ;
}
@@ -1667,29 +1586,32 @@ void reiserfs_release_objectid (struct r
int reiserfs_convert_objectid_map_v1(struct super_block *) ;
// both are in le form
-extern inline int comp_le_keys (struct key *, struct key *);
-extern inline int comp_short_le_keys (struct key *, struct key *);
+extern inline int comp_le_keys (const struct key *, const struct key *);
+extern inline int comp_short_le_keys (const struct key *, const struct key *);
//
// get key version from on disk key - kludge
//
-extern inline int le_key_version (struct key * key)
+extern inline int le_key_version (const struct key * key)
{
int type;
@@ -1702,18 +1624,23 @@ extern inline int le_key_version (struct
}
/* the ext2 bit routines adjust for big or little endian as
** appropriate for the arch, so in our laziness we use them rather
@@ -1969,7 +1903,7 @@ char *reiserfs_get_version_string(void)
#ifdef __i386__
extern __inline__ int
-find_first_nonzero_bit(void * addr, unsigned size) {
+find_first_nonzero_bit(const void * addr, unsigned size) {
int res;
int __d0;
void *__d1;
@@ -1997,7 +1931,8 @@ find_first_nonzero_bit(void * addr, unsi
#else /* __i386__ */
-extern __inline__ int find_next_nonzero_bit(void * addr, unsigned size, unsigned offset)
+extern __inline__ int find_next_nonzero_bit(const void * addr,
+ unsigned size, unsigned offset)
{
unsigned int * p = ((unsigned int *) addr) + (offset >> 5);
unsigned int result = offset & ~31UL;
@@ -2045,10 +1980,10 @@ found_middle:
absolutely safe */
#define SPARE_SPACE 500