jbd: Use offset_in_page() instead of manual calculation
authorNamhyung Kim <namhyung@gmail.com>
Mon, 4 Oct 2010 16:03:40 +0000 (01:03 +0900)
committerJan Kara <jack@suse.cz>
Wed, 27 Oct 2010 23:30:02 +0000 (01:30 +0200)
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/jbd/transaction.c

index 981449ca8f18a7fd6aa2101ff3e88a04ca64b9ca..c9bb7a73f8fdcff9d8ecf6f7e47683e3ec0bdff7 100644 (file)
@@ -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);