Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jack/linux-fs

Pull reiserfs and ext3 changes from Jan Kara:
 "Big reiserfs cleanup from Jeff, an ext3 deadlock fix, and some small
  cleanups"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (34 commits)
  reiserfs: Fix compilation breakage with CONFIG_REISERFS_CHECK
  ext3: Fix deadlock in data=journal mode when fs is frozen
  reiserfs: call truncate_setsize under tailpack mutex
  fs/jbd/revoke.c: replace shift loop by ilog2
  reiserfs: remove obsolete __constant_cpu_to_le32
  reiserfs: balance_leaf refactor, split up balance_leaf_when_delete
  reiserfs: balance_leaf refactor, format balance_leaf_finish_node
  reiserfs: balance_leaf refactor, format balance_leaf_new_nodes_paste
  reiserfs: balance_leaf refactor, format balance_leaf_paste_right
  reiserfs: balance_leaf refactor, format balance_leaf_insert_right
  reiserfs: balance_leaf refactor, format balance_leaf_paste_left
  reiserfs: balance_leaf refactor, format balance_leaf_insert_left
  reiserfs: balance_leaf refactor, pull out balance_leaf{left, right, new_nodes, finish_node}
  reiserfs: balance_leaf refactor, pull out balance_leaf_finish_node_paste
  reiserfs: balance_leaf refactor pull out balance_leaf_finish_node_insert
  reiserfs: balance_leaf refactor, pull out balance_leaf_new_nodes_paste
  reiserfs: balance_leaf refactor, pull out balance_leaf_new_nodes_insert
  reiserfs: balance_leaf refactor, pull out balance_leaf_paste_right
  reiserfs: balance_leaf refactor, pull out balance_leaf_insert_right
  reiserfs: balance_leaf refactor, pull out balance_leaf_paste_left
  ...
  • Loading branch information
Linus Torvalds committed Jun 11, 2014
2 parents 859862d + 19ef122 commit 2840c56
Show file tree
Hide file tree
Showing 25 changed files with 7,052 additions and 4,916 deletions.
33 changes: 17 additions & 16 deletions fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,17 +1716,17 @@ static int ext3_journalled_writepage(struct page *page,
WARN_ON_ONCE(IS_RDONLY(inode) &&
!(EXT3_SB(inode->i_sb)->s_mount_state & EXT3_ERROR_FS));

if (ext3_journal_current_handle())
goto no_write;

trace_ext3_journalled_writepage(page);
handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode));
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
goto no_write;
}

if (!page_has_buffers(page) || PageChecked(page)) {
if (ext3_journal_current_handle())
goto no_write;

handle = ext3_journal_start(inode,
ext3_writepage_trans_blocks(inode));
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
goto no_write;
}
/*
* It's mmapped pagecache. Add buffers and journal it. There
* doesn't seem much point in redirtying the page here.
Expand All @@ -1749,17 +1749,18 @@ static int ext3_journalled_writepage(struct page *page,
atomic_set(&EXT3_I(inode)->i_datasync_tid,
handle->h_transaction->t_tid);
unlock_page(page);
err = ext3_journal_stop(handle);
if (!ret)
ret = err;
} else {
/*
* It may be a page full of checkpoint-mode buffers. We don't
* really know unless we go poke around in the buffer_heads.
* But block_write_full_page will do the right thing.
* It is a page full of checkpoint-mode buffers. Go and write
* them. They should have been already mapped when they went
* to the journal so provide NULL get_block function to catch
* errors.
*/
ret = block_write_full_page(page, ext3_get_block, wbc);
ret = block_write_full_page(page, NULL, wbc);
}
err = ext3_journal_stop(handle);
if (!ret)
ret = err;
out:
return ret;

Expand Down
12 changes: 4 additions & 8 deletions fs/jbd/revoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,15 @@ int __init journal_init_revoke_caches(void)

static struct jbd_revoke_table_s *journal_init_revoke_table(int hash_size)
{
int shift = 0;
int tmp = hash_size;
int i;
struct jbd_revoke_table_s *table;

table = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
if (!table)
goto out;

while((tmp >>= 1UL) != 0UL)
shift++;

table->hash_size = hash_size;
table->hash_shift = shift;
table->hash_shift = ilog2(hash_size);
table->hash_table =
kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL);
if (!table->hash_table) {
Expand All @@ -252,8 +248,8 @@ static struct jbd_revoke_table_s *journal_init_revoke_table(int hash_size)
goto out;
}

for (tmp = 0; tmp < hash_size; tmp++)
INIT_LIST_HEAD(&table->hash_table[tmp]);
for (i = 0; i < hash_size; i++)
INIT_LIST_HEAD(&table->hash_table[i]);

out:
return table;
Expand Down
Loading

0 comments on commit 2840c56

Please sign in to comment.