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
1fe87216
Commit
1fe87216
authored
Jun 17, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Jun 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] JBD: b_tnext locking
Implement the designated b_tnext locking. This also covers b_tprev locking.
parent
e87dd8c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
fs/jbd/transaction.c
fs/jbd/transaction.c
+11
-7
include/linux/journal-head.h
include/linux/journal-head.h
+1
-1
No files found.
fs/jbd/transaction.c
View file @
1fe87216
...
@@ -1414,7 +1414,10 @@ int journal_force_commit(journal_t *journal)
...
@@ -1414,7 +1414,10 @@ int journal_force_commit(journal_t *journal)
/*
/*
* Append a buffer to a transaction list, given the transaction's list head
* Append a buffer to a transaction list, given the transaction's list head
* pointer.
* pointer.
*
* journal_datalist_lock is held.
* journal_datalist_lock is held.
*
* jbd_lock_bh_state(jh2bh(jh)) is held.
*/
*/
static
inline
void
static
inline
void
...
@@ -1438,6 +1441,8 @@ __blist_add_buffer(struct journal_head **list, struct journal_head *jh)
...
@@ -1438,6 +1441,8 @@ __blist_add_buffer(struct journal_head **list, struct journal_head *jh)
*
*
* Called with journal_datalist_lock held, and the journal may not
* Called with journal_datalist_lock held, and the journal may not
* be locked.
* be locked.
*
* jbd_lock_bh_state(jh2bh(jh)) is held.
*/
*/
static
inline
void
static
inline
void
...
@@ -1468,16 +1473,13 @@ __blist_del_buffer(struct journal_head **list, struct journal_head *jh)
...
@@ -1468,16 +1473,13 @@ __blist_del_buffer(struct journal_head **list, struct journal_head *jh)
void
__journal_unfile_buffer
(
struct
journal_head
*
jh
)
void
__journal_unfile_buffer
(
struct
journal_head
*
jh
)
{
{
struct
journal_head
**
list
=
0
;
struct
journal_head
**
list
=
0
;
transaction_t
*
transaction
;
transaction_t
*
transaction
;
struct
buffer_head
*
bh
=
jh2bh
(
jh
);
assert_spin_locked
(
&
journal_datalist_lock
);
assert_spin_locked
(
&
journal_datalist_lock
);
transaction
=
jh
->
b_transaction
;
transaction
=
jh
->
b_transaction
;
#ifdef __SMP__
J_ASSERT
(
current
->
lock_depth
>=
0
);
#endif
J_ASSERT_JH
(
jh
,
jh
->
b_jlist
<
BJ_Types
);
J_ASSERT_JH
(
jh
,
jh
->
b_jlist
<
BJ_Types
);
if
(
jh
->
b_jlist
!=
BJ_None
)
if
(
jh
->
b_jlist
!=
BJ_None
)
J_ASSERT_JH
(
jh
,
transaction
!=
0
);
J_ASSERT_JH
(
jh
,
transaction
!=
0
);
...
@@ -1511,15 +1513,17 @@ void __journal_unfile_buffer(struct journal_head *jh)
...
@@ -1511,15 +1513,17 @@ void __journal_unfile_buffer(struct journal_head *jh)
__blist_del_buffer
(
list
,
jh
);
__blist_del_buffer
(
list
,
jh
);
jh
->
b_jlist
=
BJ_None
;
jh
->
b_jlist
=
BJ_None
;
if
(
test_
and_clear_bit
(
BH_JBDDirty
,
&
jh2bh
(
jh
)
->
b_state
))
if
(
test_
clear_buffer_jbddirty
(
bh
))
mark_buffer_dirty
(
jh2bh
(
jh
)
);
/* Expose it to the VM */
mark_buffer_dirty
(
bh
);
/* Expose it to the VM */
}
}
void
journal_unfile_buffer
(
struct
journal_head
*
jh
)
void
journal_unfile_buffer
(
struct
journal_head
*
jh
)
{
{
jbd_lock_bh_state
(
jh2bh
(
jh
));
spin_lock
(
&
journal_datalist_lock
);
spin_lock
(
&
journal_datalist_lock
);
__journal_unfile_buffer
(
jh
);
__journal_unfile_buffer
(
jh
);
spin_unlock
(
&
journal_datalist_lock
);
spin_unlock
(
&
journal_datalist_lock
);
jbd_unlock_bh_state
(
jh2bh
(
jh
));
}
}
/*
/*
...
...
include/linux/journal-head.h
View file @
1fe87216
...
@@ -63,7 +63,7 @@ struct journal_head {
...
@@ -63,7 +63,7 @@ struct journal_head {
/*
/*
* Doubly-linked list of buffers on a transaction's data, metadata or
* Doubly-linked list of buffers on a transaction's data, metadata or
* forget queue. [jbd_lock_bh_state()]
* forget queue. [
t_list_lock] [
jbd_lock_bh_state()]
*/
*/
struct
journal_head
*
b_tnext
,
*
b_tprev
;
struct
journal_head
*
b_tnext
,
*
b_tprev
;
...
...
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