Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
866aa8f7
Commit
866aa8f7
authored
Jul 14, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://thebsh.namesys.com/bk/reiser3-linux-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
964f2d4d
0b2f5974
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
116 deletions
+17
-116
fs/reiserfs/Makefile
fs/reiserfs/Makefile
+1
-1
fs/reiserfs/buffer2.c
fs/reiserfs/buffer2.c
+0
-69
fs/reiserfs/do_balan.c
fs/reiserfs/do_balan.c
+2
-6
fs/reiserfs/fix_node.c
fs/reiserfs/fix_node.c
+8
-25
fs/reiserfs/ibalance.c
fs/reiserfs/ibalance.c
+3
-4
fs/reiserfs/stree.c
fs/reiserfs/stree.c
+1
-1
fs/reiserfs/super.c
fs/reiserfs/super.c
+2
-2
include/linux/reiserfs_fs.h
include/linux/reiserfs_fs.h
+0
-8
No files found.
fs/reiserfs/Makefile
View file @
866aa8f7
...
...
@@ -6,7 +6,7 @@ obj-$(CONFIG_REISERFS_FS) += reiserfs.o
reiserfs-objs
:=
bitmap.o do_balan.o namei.o inode.o file.o dir.o fix_node.o
\
super.o prints.o objectid.o lbalance.o ibalance.o stree.o
\
hashes.o
buffer2.o
tail_conversion.o journal.o resize.o
\
hashes.o tail_conversion.o journal.o resize.o
\
item_ops.o ioctl.o procfs.o
# gcc -O2 (the kernel default) is overaggressive on ppc32 when many inline
...
...
fs/reiserfs/buffer2.c
deleted
100644 → 0
View file @
964f2d4d
/*
* Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
*/
#include <linux/config.h>
#include <linux/time.h>
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
#include <linux/kernel_stat.h>
#include <linux/buffer_head.h>
/*
* wait_buffer_until_released
* reiserfs_bread
*/
/* when we allocate a new block (get_new_buffer, get_empty_nodes) and
get buffer for it, it is possible that it is held by someone else
or even by this process. In this function we wait until all other
holders release buffer. To make sure, that current process does not
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
(
const
struct
buffer_head
*
bh
)
{
int
repeat_counter
=
0
;
/*
* FIXME! Temporary cludge until ReiserFS people tell what they
* actually are trying to protect against!
*/
if
(
1
)
return
;
while
(
atomic_read
(
&
(
bh
->
b_count
))
>
1
)
{
if
(
!
(
++
repeat_counter
%
30000000
)
)
{
reiserfs_warning
(
"vs-3050: wait_buffer_until_released: nobody releases buffer (%b). Still waiting (%d) %cJDIRTY %cJWAIT
\n
"
,
bh
,
repeat_counter
,
buffer_journaled
(
bh
)
?
' '
:
'!'
,
buffer_journal_dirty
(
bh
)
?
' '
:
'!'
);
}
blk_run_queues
();
yield
();
}
if
(
repeat_counter
>
30000000
)
{
reiserfs_warning
(
"vs-3051: done waiting, ignore vs-3050 messages for (%b)
\n
"
,
bh
)
;
}
}
/*
* reiserfs_bread() reads a specified block and returns the buffer that contains
* it. It returns NULL if the block was unreadable.
*/
/* It first tries to find the block in cache, and if it cannot do so
then it creates a new buffer and schedules I/O to read the
block. */
/* The function is NOT SCHEDULE-SAFE! */
struct
buffer_head
*
reiserfs_bread
(
struct
super_block
*
super
,
int
n_block
)
{
struct
buffer_head
*
result
;
PROC_EXP
(
unsigned
int
ctx_switches
=
nr_context_switches
()
);
result
=
sb_bread
(
super
,
n_block
);
PROC_INFO_INC
(
super
,
breads
);
PROC_EXP
(
if
(
nr_context_switches
()
!=
ctx_switches
)
PROC_INFO_INC
(
super
,
bread_miss
)
);
return
result
;
}
fs/reiserfs/do_balan.c
View file @
866aa8f7
...
...
@@ -1078,13 +1078,9 @@ static int balance_leaf (struct tree_balance * tb,
memcpy
(
insert_key
+
i
,
B_N_PKEY
(
S_new
[
i
],
0
),
KEY_SIZE
);
insert_ptr
[
i
]
=
S_new
[
i
];
RFALSE
(
(
atomic_read
(
&
(
S_new
[
i
]
->
b_count
))
!=
1
)
&&
(
atomic_read
(
&
(
S_new
[
i
]
->
b_count
))
!=
2
||
!
(
buffer_journaled
(
S_new
[
i
])
||
buffer_journal_dirty
(
S_new
[
i
]))),
RFALSE
(
!
buffer_journaled
(
S_new
[
i
])
||
buffer_journal_dirty
(
S_new
[
i
])
||
buffer_dirty
(
S_new
[
i
]),
"PAP-12247: S_new[%d] : (%b)
\n
"
,
i
,
S_new
[
i
]);
}
/* if the affected item was not wholly shifted then we perform all necessary operations on that part or whole of the
...
...
fs/reiserfs/fix_node.c
View file @
866aa8f7
...
...
@@ -807,32 +807,15 @@ static int get_empty_nodes(
"PAP-8135: reiserfs_new_blocknrs failed when got new blocks"
);
p_s_new_bh
=
sb_getblk
(
p_s_sb
,
*
p_n_blocknr
);
if
(
atomic_read
(
&
(
p_s_new_bh
->
b_count
))
>
1
)
{
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/*
reiserfs_warning ("waiting for buffer %b, iput inode pid = %d, this pid %d, mode %c, %h\n",
p_s_new_bh, put_inode_pid, current->pid, p_s_tb->tb_vn->vn_mode, p_s_tb->tb_vn->vn_ins_ih);
print_tb (0, 0, 0, p_s_tb, "tb");
*/
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
if
(
atomic_read
(
&
(
p_s_new_bh
->
b_count
))
>
2
||
!
(
buffer_journaled
(
p_s_new_bh
)
||
buffer_journal_dirty
(
p_s_new_bh
)))
{
n_retval
=
REPEAT_SEARCH
;
free_buffers_in_tb
(
p_s_tb
);
wait_buffer_until_released
(
p_s_new_bh
);
}
}
RFALSE
(
(
atomic_read
(
&
(
p_s_new_bh
->
b_count
))
!=
1
||
buffer_dirty
(
p_s_new_bh
))
&&
(
atomic_read
(
&
(
p_s_new_bh
->
b_count
))
>
2
||
!
(
buffer_journaled
(
p_s_new_bh
)
||
buffer_journal_dirty
(
p_s_new_bh
))),
"PAP-8140: not free or dirty buffer %b for the new block"
,
RFALSE
(
buffer_dirty
(
p_s_new_bh
)
||
buffer_journaled
(
p_s_new_bh
)
||
buffer_journal_dirty
(
p_s_new_bh
),
"PAP-8140: journlaled or dirty buffer %b for the new block"
,
p_s_new_bh
);
/* Put empty buffers into the array. */
if
(
p_s_tb
->
FEB
[
p_s_tb
->
cur_blknum
])
BUG
(
);
RFALSE
(
p_s_tb
->
FEB
[
p_s_tb
->
cur_blknum
],
"PAP-8141: busy slot for new buffer"
);
mark_buffer_journal_new
(
p_s_new_bh
)
;
p_s_tb
->
FEB
[
p_s_tb
->
cur_blknum
++
]
=
p_s_new_bh
;
...
...
@@ -1926,7 +1909,7 @@ static int get_neighbors(
n_child_position
=
(
p_s_bh
==
p_s_tb
->
FL
[
n_h
]
)
?
p_s_tb
->
lkey
[
n_h
]
:
B_NR_ITEMS
(
p_s_tb
->
FL
[
n_h
]);
n_son_number
=
B_N_CHILD_NUM
(
p_s_tb
->
FL
[
n_h
],
n_child_position
);
p_s_bh
=
reiserfs
_bread
(
p_s_sb
,
n_son_number
);
p_s_bh
=
sb
_bread
(
p_s_sb
,
n_son_number
);
if
(
!
p_s_bh
)
return
IO_ERROR
;
if
(
FILESYSTEM_CHANGED_TB
(
p_s_tb
)
)
{
...
...
@@ -1959,7 +1942,7 @@ static int get_neighbors(
n_child_position
=
(
p_s_bh
==
p_s_tb
->
FR
[
n_h
]
)
?
p_s_tb
->
rkey
[
n_h
]
+
1
:
0
;
n_son_number
=
B_N_CHILD_NUM
(
p_s_tb
->
FR
[
n_h
],
n_child_position
);
p_s_bh
=
reiserfs
_bread
(
p_s_sb
,
n_son_number
);
p_s_bh
=
sb
_bread
(
p_s_sb
,
n_son_number
);
if
(
!
p_s_bh
)
return
IO_ERROR
;
if
(
FILESYSTEM_CHANGED_TB
(
p_s_tb
)
)
{
...
...
fs/reiserfs/ibalance.c
View file @
866aa8f7
...
...
@@ -1028,10 +1028,9 @@ int balance_internal (struct tree_balance * tb, /* tree_balance structure */
/* new_insert_ptr = node_pointer to S_new */
new_insert_ptr
=
S_new
;
RFALSE
((
buffer_locked
(
S_new
)
||
atomic_read
(
&
(
S_new
->
b_count
))
!=
1
)
&&
(
buffer_locked
(
S_new
)
||
atomic_read
(
&
(
S_new
->
b_count
))
>
2
||
!
(
buffer_journaled
(
S_new
)
||
buffer_journal_dirty
(
S_new
))),
"cm-00001: bad S_new (%b)"
,
S_new
);
RFALSE
(
!
buffer_journaled
(
S_new
)
||
buffer_journal_dirty
(
S_new
)
||
buffer_dirty
(
S_new
),
"cm-00001: bad S_new (%b)"
,
S_new
);
// S_new is released in unfix_nodes
}
...
...
fs/reiserfs/stree.c
View file @
866aa8f7
...
...
@@ -700,7 +700,7 @@ int search_by_key (struct super_block * p_s_sb,
/* Read the next tree node, and set the last element in the path to
have a pointer to it. */
if
(
!
(
p_s_bh
=
p_s_last_element
->
pe_buffer
=
reiserfs
_bread
(
p_s_sb
,
n_block_number
))
)
{
sb
_bread
(
p_s_sb
,
n_block_number
))
)
{
p_s_search_path
->
path_length
--
;
pathrelse
(
p_s_search_path
);
return
IO_ERROR
;
...
...
fs/reiserfs/super.c
View file @
866aa8f7
...
...
@@ -775,7 +775,7 @@ static int read_old_bitmaps (struct super_block * s)
memset
(
SB_AP_BITMAP
(
s
),
0
,
sizeof
(
struct
buffer_head
*
)
*
sb_bmap_nr
(
rs
));
for
(
i
=
0
;
i
<
sb_bmap_nr
(
rs
);
i
++
)
{
SB_AP_BITMAP
(
s
)[
i
]
=
reiserfs
_bread
(
s
,
bmp1
+
i
);
SB_AP_BITMAP
(
s
)[
i
]
=
sb
_bread
(
s
,
bmp1
+
i
);
if
(
!
SB_AP_BITMAP
(
s
)[
i
])
return
1
;
}
...
...
@@ -827,7 +827,7 @@ static int read_super_block (struct super_block * s, int offset)
sb_set_blocksize
(
s
,
sb_blocksize
(
rs
));
brelse
(
bh
);
bh
=
reiserfs
_bread
(
s
,
offset
/
s
->
s_blocksize
);
bh
=
sb
_bread
(
s
,
offset
/
s
->
s_blocksize
);
if
(
!
bh
)
{
printk
(
"sh-2007: read_super_block: "
"bread failed (dev %s, block %lu, size %lu)
\n
"
,
...
...
include/linux/reiserfs_fs.h
View file @
866aa8f7
...
...
@@ -1937,14 +1937,6 @@ void reiserfs_unmap_buffer(struct buffer_head *) ;
extern
struct
inode_operations
reiserfs_file_inode_operations
;
extern
struct
file_operations
reiserfs_file_operations
;
extern
struct
address_space_operations
reiserfs_address_space_operations
;
int
get_new_buffer
(
struct
reiserfs_transaction_handle
*
th
,
struct
buffer_head
*
,
struct
buffer_head
**
,
struct
path
*
);
/* buffer2.c */
struct
buffer_head
*
reiserfs_getblk
(
struct
super_block
*
super
,
int
n_block
);
void
wait_buffer_until_released
(
const
struct
buffer_head
*
bh
);
struct
buffer_head
*
reiserfs_bread
(
struct
super_block
*
super
,
int
n_block
);
/* fix_nodes.c */
#ifdef CONFIG_REISERFS_CHECK
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment