mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ocfs2: cleanup some return variables
Simply return directly instead of assign the return value to another variable. Link: https://lkml.kernel.org/r/20220114021641.13927-1-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com> Reported-by: Zeal Robot <zealci@zte.com.cn> Cc: Minghao Chi <chi.minghao@zte.com.cn> Cc: CGEL ZTE <cgel.zte@gmail.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Changwei Ge <gechangwei@live.cn> Cc: Gang He <ghe@suse.com> Cc: Jun Piao <piaojun@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
714fbf2647
commit
38c9d2d3f3
2 changed files with 9 additions and 18 deletions
|
@ -540,15 +540,12 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb,
|
||||||
struct ocfs2_alloc_context *meta_ac,
|
struct ocfs2_alloc_context *meta_ac,
|
||||||
enum ocfs2_alloc_restarted *reason_ret)
|
enum ocfs2_alloc_restarted *reason_ret)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct ocfs2_extent_tree et;
|
struct ocfs2_extent_tree et;
|
||||||
|
|
||||||
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), fe_bh);
|
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), fe_bh);
|
||||||
ret = ocfs2_add_clusters_in_btree(handle, &et, logical_offset,
|
return ocfs2_add_clusters_in_btree(handle, &et, logical_offset,
|
||||||
clusters_to_add, mark_unwritten,
|
clusters_to_add, mark_unwritten,
|
||||||
data_ac, meta_ac, reason_ret);
|
data_ac, meta_ac, reason_ret);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
|
static int ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
|
||||||
|
|
|
@ -683,28 +683,22 @@ static int user_dlm_lock(struct ocfs2_cluster_connection *conn,
|
||||||
void *name,
|
void *name,
|
||||||
unsigned int namelen)
|
unsigned int namelen)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!lksb->lksb_fsdlm.sb_lvbptr)
|
if (!lksb->lksb_fsdlm.sb_lvbptr)
|
||||||
lksb->lksb_fsdlm.sb_lvbptr = (char *)lksb +
|
lksb->lksb_fsdlm.sb_lvbptr = (char *)lksb +
|
||||||
sizeof(struct dlm_lksb);
|
sizeof(struct dlm_lksb);
|
||||||
|
|
||||||
ret = dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm,
|
return dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm,
|
||||||
flags|DLM_LKF_NODLCKWT, name, namelen, 0,
|
flags|DLM_LKF_NODLCKWT, name, namelen, 0,
|
||||||
fsdlm_lock_ast_wrapper, lksb,
|
fsdlm_lock_ast_wrapper, lksb,
|
||||||
fsdlm_blocking_ast_wrapper);
|
fsdlm_blocking_ast_wrapper);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int user_dlm_unlock(struct ocfs2_cluster_connection *conn,
|
static int user_dlm_unlock(struct ocfs2_cluster_connection *conn,
|
||||||
struct ocfs2_dlm_lksb *lksb,
|
struct ocfs2_dlm_lksb *lksb,
|
||||||
u32 flags)
|
u32 flags)
|
||||||
{
|
{
|
||||||
int ret;
|
return dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid,
|
||||||
|
flags, &lksb->lksb_fsdlm, lksb);
|
||||||
ret = dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid,
|
|
||||||
flags, &lksb->lksb_fsdlm, lksb);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int user_dlm_lock_status(struct ocfs2_dlm_lksb *lksb)
|
static int user_dlm_lock_status(struct ocfs2_dlm_lksb *lksb)
|
||||||
|
|
Loading…
Add table
Reference in a new issue