Skip to content

Commit

Permalink
ocfs2: Remove struct ocfs2_journal_handle in favor of handle_t
Browse files Browse the repository at this point in the history
This is mostly a search and replace as ocfs2_journal_handle is now no more
than a container for a handle_t pointer.

ocfs2_commit_trans() becomes very straight forward, and we remove some out
of date comments / code.

Signed-off-by: Mark Fasheh <[email protected]>
  • Loading branch information
Mark Fasheh committed Dec 2, 2006
1 parent 65eff9c commit 1fabe14
Show file tree
Hide file tree
Showing 20 changed files with 130 additions and 186 deletions.
32 changes: 16 additions & 16 deletions fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,29 @@ static int ocfs2_extent_contig(struct inode *inode,
u64 blkno);

static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
int wanted,
struct ocfs2_alloc_context *meta_ac,
struct buffer_head *bhs[]);

static int ocfs2_add_branch(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head *eb_bh,
struct buffer_head *last_eb_bh,
struct ocfs2_alloc_context *meta_ac);

static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
struct ocfs2_alloc_context *meta_ac,
struct buffer_head **ret_new_eb_bh);

static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 blkno,
Expand Down Expand Up @@ -152,7 +152,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
* l_count for you
*/
static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
int wanted,
struct ocfs2_alloc_context *meta_ac,
Expand Down Expand Up @@ -253,7 +253,7 @@ static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
* contain a single record with e_clusters == 0.
*/
static int ocfs2_add_branch(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head *eb_bh,
Expand Down Expand Up @@ -418,7 +418,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
* after this call.
*/
static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
struct ocfs2_alloc_context *meta_ac,
Expand Down Expand Up @@ -520,7 +520,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
* down.
*/
static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 start_blk,
Expand Down Expand Up @@ -809,7 +809,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,

/* the caller needs to update fe->i_clusters */
int ocfs2_insert_extent(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 start_blk,
Expand Down Expand Up @@ -951,7 +951,7 @@ static int ocfs2_truncate_log_can_coalesce(struct ocfs2_truncate_log *tl,
}

static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
u64 start_blk,
unsigned int num_clusters)
{
Expand Down Expand Up @@ -1034,7 +1034,7 @@ static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
}

static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *data_alloc_inode,
struct buffer_head *data_alloc_bh)
{
Expand Down Expand Up @@ -1074,7 +1074,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
/* TODO: Perhaps we can calculate the bulk of the
* credits up front rather than extending like
* this. */
status = ocfs2_extend_trans(handle->k_handle,
status = ocfs2_extend_trans(handle,
OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC);
if (status < 0) {
mlog_errno(status);
Expand Down Expand Up @@ -1113,7 +1113,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
{
int status;
unsigned int num_to_flush;
struct ocfs2_journal_handle *handle;
handle_t *handle;
struct inode *tl_inode = osb->osb_tl_inode;
struct inode *data_alloc_inode = NULL;
struct buffer_head *tl_bh = osb->osb_tl_bh;
Expand Down Expand Up @@ -1339,7 +1339,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
int i;
unsigned int clusters, num_recs, start_cluster;
u64 start_blk;
struct ocfs2_journal_handle *handle;
handle_t *handle;
struct inode *tl_inode = osb->osb_tl_inode;
struct ocfs2_truncate_log *tl;

Expand Down Expand Up @@ -1534,7 +1534,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head *old_last_eb_bh,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct ocfs2_truncate_context *tc)
{
int status, i, depth;
Expand Down Expand Up @@ -1773,7 +1773,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
struct ocfs2_extent_block *eb;
struct ocfs2_extent_list *el;
struct buffer_head *last_eb_bh;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
struct inode *tl_inode = osb->osb_tl_inode;

mlog_entry_void();
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

struct ocfs2_alloc_context;
int ocfs2_insert_extent(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 blkno,
Expand Down
8 changes: 4 additions & 4 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,13 @@ static int walk_page_buffers( handle_t *handle,
return ret;
}

struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
struct page *page,
unsigned from,
unsigned to)
{
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
int ret = 0;

handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
Expand All @@ -372,7 +372,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
}

if (ocfs2_should_order_data(inode)) {
ret = walk_page_buffers(handle->k_handle,
ret = walk_page_buffers(handle,
page_buffers(page),
from, to, NULL,
ocfs2_journal_dirty_data);
Expand All @@ -394,7 +394,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
int ret;
struct buffer_head *di_bh = NULL;
struct inode *inode = page->mapping->host;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
struct ocfs2_dinode *di;

mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/aops.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
unsigned from, unsigned to);

struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
struct page *page,
unsigned from,
unsigned to);
Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int ocfs2_empty_dir(struct inode *inode)

/* returns a bh of the 1st new block in the allocation. */
int ocfs2_do_extend_dir(struct super_block *sb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *dir,
struct buffer_head *parent_fe_bh,
struct ocfs2_alloc_context *data_ac,
Expand Down Expand Up @@ -398,7 +398,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
struct ocfs2_dinode *fe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
struct ocfs2_alloc_context *data_ac = NULL;
struct ocfs2_alloc_context *meta_ac = NULL;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
struct buffer_head *new_bh = NULL;
struct ocfs2_dir_entry * de;
struct super_block *sb = osb->sb;
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
struct buffer_head **ret_de_bh);
struct ocfs2_alloc_context;
int ocfs2_do_extend_dir(struct super_block *sb,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct inode *dir,
struct buffer_head *parent_fe_bh,
struct ocfs2_alloc_context *data_ac,
Expand Down
18 changes: 9 additions & 9 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int ocfs2_sync_file(struct file *file,
return (err < 0) ? -EIO : 0;
}

int ocfs2_set_inode_size(struct ocfs2_journal_handle *handle,
int ocfs2_set_inode_size(handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 new_i_size)
Expand Down Expand Up @@ -163,7 +163,7 @@ static int ocfs2_simple_size_update(struct inode *inode,
{
int ret;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;

handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
if (handle == NULL) {
Expand All @@ -188,7 +188,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
u64 new_i_size)
{
int status;
struct ocfs2_journal_handle *handle;
handle_t *handle;

mlog_entry_void();

Expand Down Expand Up @@ -327,7 +327,7 @@ int ocfs2_do_extend_allocation(struct ocfs2_super *osb,
struct inode *inode,
u32 clusters_to_add,
struct buffer_head *fe_bh,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct ocfs2_alloc_context *data_ac,
struct ocfs2_alloc_context *meta_ac,
enum ocfs2_alloc_restarted *reason_ret)
Expand Down Expand Up @@ -432,7 +432,7 @@ static int ocfs2_extend_allocation(struct inode *inode,
u32 prev_clusters;
struct buffer_head *bh = NULL;
struct ocfs2_dinode *fe = NULL;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
struct ocfs2_alloc_context *data_ac = NULL;
struct ocfs2_alloc_context *meta_ac = NULL;
enum ocfs2_alloc_restarted why;
Expand Down Expand Up @@ -552,7 +552,7 @@ static int ocfs2_extend_allocation(struct inode *inode,
credits = ocfs2_calc_extend_credits(osb->sb,
fe,
clusters_to_add);
status = ocfs2_extend_trans(handle->k_handle, credits);
status = ocfs2_extend_trans(handle, credits);
if (status < 0) {
/* handle still has to be committed at
* this point. */
Expand Down Expand Up @@ -610,7 +610,7 @@ static int ocfs2_write_zero_page(struct inode *inode,
struct page *page;
unsigned long index;
unsigned int offset;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
int ret;

offset = (size & (PAGE_CACHE_SIZE-1)); /* Within page */
Expand Down Expand Up @@ -775,7 +775,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
struct super_block *sb = inode->i_sb;
struct ocfs2_super *osb = OCFS2_SB(sb);
struct buffer_head *bh = NULL;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;

mlog_entry("(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
Expand Down Expand Up @@ -897,7 +897,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
int ret;
struct buffer_head *bh = NULL;
struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_journal_handle *handle;
handle_t *handle;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_dinode *di;

Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ int ocfs2_do_extend_allocation(struct ocfs2_super *osb,
struct inode *inode,
u32 clusters_to_add,
struct buffer_head *fe_bh,
struct ocfs2_journal_handle *handle,
handle_t *handle,
struct ocfs2_alloc_context *data_ac,
struct ocfs2_alloc_context *meta_ac,
enum ocfs2_alloc_restarted *reason);
int ocfs2_setattr(struct dentry *dentry, struct iattr *attr);
int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat);

int ocfs2_set_inode_size(struct ocfs2_journal_handle *handle,
int ocfs2_set_inode_size(handle_t *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 new_i_size);
Expand Down
6 changes: 3 additions & 3 deletions fs/ocfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
struct buffer_head *fe_bh)
{
int status = 0;
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
struct ocfs2_truncate_context *tc = NULL;
struct ocfs2_dinode *fe;

Expand Down Expand Up @@ -568,7 +568,7 @@ static int ocfs2_remove_inode(struct inode *inode,
int status;
struct inode *inode_alloc_inode = NULL;
struct buffer_head *inode_alloc_bh = NULL;
struct ocfs2_journal_handle *handle;
handle_t *handle;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data;

Expand Down Expand Up @@ -1198,7 +1198,7 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
* struct inode.
* Only takes ip_lock.
*/
int ocfs2_mark_inode_dirty(struct ocfs2_journal_handle *handle,
int ocfs2_mark_inode_dirty(handle_t *handle,
struct inode *inode,
struct buffer_head *bh)
{
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ssize_t ocfs2_rw_direct(int rw, struct file *filp, char *buf,
void ocfs2_sync_blockdev(struct super_block *sb);
void ocfs2_refresh_inode(struct inode *inode,
struct ocfs2_dinode *fe);
int ocfs2_mark_inode_dirty(struct ocfs2_journal_handle *handle,
int ocfs2_mark_inode_dirty(handle_t *handle,
struct inode *inode,
struct buffer_head *bh);
int ocfs2_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb);
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
{
struct ocfs2_inode_info *ocfs2_inode = OCFS2_I(inode);
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_journal_handle *handle = NULL;
handle_t *handle = NULL;
struct buffer_head *bh = NULL;
unsigned oldflags;
int status;
Expand Down
Loading

0 comments on commit 1fabe14

Please sign in to comment.