Commit 58d85426 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by Jan Kara

reiserfs: cleanup, remove sb argument from journal_end

journal_end doesn't need a separate sb argument; it's provided by the
transaction handle.
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 706a5323
...@@ -96,7 +96,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp) ...@@ -96,7 +96,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
#ifdef REISERFS_PREALLOCATE #ifdef REISERFS_PREALLOCATE
reiserfs_discard_prealloc(&th, inode); reiserfs_discard_prealloc(&th, inode);
#endif #endif
err = journal_end(&th, inode->i_sb); err = journal_end(&th);
/* copy back the error code from journal_begin */ /* copy back the error code from journal_begin */
if (!err) if (!err)
...@@ -227,7 +227,7 @@ int reiserfs_commit_page(struct inode *inode, struct page *page, ...@@ -227,7 +227,7 @@ int reiserfs_commit_page(struct inode *inode, struct page *page,
} }
} }
if (logit) { if (logit) {
ret = journal_end(&th, s); ret = journal_end(&th);
drop_write_lock: drop_write_lock:
reiserfs_write_unlock(s); reiserfs_write_unlock(s);
} }
......
...@@ -72,7 +72,7 @@ void reiserfs_evict_inode(struct inode *inode) ...@@ -72,7 +72,7 @@ void reiserfs_evict_inode(struct inode *inode)
reiserfs_write_lock_nested(inode->i_sb, depth); reiserfs_write_lock_nested(inode->i_sb, depth);
} }
if (journal_end(&th, inode->i_sb)) if (journal_end(&th))
goto out; goto out;
/* /*
...@@ -264,7 +264,7 @@ static int restart_transaction(struct reiserfs_transaction_handle *th, ...@@ -264,7 +264,7 @@ static int restart_transaction(struct reiserfs_transaction_handle *th,
return 0; return 0;
} }
reiserfs_update_sd(th, inode); reiserfs_update_sd(th, inode);
err = journal_end(th, s); err = journal_end(th);
if (!err) { if (!err) {
err = journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6); err = journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6);
if (!err) if (!err)
...@@ -1790,7 +1790,7 @@ int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -1790,7 +1790,7 @@ int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc)
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock(inode->i_sb);
if (!journal_begin(&th, inode->i_sb, jbegin_count)) { if (!journal_begin(&th, inode->i_sb, jbegin_count)) {
reiserfs_update_sd(&th, inode); reiserfs_update_sd(&th, inode);
journal_end_sync(&th, inode->i_sb); journal_end_sync(&th);
} }
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
} }
...@@ -2097,7 +2097,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -2097,7 +2097,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
if (retval) { if (retval) {
err = retval; err = retval;
reiserfs_check_path(&path_to_key); reiserfs_check_path(&path_to_key);
journal_end(th, th->t_super); journal_end(th);
goto out_inserted_sd; goto out_inserted_sd;
} }
...@@ -2108,7 +2108,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -2108,7 +2108,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
if (retval) { if (retval) {
err = retval; err = retval;
reiserfs_check_path(&path_to_key); reiserfs_check_path(&path_to_key);
journal_end(th, th->t_super); journal_end(th);
goto out_inserted_sd; goto out_inserted_sd;
} }
} else if (inode->i_sb->s_flags & MS_POSIXACL) { } else if (inode->i_sb->s_flags & MS_POSIXACL) {
...@@ -2125,7 +2125,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -2125,7 +2125,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
if (retval) { if (retval) {
err = retval; err = retval;
reiserfs_check_path(&path_to_key); reiserfs_check_path(&path_to_key);
retval = journal_end(th, th->t_super); retval = journal_end(th);
if (retval) if (retval)
err = retval; err = retval;
goto out_inserted_sd; goto out_inserted_sd;
...@@ -2147,7 +2147,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -2147,7 +2147,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
reiserfs_write_lock_nested(inode->i_sb, depth); reiserfs_write_lock_nested(inode->i_sb, depth);
out_end_trans: out_end_trans:
journal_end(th, th->t_super); journal_end(th);
/* /*
* Drop can be outside and it needs more credits so it's better * Drop can be outside and it needs more credits so it's better
* to have it outside * to have it outside
...@@ -2317,7 +2317,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps) ...@@ -2317,7 +2317,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps)
*/ */
add_save_link(&th, inode, 1); add_save_link(&th, inode, 1);
err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps); err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps);
error = journal_end(&th, inode->i_sb); error = journal_end(&th);
if (error) if (error)
goto out; goto out;
...@@ -2480,7 +2480,7 @@ static int map_block_for_writepage(struct inode *inode, ...@@ -2480,7 +2480,7 @@ static int map_block_for_writepage(struct inode *inode,
out: out:
pathrelse(&path); pathrelse(&path);
if (trans_running) { if (trans_running) {
int err = journal_end(&th, inode->i_sb); int err = journal_end(&th);
if (err) if (err)
retval = err; retval = err;
trans_running = 0; trans_running = 0;
...@@ -2650,7 +2650,7 @@ static int reiserfs_write_full_page(struct page *page, ...@@ -2650,7 +2650,7 @@ static int reiserfs_write_full_page(struct page *page,
} while ((bh = bh->b_this_page) != head); } while ((bh = bh->b_this_page) != head);
if (checked) { if (checked) {
error = journal_end(&th, s); error = journal_end(&th);
reiserfs_write_unlock(s); reiserfs_write_unlock(s);
if (error) if (error)
goto fail; goto fail;
...@@ -2953,7 +2953,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping, ...@@ -2953,7 +2953,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
mark_inode_dirty(inode); mark_inode_dirty(inode);
reiserfs_update_sd(&myth, inode); reiserfs_update_sd(&myth, inode);
update_sd = 1; update_sd = 1;
ret = journal_end(&myth, inode->i_sb); ret = journal_end(&myth);
if (ret) if (ret)
goto journal_error; goto journal_error;
} }
...@@ -3042,7 +3042,7 @@ int reiserfs_commit_write(struct file *f, struct page *page, ...@@ -3042,7 +3042,7 @@ int reiserfs_commit_write(struct file *f, struct page *page,
mark_inode_dirty(inode); mark_inode_dirty(inode);
reiserfs_update_sd(&myth, inode); reiserfs_update_sd(&myth, inode);
update_sd = 1; update_sd = 1;
ret = journal_end(&myth, inode->i_sb); ret = journal_end(&myth);
if (ret) if (ret)
goto journal_error; goto journal_error;
} }
...@@ -3346,7 +3346,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -3346,7 +3346,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
err = journal_begin(&th, inode->i_sb, 4); err = journal_begin(&th, inode->i_sb, 4);
if (!err) { if (!err) {
reiserfs_discard_prealloc(&th, inode); reiserfs_discard_prealloc(&th, inode);
err = journal_end(&th, inode->i_sb); err = journal_end(&th);
} }
if (err) if (err)
error = err; error = err;
...@@ -3398,7 +3398,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -3398,7 +3398,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
error = dquot_transfer(inode, attr); error = dquot_transfer(inode, attr);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock(inode->i_sb);
if (error) { if (error) {
journal_end(&th, inode->i_sb); journal_end(&th);
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
goto out; goto out;
} }
...@@ -3412,7 +3412,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -3412,7 +3412,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
if (attr->ia_valid & ATTR_GID) if (attr->ia_valid & ATTR_GID)
inode->i_gid = attr->ia_gid; inode->i_gid = attr->ia_gid;
mark_inode_dirty(inode); mark_inode_dirty(inode);
error = journal_end(&th, inode->i_sb); error = journal_end(&th);
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
if (error) if (error)
goto out; goto out;
......
...@@ -83,8 +83,7 @@ ...@@ -83,8 +83,7 @@
#define COMMIT_NOW 2 /* end and commit this transaction */ #define COMMIT_NOW 2 /* end and commit this transaction */
#define WAIT 4 /* wait for the log blocks to hit the disk */ #define WAIT 4 /* wait for the log blocks to hit the disk */
static int do_journal_end(struct reiserfs_transaction_handle *, static int do_journal_end(struct reiserfs_transaction_handle *, int flags);
struct super_block *, int flags);
static int flush_journal_list(struct super_block *s, static int flush_journal_list(struct super_block *s,
struct reiserfs_journal_list *jl, int flushall); struct reiserfs_journal_list *jl, int flushall);
static int flush_commit_list(struct super_block *s, static int flush_commit_list(struct super_block *s,
...@@ -1920,7 +1919,7 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, ...@@ -1920,7 +1919,7 @@ static int do_journal_release(struct reiserfs_transaction_handle *th,
if (!error && !(sb->s_flags & MS_RDONLY)) { if (!error && !(sb->s_flags & MS_RDONLY)) {
/* end the current trans */ /* end the current trans */
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
do_journal_end(th, sb, FLUSH_ALL); do_journal_end(th, FLUSH_ALL);
/* /*
* make sure something gets logged to force * make sure something gets logged to force
...@@ -1932,7 +1931,7 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, ...@@ -1932,7 +1931,7 @@ static int do_journal_release(struct reiserfs_transaction_handle *th,
1); 1);
journal_mark_dirty(&myth, sb, journal_mark_dirty(&myth, sb,
SB_BUFFER_WITH_SB(sb)); SB_BUFFER_WITH_SB(sb));
do_journal_end(&myth, sb, FLUSH_ALL); do_journal_end(&myth, FLUSH_ALL);
flushed = 1; flushed = 1;
} }
} }
...@@ -1946,7 +1945,7 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, ...@@ -1946,7 +1945,7 @@ static int do_journal_release(struct reiserfs_transaction_handle *th,
1); 1);
journal_mark_dirty(&myth, sb, journal_mark_dirty(&myth, sb,
SB_BUFFER_WITH_SB(sb)); SB_BUFFER_WITH_SB(sb));
do_journal_end(&myth, sb, FLUSH_ALL); do_journal_end(&myth, FLUSH_ALL);
} }
} }
...@@ -3101,9 +3100,9 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, ...@@ -3101,9 +3100,9 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
/* someone might have ended the transaction while we joined */ /* someone might have ended the transaction while we joined */
if (old_trans_id != journal->j_trans_id) { if (old_trans_id != journal->j_trans_id) {
retval = do_journal_end(&myth, sb, 0); retval = do_journal_end(&myth, 0);
} else { } else {
retval = do_journal_end(&myth, sb, COMMIT_NOW); retval = do_journal_end(&myth, COMMIT_NOW);
} }
if (retval) if (retval)
...@@ -3173,7 +3172,7 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th) ...@@ -3173,7 +3172,7 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th)
struct super_block *s = th->t_super; struct super_block *s = th->t_super;
int ret = 0; int ret = 0;
if (th->t_trans_id) if (th->t_trans_id)
ret = journal_end(th, th->t_super); ret = journal_end(th);
else else
ret = -EIO; ret = -EIO;
if (th->t_refcount == 0) { if (th->t_refcount == 0) {
...@@ -3374,8 +3373,9 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3374,8 +3373,9 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
return 0; return 0;
} }
int journal_end(struct reiserfs_transaction_handle *th, struct super_block *sb) int journal_end(struct reiserfs_transaction_handle *th)
{ {
struct super_block *sb = th->t_super;
if (!current->journal_info && th->t_refcount > 1) if (!current->journal_info && th->t_refcount > 1)
reiserfs_warning(sb, "REISER-NESTING", reiserfs_warning(sb, "REISER-NESTING",
"th NULL, refcount %d", th->t_refcount); "th NULL, refcount %d", th->t_refcount);
...@@ -3402,7 +3402,7 @@ int journal_end(struct reiserfs_transaction_handle *th, struct super_block *sb) ...@@ -3402,7 +3402,7 @@ int journal_end(struct reiserfs_transaction_handle *th, struct super_block *sb)
} }
return 0; return 0;
} else { } else {
return do_journal_end(th, sb, 0); return do_journal_end(th, 0);
} }
} }
...@@ -3511,9 +3511,9 @@ static int can_dirty(struct reiserfs_journal_cnode *cn) ...@@ -3511,9 +3511,9 @@ static int can_dirty(struct reiserfs_journal_cnode *cn)
* syncs the commit blocks, but does not force the real buffers to disk * syncs the commit blocks, but does not force the real buffers to disk
* will wait until the current transaction is done/committed before returning * will wait until the current transaction is done/committed before returning
*/ */
int journal_end_sync(struct reiserfs_transaction_handle *th, int journal_end_sync(struct reiserfs_transaction_handle *th)
struct super_block *sb)
{ {
struct super_block *sb = th->t_super;
struct reiserfs_journal *journal = SB_JOURNAL(sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
...@@ -3524,7 +3524,7 @@ int journal_end_sync(struct reiserfs_transaction_handle *th, ...@@ -3524,7 +3524,7 @@ int journal_end_sync(struct reiserfs_transaction_handle *th,
1); 1);
journal_mark_dirty(th, sb, SB_BUFFER_WITH_SB(sb)); journal_mark_dirty(th, sb, SB_BUFFER_WITH_SB(sb));
} }
return do_journal_end(th, sb, COMMIT_NOW | WAIT); return do_journal_end(th, COMMIT_NOW | WAIT);
} }
/* writeback the pending async commits to disk */ /* writeback the pending async commits to disk */
...@@ -3584,7 +3584,7 @@ void reiserfs_flush_old_commits(struct super_block *sb) ...@@ -3584,7 +3584,7 @@ void reiserfs_flush_old_commits(struct super_block *sb)
* no sense to do an async commit so that kreiserfsd * no sense to do an async commit so that kreiserfsd
* can do it later * can do it later
*/ */
do_journal_end(&th, sb, COMMIT_NOW | WAIT); do_journal_end(&th, COMMIT_NOW | WAIT);
} }
} }
} }
...@@ -3604,8 +3604,7 @@ void reiserfs_flush_old_commits(struct super_block *sb) ...@@ -3604,8 +3604,7 @@ void reiserfs_flush_old_commits(struct super_block *sb)
* Note, we can't allow the journal_end to proceed while there are still * Note, we can't allow the journal_end to proceed while there are still
* writers in the log. * writers in the log.
*/ */
static int check_journal_end(struct reiserfs_transaction_handle *th, static int check_journal_end(struct reiserfs_transaction_handle *th, int flags)
struct super_block *sb, int flags)
{ {
time_t now; time_t now;
...@@ -3613,6 +3612,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3613,6 +3612,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
int commit_now = flags & COMMIT_NOW; int commit_now = flags & COMMIT_NOW;
int wait_on_commit = flags & WAIT; int wait_on_commit = flags & WAIT;
struct reiserfs_journal_list *jl; struct reiserfs_journal_list *jl;
struct super_block *sb = th->t_super;
struct reiserfs_journal *journal = SB_JOURNAL(sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
...@@ -3864,11 +3864,11 @@ static int __commit_trans_jl(struct inode *inode, unsigned long id, ...@@ -3864,11 +3864,11 @@ static int __commit_trans_jl(struct inode *inode, unsigned long id,
reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb), reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb),
1); 1);
journal_mark_dirty(&th, sb, SB_BUFFER_WITH_SB(sb)); journal_mark_dirty(&th, sb, SB_BUFFER_WITH_SB(sb));
ret = journal_end(&th, sb); ret = journal_end(&th);
goto flush_commit_only; goto flush_commit_only;
} }
ret = journal_end_sync(&th, sb); ret = journal_end_sync(&th);
if (!ret) if (!ret)
ret = 1; ret = 1;
...@@ -3974,9 +3974,9 @@ int reiserfs_prepare_for_journal(struct super_block *sb, ...@@ -3974,9 +3974,9 @@ int reiserfs_prepare_for_journal(struct super_block *sb,
* If the journal is aborted, we just clean up. Things like flushing * If the journal is aborted, we just clean up. Things like flushing
* journal lists, etc just won't happen. * journal lists, etc just won't happen.
*/ */
static int do_journal_end(struct reiserfs_transaction_handle *th, static int do_journal_end(struct reiserfs_transaction_handle *th, int flags)
struct super_block *sb, int flags)
{ {
struct super_block *sb = th->t_super;
struct reiserfs_journal *journal = SB_JOURNAL(sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn, *next, *jl_cn; struct reiserfs_journal_cnode *cn, *next, *jl_cn;
struct reiserfs_journal_cnode *last_cn = NULL; struct reiserfs_journal_cnode *last_cn = NULL;
...@@ -3998,6 +3998,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3998,6 +3998,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
BUG_ON(th->t_refcount > 1); BUG_ON(th->t_refcount > 1);
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
BUG_ON(!th->t_super);
/* /*
* protect flush_older_commits from doing mistakes if the * protect flush_older_commits from doing mistakes if the
...@@ -4031,7 +4032,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4031,7 +4032,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
* not return 1 it tells us if we should continue with the * not return 1 it tells us if we should continue with the
* journal_end, or just return * journal_end, or just return
*/ */
if (!check_journal_end(th, sb, flags)) { if (!check_journal_end(th, flags)) {
reiserfs_schedule_old_flush(sb); reiserfs_schedule_old_flush(sb);
wake_queued_writers(sb); wake_queued_writers(sb);
reiserfs_async_progress_wait(sb); reiserfs_async_progress_wait(sb);
......
...@@ -672,7 +672,7 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mod ...@@ -672,7 +672,7 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mod
int err; int err;
drop_nlink(inode); drop_nlink(inode);
reiserfs_update_sd(&th, inode); reiserfs_update_sd(&th, inode);
err = journal_end(&th, dir->i_sb); err = journal_end(&th);
if (err) if (err)
retval = err; retval = err;
unlock_new_inode(inode); unlock_new_inode(inode);
...@@ -684,7 +684,7 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mod ...@@ -684,7 +684,7 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mod
unlock_new_inode(inode); unlock_new_inode(inode);
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
retval = journal_end(&th, dir->i_sb); retval = journal_end(&th);
out_failed: out_failed:
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
...@@ -755,7 +755,7 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode ...@@ -755,7 +755,7 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode
int err; int err;
drop_nlink(inode); drop_nlink(inode);
reiserfs_update_sd(&th, inode); reiserfs_update_sd(&th, inode);
err = journal_end(&th, dir->i_sb); err = journal_end(&th);
if (err) if (err)
retval = err; retval = err;
unlock_new_inode(inode); unlock_new_inode(inode);
...@@ -765,7 +765,7 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode ...@@ -765,7 +765,7 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode
unlock_new_inode(inode); unlock_new_inode(inode);
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
retval = journal_end(&th, dir->i_sb); retval = journal_end(&th);
out_failed: out_failed:
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
...@@ -847,7 +847,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode ...@@ -847,7 +847,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
clear_nlink(inode); clear_nlink(inode);
DEC_DIR_INODE_NLINK(dir); DEC_DIR_INODE_NLINK(dir);
reiserfs_update_sd(&th, inode); reiserfs_update_sd(&th, inode);
err = journal_end(&th, dir->i_sb); err = journal_end(&th);
if (err) if (err)
retval = err; retval = err;
unlock_new_inode(inode); unlock_new_inode(inode);
...@@ -859,7 +859,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode ...@@ -859,7 +859,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
unlock_new_inode(inode); unlock_new_inode(inode);
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
retval = journal_end(&th, dir->i_sb); retval = journal_end(&th);
out_failed: out_failed:
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
return retval; return retval;
...@@ -956,7 +956,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -956,7 +956,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
/* prevent empty directory from getting lost */ /* prevent empty directory from getting lost */
add_save_link(&th, inode, 0 /* not truncate */ ); add_save_link(&th, inode, 0 /* not truncate */ );
retval = journal_end(&th, dir->i_sb); retval = journal_end(&th);
reiserfs_check_path(&path); reiserfs_check_path(&path);
out_rmdir: out_rmdir:
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
...@@ -969,7 +969,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -969,7 +969,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
* release path if operation was not complete * release path if operation was not complete
*/ */
pathrelse(&path); pathrelse(&path);
err = journal_end(&th, dir->i_sb); err = journal_end(&th);
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
return err ? err : retval; return err ? err : retval;
} }
...@@ -1059,14 +1059,14 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1059,14 +1059,14 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
/* prevent file from getting lost */ /* prevent file from getting lost */
add_save_link(&th, inode, 0 /* not truncate */ ); add_save_link(&th, inode, 0 /* not truncate */ );
retval = journal_end(&th, dir->i_sb); retval = journal_end(&th);
reiserfs_check_path(&path); reiserfs_check_path(&path);
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
return retval; return retval;
end_unlink: end_unlink:
pathrelse(&path); pathrelse(&path);
err = journal_end(&th, dir->i_sb); err = journal_end(&th);
reiserfs_check_path(&path); reiserfs_check_path(&path);
if (err) if (err)
retval = err; retval = err;
...@@ -1153,7 +1153,7 @@ static int reiserfs_symlink(struct inode *parent_dir, ...@@ -1153,7 +1153,7 @@ static int reiserfs_symlink(struct inode *parent_dir,
int err; int err;
drop_nlink(inode); drop_nlink(inode);
reiserfs_update_sd(&th, inode); reiserfs_update_sd(&th, inode);
err = journal_end(&th, parent_dir->i_sb); err = journal_end(&th);
if (err) if (err)
retval = err; retval = err;
unlock_new_inode(inode); unlock_new_inode(inode);
...@@ -1163,7 +1163,7 @@ static int reiserfs_symlink(struct inode *parent_dir, ...@@ -1163,7 +1163,7 @@ static int reiserfs_symlink(struct inode *parent_dir,
unlock_new_inode(inode); unlock_new_inode(inode);
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
retval = journal_end(&th, parent_dir->i_sb); retval = journal_end(&th);
out_failed: out_failed:
reiserfs_write_unlock(parent_dir->i_sb); reiserfs_write_unlock(parent_dir->i_sb);
return retval; return retval;
...@@ -1213,7 +1213,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, ...@@ -1213,7 +1213,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir,
if (retval) { if (retval) {
int err; int err;
drop_nlink(inode); drop_nlink(inode);
err = journal_end(&th, dir->i_sb); err = journal_end(&th);
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
return err ? err : retval; return err ? err : retval;
} }
...@@ -1223,7 +1223,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, ...@@ -1223,7 +1223,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir,
ihold(inode); ihold(inode);
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
retval = journal_end(&th, dir->i_sb); retval = journal_end(&th);
reiserfs_write_unlock(dir->i_sb); reiserfs_write_unlock(dir->i_sb);
return retval; return retval;
} }
...@@ -1385,7 +1385,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1385,7 +1385,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
"new entry is found, new inode == 0"); "new entry is found, new inode == 0");
} }
} else if (retval) { } else if (retval) {
int err = journal_end(&th, old_dir->i_sb); int err = journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb); reiserfs_write_unlock(old_dir->i_sb);
return err ? err : retval; return err ? err : retval;
} }
...@@ -1412,7 +1412,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1412,7 +1412,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
&old_entry_path, &old_entry_path,
&old_de)) != NAME_FOUND) { &old_de)) != NAME_FOUND) {
pathrelse(&old_entry_path); pathrelse(&old_entry_path);
journal_end(&th, old_dir->i_sb); journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb); reiserfs_write_unlock(old_dir->i_sb);
return -EIO; return -EIO;
} }
...@@ -1436,7 +1436,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1436,7 +1436,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (retval != NAME_FOUND_INVISIBLE && retval != NAME_FOUND) { if (retval != NAME_FOUND_INVISIBLE && retval != NAME_FOUND) {
pathrelse(&new_entry_path); pathrelse(&new_entry_path);
pathrelse(&old_entry_path); pathrelse(&old_entry_path);
journal_end(&th, old_dir->i_sb); journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb); reiserfs_write_unlock(old_dir->i_sb);
return -EIO; return -EIO;
} }
...@@ -1454,7 +1454,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1454,7 +1454,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
pathrelse(&dot_dot_entry_path); pathrelse(&dot_dot_entry_path);
pathrelse(&new_entry_path); pathrelse(&new_entry_path);
pathrelse(&old_entry_path); pathrelse(&old_entry_path);
journal_end(&th, old_dir->i_sb); journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb); reiserfs_write_unlock(old_dir->i_sb);
return -EIO; return -EIO;
} }
...@@ -1601,7 +1601,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1601,7 +1601,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
reiserfs_update_sd(&th, new_dentry_inode); reiserfs_update_sd(&th, new_dentry_inode);
} }
retval = journal_end(&th, old_dir->i_sb); retval = journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb); reiserfs_write_unlock(old_dir->i_sb);
return retval; return retval;
} }
......
...@@ -2914,9 +2914,8 @@ int journal_init(struct super_block *, const char *j_dev_name, int old_format, ...@@ -2914,9 +2914,8 @@ int journal_init(struct super_block *, const char *j_dev_name, int old_format,
int journal_release(struct reiserfs_transaction_handle *, struct super_block *); int journal_release(struct reiserfs_transaction_handle *, struct super_block *);
int journal_release_error(struct reiserfs_transaction_handle *, int journal_release_error(struct reiserfs_transaction_handle *,
struct super_block *); struct super_block *);
int journal_end(struct reiserfs_transaction_handle *, struct super_block *); int journal_end(struct reiserfs_transaction_handle *);
int journal_end_sync(struct reiserfs_transaction_handle *, int journal_end_sync(struct reiserfs_transaction_handle *);
struct super_block *);
int journal_mark_freed(struct reiserfs_transaction_handle *, int journal_mark_freed(struct reiserfs_transaction_handle *,
struct super_block *, b_blocknr_t blocknr); struct super_block *, b_blocknr_t blocknr);
int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); int journal_transaction_should_end(struct reiserfs_transaction_handle *, int);
......
...@@ -182,7 +182,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) ...@@ -182,7 +182,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
info = SB_AP_BITMAP(s) + bmap_nr - 1; info = SB_AP_BITMAP(s) + bmap_nr - 1;
bh = reiserfs_read_bitmap_block(s, bmap_nr - 1); bh = reiserfs_read_bitmap_block(s, bmap_nr - 1);
if (!bh) { if (!bh) {
int jerr = journal_end(&th, s); int jerr = journal_end(&th);
if (jerr) if (jerr)
return jerr; return jerr;
return -EIO; return -EIO;
...@@ -200,7 +200,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) ...@@ -200,7 +200,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
info = SB_AP_BITMAP(s) + bmap_nr_new - 1; info = SB_AP_BITMAP(s) + bmap_nr_new - 1;
bh = reiserfs_read_bitmap_block(s, bmap_nr_new - 1); bh = reiserfs_read_bitmap_block(s, bmap_nr_new - 1);
if (!bh) { if (!bh) {
int jerr = journal_end(&th, s); int jerr = journal_end(&th);
if (jerr) if (jerr)
return jerr; return jerr;
return -EIO; return -EIO;
...@@ -225,5 +225,5 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) ...@@ -225,5 +225,5 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s)); journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
SB_JOURNAL(s)->j_must_wait = 1; SB_JOURNAL(s)->j_must_wait = 1;
return journal_end(&th, s); return journal_end(&th);
} }
...@@ -1993,7 +1993,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, ...@@ -1993,7 +1993,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th,
} }
reiserfs_update_sd(th, inode); reiserfs_update_sd(th, inode);
err = journal_end(th, inode->i_sb); err = journal_end(th);
if (err) if (err)
goto out; goto out;
err = journal_begin(th, inode->i_sb, err = journal_begin(th, inode->i_sb,
......
...@@ -74,7 +74,7 @@ static int reiserfs_sync_fs(struct super_block *s, int wait) ...@@ -74,7 +74,7 @@ static int reiserfs_sync_fs(struct super_block *s, int wait)
dquot_writeback_dquots(s, -1); dquot_writeback_dquots(s, -1);
reiserfs_write_lock(s); reiserfs_write_lock(s);
if (!journal_begin(&th, s, 1)) if (!journal_begin(&th, s, 1))
if (!journal_end_sync(&th, s)) if (!journal_end_sync(&th))
reiserfs_flush_old_commits(s); reiserfs_flush_old_commits(s);
reiserfs_write_unlock(s); reiserfs_write_unlock(s);
return 0; return 0;
...@@ -138,7 +138,7 @@ static int reiserfs_freeze(struct super_block *s) ...@@ -138,7 +138,7 @@ static int reiserfs_freeze(struct super_block *s)
1); 1);
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s)); journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
reiserfs_block_writes(&th); reiserfs_block_writes(&th);
journal_end_sync(&th, s); journal_end_sync(&th);
} }
} }
reiserfs_write_unlock(s); reiserfs_write_unlock(s);
...@@ -178,7 +178,7 @@ static int remove_save_link_only(struct super_block *s, ...@@ -178,7 +178,7 @@ static int remove_save_link_only(struct super_block *s,
/* removals are protected by direct items */ /* removals are protected by direct items */
reiserfs_release_objectid(&th, le32_to_cpu(key->k_objectid)); reiserfs_release_objectid(&th, le32_to_cpu(key->k_objectid));
return journal_end(&th, s); return journal_end(&th);
} }
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
...@@ -506,7 +506,7 @@ int remove_save_link(struct inode *inode, int truncate) ...@@ -506,7 +506,7 @@ int remove_save_link(struct inode *inode, int truncate)
} else } else
REISERFS_I(inode)->i_flags &= ~i_link_saved_truncate_mask; REISERFS_I(inode)->i_flags &= ~i_link_saved_truncate_mask;
return journal_end(&th, inode->i_sb); return journal_end(&th);
} }
static void reiserfs_kill_sb(struct super_block *s) static void reiserfs_kill_sb(struct super_block *s)
...@@ -659,7 +659,7 @@ static void reiserfs_dirty_inode(struct inode *inode, int flags) ...@@ -659,7 +659,7 @@ static void reiserfs_dirty_inode(struct inode *inode, int flags)
goto out; goto out;
reiserfs_update_sd(&th, inode); reiserfs_update_sd(&th, inode);
journal_end(&th, inode->i_sb); journal_end(&th);
out: out:
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
...@@ -1514,7 +1514,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) ...@@ -1514,7 +1514,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
} }
/* this will force a full flush of all journal lists */ /* this will force a full flush of all journal lists */
SB_JOURNAL(s)->j_must_wait = 1; SB_JOURNAL(s)->j_must_wait = 1;
err = journal_end(&th, s); err = journal_end(&th);
if (err) if (err)
goto out_err_unlock; goto out_err_unlock;
...@@ -2107,7 +2107,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) ...@@ -2107,7 +2107,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s)); journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
errval = journal_end(&th, s); errval = journal_end(&th);
if (errval) { if (errval) {
dput(s->s_root); dput(s->s_root);
s->s_root = NULL; s->s_root = NULL;
...@@ -2220,7 +2220,7 @@ static int reiserfs_write_dquot(struct dquot *dquot) ...@@ -2220,7 +2220,7 @@ static int reiserfs_write_dquot(struct dquot *dquot)
depth = reiserfs_write_unlock_nested(dquot->dq_sb); depth = reiserfs_write_unlock_nested(dquot->dq_sb);
ret = dquot_commit(dquot); ret = dquot_commit(dquot);
reiserfs_write_lock_nested(dquot->dq_sb, depth); reiserfs_write_lock_nested(dquot->dq_sb, depth);
err = journal_end(&th, dquot->dq_sb); err = journal_end(&th);
if (!ret && err) if (!ret && err)
ret = err; ret = err;
out: out:
...@@ -2243,7 +2243,7 @@ static int reiserfs_acquire_dquot(struct dquot *dquot) ...@@ -2243,7 +2243,7 @@ static int reiserfs_acquire_dquot(struct dquot *dquot)
depth = reiserfs_write_unlock_nested(dquot->dq_sb); depth = reiserfs_write_unlock_nested(dquot->dq_sb);
ret = dquot_acquire(dquot); ret = dquot_acquire(dquot);
reiserfs_write_lock_nested(dquot->dq_sb, depth); reiserfs_write_lock_nested(dquot->dq_sb, depth);
err = journal_end(&th, dquot->dq_sb); err = journal_end(&th);
if (!ret && err) if (!ret && err)
ret = err; ret = err;
out: out:
...@@ -2268,7 +2268,7 @@ static int reiserfs_release_dquot(struct dquot *dquot) ...@@ -2268,7 +2268,7 @@ static int reiserfs_release_dquot(struct dquot *dquot)
} }
ret = dquot_release(dquot); ret = dquot_release(dquot);
reiserfs_write_lock(dquot->dq_sb); reiserfs_write_lock(dquot->dq_sb);
err = journal_end(&th, dquot->dq_sb); err = journal_end(&th);
if (!ret && err) if (!ret && err)
ret = err; ret = err;
reiserfs_write_unlock(dquot->dq_sb); reiserfs_write_unlock(dquot->dq_sb);
...@@ -2301,7 +2301,7 @@ static int reiserfs_write_info(struct super_block *sb, int type) ...@@ -2301,7 +2301,7 @@ static int reiserfs_write_info(struct super_block *sb, int type)
depth = reiserfs_write_unlock_nested(sb); depth = reiserfs_write_unlock_nested(sb);
ret = dquot_commit_info(sb, type); ret = dquot_commit_info(sb, type);
reiserfs_write_lock_nested(sb, depth); reiserfs_write_lock_nested(sb, depth);
err = journal_end(&th, sb); err = journal_end(&th);
if (!ret && err) if (!ret && err)
ret = err; ret = err;
out: out:
...@@ -2374,7 +2374,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, ...@@ -2374,7 +2374,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
err = journal_begin(&th, sb, 1); err = journal_begin(&th, sb, 1);
if (err) if (err)
goto out; goto out;
err = journal_end_sync(&th, sb); err = journal_end_sync(&th);
if (err) if (err)
goto out; goto out;
} }
......
...@@ -292,7 +292,7 @@ static int reiserfs_for_each_xattr(struct inode *inode, ...@@ -292,7 +292,7 @@ static int reiserfs_for_each_xattr(struct inode *inode,
I_MUTEX_XATTR); I_MUTEX_XATTR);
err = action(dir, data); err = action(dir, data);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock(inode->i_sb);
jerror = journal_end(&th, inode->i_sb); jerror = journal_end(&th);
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
mutex_unlock(&dir->d_parent->d_inode->i_mutex); mutex_unlock(&dir->d_parent->d_inode->i_mutex);
err = jerror ?: err; err = jerror ?: err;
...@@ -601,7 +601,7 @@ int reiserfs_xattr_set(struct inode *inode, const char *name, ...@@ -601,7 +601,7 @@ int reiserfs_xattr_set(struct inode *inode, const char *name,
buffer, buffer_size, flags); buffer, buffer_size, flags);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock(inode->i_sb);
error2 = journal_end(&th, inode->i_sb); error2 = journal_end(&th);
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
if (error == 0) if (error == 0)
error = error2; error = error2;
......
...@@ -39,7 +39,7 @@ reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) ...@@ -39,7 +39,7 @@ reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
if (error == 0) { if (error == 0) {
error = __reiserfs_set_acl(&th, inode, type, acl); error = __reiserfs_set_acl(&th, inode, type, acl);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock(inode->i_sb);
error2 = journal_end(&th, inode->i_sb); error2 = journal_end(&th);
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
if (error2) if (error2)
error = error2; error = error2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment