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
Kirill Smelkov
linux
Commits
913df90a
Commit
913df90a
authored
May 31, 2002
by
Oleg Drokin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reiserfs_fs.h, journal.c:
renamed journal device buffer head funcs and moved them into reiserfs_fs.h.
parent
715403ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
fs/reiserfs/journal.c
fs/reiserfs/journal.c
+12
-27
include/linux/reiserfs_fs.h
include/linux/reiserfs_fs.h
+5
-0
No files found.
fs/reiserfs/journal.c
View file @
913df90a
...
...
@@ -99,21 +99,6 @@ static int journal_join(struct reiserfs_transaction_handle *th, struct super_blo
static
int
release_journal_dev
(
struct
super_block
*
super
,
struct
reiserfs_journal
*
journal
);
static
inline
struct
buffer_head
*
journ_get_hash_table
(
struct
super_block
*
s
,
int
block
)
{
return
__get_hash_table
(
SB_JOURNAL
(
s
)
->
j_dev_bd
,
block
,
s
->
s_blocksize
);
}
static
inline
struct
buffer_head
*
journ_getblk
(
struct
super_block
*
s
,
int
block
)
{
return
__getblk
(
SB_JOURNAL
(
s
)
->
j_dev_bd
,
block
,
s
->
s_blocksize
);
}
static
inline
struct
buffer_head
*
journ_bread
(
struct
super_block
*
s
,
int
block
)
{
return
__bread
(
SB_JOURNAL
(
s
)
->
j_dev_bd
,
block
,
s
->
s_blocksize
);
}
static
void
init_journal_hash
(
struct
super_block
*
p_s_sb
)
{
memset
(
SB_JOURNAL
(
p_s_sb
)
->
j_hash_table
,
0
,
JOURNAL_HASH_SIZE
*
sizeof
(
struct
reiserfs_journal_cnode
*
))
;
}
...
...
@@ -704,7 +689,7 @@ static int flush_commit_list(struct super_block *s, struct reiserfs_journal_list
count
=
0
;
for
(
i
=
0
;
atomic_read
(
&
(
jl
->
j_commit_left
))
>
1
&&
i
<
(
jl
->
j_len
+
1
)
;
i
++
)
{
/* everything but commit_bh */
bn
=
SB_ONDISK_JOURNAL_1st_BLOCK
(
s
)
+
(
jl
->
j_start
+
i
)
%
SB_ONDISK_JOURNAL_SIZE
(
s
);
tbh
=
journ_get_hash_table
(
s
,
bn
)
;
tbh
=
journ
al
_get_hash_table
(
s
,
bn
)
;
/* kill this sanity check */
if
(
count
>
(
orig_commit_left
+
2
))
{
...
...
@@ -733,7 +718,7 @@ reiserfs_panic(s, "journal-539: flush_commit_list: BAD count(%d) > orig_commit_l
for
(
i
=
0
;
atomic_read
(
&
(
jl
->
j_commit_left
))
>
1
&&
i
<
(
jl
->
j_len
+
1
)
;
i
++
)
{
/* everything but commit_bh */
bn
=
SB_ONDISK_JOURNAL_1st_BLOCK
(
s
)
+
(
jl
->
j_start
+
i
)
%
SB_ONDISK_JOURNAL_SIZE
(
s
)
;
tbh
=
journ_get_hash_table
(
s
,
bn
)
;
tbh
=
journ
al
_get_hash_table
(
s
,
bn
)
;
wait_on_buffer
(
tbh
)
;
if
(
!
buffer_uptodate
(
tbh
))
{
...
...
@@ -1426,7 +1411,7 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffe
offset
=
d_bh
->
b_blocknr
-
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
;
/* ok, we have a journal description block, lets see if the transaction was valid */
c_bh
=
journ_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
c_bh
=
journ
al
_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
((
offset
+
le32_to_cpu
(
desc
->
j_len
)
+
1
)
%
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
)))
;
if
(
!
c_bh
)
return
0
;
...
...
@@ -1481,7 +1466,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
unsigned
long
trans_offset
;
int
i
;
d_bh
=
journ_bread
(
p_s_sb
,
cur_dblock
)
;
d_bh
=
journ
al
_bread
(
p_s_sb
,
cur_dblock
)
;
if
(
!
d_bh
)
return
1
;
desc
=
(
struct
reiserfs_journal_desc
*
)
d_bh
->
b_data
;
...
...
@@ -1505,7 +1490,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
brelse
(
d_bh
)
;
return
1
;
}
c_bh
=
journ_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
c_bh
=
journ
al
_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
((
trans_offset
+
le32_to_cpu
(
desc
->
j_len
)
+
1
)
%
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
)))
;
if
(
!
c_bh
)
{
...
...
@@ -1536,7 +1521,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
}
/* get all the buffer heads */
for
(
i
=
0
;
i
<
le32_to_cpu
(
desc
->
j_len
)
;
i
++
)
{
log_blocks
[
i
]
=
journ_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
(
trans_offset
+
1
+
i
)
%
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
));
log_blocks
[
i
]
=
journ
al
_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
(
trans_offset
+
1
+
i
)
%
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
));
if
(
i
<
JOURNAL_TRANS_HALF
)
{
real_blocks
[
i
]
=
sb_getblk
(
p_s_sb
,
le32_to_cpu
(
desc
->
j_realblock
[
i
]))
;
}
else
{
...
...
@@ -1674,7 +1659,7 @@ static int journal_read(struct super_block *p_s_sb) {
** is the first unflushed, and if that transaction is not valid,
** replay is done
*/
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
=
journ_bread
(
p_s_sb
,
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
=
journ
al
_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
));
if
(
!
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
)
{
...
...
@@ -1698,7 +1683,7 @@ static int journal_read(struct super_block *p_s_sb) {
** there is nothing more we can do, and it makes no sense to read
** through the whole log.
*/
d_bh
=
journ_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
le32_to_cpu
(
jh
->
j_first_unflushed_offset
))
;
d_bh
=
journ
al
_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
le32_to_cpu
(
jh
->
j_first_unflushed_offset
))
;
ret
=
journal_transaction_is_valid
(
p_s_sb
,
d_bh
,
NULL
,
NULL
)
;
if
(
!
ret
)
{
continue_replay
=
0
;
...
...
@@ -2048,7 +2033,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
rs
=
SB_DISK_SUPER_BLOCK
(
p_s_sb
);
/* read journal header */
bhjh
=
journ_bread
(
p_s_sb
,
bhjh
=
journ
al
_bread
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
));
if
(
!
bhjh
)
{
printk
(
"sh-459: unable to read journal header
\n
"
)
;
...
...
@@ -2988,7 +2973,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b
rs
=
SB_DISK_SUPER_BLOCK
(
p_s_sb
)
;
/* setup description block */
d_bh
=
journ_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
SB_JOURNAL
(
p_s_sb
)
->
j_start
)
;
d_bh
=
journ
al
_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
SB_JOURNAL
(
p_s_sb
)
->
j_start
)
;
set_buffer_uptodate
(
d_bh
)
;
desc
=
(
struct
reiserfs_journal_desc
*
)(
d_bh
)
->
b_data
;
memset
(
desc
,
0
,
sizeof
(
struct
reiserfs_journal_desc
))
;
...
...
@@ -2996,7 +2981,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b
desc
->
j_trans_id
=
cpu_to_le32
(
SB_JOURNAL
(
p_s_sb
)
->
j_trans_id
)
;
/* setup commit block. Don't write (keep it clean too) this one until after everyone else is written */
c_bh
=
journ_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
c_bh
=
journ
al
_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
((
SB_JOURNAL
(
p_s_sb
)
->
j_start
+
SB_JOURNAL
(
p_s_sb
)
->
j_len
+
1
)
%
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
)))
;
commit
=
(
struct
reiserfs_journal_commit
*
)
c_bh
->
b_data
;
memset
(
commit
,
0
,
sizeof
(
struct
reiserfs_journal_commit
))
;
...
...
@@ -3087,7 +3072,7 @@ printk("journal-2020: do_journal_end: BAD desc->j_len is ZERO\n") ;
/* copy all the real blocks into log area. dirty log blocks */
if
(
test_bit
(
BH_JDirty
,
&
cn
->
bh
->
b_state
))
{
struct
buffer_head
*
tmp_bh
;
tmp_bh
=
journ_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
tmp_bh
=
journ
al
_getblk
(
p_s_sb
,
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
((
cur_write_start
+
jindex
)
%
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
)))
;
set_buffer_uptodate
(
tmp_bh
)
;
memcpy
(
tmp_bh
->
b_data
,
cn
->
bh
->
b_data
,
cn
->
bh
->
b_size
)
;
...
...
include/linux/reiserfs_fs.h
View file @
913df90a
...
...
@@ -1652,6 +1652,11 @@ extern wait_queue_head_t reiserfs_commit_thread_wait ;
*/
#define JOURNAL_BUFFER(j,n) ((j)->j_ap_blocks[((j)->j_start + (n)) % JOURNAL_BLOCK_COUNT])
// We need these to make journal.c code more readable
#define journal_get_hash_table(s, block) __get_hash_table(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
#define journal_getblk(s, block) __getblk(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
#define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
void
reiserfs_commit_for_inode
(
struct
inode
*
)
;
void
reiserfs_update_inode_transaction
(
struct
inode
*
)
;
void
reiserfs_wait_on_write_block
(
struct
super_block
*
s
)
;
...
...
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