Skip to contentSkip to conversation

jbd: Convert atomic_inc() to get_bh()

PATCH In review Namhyung Kim 2 participants 2 messages Oct 16, 2010 – Oct 18, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jbd: Convert atomic_inc() to get_bh()

Convert atomic_inc(&bh->b_count) to get_bh(bh) for consistency.

---
 fs/jbd/checkpoint.c |    4 ++--
 fs/jbd/commit.c     |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
fs/jbd/checkpoint.c +2 -2
index 05a38b9..e4b87bc 100644
@@ -221,7 +221,7 @@ restart:
 			goto restart;
 		}
 		if (buffer_locked(bh)) {
-			atomic_inc(&bh->b_count);
+			get_bh(bh);
 			spin_unlock(&journal->j_list_lock);
 			jbd_unlock_bh_state(bh);
 			wait_on_buffer(bh);
@@ -283,7 +283,7 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
 	int ret = 0;
 
 	if (buffer_locked(bh)) {
-		atomic_inc(&bh->b_count);
+		get_bh(bh);
 		spin_unlock(&journal->j_list_lock);
 		jbd_unlock_bh_state(bh);
 		wait_on_buffer(bh);
fs/jbd/commit.c +1 -1
index 95d8c11..1a9d033 100644
@@ -611,7 +611,7 @@ void journal_commit_transaction(journal_t *journal)
 		/* Bump b_count to prevent truncate from stumbling over
                    the shadowed buffer!  @@@ This can go if we ever get
                    rid of the BJ_IO/BJ_Shadow pairing of buffers. */
-		atomic_inc(&jh2bh(jh)->b_count);
+		get_bh(jh2bh(jh));
 
 		/* Make a temporary IO buffer with which to write it out
                    (this will requeue both the metadata buffer and the
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 1 line · Namhyung Kim

Convert atomic_inc(&bh->b_count) to get_bh(bh) for consistency.

Thanks. Merged.

Honza

Quoted 45 lines
---
 fs/jbd/checkpoint.c |    4 ++--
 fs/jbd/commit.c     |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
fs/jbd/checkpoint.c +2 -2
index 05a38b9..e4b87bc 100644
@@ -221,7 +221,7 @@ restart:
 			goto restart;
 		}
 		if (buffer_locked(bh)) {
-			atomic_inc(&bh->b_count);
+			get_bh(bh);
 			spin_unlock(&journal->j_list_lock);
 			jbd_unlock_bh_state(bh);
 			wait_on_buffer(bh);
@@ -283,7 +283,7 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
 	int ret = 0;
 
 	if (buffer_locked(bh)) {
-		atomic_inc(&bh->b_count);
+		get_bh(bh);
 		spin_unlock(&journal->j_list_lock);
 		jbd_unlock_bh_state(bh);
 		wait_on_buffer(bh);
fs/jbd/commit.c +1 -1
index 95d8c11..1a9d033 100644
@@ -611,7 +611,7 @@ void journal_commit_transaction(journal_t *journal)
 		/* Bump b_count to prevent truncate from stumbling over
                    the shadowed buffer!  @@@ This can go if we ever get
                    rid of the BJ_IO/BJ_Shadow pairing of buffers. */
-		atomic_inc(&jh2bh(jh)->b_count);
+		get_bh(jh2bh(jh));
 
 		/* Make a temporary IO buffer with which to write it out
                    (this will requeue both the metadata buffer and the
Signature · 1 line
1.7.0.4
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR