diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-09-03 23:03:41 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 20:02:43 -0400 |
commit | 2b4e30fbde425828b17f0e9c8f8e3fd3ecb2bc75 (patch) | |
tree | 5b340cde72e058b51642f0c7255818f62014bc91 /fs/ocfs2/alloc.c | |
parent | 12462f1d9f0b96389497438dc2730c6f7410be82 (diff) |
ocfs2: Switch over to JBD2.
ocfs2 wants JBD2 for many reasons, not the least of which is that JBD is
limiting our maximum filesystem size.
It's a pretty trivial change. Most functions are just renamed. The
only functional change is moving to Jan's inode-based ordered data mode.
It's better, too.
Because JBD2 reads and writes JBD journals, this is compatible with any
existing filesystem. It can even interact with JBD-based ocfs2 as long
as the journal is formated for JBD.
We provide a compatibility option so that paranoid people can still use
JBD for the time being. This will go away shortly.
[ Moved call of ocfs2_begin_ordered_truncate() from ocfs2_delete_inode() to
ocfs2_truncate_for_delete(). --Mark ]
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 47201b67dbf2..ebfe36ab2d5e 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -6421,20 +6421,13 @@ bail: | |||
6421 | return status; | 6421 | return status; |
6422 | } | 6422 | } |
6423 | 6423 | ||
6424 | static int ocfs2_writeback_zero_func(handle_t *handle, struct buffer_head *bh) | 6424 | static int ocfs2_zero_func(handle_t *handle, struct buffer_head *bh) |
6425 | { | 6425 | { |
6426 | set_buffer_uptodate(bh); | 6426 | set_buffer_uptodate(bh); |
6427 | mark_buffer_dirty(bh); | 6427 | mark_buffer_dirty(bh); |
6428 | return 0; | 6428 | return 0; |
6429 | } | 6429 | } |
6430 | 6430 | ||
6431 | static int ocfs2_ordered_zero_func(handle_t *handle, struct buffer_head *bh) | ||
6432 | { | ||
6433 | set_buffer_uptodate(bh); | ||
6434 | mark_buffer_dirty(bh); | ||
6435 | return ocfs2_journal_dirty_data(handle, bh); | ||
6436 | } | ||
6437 | |||
6438 | static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, | 6431 | static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, |
6439 | unsigned int from, unsigned int to, | 6432 | unsigned int from, unsigned int to, |
6440 | struct page *page, int zero, u64 *phys) | 6433 | struct page *page, int zero, u64 *phys) |
@@ -6453,17 +6446,18 @@ static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, | |||
6453 | * here if they aren't - ocfs2_map_page_blocks() | 6446 | * here if they aren't - ocfs2_map_page_blocks() |
6454 | * might've skipped some | 6447 | * might've skipped some |
6455 | */ | 6448 | */ |
6456 | if (ocfs2_should_order_data(inode)) { | 6449 | ret = walk_page_buffers(handle, page_buffers(page), |
6457 | ret = walk_page_buffers(handle, | 6450 | from, to, &partial, |
6458 | page_buffers(page), | 6451 | ocfs2_zero_func); |
6459 | from, to, &partial, | 6452 | if (ret < 0) |
6460 | ocfs2_ordered_zero_func); | 6453 | mlog_errno(ret); |
6461 | if (ret < 0) | 6454 | else if (ocfs2_should_order_data(inode)) { |
6462 | mlog_errno(ret); | 6455 | ret = ocfs2_jbd2_file_inode(handle, inode); |
6463 | } else { | 6456 | #ifdef CONFIG_OCFS2_COMPAT_JBD |
6464 | ret = walk_page_buffers(handle, page_buffers(page), | 6457 | ret = walk_page_buffers(handle, page_buffers(page), |
6465 | from, to, &partial, | 6458 | from, to, &partial, |
6466 | ocfs2_writeback_zero_func); | 6459 | ocfs2_journal_dirty_data); |
6460 | #endif | ||
6467 | if (ret < 0) | 6461 | if (ret < 0) |
6468 | mlog_errno(ret); | 6462 | mlog_errno(ret); |
6469 | } | 6463 | } |