Skip to contentSkip to conversation

jbd: Use offset_in_page() instead of manual calculation

PATCH In review Namhyung Kim 2 participants 2 messages Oct 4, 2010 – Oct 5, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jbd: Use offset_in_page() instead of manual calculation

---
 fs/jbd/transaction.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/jbd/transaction.c +1 -1
index 981449c..c9bb7a7 100644
@@ -711,7 +711,7 @@ done:
 		J_EXPECT_JH(jh, buffer_uptodate(jh2bh(jh)),
 			    "Possible IO failure.\n");
 		page = jh2bh(jh)->b_page;
-		offset = ((unsigned long) jh2bh(jh)->b_data) & ~PAGE_MASK;
+		offset = offset_in_page(jh2bh(jh)->b_data);
 		source = kmap_atomic(page, KM_USER0);
 		memcpy(jh->b_frozen_data, source+offset, jh2bh(jh)->b_size);
 		kunmap_atomic(source, KM_USER0);
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 1 line · Namhyung Kim

Thanks. Merged.

Honza

Quoted 20 lines
---
 fs/jbd/transaction.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/jbd/transaction.c +1 -1
index 981449c..c9bb7a7 100644
@@ -711,7 +711,7 @@ done:
 		J_EXPECT_JH(jh, buffer_uptodate(jh2bh(jh)),
 			    "Possible IO failure.\n");
 		page = jh2bh(jh)->b_page;
-		offset = ((unsigned long) jh2bh(jh)->b_data) & ~PAGE_MASK;
+		offset = offset_in_page(jh2bh(jh)->b_data);
 		source = kmap_atomic(page, KM_USER0);
 		memcpy(jh->b_frozen_data, source+offset, jh2bh(jh)->b_size);
 		kunmap_atomic(source, KM_USER0);
Signature · 1 line
1.7.0.4
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR