Skip to content

Commit

Permalink
ocfs2: remove unused handle argument from ocfs2_meta_lock_full()
Browse files Browse the repository at this point in the history
Now that this is unused and all callers pass NULL, we can safely remove it.

Signed-off-by: Mark Fasheh <[email protected]>
  • Loading branch information
Mark Fasheh committed Dec 2, 2006
1 parent a301a27 commit 4bcec18
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 51 deletions.
7 changes: 2 additions & 5 deletions fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)

mutex_lock(&data_alloc_inode->i_mutex);

status = ocfs2_meta_lock(data_alloc_inode, NULL, &data_alloc_bh, 1);
status = ocfs2_meta_lock(data_alloc_inode, &data_alloc_bh, 1);
if (status < 0) {
mlog_errno(status);
goto out_mutex;
Expand Down Expand Up @@ -2003,10 +2003,7 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
mutex_lock(&ext_alloc_inode->i_mutex);
(*tc)->tc_ext_alloc_inode = ext_alloc_inode;

status = ocfs2_meta_lock(ext_alloc_inode,
NULL,
&ext_alloc_bh,
1);
status = ocfs2_meta_lock(ext_alloc_inode, &ext_alloc_bh, 1);
if (status < 0) {
mlog_errno(status);
goto bail;
Expand Down
8 changes: 4 additions & 4 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)

mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));

ret = ocfs2_meta_lock_with_page(inode, NULL, NULL, 0, page);
ret = ocfs2_meta_lock_with_page(inode, NULL, 0, page);
if (ret != 0) {
if (ret == AOP_TRUNCATED_PAGE)
unlock = 0;
Expand Down Expand Up @@ -305,7 +305,7 @@ static int ocfs2_prepare_write(struct file *file, struct page *page,

mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);

ret = ocfs2_meta_lock_with_page(inode, NULL, NULL, 0, page);
ret = ocfs2_meta_lock_with_page(inode, NULL, 0, page);
if (ret != 0) {
mlog_errno(ret);
goto out;
Expand Down Expand Up @@ -412,7 +412,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
* stale inode allocation image (i_size, i_clusters, etc).
*/

ret = ocfs2_meta_lock_with_page(inode, NULL, &di_bh, 1, page);
ret = ocfs2_meta_lock_with_page(inode, &di_bh, 1, page);
if (ret != 0) {
mlog_errno(ret);
goto out;
Expand Down Expand Up @@ -490,7 +490,7 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
* accessed concurrently from multiple nodes.
*/
if (!INODE_JOURNAL(inode)) {
err = ocfs2_meta_lock(inode, NULL, NULL, 0);
err = ocfs2_meta_lock(inode, NULL, 0);
if (err) {
if (err != -ENOENT)
mlog_errno(err);
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
stored = 0;
bh = NULL;

error = ocfs2_meta_lock(inode, NULL, NULL, 0);
error = ocfs2_meta_lock(inode, NULL, 0);
if (error < 0) {
if (error != -ENOENT)
mlog_errno(error);
Expand Down
7 changes: 2 additions & 5 deletions fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,6 @@ static int ocfs2_assign_bh(struct inode *inode,
* the result of the lock will be communicated via the callback.
*/
int ocfs2_meta_lock_full(struct inode *inode,
struct ocfs2_journal_handle *handle,
struct buffer_head **ret_bh,
int ex,
int arg_flags)
Expand Down Expand Up @@ -1707,18 +1706,16 @@ int ocfs2_meta_lock_full(struct inode *inode,
* the lock inversion simply.
*/
int ocfs2_meta_lock_with_page(struct inode *inode,
struct ocfs2_journal_handle *handle,
struct buffer_head **ret_bh,
int ex,
struct page *page)
{
int ret;

ret = ocfs2_meta_lock_full(inode, handle, ret_bh, ex,
OCFS2_LOCK_NONBLOCK);
ret = ocfs2_meta_lock_full(inode, ret_bh, ex, OCFS2_LOCK_NONBLOCK);
if (ret == -EAGAIN) {
unlock_page(page);
if (ocfs2_meta_lock(inode, handle, ret_bh, ex) == 0)
if (ocfs2_meta_lock(inode, ret_bh, ex) == 0)
ocfs2_meta_unlock(inode, ex);
ret = AOP_TRUNCATED_PAGE;
}
Expand Down
4 changes: 1 addition & 3 deletions fs/ocfs2/dlmglue.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,16 @@ void ocfs2_data_unlock(struct inode *inode,
int ocfs2_rw_lock(struct inode *inode, int write);
void ocfs2_rw_unlock(struct inode *inode, int write);
int ocfs2_meta_lock_full(struct inode *inode,
struct ocfs2_journal_handle *handle,
struct buffer_head **ret_bh,
int ex,
int arg_flags);
int ocfs2_meta_lock_with_page(struct inode *inode,
struct ocfs2_journal_handle *handle,
struct buffer_head **ret_bh,
int ex,
struct page *page);
/* 99% of the time we don't want to supply any additional flags --
* those are for very specific cases only. */
#define ocfs2_meta_lock(i, h, b, e) ocfs2_meta_lock_full(i, h, b, e, 0)
#define ocfs2_meta_lock(i, b, e) ocfs2_meta_lock_full(i, b, e, 0)
void ocfs2_meta_unlock(struct inode *inode,
int ex);
int ocfs2_super_lock(struct ocfs2_super *osb,
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
mlog(0, "find parent of directory %llu\n",
(unsigned long long)OCFS2_I(dir)->ip_blkno);

status = ocfs2_meta_lock(dir, NULL, NULL, 0);
status = ocfs2_meta_lock(dir, NULL, 0);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down
6 changes: 3 additions & 3 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
}
}

status = ocfs2_meta_lock(inode, NULL, &bh, 1);
status = ocfs2_meta_lock(inode, &bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -1006,7 +1006,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
*/
meta_level = (filp->f_flags & O_APPEND) ? 1 : 0;
for(;;) {
ret = ocfs2_meta_lock(inode, NULL, NULL, meta_level);
ret = ocfs2_meta_lock(inode, NULL, meta_level);
if (ret < 0) {
meta_level = -1;
mlog_errno(ret);
Expand Down Expand Up @@ -1174,7 +1174,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
* like i_size. This allows the checks down below
* generic_file_aio_read() a chance of actually working.
*/
ret = ocfs2_meta_lock(inode, NULL, NULL, 0);
ret = ocfs2_meta_lock(inode, NULL, 0);
if (ret < 0) {
mlog_errno(ret);
goto bail;
Expand Down
10 changes: 5 additions & 5 deletions fs/ocfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static int ocfs2_read_locked_inode(struct inode *inode,
generation, inode);

if (can_lock) {
status = ocfs2_meta_lock(inode, NULL, NULL, 0);
status = ocfs2_meta_lock(inode, NULL, 0);
if (status) {
make_bad_inode(inode);
mlog_errno(status);
Expand Down Expand Up @@ -582,7 +582,7 @@ static int ocfs2_remove_inode(struct inode *inode,
}

mutex_lock(&inode_alloc_inode->i_mutex);
status = ocfs2_meta_lock(inode_alloc_inode, NULL, &inode_alloc_bh, 1);
status = ocfs2_meta_lock(inode_alloc_inode, &inode_alloc_bh, 1);
if (status < 0) {
mutex_unlock(&inode_alloc_inode->i_mutex);

Expand Down Expand Up @@ -705,7 +705,7 @@ static int ocfs2_wipe_inode(struct inode *inode,
* delete_inode operation. We do this now to avoid races with
* recovery completion on other nodes. */
mutex_lock(&orphan_dir_inode->i_mutex);
status = ocfs2_meta_lock(orphan_dir_inode, NULL, &orphan_dir_bh, 1);
status = ocfs2_meta_lock(orphan_dir_inode, &orphan_dir_bh, 1);
if (status < 0) {
mutex_unlock(&orphan_dir_inode->i_mutex);

Expand Down Expand Up @@ -933,7 +933,7 @@ void ocfs2_delete_inode(struct inode *inode)
* allocation lock here as it won't be needed - nobody will
* have the file open.
*/
status = ocfs2_meta_lock(inode, NULL, &di_bh, 1);
status = ocfs2_meta_lock(inode, &di_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -1180,7 +1180,7 @@ int ocfs2_inode_revalidate(struct dentry *dentry)

/* Let ocfs2_meta_lock do the work of updating our struct
* inode for us. */
status = ocfs2_meta_lock(inode, NULL, NULL, 0);
status = ocfs2_meta_lock(inode, NULL, 0);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags)
{
int status;

status = ocfs2_meta_lock(inode, NULL, NULL, 0);
status = ocfs2_meta_lock(inode, NULL, 0);
if (status < 0) {
mlog_errno(status);
return status;
Expand All @@ -50,7 +50,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,

mutex_lock(&inode->i_mutex);

status = ocfs2_meta_lock(inode, NULL, &bh, 1);
status = ocfs2_meta_lock(inode, &bh, 1);
if (status < 0) {
mlog_errno(status);
goto bail;
Expand Down
10 changes: 4 additions & 6 deletions fs/ocfs2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,7 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
/* Skip recovery waits here - journal inode metadata never
* changes in a live cluster so it can be considered an
* exception to the rule. */
status = ocfs2_meta_lock_full(inode, NULL, &bh, 1,
OCFS2_META_LOCK_RECOVERY);
status = ocfs2_meta_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);
if (status < 0) {
if (status != -ERESTARTSYS)
mlog(ML_ERROR, "Could not get lock on journal!\n");
Expand Down Expand Up @@ -1022,8 +1021,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
}
SET_INODE_JOURNAL(inode);

status = ocfs2_meta_lock_full(inode, NULL, &bh, 1,
OCFS2_META_LOCK_RECOVERY);
status = ocfs2_meta_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);
if (status < 0) {
mlog(0, "status returned from ocfs2_meta_lock=%d\n", status);
if (status != -ERESTARTSYS)
Expand Down Expand Up @@ -1212,7 +1210,7 @@ static int ocfs2_trylock_journal(struct ocfs2_super *osb,
SET_INODE_JOURNAL(inode);

flags = OCFS2_META_LOCK_RECOVERY | OCFS2_META_LOCK_NOQUEUE;
status = ocfs2_meta_lock_full(inode, NULL, NULL, 1, flags);
status = ocfs2_meta_lock_full(inode, NULL, 1, flags);
if (status < 0) {
if (status != -EAGAIN)
mlog_errno(status);
Expand Down Expand Up @@ -1295,7 +1293,7 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb,
}

mutex_lock(&orphan_dir_inode->i_mutex);
status = ocfs2_meta_lock(orphan_dir_inode, NULL, NULL, 0);
status = ocfs2_meta_lock(orphan_dir_inode, NULL, 0);
if (status < 0) {
mlog_errno(status);
goto out;
Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/localalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)

mutex_lock(&main_bm_inode->i_mutex);

status = ocfs2_meta_lock(main_bm_inode, NULL, &main_bm_bh, 1);
status = ocfs2_meta_lock(main_bm_inode, &main_bm_bh, 1);
if (status < 0) {
mlog_errno(status);
goto out_mutex;
Expand Down Expand Up @@ -399,7 +399,7 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,

mutex_lock(&main_bm_inode->i_mutex);

status = ocfs2_meta_lock(main_bm_inode, NULL, &main_bm_bh, 1);
status = ocfs2_meta_lock(main_bm_inode, &main_bm_bh, 1);
if (status < 0) {
mlog_errno(status);
goto out_mutex;
Expand Down
24 changes: 12 additions & 12 deletions fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
mlog(0, "find name %.*s in directory %llu\n", dentry->d_name.len,
dentry->d_name.name, (unsigned long long)OCFS2_I(dir)->ip_blkno);

status = ocfs2_meta_lock(dir, NULL, NULL, 0);
status = ocfs2_meta_lock(dir, NULL, 0);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -327,7 +327,7 @@ static int ocfs2_mknod(struct inode *dir,
/* get our super block */
osb = OCFS2_SB(dir->i_sb);

status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
status = ocfs2_meta_lock(dir, &parent_fe_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -658,7 +658,7 @@ static int ocfs2_link(struct dentry *old_dentry,
if (S_ISDIR(inode->i_mode))
return -EPERM;

err = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
err = ocfs2_meta_lock(dir, &parent_fe_bh, 1);
if (err < 0) {
if (err != -ENOENT)
mlog_errno(err);
Expand All @@ -683,7 +683,7 @@ static int ocfs2_link(struct dentry *old_dentry,
goto out;
}

err = ocfs2_meta_lock(inode, NULL, &fe_bh, 1);
err = ocfs2_meta_lock(inode, &fe_bh, 1);
if (err < 0) {
if (err != -ENOENT)
mlog_errno(err);
Expand Down Expand Up @@ -825,7 +825,7 @@ static int ocfs2_unlink(struct inode *dir,
return -EPERM;
}

status = ocfs2_meta_lock(dir, NULL, &parent_node_bh, 1);
status = ocfs2_meta_lock(dir, &parent_node_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand All @@ -850,7 +850,7 @@ static int ocfs2_unlink(struct inode *dir,
goto leave;
}

status = ocfs2_meta_lock(inode, NULL, &fe_bh, 1);
status = ocfs2_meta_lock(inode, &fe_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -1012,7 +1012,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
inode1 = tmpinode;
}
/* lock id2 */
status = ocfs2_meta_lock(inode2, NULL, bh2, 1);
status = ocfs2_meta_lock(inode2, bh2, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand All @@ -1021,7 +1021,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
}

/* lock id1 */
status = ocfs2_meta_lock(inode1, NULL, bh1, 1);
status = ocfs2_meta_lock(inode1, bh1, 1);
if (status < 0) {
/*
* An error return must mean that no cluster locks
Expand Down Expand Up @@ -1142,7 +1142,7 @@ static int ocfs2_rename(struct inode *old_dir,
* the vote thread on other nodes won't have to concurrently
* downconvert the inode and the dentry locks.
*/
status = ocfs2_meta_lock(old_inode, NULL, NULL, 1);
status = ocfs2_meta_lock(old_inode, NULL, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -1234,7 +1234,7 @@ static int ocfs2_rename(struct inode *old_dir,
goto bail;
}

status = ocfs2_meta_lock(new_inode, NULL, &newfe_bh, 1);
status = ocfs2_meta_lock(new_inode, &newfe_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -1608,7 +1608,7 @@ static int ocfs2_symlink(struct inode *dir,
credits = ocfs2_calc_symlink_credits(sb);

/* lock the parent directory */
status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
status = ocfs2_meta_lock(dir, &parent_fe_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
Expand Down Expand Up @@ -2127,7 +2127,7 @@ static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb,

mutex_lock(&orphan_dir_inode->i_mutex);

status = ocfs2_meta_lock(orphan_dir_inode, NULL, &orphan_dir_bh, 1);
status = ocfs2_meta_lock(orphan_dir_inode, &orphan_dir_bh, 1);
if (status < 0) {
mlog_errno(status);
goto leave;
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/suballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,

mutex_lock(&alloc_inode->i_mutex);

status = ocfs2_meta_lock(alloc_inode, NULL, &bh, 1);
status = ocfs2_meta_lock(alloc_inode, &bh, 1);
if (status < 0) {
mutex_unlock(&alloc_inode->i_mutex);
iput(alloc_inode);
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
goto bail;
}

status = ocfs2_meta_lock(inode, NULL, &bh, 0);
status = ocfs2_meta_lock(inode, &bh, 0);
if (status < 0) {
mlog_errno(status);
goto bail;
Expand Down

0 comments on commit 4bcec18

Please sign in to comment.