Commit fbe7c6c7 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

staging: lustre: remove parentheses from return arguments

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier i;
constant c;
@@

return
- (
    \(i\|-i\|i(...)\|c\)
- )
  ;
// </smpl>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1d8cb70c
...@@ -1487,7 +1487,7 @@ kiblnd_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) ...@@ -1487,7 +1487,7 @@ kiblnd_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
switch (type) { switch (type) {
default: default:
LBUG(); LBUG();
return (-EIO); return -EIO;
case LNET_MSG_ACK: case LNET_MSG_ACK:
LASSERT (payload_nob == 0); LASSERT (payload_nob == 0);
......
...@@ -377,7 +377,7 @@ lnet_freelist_init (lnet_freelist_t *fl, int n, int size) ...@@ -377,7 +377,7 @@ lnet_freelist_init (lnet_freelist_t *fl, int n, int size)
LIBCFS_ALLOC(space, n * size); LIBCFS_ALLOC(space, n * size);
if (space == NULL) if (space == NULL)
return (-ENOMEM); return -ENOMEM;
INIT_LIST_HEAD (&fl->fl_list); INIT_LIST_HEAD (&fl->fl_list);
fl->fl_objs = space; fl->fl_objs = space;
...@@ -390,7 +390,7 @@ lnet_freelist_init (lnet_freelist_t *fl, int n, int size) ...@@ -390,7 +390,7 @@ lnet_freelist_init (lnet_freelist_t *fl, int n, int size)
space += size; space += size;
} while (--n != 0); } while (--n != 0);
return (0); return 0;
} }
void void
......
...@@ -321,7 +321,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway, ...@@ -321,7 +321,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway,
LNET_NETTYP(net) == LOLND || LNET_NETTYP(net) == LOLND ||
LNET_NIDNET(gateway) == net || LNET_NIDNET(gateway) == net ||
hops < 1 || hops > 255) hops < 1 || hops > 255)
return (-EINVAL); return -EINVAL;
if (lnet_islocalnet(net)) /* it's a local network */ if (lnet_islocalnet(net)) /* it's a local network */
return 0; /* ignore the route entry */ return 0; /* ignore the route entry */
......
...@@ -640,18 +640,18 @@ int target_send_reply_msg(struct ptlrpc_request *req, int rc, int fail_id) ...@@ -640,18 +640,18 @@ int target_send_reply_msg(struct ptlrpc_request *req, int rc, int fail_id)
{ {
if (OBD_FAIL_CHECK_ORSET(fail_id & ~OBD_FAIL_ONCE, OBD_FAIL_ONCE)) { if (OBD_FAIL_CHECK_ORSET(fail_id & ~OBD_FAIL_ONCE, OBD_FAIL_ONCE)) {
DEBUG_REQ(D_ERROR, req, "dropping reply"); DEBUG_REQ(D_ERROR, req, "dropping reply");
return (-ECOMM); return -ECOMM;
} }
if (unlikely(rc)) { if (unlikely(rc)) {
DEBUG_REQ(D_NET, req, "processing error (%d)", rc); DEBUG_REQ(D_NET, req, "processing error (%d)", rc);
req->rq_status = rc; req->rq_status = rc;
return (ptlrpc_send_error(req, 1)); return ptlrpc_send_error(req, 1);
} else { } else {
DEBUG_REQ(D_NET, req, "sending reply"); DEBUG_REQ(D_NET, req, "sending reply");
} }
return (ptlrpc_send_reply(req, PTLRPC_REPLY_MAYBE_DIFFICULT)); return ptlrpc_send_reply(req, PTLRPC_REPLY_MAYBE_DIFFICULT);
} }
void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id) void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
......
...@@ -105,12 +105,12 @@ libcfs_psdev_open(struct inode *inode, struct file *file) ...@@ -105,12 +105,12 @@ libcfs_psdev_open(struct inode *inode, struct file *file)
int rc = 0; int rc = 0;
if (!inode) if (!inode)
return (-EINVAL); return -EINVAL;
pdu = (struct libcfs_device_userstate **)&file->private_data; pdu = (struct libcfs_device_userstate **)&file->private_data;
if (libcfs_psdev_ops.p_open != NULL) if (libcfs_psdev_ops.p_open != NULL)
rc = libcfs_psdev_ops.p_open(0, (void *)pdu); rc = libcfs_psdev_ops.p_open(0, (void *)pdu);
else else
return (-EPERM); return -EPERM;
return rc; return rc;
} }
...@@ -122,7 +122,7 @@ libcfs_psdev_release(struct inode *inode, struct file *file) ...@@ -122,7 +122,7 @@ libcfs_psdev_release(struct inode *inode, struct file *file)
int rc = 0; int rc = 0;
if (!inode) if (!inode)
return (-EINVAL); return -EINVAL;
pdu = file->private_data; pdu = file->private_data;
if (libcfs_psdev_ops.p_close != NULL) if (libcfs_psdev_ops.p_close != NULL)
rc = libcfs_psdev_ops.p_close(0, (void *)pdu); rc = libcfs_psdev_ops.p_close(0, (void *)pdu);
...@@ -145,14 +145,14 @@ static long libcfs_ioctl(struct file *file, ...@@ -145,14 +145,14 @@ static long libcfs_ioctl(struct file *file,
_IOC_NR(cmd) > IOC_LIBCFS_MAX_NR) { _IOC_NR(cmd) > IOC_LIBCFS_MAX_NR) {
CDEBUG(D_IOCTL, "invalid ioctl ( type %d, nr %d, size %d )\n", CDEBUG(D_IOCTL, "invalid ioctl ( type %d, nr %d, size %d )\n",
_IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd)); _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
return (-EINVAL); return -EINVAL;
} }
/* Handle platform-dependent IOC requests */ /* Handle platform-dependent IOC requests */
switch (cmd) { switch (cmd) {
case IOC_LIBCFS_PANIC: case IOC_LIBCFS_PANIC:
if (!capable(CFS_CAP_SYS_BOOT)) if (!capable(CFS_CAP_SYS_BOOT))
return (-EPERM); return -EPERM;
panic("debugctl-invoked panic"); panic("debugctl-invoked panic");
return 0; return 0;
case IOC_LIBCFS_MEMHOG: case IOC_LIBCFS_MEMHOG:
......
...@@ -298,7 +298,7 @@ libcfs_sock_write (struct socket *sock, void *buffer, int nob, int timeout) ...@@ -298,7 +298,7 @@ libcfs_sock_write (struct socket *sock, void *buffer, int nob, int timeout)
if (rc == 0) { if (rc == 0) {
CERROR ("Unexpected zero rc\n"); CERROR ("Unexpected zero rc\n");
return (-ECONNABORTED); return -ECONNABORTED;
} }
if (ticks <= 0) if (ticks <= 0)
...@@ -308,7 +308,7 @@ libcfs_sock_write (struct socket *sock, void *buffer, int nob, int timeout) ...@@ -308,7 +308,7 @@ libcfs_sock_write (struct socket *sock, void *buffer, int nob, int timeout)
nob -= rc; nob -= rc;
} }
return (0); return 0;
} }
EXPORT_SYMBOL(libcfs_sock_write); EXPORT_SYMBOL(libcfs_sock_write);
...@@ -384,7 +384,7 @@ libcfs_sock_create (struct socket **sockp, int *fatal, ...@@ -384,7 +384,7 @@ libcfs_sock_create (struct socket **sockp, int *fatal,
*sockp = sock; *sockp = sock;
if (rc != 0) { if (rc != 0) {
CERROR ("Can't create socket: %d\n", rc); CERROR ("Can't create socket: %d\n", rc);
return (rc); return rc;
} }
option = 1; option = 1;
...@@ -436,7 +436,7 @@ libcfs_sock_setbuf (struct socket *sock, int txbufsize, int rxbufsize) ...@@ -436,7 +436,7 @@ libcfs_sock_setbuf (struct socket *sock, int txbufsize, int rxbufsize)
if (rc != 0) { if (rc != 0) {
CERROR ("Can't set send buffer %d: %d\n", CERROR ("Can't set send buffer %d: %d\n",
option, rc); option, rc);
return (rc); return rc;
} }
} }
...@@ -447,7 +447,7 @@ libcfs_sock_setbuf (struct socket *sock, int txbufsize, int rxbufsize) ...@@ -447,7 +447,7 @@ libcfs_sock_setbuf (struct socket *sock, int txbufsize, int rxbufsize)
if (rc != 0) { if (rc != 0) {
CERROR ("Can't set receive buffer %d: %d\n", CERROR ("Can't set receive buffer %d: %d\n",
option, rc); option, rc);
return (rc); return rc;
} }
} }
......
...@@ -119,7 +119,7 @@ kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages, ...@@ -119,7 +119,7 @@ kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
count1 < PAGE_CACHE_SIZE/sizeof(struct page *)) { count1 < PAGE_CACHE_SIZE/sizeof(struct page *)) {
if (cfs_signal_pending()) if (cfs_signal_pending())
return (-EINTR); return -EINTR;
*level1p = alloc_page(flags); *level1p = alloc_page(flags);
if (*level1p == NULL) if (*level1p == NULL)
...@@ -134,11 +134,11 @@ kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages, ...@@ -134,11 +134,11 @@ kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
count2 < PAGE_CACHE_SIZE/sizeof(struct page *)) { count2 < PAGE_CACHE_SIZE/sizeof(struct page *)) {
if (cfs_signal_pending()) if (cfs_signal_pending())
return (-EINTR); return -EINTR;
*level2p = alloc_page(flags); *level2p = alloc_page(flags);
if (*level2p == NULL) if (*level2p == NULL)
return (-ENOMEM); return -ENOMEM;
ldu->ldu_memhog_pages++; ldu->ldu_memhog_pages++;
level2p++; level2p++;
...@@ -351,7 +351,7 @@ static int init_libcfs_module(void) ...@@ -351,7 +351,7 @@ static int init_libcfs_module(void)
rc = libcfs_debug_init(5 * 1024 * 1024); rc = libcfs_debug_init(5 * 1024 * 1024);
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "LustreError: libcfs_debug_init: %d\n", rc); printk(KERN_ERR "LustreError: libcfs_debug_init: %d\n", rc);
return (rc); return rc;
} }
rc = cfs_cpu_init(); rc = cfs_cpu_init();
......
...@@ -761,9 +761,9 @@ void ll_kill_super(struct super_block *sb) ...@@ -761,9 +761,9 @@ void ll_kill_super(struct super_block *sb)
static inline int ll_set_opt(const char *opt, char *data, int fl) static inline int ll_set_opt(const char *opt, char *data, int fl)
{ {
if (strncmp(opt, data, strlen(opt)) != 0) if (strncmp(opt, data, strlen(opt)) != 0)
return(0); return 0;
else else
return(fl); return fl;
} }
/* non-client-specific mount options are parsed in lmd_parse */ /* non-client-specific mount options are parsed in lmd_parse */
...@@ -2213,7 +2213,7 @@ int ll_process_config(struct lustre_cfg *lcfg) ...@@ -2213,7 +2213,7 @@ int ll_process_config(struct lustre_cfg *lcfg)
lcfg, sb); lcfg, sb);
if (rc > 0) if (rc > 0)
rc = 0; rc = 0;
return(rc); return rc;
} }
/* this function prepares md_op_data hint for passing ot down to MD stack. */ /* this function prepares md_op_data hint for passing ot down to MD stack. */
......
...@@ -526,7 +526,7 @@ ssize_t ll_getxattr(struct dentry *dentry, const char *name, ...@@ -526,7 +526,7 @@ ssize_t ll_getxattr(struct dentry *dentry, const char *name,
ptlrpc_req_finished(request); ptlrpc_req_finished(request);
else if (lmm) else if (lmm)
obd_free_diskmd(ll_i2dtexp(inode), &lmm); obd_free_diskmd(ll_i2dtexp(inode), &lmm);
return(rc); return rc;
} }
return ll_getxattr_common(inode, name, buffer, size, OBD_MD_FLXATTR); return ll_getxattr_common(inode, name, buffer, size, OBD_MD_FLXATTR);
......
...@@ -443,7 +443,7 @@ struct lustre_idmap_table *lustre_idmap_init(void) ...@@ -443,7 +443,7 @@ struct lustre_idmap_table *lustre_idmap_init(void)
OBD_ALLOC_PTR(t); OBD_ALLOC_PTR(t);
if (unlikely(t == NULL)) if (unlikely(t == NULL))
return (ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
spin_lock_init(&t->lit_lock); spin_lock_init(&t->lit_lock);
for (i = 0; i < ARRAY_SIZE(t->lit_idmaps); i++) for (i = 0; i < ARRAY_SIZE(t->lit_idmaps); i++)
......
...@@ -1927,8 +1927,8 @@ int lprocfs_obd_seq_create(struct obd_device *dev, ...@@ -1927,8 +1927,8 @@ int lprocfs_obd_seq_create(struct obd_device *dev,
const struct file_operations *seq_fops, const struct file_operations *seq_fops,
void *data) void *data)
{ {
return (lprocfs_seq_create(dev->obd_proc_entry, name, return lprocfs_seq_create(dev->obd_proc_entry, name,
mode, seq_fops, data)); mode, seq_fops, data);
} }
EXPORT_SYMBOL(lprocfs_obd_seq_create); EXPORT_SYMBOL(lprocfs_obd_seq_create);
......
...@@ -174,7 +174,7 @@ int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, ...@@ -174,7 +174,7 @@ int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
lcfg->lcfg_nid = nid; lcfg->lcfg_nid = nid;
rc = class_process_config(lcfg); rc = class_process_config(lcfg);
lustre_cfg_free(lcfg); lustre_cfg_free(lcfg);
return(rc); return rc;
} }
EXPORT_SYMBOL(do_lcfg); EXPORT_SYMBOL(do_lcfg);
......
...@@ -276,7 +276,7 @@ echo_page_debug_check(struct page *page, u64 id, ...@@ -276,7 +276,7 @@ echo_page_debug_check(struct page *page, u64 id,
kunmap(page); kunmap(page);
return (rc); return rc;
} }
/* This allows us to verify that desc_private is passed unmolested */ /* This allows us to verify that desc_private is passed unmolested */
...@@ -659,7 +659,7 @@ int echo_persistent_pages_init(void) ...@@ -659,7 +659,7 @@ int echo_persistent_pages_init(void)
OBD_PAGE_ALLOC(pg, gfp_mask); OBD_PAGE_ALLOC(pg, gfp_mask);
if (pg == NULL) { if (pg == NULL) {
echo_persistent_pages_fini (); echo_persistent_pages_fini ();
return (-ENOMEM); return -ENOMEM;
} }
memset (kmap (pg), 0, PAGE_CACHE_SIZE); memset (kmap (pg), 0, PAGE_CACHE_SIZE);
...@@ -668,5 +668,5 @@ int echo_persistent_pages_init(void) ...@@ -668,5 +668,5 @@ int echo_persistent_pages_init(void)
echo_persistent_pages[i] = pg; echo_persistent_pages[i] = pg;
} }
return (0); return 0;
} }
...@@ -922,7 +922,7 @@ static struct lu_device *echo_device_alloc(const struct lu_env *env, ...@@ -922,7 +922,7 @@ static struct lu_device *echo_device_alloc(const struct lu_env *env,
default: default:
break; break;
} }
return(ERR_PTR(rc)); return ERR_PTR(rc);
} }
static int echo_device_init(const struct lu_env *env, struct lu_device *d, static int echo_device_init(const struct lu_env *env, struct lu_device *d,
...@@ -1384,15 +1384,15 @@ echo_copyout_lsm (struct lov_stripe_md *lsm, void *_ulsm, int ulsm_nob) ...@@ -1384,15 +1384,15 @@ echo_copyout_lsm (struct lov_stripe_md *lsm, void *_ulsm, int ulsm_nob)
nob = offsetof (struct lov_stripe_md, lsm_oinfo[lsm->lsm_stripe_count]); nob = offsetof (struct lov_stripe_md, lsm_oinfo[lsm->lsm_stripe_count]);
if (nob > ulsm_nob) if (nob > ulsm_nob)
return (-EINVAL); return -EINVAL;
if (copy_to_user (ulsm, lsm, sizeof(*ulsm))) if (copy_to_user (ulsm, lsm, sizeof(*ulsm)))
return (-EFAULT); return -EFAULT;
for (i = 0; i < lsm->lsm_stripe_count; i++) { for (i = 0; i < lsm->lsm_stripe_count; i++) {
if (copy_to_user (ulsm->lsm_oinfo[i], lsm->lsm_oinfo[i], if (copy_to_user (ulsm->lsm_oinfo[i], lsm->lsm_oinfo[i],
sizeof(lsm->lsm_oinfo[0]))) sizeof(lsm->lsm_oinfo[0])))
return (-EFAULT); return -EFAULT;
} }
return 0; return 0;
} }
...@@ -1405,16 +1405,16 @@ echo_copyin_lsm (struct echo_device *ed, struct lov_stripe_md *lsm, ...@@ -1405,16 +1405,16 @@ echo_copyin_lsm (struct echo_device *ed, struct lov_stripe_md *lsm,
int i; int i;
if (ulsm_nob < sizeof (*lsm)) if (ulsm_nob < sizeof (*lsm))
return (-EINVAL); return -EINVAL;
if (copy_from_user (lsm, ulsm, sizeof (*lsm))) if (copy_from_user (lsm, ulsm, sizeof (*lsm)))
return (-EFAULT); return -EFAULT;
if (lsm->lsm_stripe_count > ec->ec_nstripes || if (lsm->lsm_stripe_count > ec->ec_nstripes ||
lsm->lsm_magic != LOV_MAGIC || lsm->lsm_magic != LOV_MAGIC ||
(lsm->lsm_stripe_size & (~CFS_PAGE_MASK)) != 0 || (lsm->lsm_stripe_size & (~CFS_PAGE_MASK)) != 0 ||
((__u64)lsm->lsm_stripe_size * lsm->lsm_stripe_count > ~0UL)) ((__u64)lsm->lsm_stripe_size * lsm->lsm_stripe_count > ~0UL))
return (-EINVAL); return -EINVAL;
for (i = 0; i < lsm->lsm_stripe_count; i++) { for (i = 0; i < lsm->lsm_stripe_count; i++) {
...@@ -1422,9 +1422,9 @@ echo_copyin_lsm (struct echo_device *ed, struct lov_stripe_md *lsm, ...@@ -1422,9 +1422,9 @@ echo_copyin_lsm (struct echo_device *ed, struct lov_stripe_md *lsm,
((struct lov_stripe_md *)ulsm)-> \ ((struct lov_stripe_md *)ulsm)-> \
lsm_oinfo[i], lsm_oinfo[i],
sizeof(lsm->lsm_oinfo[0]))) sizeof(lsm->lsm_oinfo[0])))
return (-EFAULT); return -EFAULT;
} }
return (0); return 0;
} }
static inline void echo_md_build_name(struct lu_name *lname, char *name, static inline void echo_md_build_name(struct lu_name *lname, char *name,
...@@ -2282,7 +2282,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed, ...@@ -2282,7 +2282,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
echo_free_memmd(ed, &lsm); echo_free_memmd(ed, &lsm);
if (rc) if (rc)
CERROR("create object failed with: rc = %d\n", rc); CERROR("create object failed with: rc = %d\n", rc);
return (rc); return rc;
} }
static int echo_get_object(struct echo_object **ecop, struct echo_device *ed, static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
...@@ -3008,7 +3008,7 @@ static int echo_client_setup(const struct lu_env *env, ...@@ -3008,7 +3008,7 @@ static int echo_client_setup(const struct lu_env *env,
if (rc != 0) { if (rc != 0) {
CERROR("fail to connect to device %s\n", CERROR("fail to connect to device %s\n",
lustre_cfg_string(lcfg, 1)); lustre_cfg_string(lcfg, 1));
return (rc); return rc;
} }
return rc; return rc;
......
...@@ -1114,7 +1114,7 @@ static int check_write_rcs(struct ptlrpc_request *req, ...@@ -1114,7 +1114,7 @@ static int check_write_rcs(struct ptlrpc_request *req,
niocount); niocount);
if (remote_rcs == NULL) { if (remote_rcs == NULL) {
CDEBUG(D_INFO, "Missing/short RC vector on BRW_WRITE reply\n"); CDEBUG(D_INFO, "Missing/short RC vector on BRW_WRITE reply\n");
return(-EPROTO); return -EPROTO;
} }
/* return error if any niobuf was in error */ /* return error if any niobuf was in error */
...@@ -1125,17 +1125,17 @@ static int check_write_rcs(struct ptlrpc_request *req, ...@@ -1125,17 +1125,17 @@ static int check_write_rcs(struct ptlrpc_request *req,
if (remote_rcs[i] != 0) { if (remote_rcs[i] != 0) {
CDEBUG(D_INFO, "rc[%d] invalid (%d) req %p\n", CDEBUG(D_INFO, "rc[%d] invalid (%d) req %p\n",
i, remote_rcs[i], req); i, remote_rcs[i], req);
return(-EPROTO); return -EPROTO;
} }
} }
if (req->rq_bulk->bd_nob_transferred != requested_nob) { if (req->rq_bulk->bd_nob_transferred != requested_nob) {
CERROR("Unexpected # bytes transferred: %d (requested %d)\n", CERROR("Unexpected # bytes transferred: %d (requested %d)\n",
req->rq_bulk->bd_nob_transferred, requested_nob); req->rq_bulk->bd_nob_transferred, requested_nob);
return(-EPROTO); return -EPROTO;
} }
return (0); return 0;
} }
static inline int can_merge_pages(struct brw_page *p1, struct brw_page *p2) static inline int can_merge_pages(struct brw_page *p1, struct brw_page *p2)
...@@ -1546,7 +1546,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc) ...@@ -1546,7 +1546,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
if (rc != req->rq_bulk->bd_nob_transferred) { if (rc != req->rq_bulk->bd_nob_transferred) {
CERROR ("Unexpected rc %d (%d transferred)\n", CERROR ("Unexpected rc %d (%d transferred)\n",
rc, req->rq_bulk->bd_nob_transferred); rc, req->rq_bulk->bd_nob_transferred);
return (-EPROTO); return -EPROTO;
} }
if (rc < aa->aa_requested_nob) if (rc < aa->aa_requested_nob)
...@@ -1636,7 +1636,7 @@ static int osc_brw_internal(int cmd, struct obd_export *exp, struct obdo *oa, ...@@ -1636,7 +1636,7 @@ static int osc_brw_internal(int cmd, struct obd_export *exp, struct obdo *oa,
rc = osc_brw_prep_request(cmd, &exp->exp_obd->u.cli, oa, lsm, rc = osc_brw_prep_request(cmd, &exp->exp_obd->u.cli, oa, lsm,
page_count, pga, &req, ocapa, 0, resends); page_count, pga, &req, ocapa, 0, resends);
if (rc != 0) if (rc != 0)
return (rc); return rc;
if (resends) { if (resends) {
req->rq_generation_set = 1; req->rq_generation_set = 1;
...@@ -2292,10 +2292,10 @@ static int osc_find_cbdata(struct obd_export *exp, struct lov_stripe_md *lsm, ...@@ -2292,10 +2292,10 @@ static int osc_find_cbdata(struct obd_export *exp, struct lov_stripe_md *lsm,
ostid_build_res_name(&lsm->lsm_oi, &res_id); ostid_build_res_name(&lsm->lsm_oi, &res_id);
rc = ldlm_resource_iterate(obd->obd_namespace, &res_id, replace, data); rc = ldlm_resource_iterate(obd->obd_namespace, &res_id, replace, data);
if (rc == LDLM_ITER_STOP) if (rc == LDLM_ITER_STOP)
return(1); return 1;
if (rc == LDLM_ITER_CONTINUE) if (rc == LDLM_ITER_CONTINUE)
return(0); return 0;
return(rc); return rc;
} }
static int osc_enqueue_fini(struct ptlrpc_request *req, struct ost_lvb *lvb, static int osc_enqueue_fini(struct ptlrpc_request *req, struct ost_lvb *lvb,
...@@ -3561,7 +3561,7 @@ int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg) ...@@ -3561,7 +3561,7 @@ int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg)
break; break;
} }
return(rc); return rc;
} }
static int osc_process_config(struct obd_device *obd, u32 len, void *buf) static int osc_process_config(struct obd_device *obd, u32 len, void *buf)
......
...@@ -313,14 +313,14 @@ static int unpack_reply(struct ptlrpc_request *req) ...@@ -313,14 +313,14 @@ static int unpack_reply(struct ptlrpc_request *req)
rc = ptlrpc_unpack_rep_msg(req, req->rq_replen); rc = ptlrpc_unpack_rep_msg(req, req->rq_replen);
if (rc) { if (rc) {
DEBUG_REQ(D_ERROR, req, "unpack_rep failed: %d", rc); DEBUG_REQ(D_ERROR, req, "unpack_rep failed: %d", rc);
return(-EPROTO); return -EPROTO;
} }
} }
rc = lustre_unpack_rep_ptlrpc_body(req, MSG_PTLRPC_BODY_OFF); rc = lustre_unpack_rep_ptlrpc_body(req, MSG_PTLRPC_BODY_OFF);
if (rc) { if (rc) {
DEBUG_REQ(D_ERROR, req, "unpack ptlrpc body failed: %d", rc); DEBUG_REQ(D_ERROR, req, "unpack ptlrpc body failed: %d", rc);
return(-EPROTO); return -EPROTO;
} }
return 0; return 0;
} }
......
...@@ -542,7 +542,7 @@ int ptlrpc_ni_init(void) ...@@ -542,7 +542,7 @@ int ptlrpc_ni_init(void)
rc = LNetNIInit(pid); rc = LNetNIInit(pid);
if (rc < 0) { if (rc < 0) {
CDEBUG(D_NET, "Can't init network interface: %d\n", rc); CDEBUG(D_NET, "Can't init network interface: %d\n", rc);
return (-ENOENT); return -ENOENT;
} }
/* CAVEAT EMPTOR: how we process portals events is _radically_ /* CAVEAT EMPTOR: how we process portals events is _radically_
...@@ -558,7 +558,7 @@ int ptlrpc_ni_init(void) ...@@ -558,7 +558,7 @@ int ptlrpc_ni_init(void)
CERROR("Failed to allocate event queue: %d\n", rc); CERROR("Failed to allocate event queue: %d\n", rc);
LNetNIFini(); LNetNIFini();
return (-ENOMEM); return -ENOMEM;
} }
......
...@@ -331,7 +331,7 @@ static int llog_client_close(const struct lu_env *env, ...@@ -331,7 +331,7 @@ static int llog_client_close(const struct lu_env *env,
/* this doesn't call LLOG_ORIGIN_HANDLE_CLOSE because /* this doesn't call LLOG_ORIGIN_HANDLE_CLOSE because
the servers all close the file at the end of every the servers all close the file at the end of every
other LLOG_ RPC. */ other LLOG_ RPC. */
return(0); return 0;
} }
struct llog_operations llog_client_ops = { struct llog_operations llog_client_ops = {
......
...@@ -443,7 +443,7 @@ int ptlrpc_reply(struct ptlrpc_request *req) ...@@ -443,7 +443,7 @@ int ptlrpc_reply(struct ptlrpc_request *req)
if (req->rq_no_reply) if (req->rq_no_reply)
return 0; return 0;
else else
return (ptlrpc_send_reply(req, 0)); return ptlrpc_send_reply(req, 0);
} }
EXPORT_SYMBOL(ptlrpc_reply); EXPORT_SYMBOL(ptlrpc_reply);
...@@ -691,7 +691,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) ...@@ -691,7 +691,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
service->srv_req_portal); service->srv_req_portal);
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_RQBD)) if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_RQBD))
return (-ENOMEM); return -ENOMEM;
/* NB: CPT affinity service should use new LNet flag LNET_INS_LOCAL, /* NB: CPT affinity service should use new LNet flag LNET_INS_LOCAL,
* which means buffer can only be attached on local CPT, and LND * which means buffer can only be attached on local CPT, and LND
...@@ -702,7 +702,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) ...@@ -702,7 +702,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
LNET_INS_LOCAL : LNET_INS_AFTER, &me_h); LNET_INS_LOCAL : LNET_INS_AFTER, &me_h);
if (rc != 0) { if (rc != 0) {
CERROR("LNetMEAttach failed: %d\n", rc); CERROR("LNetMEAttach failed: %d\n", rc);
return (-ENOMEM); return -ENOMEM;
} }
LASSERT(rqbd->rqbd_refcount == 0); LASSERT(rqbd->rqbd_refcount == 0);
...@@ -718,7 +718,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) ...@@ -718,7 +718,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
rc = LNetMDAttach(me_h, md, LNET_UNLINK, &rqbd->rqbd_md_h); rc = LNetMDAttach(me_h, md, LNET_UNLINK, &rqbd->rqbd_md_h);
if (rc == 0) if (rc == 0)
return (0); return 0;
CERROR("LNetMDAttach failed: %d;\n", rc); CERROR("LNetMDAttach failed: %d;\n", rc);
LASSERT(rc == -ENOMEM); LASSERT(rc == -ENOMEM);
...@@ -726,5 +726,5 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) ...@@ -726,5 +726,5 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
LASSERT(rc == 0); LASSERT(rc == 0);
rqbd->rqbd_refcount = 0; rqbd->rqbd_refcount = 0;
return (-ENOMEM); return -ENOMEM;
} }
...@@ -435,7 +435,7 @@ struct timeout_item* ptlrpc_new_timeout(int time, enum timeout_event event, ...@@ -435,7 +435,7 @@ struct timeout_item* ptlrpc_new_timeout(int time, enum timeout_event event,
OBD_ALLOC_PTR(ti); OBD_ALLOC_PTR(ti);
if (!ti) if (!ti)
return(NULL); return NULL;
INIT_LIST_HEAD(&ti->ti_obd_list); INIT_LIST_HEAD(&ti->ti_obd_list);
INIT_LIST_HEAD(&ti->ti_chain); INIT_LIST_HEAD(&ti->ti_chain);
...@@ -490,7 +490,7 @@ int ptlrpc_add_timeout_client(int time, enum timeout_event event, ...@@ -490,7 +490,7 @@ int ptlrpc_add_timeout_client(int time, enum timeout_event event,
ti = ptlrpc_pinger_register_timeout(time, event, cb, data); ti = ptlrpc_pinger_register_timeout(time, event, cb, data);
if (!ti) { if (!ti) {
mutex_unlock(&pinger_mutex); mutex_unlock(&pinger_mutex);
return (-EINVAL); return -EINVAL;
} }
list_add(obd_list, &ti->ti_obd_list); list_add(obd_list, &ti->ti_obd_list);
mutex_unlock(&pinger_mutex); mutex_unlock(&pinger_mutex);
......
...@@ -1172,13 +1172,13 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req) ...@@ -1172,13 +1172,13 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req)
__u32 index; __u32 index;
if (AT_OFF) if (AT_OFF)
return(0); return 0;
if (req->rq_no_reply) if (req->rq_no_reply)
return 0; return 0;
if ((lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) == 0) if ((lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) == 0)
return(-ENOSYS); return -ENOSYS;
spin_lock(&svcpt->scp_at_lock); spin_lock(&svcpt->scp_at_lock);
LASSERT(list_empty(&req->rq_timed_list)); LASSERT(list_empty(&req->rq_timed_list));
......
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