Skip to content

Commit

Permalink
jbd: Use offset_in_page() instead of manual calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Namhyung Kim authored and Jan Kara committed Oct 27, 2010
1 parent 2b23976 commit 8117f98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/jbd/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
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);
Expand Down

0 comments on commit 8117f98

Please sign in to comment.