#ifdef REISERFS_PREALLOCATE
reiserfs_discard_prealloc(&th, inode);
#endif
- err = journal_end(&th, inode->i_sb);
+ err = journal_end(&th);
/* copy back the error code from journal_begin */
if (!err)
}
}
if (logit) {
- ret = journal_end(&th, s);
+ ret = journal_end(&th);
drop_write_lock:
reiserfs_write_unlock(s);
}
reiserfs_write_lock_nested(inode->i_sb, depth);
}
- if (journal_end(&th, inode->i_sb))
+ if (journal_end(&th))
goto out;
/*
return 0;
}
reiserfs_update_sd(th, inode);
- err = journal_end(th, s);
+ err = journal_end(th);
if (!err) {
err = journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6);
if (!err)
reiserfs_write_lock(inode->i_sb);
if (!journal_begin(&th, inode->i_sb, jbegin_count)) {
reiserfs_update_sd(&th, inode);
- journal_end_sync(&th, inode->i_sb);
+ journal_end_sync(&th);
}
reiserfs_write_unlock(inode->i_sb);
}
if (retval) {
err = retval;
reiserfs_check_path(&path_to_key);
- journal_end(th, th->t_super);
+ journal_end(th);
goto out_inserted_sd;
}
if (retval) {
err = retval;
reiserfs_check_path(&path_to_key);
- journal_end(th, th->t_super);
+ journal_end(th);
goto out_inserted_sd;
}
} else if (inode->i_sb->s_flags & MS_POSIXACL) {
if (retval) {
err = retval;
reiserfs_check_path(&path_to_key);
- retval = journal_end(th, th->t_super);
+ retval = journal_end(th);
if (retval)
err = retval;
goto out_inserted_sd;
reiserfs_write_lock_nested(inode->i_sb, depth);
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
* to have it outside
*/
add_save_link(&th, inode, 1);
err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps);
- error = journal_end(&th, inode->i_sb);
+ error = journal_end(&th);
if (error)
goto out;
out:
pathrelse(&path);
if (trans_running) {
- int err = journal_end(&th, inode->i_sb);
+ int err = journal_end(&th);
if (err)
retval = err;
trans_running = 0;
} while ((bh = bh->b_this_page) != head);
if (checked) {
- error = journal_end(&th, s);
+ error = journal_end(&th);
reiserfs_write_unlock(s);
if (error)
goto fail;
mark_inode_dirty(inode);
reiserfs_update_sd(&myth, inode);
update_sd = 1;
- ret = journal_end(&myth, inode->i_sb);
+ ret = journal_end(&myth);
if (ret)
goto journal_error;
}
mark_inode_dirty(inode);
reiserfs_update_sd(&myth, inode);
update_sd = 1;
- ret = journal_end(&myth, inode->i_sb);
+ ret = journal_end(&myth);
if (ret)
goto journal_error;
}
err = journal_begin(&th, inode->i_sb, 4);
if (!err) {
reiserfs_discard_prealloc(&th, inode);
- err = journal_end(&th, inode->i_sb);
+ err = journal_end(&th);
}
if (err)
error = err;
error = dquot_transfer(inode, attr);
reiserfs_write_lock(inode->i_sb);
if (error) {
- journal_end(&th, inode->i_sb);
+ journal_end(&th);
reiserfs_write_unlock(inode->i_sb);
goto out;
}
if (attr->ia_valid & ATTR_GID)
inode->i_gid = attr->ia_gid;
mark_inode_dirty(inode);
- error = journal_end(&th, inode->i_sb);
+ error = journal_end(&th);
reiserfs_write_unlock(inode->i_sb);
if (error)
goto out;
#define COMMIT_NOW 2 /* end and commit this transaction */
#define WAIT 4 /* wait for the log blocks to hit the disk */
-static int do_journal_end(struct reiserfs_transaction_handle *,
- struct super_block *, int flags);
+static int do_journal_end(struct reiserfs_transaction_handle *, int flags);
static int flush_journal_list(struct super_block *s,
struct reiserfs_journal_list *jl, int flushall);
static int flush_commit_list(struct super_block *s,
if (!error && !(sb->s_flags & MS_RDONLY)) {
/* end the current trans */
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
1);
journal_mark_dirty(&myth, sb,
SB_BUFFER_WITH_SB(sb));
- do_journal_end(&myth, sb, FLUSH_ALL);
+ do_journal_end(&myth, FLUSH_ALL);
flushed = 1;
}
}
1);
journal_mark_dirty(&myth, sb,
SB_BUFFER_WITH_SB(sb));
- do_journal_end(&myth, sb, FLUSH_ALL);
+ do_journal_end(&myth, FLUSH_ALL);
}
}
/* someone might have ended the transaction while we joined */
if (old_trans_id != journal->j_trans_id) {
- retval = do_journal_end(&myth, sb, 0);
+ retval = do_journal_end(&myth, 0);
} else {
- retval = do_journal_end(&myth, sb, COMMIT_NOW);
+ retval = do_journal_end(&myth, COMMIT_NOW);
}
if (retval)
struct super_block *s = th->t_super;
int ret = 0;
if (th->t_trans_id)
- ret = journal_end(th, th->t_super);
+ ret = journal_end(th);
else
ret = -EIO;
if (th->t_refcount == 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)
reiserfs_warning(sb, "REISER-NESTING",
"th NULL, refcount %d", th->t_refcount);
}
return 0;
} else {
- return do_journal_end(th, sb, 0);
+ return do_journal_end(th, 0);
}
}
* syncs the commit blocks, but does not force the real buffers to disk
* will wait until the current transaction is done/committed before returning
*/
-int journal_end_sync(struct reiserfs_transaction_handle *th,
- struct super_block *sb)
+int journal_end_sync(struct reiserfs_transaction_handle *th)
{
+ struct super_block *sb = th->t_super;
struct reiserfs_journal *journal = SB_JOURNAL(sb);
BUG_ON(!th->t_trans_id);
1);
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 */
* no sense to do an async commit so that kreiserfsd
* can do it later
*/
- do_journal_end(&th, sb, COMMIT_NOW | WAIT);
+ do_journal_end(&th, COMMIT_NOW | WAIT);
}
}
}
* Note, we can't allow the journal_end to proceed while there are still
* writers in the log.
*/
-static int check_journal_end(struct reiserfs_transaction_handle *th,
- struct super_block *sb, int flags)
+static int check_journal_end(struct reiserfs_transaction_handle *th, int flags)
{
time_t now;
int commit_now = flags & COMMIT_NOW;
int wait_on_commit = flags & WAIT;
struct reiserfs_journal_list *jl;
+ struct super_block *sb = th->t_super;
struct reiserfs_journal *journal = SB_JOURNAL(sb);
BUG_ON(!th->t_trans_id);
reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb),
1);
journal_mark_dirty(&th, sb, SB_BUFFER_WITH_SB(sb));
- ret = journal_end(&th, sb);
+ ret = journal_end(&th);
goto flush_commit_only;
}
- ret = journal_end_sync(&th, sb);
+ ret = journal_end_sync(&th);
if (!ret)
ret = 1;
* If the journal is aborted, we just clean up. Things like flushing
* journal lists, etc just won't happen.
*/
-static int do_journal_end(struct reiserfs_transaction_handle *th,
- struct super_block *sb, int flags)
+static int do_journal_end(struct reiserfs_transaction_handle *th, int flags)
{
+ struct super_block *sb = th->t_super;
struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn, *next, *jl_cn;
struct reiserfs_journal_cnode *last_cn = NULL;
BUG_ON(th->t_refcount > 1);
BUG_ON(!th->t_trans_id);
+ BUG_ON(!th->t_super);
/*
* protect flush_older_commits from doing mistakes if the
* not return 1 it tells us if we should continue with the
* journal_end, or just return
*/
- if (!check_journal_end(th, sb, flags)) {
+ if (!check_journal_end(th, flags)) {
reiserfs_schedule_old_flush(sb);
wake_queued_writers(sb);
reiserfs_async_progress_wait(sb);
int err;
drop_nlink(inode);
reiserfs_update_sd(&th, inode);
- err = journal_end(&th, dir->i_sb);
+ err = journal_end(&th);
if (err)
retval = err;
unlock_new_inode(inode);
unlock_new_inode(inode);
d_instantiate(dentry, inode);
- retval = journal_end(&th, dir->i_sb);
+ retval = journal_end(&th);
out_failed:
reiserfs_write_unlock(dir->i_sb);
int err;
drop_nlink(inode);
reiserfs_update_sd(&th, inode);
- err = journal_end(&th, dir->i_sb);
+ err = journal_end(&th);
if (err)
retval = err;
unlock_new_inode(inode);
unlock_new_inode(inode);
d_instantiate(dentry, inode);
- retval = journal_end(&th, dir->i_sb);
+ retval = journal_end(&th);
out_failed:
reiserfs_write_unlock(dir->i_sb);
clear_nlink(inode);
DEC_DIR_INODE_NLINK(dir);
reiserfs_update_sd(&th, inode);
- err = journal_end(&th, dir->i_sb);
+ err = journal_end(&th);
if (err)
retval = err;
unlock_new_inode(inode);
unlock_new_inode(inode);
d_instantiate(dentry, inode);
- retval = journal_end(&th, dir->i_sb);
+ retval = journal_end(&th);
out_failed:
reiserfs_write_unlock(dir->i_sb);
return retval;
/* prevent empty directory from getting lost */
add_save_link(&th, inode, 0 /* not truncate */ );
- retval = journal_end(&th, dir->i_sb);
+ retval = journal_end(&th);
reiserfs_check_path(&path);
out_rmdir:
reiserfs_write_unlock(dir->i_sb);
* release path if operation was not complete
*/
pathrelse(&path);
- err = journal_end(&th, dir->i_sb);
+ err = journal_end(&th);
reiserfs_write_unlock(dir->i_sb);
return err ? err : retval;
}
/* prevent file from getting lost */
add_save_link(&th, inode, 0 /* not truncate */ );
- retval = journal_end(&th, dir->i_sb);
+ retval = journal_end(&th);
reiserfs_check_path(&path);
reiserfs_write_unlock(dir->i_sb);
return retval;
end_unlink:
pathrelse(&path);
- err = journal_end(&th, dir->i_sb);
+ err = journal_end(&th);
reiserfs_check_path(&path);
if (err)
retval = err;
int err;
drop_nlink(inode);
reiserfs_update_sd(&th, inode);
- err = journal_end(&th, parent_dir->i_sb);
+ err = journal_end(&th);
if (err)
retval = err;
unlock_new_inode(inode);
unlock_new_inode(inode);
d_instantiate(dentry, inode);
- retval = journal_end(&th, parent_dir->i_sb);
+ retval = journal_end(&th);
out_failed:
reiserfs_write_unlock(parent_dir->i_sb);
return retval;
if (retval) {
int err;
drop_nlink(inode);
- err = journal_end(&th, dir->i_sb);
+ err = journal_end(&th);
reiserfs_write_unlock(dir->i_sb);
return err ? err : retval;
}
ihold(inode);
d_instantiate(dentry, inode);
- retval = journal_end(&th, dir->i_sb);
+ retval = journal_end(&th);
reiserfs_write_unlock(dir->i_sb);
return retval;
}
"new entry is found, new inode == 0");
}
} else if (retval) {
- int err = journal_end(&th, old_dir->i_sb);
+ int err = journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb);
return err ? err : retval;
}
&old_entry_path,
&old_de)) != NAME_FOUND) {
pathrelse(&old_entry_path);
- journal_end(&th, old_dir->i_sb);
+ journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb);
return -EIO;
}
if (retval != NAME_FOUND_INVISIBLE && retval != NAME_FOUND) {
pathrelse(&new_entry_path);
pathrelse(&old_entry_path);
- journal_end(&th, old_dir->i_sb);
+ journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb);
return -EIO;
}
pathrelse(&dot_dot_entry_path);
pathrelse(&new_entry_path);
pathrelse(&old_entry_path);
- journal_end(&th, old_dir->i_sb);
+ journal_end(&th);
reiserfs_write_unlock(old_dir->i_sb);
return -EIO;
}
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);
return retval;
}
int journal_release(struct reiserfs_transaction_handle *, struct super_block *);
int journal_release_error(struct reiserfs_transaction_handle *,
struct super_block *);
-int journal_end(struct reiserfs_transaction_handle *, struct super_block *);
-int journal_end_sync(struct reiserfs_transaction_handle *,
- struct super_block *);
+int journal_end(struct reiserfs_transaction_handle *);
+int journal_end_sync(struct reiserfs_transaction_handle *);
int journal_mark_freed(struct reiserfs_transaction_handle *,
struct super_block *, b_blocknr_t blocknr);
int journal_transaction_should_end(struct reiserfs_transaction_handle *, int);
info = SB_AP_BITMAP(s) + bmap_nr - 1;
bh = reiserfs_read_bitmap_block(s, bmap_nr - 1);
if (!bh) {
- int jerr = journal_end(&th, s);
+ int jerr = journal_end(&th);
if (jerr)
return jerr;
return -EIO;
info = SB_AP_BITMAP(s) + bmap_nr_new - 1;
bh = reiserfs_read_bitmap_block(s, bmap_nr_new - 1);
if (!bh) {
- int jerr = journal_end(&th, s);
+ int jerr = journal_end(&th);
if (jerr)
return jerr;
return -EIO;
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
SB_JOURNAL(s)->j_must_wait = 1;
- return journal_end(&th, s);
+ return journal_end(&th);
}
}
reiserfs_update_sd(th, inode);
- err = journal_end(th, inode->i_sb);
+ err = journal_end(th);
if (err)
goto out;
err = journal_begin(th, inode->i_sb,
dquot_writeback_dquots(s, -1);
reiserfs_write_lock(s);
if (!journal_begin(&th, s, 1))
- if (!journal_end_sync(&th, s))
+ if (!journal_end_sync(&th))
reiserfs_flush_old_commits(s);
reiserfs_write_unlock(s);
return 0;
1);
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
reiserfs_block_writes(&th);
- journal_end_sync(&th, s);
+ journal_end_sync(&th);
}
}
reiserfs_write_unlock(s);
/* removals are protected by direct items */
reiserfs_release_objectid(&th, le32_to_cpu(key->k_objectid));
- return journal_end(&th, s);
+ return journal_end(&th);
}
#ifdef CONFIG_QUOTA
} else
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)
goto out;
reiserfs_update_sd(&th, inode);
- journal_end(&th, inode->i_sb);
+ journal_end(&th);
out:
reiserfs_write_unlock(inode->i_sb);
}
/* this will force a full flush of all journal lists */
SB_JOURNAL(s)->j_must_wait = 1;
- err = journal_end(&th, s);
+ err = journal_end(&th);
if (err)
goto out_err_unlock;
journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
- errval = journal_end(&th, s);
+ errval = journal_end(&th);
if (errval) {
dput(s->s_root);
s->s_root = NULL;
depth = reiserfs_write_unlock_nested(dquot->dq_sb);
ret = dquot_commit(dquot);
reiserfs_write_lock_nested(dquot->dq_sb, depth);
- err = journal_end(&th, dquot->dq_sb);
+ err = journal_end(&th);
if (!ret && err)
ret = err;
out:
depth = reiserfs_write_unlock_nested(dquot->dq_sb);
ret = dquot_acquire(dquot);
reiserfs_write_lock_nested(dquot->dq_sb, depth);
- err = journal_end(&th, dquot->dq_sb);
+ err = journal_end(&th);
if (!ret && err)
ret = err;
out:
}
ret = dquot_release(dquot);
reiserfs_write_lock(dquot->dq_sb);
- err = journal_end(&th, dquot->dq_sb);
+ err = journal_end(&th);
if (!ret && err)
ret = err;
reiserfs_write_unlock(dquot->dq_sb);
depth = reiserfs_write_unlock_nested(sb);
ret = dquot_commit_info(sb, type);
reiserfs_write_lock_nested(sb, depth);
- err = journal_end(&th, sb);
+ err = journal_end(&th);
if (!ret && err)
ret = err;
out:
err = journal_begin(&th, sb, 1);
if (err)
goto out;
- err = journal_end_sync(&th, sb);
+ err = journal_end_sync(&th);
if (err)
goto out;
}
I_MUTEX_XATTR);
err = action(dir, data);
reiserfs_write_lock(inode->i_sb);
- jerror = journal_end(&th, inode->i_sb);
+ jerror = journal_end(&th);
reiserfs_write_unlock(inode->i_sb);
mutex_unlock(&dir->d_parent->d_inode->i_mutex);
err = jerror ?: err;
buffer, buffer_size, flags);
reiserfs_write_lock(inode->i_sb);
- error2 = journal_end(&th, inode->i_sb);
+ error2 = journal_end(&th);
reiserfs_write_unlock(inode->i_sb);
if (error == 0)
error = error2;
if (error == 0) {
error = __reiserfs_set_acl(&th, inode, type, acl);
reiserfs_write_lock(inode->i_sb);
- error2 = journal_end(&th, inode->i_sb);
+ error2 = journal_end(&th);
reiserfs_write_unlock(inode->i_sb);
if (error2)
error = error2;