staging: lustre: remove RETURN macro
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2013 02:35:28 +0000 (10:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2013 02:35:28 +0000 (10:35 +0800)
We have a kernel-wide function tracing system, so use that instead of
rolling a custom one just for one filesystem.

Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
144 files changed:
drivers/staging/lustre/include/linux/libcfs/bitmap.h
drivers/staging/lustre/include/linux/libcfs/libcfs.h
drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lnet/lnet/lib-eq.c
drivers/staging/lustre/lnet/lnet/module.c
drivers/staging/lustre/lustre/fid/fid_request.c
drivers/staging/lustre/lustre/fid/lproc_fid.c
drivers/staging/lustre/lustre/fld/fld_cache.c
drivers/staging/lustre/lustre/fld/fld_request.c
drivers/staging/lustre/lustre/fld/lproc_fld.c
drivers/staging/lustre/lustre/include/lustre_cfg.h
drivers/staging/lustre/lustre/include/lustre_fid.h
drivers/staging/lustre/lustre/include/lustre_log.h
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/lclient/glimpse.c
drivers/staging/lustre/lustre/lclient/lcommon_cl.c
drivers/staging/lustre/lustre/lclient/lcommon_misc.c
drivers/staging/lustre/lustre/ldlm/interval_tree.c
drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
drivers/staging/lustre/lustre/ldlm/ldlm_request.c
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
drivers/staging/lustre/lustre/libcfs/debug.c
drivers/staging/lustre/lustre/libcfs/hash.c
drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
drivers/staging/lustre/lustre/libcfs/module.c
drivers/staging/lustre/lustre/libcfs/nidstrings.c
drivers/staging/lustre/lustre/libcfs/upcall_cache.c
drivers/staging/lustre/lustre/llite/dcache.c
drivers/staging/lustre/lustre/llite/dir.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_capa.c
drivers/staging/lustre/lustre/llite/llite_close.c
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/llite/llite_mmap.c
drivers/staging/lustre/lustre/llite/llite_nfs.c
drivers/staging/lustre/lustre/llite/lproc_llite.c
drivers/staging/lustre/lustre/llite/namei.c
drivers/staging/lustre/lustre/llite/remote_perm.c
drivers/staging/lustre/lustre/llite/rw.c
drivers/staging/lustre/lustre/llite/rw26.c
drivers/staging/lustre/lustre/llite/statahead.c
drivers/staging/lustre/lustre/llite/symlink.c
drivers/staging/lustre/lustre/llite/vvp_dev.c
drivers/staging/lustre/lustre/llite/vvp_io.c
drivers/staging/lustre/lustre/llite/vvp_lock.c
drivers/staging/lustre/lustre/llite/vvp_page.c
drivers/staging/lustre/lustre/llite/xattr.c
drivers/staging/lustre/lustre/lmv/lmv_fld.c
drivers/staging/lustre/lustre/lmv/lmv_intent.c
drivers/staging/lustre/lustre/lmv/lmv_obd.c
drivers/staging/lustre/lustre/lov/lov_dev.c
drivers/staging/lustre/lustre/lov/lov_io.c
drivers/staging/lustre/lustre/lov/lov_lock.c
drivers/staging/lustre/lustre/lov/lov_log.c
drivers/staging/lustre/lustre/lov/lov_merge.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/lov/lov_object.c
drivers/staging/lustre/lustre/lov/lov_offset.c
drivers/staging/lustre/lustre/lov/lov_pack.c
drivers/staging/lustre/lustre/lov/lov_page.c
drivers/staging/lustre/lustre/lov/lov_pool.c
drivers/staging/lustre/lustre/lov/lov_request.c
drivers/staging/lustre/lustre/lov/lovsub_dev.c
drivers/staging/lustre/lustre/lov/lovsub_lock.c
drivers/staging/lustre/lustre/lov/lovsub_object.c
drivers/staging/lustre/lustre/lov/lovsub_page.c
drivers/staging/lustre/lustre/lvfs/fsfilt.c
drivers/staging/lustre/lustre/lvfs/lvfs_linux.c
drivers/staging/lustre/lustre/mdc/lproc_mdc.c
drivers/staging/lustre/lustre/mdc/mdc_lib.c
drivers/staging/lustre/lustre/mdc/mdc_locks.c
drivers/staging/lustre/lustre/mdc/mdc_reint.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
drivers/staging/lustre/lustre/mgc/libmgc.c
drivers/staging/lustre/lustre/mgc/mgc_request.c
drivers/staging/lustre/lustre/obdclass/acl.c
drivers/staging/lustre/lustre/obdclass/capa.c
drivers/staging/lustre/lustre/obdclass/cl_io.c
drivers/staging/lustre/lustre/obdclass/cl_lock.c
drivers/staging/lustre/lustre/obdclass/cl_object.c
drivers/staging/lustre/lustre/obdclass/cl_page.c
drivers/staging/lustre/lustre/obdclass/class_obd.c
drivers/staging/lustre/lustre/obdclass/dt_object.c
drivers/staging/lustre/lustre/obdclass/genops.c
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
drivers/staging/lustre/lustre/obdclass/llog.c
drivers/staging/lustre/lustre/obdclass/llog_cat.c
drivers/staging/lustre/lustre/obdclass/llog_ioctl.c
drivers/staging/lustre/lustre/obdclass/llog_lvfs.c
drivers/staging/lustre/lustre/obdclass/llog_obd.c
drivers/staging/lustre/lustre/obdclass/llog_osd.c
drivers/staging/lustre/lustre/obdclass/llog_test.c
drivers/staging/lustre/lustre/obdclass/local_storage.c
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
drivers/staging/lustre/lustre/obdclass/lu_object.c
drivers/staging/lustre/lustre/obdclass/lustre_handles.c
drivers/staging/lustre/lustre/obdclass/lustre_peer.c
drivers/staging/lustre/lustre/obdclass/md_attrs.c
drivers/staging/lustre/lustre/obdclass/obd_config.c
drivers/staging/lustre/lustre/obdclass/obd_mount.c
drivers/staging/lustre/lustre/obdecho/echo.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/osc/osc_cache.c
drivers/staging/lustre/lustre/osc/osc_dev.c
drivers/staging/lustre/lustre/osc/osc_io.c
drivers/staging/lustre/lustre/osc/osc_lock.c
drivers/staging/lustre/lustre/osc/osc_object.c
drivers/staging/lustre/lustre/osc/osc_page.c
drivers/staging/lustre/lustre/osc/osc_quota.c
drivers/staging/lustre/lustre/osc/osc_request.c
drivers/staging/lustre/lustre/ptlrpc/client.c
drivers/staging/lustre/lustre/ptlrpc/connection.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_bulk.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_cli_upcall.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_keyring.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_krb5_mech.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_pipefs.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_rawobj.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_svc_upcall.c
drivers/staging/lustre/lustre/ptlrpc/gss/sec_gss.c
drivers/staging/lustre/lustre/ptlrpc/import.c
drivers/staging/lustre/lustre/ptlrpc/llog_client.c
drivers/staging/lustre/lustre/ptlrpc/llog_net.c
drivers/staging/lustre/lustre/ptlrpc/llog_server.c
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
drivers/staging/lustre/lustre/ptlrpc/niobuf.c
drivers/staging/lustre/lustre/ptlrpc/nrs.c
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
drivers/staging/lustre/lustre/ptlrpc/pinger.c
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c
drivers/staging/lustre/lustre/ptlrpc/recover.c
drivers/staging/lustre/lustre/ptlrpc/sec.c
drivers/staging/lustre/lustre/ptlrpc/sec_config.c
drivers/staging/lustre/lustre/ptlrpc/sec_plain.c
drivers/staging/lustre/lustre/ptlrpc/service.c

index 3f1c37b4bb7a0998711f270cb59da4381b16b964..f3d4a896a75a1045282f6fa951e93eaa01bcee8e 100644 (file)
@@ -52,11 +52,11 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
 
        OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size));
        if (ptr == NULL)
-               RETURN(ptr);
+               return ptr;
 
        ptr->size = size;
 
-       RETURN (ptr);
+       return ptr;
 }
 
 #define CFS_FREE_BITMAP(ptr)   OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
index 0f76da5c6c2dfeaded04753e079e94af514fc616..b71046ea18cb9b0ded3281fe0ac463a8cab17060 100644 (file)
@@ -80,20 +80,8 @@ static inline int __is_po2(unsigned long long val)
 #define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \
                           ((hexnum) >> 8 & 0xf))
 
-
-/*
- * Some (nomina odiosa sunt) platforms define NULL as naked 0. This confuses
- * Lustre RETURN(NULL) macro.
- */
-#if defined(NULL)
-#undef NULL
-#endif
-
-#define NULL ((void *)0)
-
 #define LUSTRE_SRV_LNET_PID      LUSTRE_LNET_PID
 
-
 #include <linux/list.h>
 
 #ifndef cfs_for_each_possible_cpu
index e0ed2cf6e208c1784c4c0c278cde40c3cbd02bdb..e6439d19f3e55939d98f2bd240442b2d31258e14 100644 (file)
@@ -262,53 +262,6 @@ do {                                                                   \
 } while (0)
 
 
-/*
- * if rc == NULL, we need to code as RETURN((void *)NULL), otherwise
- * there will be a warning in osx.
- */
-#if defined(__GNUC__)
-
-long libcfs_log_return(struct libcfs_debug_msg_data *, long rc);
-#if BITS_PER_LONG > 32
-#define RETURN(rc)                                                     \
-do {                                                                   \
-       if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {                \
-               LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);     \
-               return (typeof(rc))libcfs_log_return(&msgdata,          \
-                                                    (long)(rc));       \
-       }                                                               \
-                                                                       \
-       return (rc);                                                    \
-} while (0)
-#else /* BITS_PER_LONG == 32 */
-/* We need an on-stack variable, because we cannot case a 32-bit pointer
- * directly to (long long) without generating a complier warning/error, yet
- * casting directly to (long) will truncate 64-bit return values. The log
- * values will print as 32-bit values, but they always have been. LU-1436
- */
-#define RETURN(rc)                                                     \
-do {                                                                   \
-       if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {                \
-               typeof(rc) __rc = (rc);                                 \
-               LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);     \
-               libcfs_log_return(&msgdata, (long_ptr_t)__rc);          \
-               return __rc;                                            \
-       }                                                               \
-                                                                       \
-       return (rc);                                                    \
-} while (0)
-#endif /* BITS_PER_LONG > 32 */
-
-#elif defined(_MSC_VER)
-#define RETURN(rc)                                                   \
-do {                                                               \
-       CDEBUG(D_TRACE, "Process leaving.\n");                    \
-       return (rc);                                                \
-} while (0)
-#else
-# error "Unkown compiler"
-#endif /* __GNUC__ */
-
 extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
                            const char *format1, ...)
        __attribute__ ((format (printf, 2, 3)));
index cdaaca37271900d1191032d201dea1e74bfe4eee..617570439be6ce5b847b9f93b3019b5940c2bf0f 100644 (file)
@@ -380,7 +380,7 @@ ksocknal_receive (ksock_conn_t *conn)
        }
 
        ksocknal_connsock_decref(conn);
-       RETURN (rc);
+       return rc;
 }
 
 void
index 3b8808bf78d188a1d3c042c7fc518e45ceccb02f..4ce68d3b09311d8088665314c0a678f31b50ca54 100644 (file)
@@ -247,7 +247,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
 
        /* must called with lnet_eq_wait_lock hold */
        if (LNET_SEQ_GT(eq->eq_deq_seq, new_event->sequence))
-               RETURN(0);
+               return 0;
 
        /* We've got a new event... */
        *ev = *new_event;
@@ -267,7 +267,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
        }
 
        eq->eq_deq_seq = new_event->sequence + 1;
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -404,7 +404,7 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
        LASSERT (the_lnet.ln_refcount > 0);
 
        if (neq < 1)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        lnet_eq_wait_lock();
 
@@ -414,14 +414,14 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
 
                        if (eq == NULL) {
                                lnet_eq_wait_unlock();
-                               RETURN(-ENOENT);
+                               return -ENOENT;
                        }
 
                        rc = lnet_eq_dequeue_event(eq, event);
                        if (rc != 0) {
                                lnet_eq_wait_unlock();
                                *which = i;
-                               RETURN(rc);
+                               return rc;
                        }
                }
 
@@ -441,5 +441,5 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
        }
 
        lnet_eq_wait_unlock();
-       RETURN(0);
+       return 0;
 }
index c57e46a384cd22236ae26ec7c2cc05c3eb743758..8679b8d1b2f7680f5764020c7cf7c08b12b41973 100644 (file)
@@ -120,7 +120,7 @@ init_lnet(void)
        rc = LNetInit();
        if (rc != 0) {
                CERROR("LNetInit: error %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = libcfs_register_ioctl(&lnet_ioctl_handler);
@@ -132,7 +132,7 @@ init_lnet(void)
                (void) kthread_run(lnet_configure, NULL, "lnet_initd");
        }
 
-       RETURN(0);
+       return 0;
 }
 
 void
index 5d25a336b85266dee1d700f889787ee44eb7b403..dc3948e4be391503998d8ea40b16af918466bb69 100644 (file)
@@ -67,7 +67,7 @@ static int seq_client_rpc(struct lu_client_seq *seq,
        req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_SEQ_QUERY,
                                        LUSTRE_MDS_VERSION, SEQ_QUERY);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* Init operation code */
        op = req_capsule_client_get(&req->rq_pill, &RMF_SEQ_OPC);
@@ -153,14 +153,14 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
                 * setup (lcs_exp != NULL) */
                if (seq->lcs_exp == NULL) {
                        mutex_unlock(&seq->lcs_mutex);
-                       RETURN(-EINPROGRESS);
+                       return -EINPROGRESS;
                }
 
                rc = seq_client_rpc(seq, &seq->lcs_space,
                                    SEQ_ALLOC_SUPER, "super");
        }
        mutex_unlock(&seq->lcs_mutex);
-       RETURN(rc);
+       return rc;
 }
 
 /* Request sequence-controller node to allocate new meta-sequence. */
@@ -182,7 +182,7 @@ static int seq_client_alloc_meta(const struct lu_env *env,
                } while (rc == -EINPROGRESS || rc == -EAGAIN);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Allocate new sequence for client. */
@@ -198,7 +198,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
                if (rc) {
                        CERROR("%s: Can't allocate new meta-sequence,"
                               "rc %d\n", seq->lcs_name, rc);
-                       RETURN(rc);
+                       return rc;
                } else {
                        CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
                               seq->lcs_name, PRANGE(&seq->lcs_space));
@@ -214,7 +214,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
        CDEBUG(D_INFO, "%s: Allocated sequence ["LPX64"]\n", seq->lcs_name,
               *seqnr);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int seq_fid_alloc_prep(struct lu_client_seq *seq,
@@ -333,7 +333,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
                               "rc %d\n", seq->lcs_name, rc);
                        seq_fid_alloc_fini(seq);
                        mutex_unlock(&seq->lcs_mutex);
-                       RETURN(rc);
+                       return rc;
                }
 
                CDEBUG(D_INFO, "%s: Switch to sequence "
@@ -357,7 +357,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
        mutex_unlock(&seq->lcs_mutex);
 
        CDEBUG(D_INFO, "%s: Allocated FID "DFID"\n", seq->lcs_name,  PFID(fid));
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(seq_client_alloc_fid);
 
@@ -422,7 +422,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
                CERROR("%s: LProcFS failed in seq-init\n",
                       seq->lcs_name);
                rc = PTR_ERR(seq->lcs_proc_dir);
-               RETURN(rc);
+               return rc;
        }
 
        rc = lprocfs_add_vars(seq->lcs_proc_dir,
@@ -433,7 +433,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
                GOTO(out_cleanup, rc);
        }
 
-       RETURN(0);
+       return 0;
 
 out_cleanup:
        seq_client_proc_fini(seq);
@@ -479,7 +479,7 @@ int seq_client_init(struct lu_client_seq *seq,
        rc = seq_client_proc_init(seq);
        if (rc)
                seq_client_fini(seq);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(seq_client_init);
 
@@ -505,7 +505,7 @@ int client_fid_init(struct obd_device *obd,
 
        OBD_ALLOC_PTR(cli->cl_seq);
        if (cli->cl_seq == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
        if (prefix == NULL)
@@ -519,7 +519,7 @@ int client_fid_init(struct obd_device *obd,
        if (rc)
                GOTO(out_free_seq, rc);
 
-       RETURN(rc);
+       return rc;
 out_free_seq:
        OBD_FREE_PTR(cli->cl_seq);
        cli->cl_seq = NULL;
@@ -537,7 +537,7 @@ int client_fid_fini(struct obd_device *obd)
                cli->cl_seq = NULL;
        }
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(client_fid_fini);
 
index b1ad25706ed571a133e5342293dbec76b1e4dc65..294070da9d43217eeff7a1b2b211284054b2257f 100644 (file)
@@ -72,9 +72,9 @@ lprocfs_fid_write_common(const char *buffer, unsigned long count,
                    (long long unsigned *)&tmp.lsr_start,
                    (long long unsigned *)&tmp.lsr_end);
        if (rc != 2 || !range_is_sane(&tmp) || range_is_zero(&tmp))
-               RETURN(-EINVAL);
+               return -EINVAL;
        *range = tmp;
-       RETURN(0);
+       return 0;
 }
 
 /* Client side procfs stuff */
@@ -97,7 +97,7 @@ lprocfs_fid_space_seq_write(struct file *file, const char *buffer,
 
        mutex_unlock(&seq->lcs_mutex);
 
-       RETURN(count);
+       return count;
 }
 
 static int
@@ -112,7 +112,7 @@ lprocfs_fid_space_seq_show(struct seq_file *m, void *unused)
        rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n", PRANGE(&seq->lcs_space));
        mutex_unlock(&seq->lcs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 
 static ssize_t
@@ -127,7 +127,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer,
 
        rc = lprocfs_write_helper(buffer, count, &val);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        mutex_lock(&seq->lcs_mutex);
        if (seq->lcs_type == LUSTRE_SEQ_DATA)
@@ -146,7 +146,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer,
 
        mutex_unlock(&seq->lcs_mutex);
 
-       RETURN(count);
+       return count;
 }
 
 static int
@@ -161,7 +161,7 @@ lprocfs_fid_width_seq_show(struct seq_file *m, void *unused)
        rc = seq_printf(m, LPU64"\n", seq->lcs_width);
        mutex_unlock(&seq->lcs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -176,7 +176,7 @@ lprocfs_fid_fid_seq_show(struct seq_file *m, void *unused)
        rc = seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
        mutex_unlock(&seq->lcs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -194,7 +194,7 @@ lprocfs_fid_server_seq_show(struct seq_file *m, void *unused)
        } else {
                rc = seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
        }
-       RETURN(rc);
+       return rc;
 }
 
 LPROC_SEQ_FOPS(lprocfs_fid_space);
index b1672f773066ac0ca7bca4e79ddbfeb57d504376..25099cbe37eb7bf9a7b95911322cde1400407b5c 100644 (file)
@@ -72,7 +72,7 @@ struct fld_cache *fld_cache_init(const char *name,
 
        OBD_ALLOC_PTR(cache);
        if (cache == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        INIT_LIST_HEAD(&cache->fci_entries_head);
        INIT_LIST_HEAD(&cache->fci_lru);
@@ -92,7 +92,7 @@ struct fld_cache *fld_cache_init(const char *name,
        CDEBUG(D_INFO, "%s: FLD cache - Size: %d, Threshold: %d\n",
               cache->fci_name, cache_size, cache_threshold);
 
-       RETURN(cache);
+       return cache;
 }
 
 /**
@@ -223,7 +223,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
        LASSERT(cache != NULL);
 
        if (cache->fci_cache_count < cache->fci_cache_size)
-               RETURN(0);
+               return 0;
 
        curr = cache->fci_lru.prev;
 
@@ -239,7 +239,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
        CDEBUG(D_INFO, "%s: FLD cache - Shrunk by "
               "%d entries\n", cache->fci_name, num);
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -367,10 +367,10 @@ struct fld_cache_entry
 
        OBD_ALLOC_PTR(f_new);
        if (!f_new)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        f_new->fce_range = *range;
-       RETURN(f_new);
+       return f_new;
 }
 
 /**
@@ -424,7 +424,7 @@ int fld_cache_insert_nolock(struct fld_cache *cache,
        /* Add new entry to cache and lru list. */
        fld_cache_entry_add(cache, f_new, prev);
 out:
-       RETURN(0);
+       return 0;
 }
 
 int fld_cache_insert(struct fld_cache *cache,
@@ -435,7 +435,7 @@ int fld_cache_insert(struct fld_cache *cache,
 
        flde = fld_cache_entry_create(range);
        if (IS_ERR(flde))
-               RETURN(PTR_ERR(flde));
+               return PTR_ERR(flde);
 
        write_lock(&cache->fci_lock);
        rc = fld_cache_insert_nolock(cache, flde);
@@ -443,7 +443,7 @@ int fld_cache_insert(struct fld_cache *cache,
        if (rc)
                OBD_FREE_PTR(flde);
 
-       RETURN(rc);
+       return rc;
 }
 
 void fld_cache_delete_nolock(struct fld_cache *cache,
@@ -495,7 +495,7 @@ struct fld_cache_entry
                }
        }
 
-       RETURN(got);
+       return got;
 }
 
 /**
@@ -509,7 +509,7 @@ struct fld_cache_entry
        read_lock(&cache->fci_lock);
        got = fld_cache_entry_lookup_nolock(cache, range);
        read_unlock(&cache->fci_lock);
-       RETURN(got);
+       return got;
 }
 
 /**
@@ -539,9 +539,9 @@ int fld_cache_lookup(struct fld_cache *cache,
 
                        cache->fci_stat.fst_cache++;
                        read_unlock(&cache->fci_lock);
-                       RETURN(0);
+                       return 0;
                }
        }
        read_unlock(&cache->fci_lock);
-       RETURN(-ENOENT);
+       return -ENOENT;
 }
index 9fe004681abdfc9469dd039725c56b790156af87..a08867ab63bf6e9dad37d83185955a728a63b95a 100644 (file)
@@ -70,7 +70,7 @@ static int fld_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
        client_obd_list_lock(&cli->cl_loi_list_lock);
        rc = list_empty(&mcw->mcw_entry);
        client_obd_list_unlock(&cli->cl_loi_list_lock);
-       RETURN(rc);
+       return rc;
 };
 
 static void fld_enter_request(struct client_obd *cli)
@@ -137,7 +137,7 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq)
 
        list_for_each_entry(target, &fld->lcf_targets, ft_chain) {
                if (target->ft_idx == hash)
-                       RETURN(target);
+                       return target;
        }
 
        CERROR("%s: Can't find target by hash %d (seq "LPX64"). "
@@ -161,7 +161,7 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq)
         * LBUG() to catch this situation.
         */
        LBUG();
-       RETURN(NULL);
+       return NULL;
 }
 
 struct lu_fld_hash fld_hash[] = {
@@ -192,7 +192,7 @@ fld_client_get_target(struct lu_client_fld *fld, seqno_t seq)
                       target->ft_idx, seq);
        }
 
-       RETURN(target);
+       return target;
 }
 
 /*
@@ -214,7 +214,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
                CERROR("%s: Attempt to add target %s (idx "LPU64") "
                       "on fly - skip it\n", fld->lcf_name, name,
                       tar->ft_idx);
-               RETURN(0);
+               return 0;
        } else {
                CDEBUG(D_INFO, "%s: Adding target %s (idx "
                       LPU64")\n", fld->lcf_name, name, tar->ft_idx);
@@ -222,7 +222,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
 
        OBD_ALLOC_PTR(target);
        if (target == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        spin_lock(&fld->lcf_lock);
        list_for_each_entry(tmp, &fld->lcf_targets, ft_chain) {
@@ -231,7 +231,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
                        OBD_FREE_PTR(target);
                        CERROR("Target %s exists in FLD and known as %s:#"LPU64"\n",
                               name, fld_target_name(tmp), tmp->ft_idx);
-                       RETURN(-EEXIST);
+                       return -EEXIST;
                }
        }
 
@@ -247,7 +247,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
        fld->lcf_count++;
        spin_unlock(&fld->lcf_lock);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(fld_client_add_target);
 
@@ -268,11 +268,11 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)
                                class_export_put(target->ft_exp);
 
                        OBD_FREE_PTR(target);
-                       RETURN(0);
+                       return 0;
                }
        }
        spin_unlock(&fld->lcf_lock);
-       RETURN(-ENOENT);
+       return -ENOENT;
 }
 EXPORT_SYMBOL(fld_client_del_target);
 
@@ -291,7 +291,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
                CERROR("%s: LProcFS failed in fld-init\n",
                       fld->lcf_name);
                rc = PTR_ERR(fld->lcf_proc_dir);
-               RETURN(rc);
+               return rc;
        }
 
        rc = lprocfs_add_vars(fld->lcf_proc_dir,
@@ -302,7 +302,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
                GOTO(out_cleanup, rc);
        }
 
-       RETURN(0);
+       return 0;
 
 out_cleanup:
        fld_client_proc_fini(fld);
@@ -350,7 +350,7 @@ int fld_client_init(struct lu_client_fld *fld,
        if (!hash_is_sane(hash)) {
                CERROR("%s: Wrong hash function %#x\n",
                       fld->lcf_name, hash);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        fld->lcf_count = 0;
@@ -424,7 +424,7 @@ int fld_client_rpc(struct obd_export *exp,
        req = ptlrpc_request_alloc_pack(imp, &RQF_FLD_QUERY, LUSTRE_MDS_VERSION,
                                        FLD_QUERY);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        op = req_capsule_client_get(&req->rq_pill, &RMF_FLD_OPC);
        *op = fld_op;
@@ -471,7 +471,7 @@ int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds,
        rc = fld_cache_lookup(fld->lcf_cache, seq, &res);
        if (rc == 0) {
                *mds = res.lsr_index;
-               RETURN(0);
+               return 0;
        }
 
        /* Can not find it in the cache */
@@ -491,7 +491,7 @@ int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds,
 
                fld_cache_insert(fld->lcf_cache, &res);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(fld_client_lookup);
 
index cf1f765dcab8db035e098847159c5ece17197f50..052f7d51a07c6bf3aff6206c432c9a07879c8d17 100644 (file)
@@ -71,7 +71,7 @@ fld_proc_targets_seq_show(struct seq_file *m, void *unused)
                seq_printf(m, "%s\n", fld_target_name(target));
        spin_unlock(&fld->lcf_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 static int
@@ -85,7 +85,7 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused)
        seq_printf(m, "%s\n", fld->lcf_hash->fh_name);
        spin_unlock(&fld->lcf_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 static ssize_t
@@ -117,7 +117,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer,
                       fld->lcf_name, hash->fh_name);
        }
 
-       RETURN(count);
+       return count;
 }
 
 static ssize_t
@@ -132,7 +132,7 @@ fld_proc_cache_flush_write(struct file *file, const char __user *buffer,
 
        CDEBUG(D_INFO, "%s: Lookup cache is flushed\n", fld->lcf_name);
 
-       RETURN(count);
+       return count;
 }
 
 static int fld_proc_cache_flush_open(struct inode *inode, struct file *file)
index 46d5aaf178931accc50f5ac0cadb693d145e30d4..e14a5f674e8525d45ff3206ed1539afa4fe36625 100644 (file)
@@ -216,7 +216,7 @@ static inline int lustre_cfg_len(__u32 bufcount, __u32 *buflens)
        for (i = 0; i < bufcount; i++)
                len += cfs_size_round(buflens[i]);
 
-       RETURN(cfs_size_round(len));
+       return cfs_size_round(len);
 }
 
 
@@ -232,7 +232,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
        OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount,
                                       bufs->lcfg_buflen));
        if (!lcfg)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        lcfg->lcfg_version = LUSTRE_CFG_VERSION;
        lcfg->lcfg_command = cmd;
@@ -243,7 +243,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
                lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i];
                LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr);
        }
-       RETURN(lcfg);
+       return lcfg;
 }
 
 static inline void lustre_cfg_free(struct lustre_cfg *lcfg)
@@ -261,27 +261,27 @@ static inline int lustre_cfg_sanity_check(void *buf, int len)
        struct lustre_cfg *lcfg = (struct lustre_cfg *)buf;
 
        if (!lcfg)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* check that the first bits of the struct are valid */
        if (len < LCFG_HDR_SIZE(0))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (lcfg->lcfg_version != LUSTRE_CFG_VERSION)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (lcfg->lcfg_bufcount >= LUSTRE_CFG_MAX_BUFCOUNT)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* check that the buflens are valid */
        if (len < LCFG_HDR_SIZE(lcfg->lcfg_bufcount))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* make sure all the pointers point inside the data */
        if (len < lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
-       RETURN(0);
+       return 0;
 }
 
 #include <lustre/lustre_user.h>
index f8f35c3fa091affeda012cca0055ed880744d9a3..655119eda9a1c941cb47652a30cceb9a8060a369 100644 (file)
@@ -677,14 +677,14 @@ static inline __u64 fid_flatten(const struct lu_fid *fid)
 
        if (fid_is_igif(fid)) {
                ino = lu_igif_ino(fid);
-               RETURN(ino);
+               return ino;
        }
 
        seq = fid_seq(fid);
 
        ino = (seq << 24) + ((seq >> 24) & 0xffffff0000ULL) + fid_oid(fid);
 
-       RETURN(ino ? ino : fid_oid(fid));
+       return ino ? ino : fid_oid(fid);
 }
 
 static inline __u32 fid_hash(const struct lu_fid *f, int bits)
@@ -703,7 +703,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid)
 
        if (fid_is_igif(fid)) {
                ino = lu_igif_ino(fid);
-               RETURN(ino);
+               return ino;
        }
 
        seq = fid_seq(fid) - FID_SEQ_START;
@@ -717,7 +717,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid)
               (seq >> (64 - (40-8)) & 0xffffff00) +
               (fid_oid(fid) & 0xff000fff) + ((fid_oid(fid) & 0x00fff000) << 8);
 
-       RETURN(ino ? ino : fid_oid(fid));
+       return ino ? ino : fid_oid(fid);
 }
 
 static inline int lu_fid_diff(struct lu_fid *fid1, struct lu_fid *fid2)
index 8f642f3e0105735e0924861f16b2d3c863e71ddc..721aa05dff3b9d3b32d79234bed5e96bd170a9f1 100644 (file)
@@ -471,12 +471,12 @@ static inline int llog_destroy(const struct lu_env *env,
 
        rc = llog_handle2ops(handle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_destroy == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        rc = lop->lop_destroy(env, handle);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int llog_next_block(const struct lu_env *env,
@@ -489,13 +489,13 @@ static inline int llog_next_block(const struct lu_env *env,
 
        rc = llog_handle2ops(loghandle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_next_block == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        rc = lop->lop_next_block(env, loghandle, cur_idx, next_idx,
                                 cur_offset, buf, len);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int llog_prev_block(const struct lu_env *env,
@@ -507,12 +507,12 @@ static inline int llog_prev_block(const struct lu_env *env,
 
        rc = llog_handle2ops(loghandle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_prev_block == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        rc = lop->lop_prev_block(env, loghandle, prev_idx, buf, len);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int llog_connect(struct llog_ctxt *ctxt,
@@ -524,12 +524,12 @@ static inline int llog_connect(struct llog_ctxt *ctxt,
 
        rc = llog_obd2ops(ctxt, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_connect == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        rc = lop->lop_connect(ctxt, logid, gen, uuid);
-       RETURN(rc);
+       return rc;
 }
 
 /* llog.c */
index c10477f5faf5169f7e433a298508b146d47c9d8b..983718fe1e550cd0429ad4e6a95d9d259eeb5820 100644 (file)
@@ -326,7 +326,7 @@ void obdo_le_to_cpu(struct obdo *dobdo, struct obdo *sobdo);
 do {                                                       \
        if (!(obd)) {                                      \
                CERROR("NULL device\n");                        \
-               RETURN(-ENODEV);                                \
+               return -ENODEV;                         \
        }                                                      \
 } while (0)
 
@@ -337,7 +337,7 @@ do {                                                            \
        if (!(obd)->obd_set_up || (obd)->obd_stopping) {        \
                CERROR("Device %d not setup\n",          \
                       (obd)->obd_minor);                      \
-               RETURN(-ENODEV);                                \
+               return -ENODEV;                         \
        }                                                      \
 } while (0)
 
@@ -424,7 +424,7 @@ do {                                                            \
                if (err)                                        \
                        CERROR("md_" #op ": dev %s/%d no operation\n", \
                               obd->obd_name, obd->obd_minor);  \
-               RETURN(err);                                \
+               return err;                                 \
        }                                                      \
 } while (0)
 
@@ -432,17 +432,17 @@ do {                                                          \
 do {                                                       \
        if ((exp) == NULL) {                                \
                CERROR("obd_" #op ": NULL export\n");      \
-               RETURN(-ENODEV);                                \
+               return -ENODEV;                         \
        }                                                      \
        if ((exp)->exp_obd == NULL || !OBT((exp)->exp_obd)) {   \
                CERROR("obd_" #op ": cleaned up obd\n");        \
-               RETURN(-EOPNOTSUPP);                        \
+               return -EOPNOTSUPP;                         \
        }                                                      \
        if (!OBT((exp)->exp_obd) || !MDP((exp)->exp_obd, op)) { \
                CERROR("obd_" #op ": dev %s/%d no operation\n", \
                       (exp)->exp_obd->obd_name,                \
                       (exp)->exp_obd->obd_minor);            \
-               RETURN(-EOPNOTSUPP);                        \
+               return -EOPNOTSUPP;                         \
        }                                                      \
 } while (0)
 
@@ -453,7 +453,7 @@ do {                                                            \
                if (err)                                        \
                        CERROR("obd_" #op ": dev %d no operation\n",    \
                               obd->obd_minor);          \
-               RETURN(err);                                \
+               return err;                                 \
        }                                                      \
 } while (0)
 
@@ -461,16 +461,16 @@ do {                                                          \
 do {                                                       \
        if ((exp) == NULL) {                                \
                CERROR("obd_" #op ": NULL export\n");      \
-               RETURN(-ENODEV);                                \
+               return -ENODEV;                         \
        }                                                      \
        if ((exp)->exp_obd == NULL || !OBT((exp)->exp_obd)) {   \
                CERROR("obd_" #op ": cleaned up obd\n");        \
-               RETURN(-EOPNOTSUPP);                        \
+               return -EOPNOTSUPP;                         \
        }                                                      \
        if (!OBT((exp)->exp_obd) || !OBP((exp)->exp_obd, op)) { \
                CERROR("obd_" #op ": dev %d no operation\n",    \
                       (exp)->exp_obd->obd_minor);            \
-               RETURN(-EOPNOTSUPP);                        \
+               return -EOPNOTSUPP;                         \
        }                                                      \
 } while (0)
 
@@ -480,7 +480,7 @@ do {                                                                 \
                if (err)                                             \
                        CERROR("lop_" #op ": dev %d no operation\n", \
                               ctxt->loc_obd->obd_minor);           \
-               RETURN(err);                                     \
+               return err;                                      \
        }                                                           \
 } while (0)
 
@@ -501,7 +501,7 @@ static inline int obd_get_info(const struct lu_env *env,
 
        rc = OBP(exp->exp_obd, get_info)(env, exp, keylen, key, vallen, val,
                                         lsm);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_set_info_async(const struct lu_env *env,
@@ -516,7 +516,7 @@ static inline int obd_set_info_async(const struct lu_env *env,
 
        rc = OBP(exp->exp_obd, set_info_async)(env, exp, keylen, key, vallen,
                                               val, set);
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -574,7 +574,7 @@ static inline int obd_setup(struct obd_device *obd, struct lustre_cfg *cfg)
                OBD_COUNTER_INCREMENT(obd, setup);
                rc = OBP(obd, setup)(obd, cfg);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_precleanup(struct obd_device *obd,
@@ -601,7 +601,7 @@ static inline int obd_precleanup(struct obd_device *obd,
        OBD_COUNTER_INCREMENT(obd, precleanup);
 
        rc = OBP(obd, precleanup)(obd, cleanup_stage);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_cleanup(struct obd_device *obd)
@@ -627,7 +627,7 @@ static inline int obd_cleanup(struct obd_device *obd)
        OBD_COUNTER_INCREMENT(obd, cleanup);
 
        rc = OBP(obd, cleanup)(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static inline void obd_cleanup_client_import(struct obd_device *obd)
@@ -677,7 +677,7 @@ obd_process_config(struct obd_device *obd, int datalen, void *data)
        OBD_COUNTER_INCREMENT(obd, process_config);
        obd->obd_process_conf = 0;
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Pack an in-memory MD struct for storage on disk.
@@ -697,7 +697,7 @@ static inline int obd_packmd(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, packmd);
 
        rc = OBP(exp->exp_obd, packmd)(exp, disk_tgt, mem_src);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_size_diskmd(struct obd_export *exp,
@@ -751,7 +751,7 @@ static inline int obd_unpackmd(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, unpackmd);
 
        rc = OBP(exp->exp_obd, unpackmd)(exp, mem_tgt, disk_src, disk_len);
-       RETURN(rc);
+       return rc;
 }
 
 /* helper functions */
@@ -783,7 +783,7 @@ static inline int obd_precreate(struct obd_export *exp)
        OBD_COUNTER_INCREMENT(exp->exp_obd, precreate);
 
        rc = OBP(exp->exp_obd, precreate)(exp);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_create_async(struct obd_export *exp,
@@ -797,7 +797,7 @@ static inline int obd_create_async(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, create_async);
 
        rc = OBP(exp->exp_obd, create_async)(exp, oinfo, ea, oti);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
@@ -810,7 +810,7 @@ static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, create);
 
        rc = OBP(exp->exp_obd, create)(env, exp, obdo, ea, oti);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
@@ -824,7 +824,7 @@ static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, destroy);
 
        rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, ea, oti, md_exp, capa);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
@@ -836,7 +836,7 @@ static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, getattr);
 
        rc = OBP(exp->exp_obd, getattr)(env, exp, oinfo);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_getattr_async(struct obd_export *exp,
@@ -849,7 +849,7 @@ static inline int obd_getattr_async(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, getattr_async);
 
        rc = OBP(exp->exp_obd, getattr_async)(exp, oinfo, set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
@@ -862,7 +862,7 @@ static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, setattr);
 
        rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo, oti);
-       RETURN(rc);
+       return rc;
 }
 
 /* This performs all the requests set init/wait/destroy actions. */
@@ -878,13 +878,13 @@ static inline int obd_setattr_rqset(struct obd_export *exp,
 
        set =  ptlrpc_prep_set();
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = OBP(exp->exp_obd, setattr_async)(exp, oinfo, oti, set);
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
-       RETURN(rc);
+       return rc;
 }
 
 /* This adds all the requests into @set if @set != NULL, otherwise
@@ -900,7 +900,7 @@ static inline int obd_setattr_async(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, setattr_async);
 
        rc = OBP(exp->exp_obd, setattr_async)(exp, oinfo, oti, set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
@@ -914,7 +914,7 @@ static inline int obd_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
        OBD_COUNTER_INCREMENT(obd, add_conn);
 
        rc = OBP(obd, add_conn)(imp, uuid, priority);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_del_conn(struct obd_import *imp, struct obd_uuid *uuid)
@@ -927,7 +927,7 @@ static inline int obd_del_conn(struct obd_import *imp, struct obd_uuid *uuid)
        OBD_COUNTER_INCREMENT(obd, del_conn);
 
        rc = OBP(obd, del_conn)(imp, uuid);
-       RETURN(rc);
+       return rc;
 }
 
 static inline struct obd_uuid *obd_get_uuid(struct obd_export *exp)
@@ -938,7 +938,7 @@ static inline struct obd_uuid *obd_get_uuid(struct obd_export *exp)
        EXP_COUNTER_INCREMENT(exp, get_uuid);
 
        uuid = OBP(exp->exp_obd, get_uuid)(exp);
-       RETURN(uuid);
+       return uuid;
 }
 
 /** Create a new /a exp on device /a obd for the uuid /a cluuid
@@ -964,7 +964,7 @@ static inline int obd_connect(const struct lu_env *env,
        /* check that only subset is granted */
        LASSERT(ergo(data != NULL, (data->ocd_connect_flags & ocf) ==
                                    data->ocd_connect_flags));
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_reconnect(const struct lu_env *env,
@@ -986,7 +986,7 @@ static inline int obd_reconnect(const struct lu_env *env,
        /* check that only subset is granted */
        LASSERT(ergo(d != NULL,
                     (d->ocd_connect_flags & ocf) == d->ocd_connect_flags));
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_disconnect(struct obd_export *exp)
@@ -997,7 +997,7 @@ static inline int obd_disconnect(struct obd_export *exp)
        EXP_COUNTER_INCREMENT(exp, disconnect);
 
        rc = OBP(exp->exp_obd, disconnect)(exp);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_fid_init(struct obd_device *obd, struct obd_export *exp,
@@ -1009,7 +1009,7 @@ static inline int obd_fid_init(struct obd_device *obd, struct obd_export *exp,
        OBD_COUNTER_INCREMENT(obd, fid_init);
 
        rc = OBP(obd, fid_init)(obd, exp, type);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_fid_fini(struct obd_device *obd)
@@ -1020,7 +1020,7 @@ static inline int obd_fid_fini(struct obd_device *obd)
        OBD_COUNTER_INCREMENT(obd, fid_fini);
 
        rc = OBP(obd, fid_fini)(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_fid_alloc(struct obd_export *exp,
@@ -1033,7 +1033,7 @@ static inline int obd_fid_alloc(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, fid_alloc);
 
        rc = OBP(exp->exp_obd, fid_alloc)(exp, fid, op_data);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_ping(const struct lu_env *env, struct obd_export *exp)
@@ -1044,7 +1044,7 @@ static inline int obd_ping(const struct lu_env *env, struct obd_export *exp)
        EXP_COUNTER_INCREMENT(exp, ping);
 
        rc = OBP(exp->exp_obd, ping)(env, exp);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_pool_new(struct obd_device *obd, char *poolname)
@@ -1055,7 +1055,7 @@ static inline int obd_pool_new(struct obd_device *obd, char *poolname)
        OBD_COUNTER_INCREMENT(obd, pool_new);
 
        rc = OBP(obd, pool_new)(obd, poolname);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_pool_del(struct obd_device *obd, char *poolname)
@@ -1066,7 +1066,7 @@ static inline int obd_pool_del(struct obd_device *obd, char *poolname)
        OBD_COUNTER_INCREMENT(obd, pool_del);
 
        rc = OBP(obd, pool_del)(obd, poolname);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_pool_add(struct obd_device *obd, char *poolname, char *ostname)
@@ -1077,7 +1077,7 @@ static inline int obd_pool_add(struct obd_device *obd, char *poolname, char *ost
        OBD_COUNTER_INCREMENT(obd, pool_add);
 
        rc = OBP(obd, pool_add)(obd, poolname, ostname);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_pool_rem(struct obd_device *obd, char *poolname, char *ostname)
@@ -1088,7 +1088,7 @@ static inline int obd_pool_rem(struct obd_device *obd, char *poolname, char *ost
        OBD_COUNTER_INCREMENT(obd, pool_rem);
 
        rc = OBP(obd, pool_rem)(obd, poolname, ostname);
-       RETURN(rc);
+       return rc;
 }
 
 static inline void obd_getref(struct obd_device *obd)
@@ -1114,7 +1114,7 @@ static inline int obd_init_export(struct obd_export *exp)
        if ((exp)->exp_obd != NULL && OBT((exp)->exp_obd) &&
            OBP((exp)->exp_obd, init_export))
                rc = OBP(exp->exp_obd, init_export)(exp);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_destroy_export(struct obd_export *exp)
@@ -1122,7 +1122,7 @@ static inline int obd_destroy_export(struct obd_export *exp)
        if ((exp)->exp_obd != NULL && OBT((exp)->exp_obd) &&
            OBP((exp)->exp_obd, destroy_export))
                OBP(exp->exp_obd, destroy_export)(exp);
-       RETURN(0);
+       return 0;
 }
 
 static inline int obd_extent_calc(struct obd_export *exp,
@@ -1133,7 +1133,7 @@ static inline int obd_extent_calc(struct obd_export *exp,
 
        EXP_CHECK_DT_OP(exp, extent_calc);
        rc = OBP(exp->exp_obd, extent_calc)(exp, md, cmd, offset);
-       RETURN(rc);
+       return rc;
 }
 
 static inline struct dentry *
@@ -1158,7 +1158,7 @@ static inline int obd_statfs_async(struct obd_export *exp,
        struct obd_device *obd;
 
        if (exp == NULL || exp->exp_obd == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        obd = exp->exp_obd;
        OBD_CHECK_DT_OP(obd, statfs, -EOPNOTSUPP);
@@ -1181,7 +1181,7 @@ static inline int obd_statfs_async(struct obd_export *exp,
                if (oinfo->oi_cb_up)
                        oinfo->oi_cb_up(oinfo, 0);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_statfs_rqset(struct obd_export *exp,
@@ -1194,7 +1194,7 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
 
        set =  ptlrpc_prep_set();
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        oinfo.oi_osfs = osfs;
        oinfo.oi_flags = flags;
@@ -1202,7 +1202,7 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
-       RETURN(rc);
+       return rc;
 }
 
 /* @max_age is the oldest time in jiffies that we accept using a cached data.
@@ -1216,7 +1216,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
        struct obd_device *obd = exp->exp_obd;
 
        if (obd == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        OBD_CHECK_DT_OP(obd, statfs, -EOPNOTSUPP);
        OBD_COUNTER_INCREMENT(obd, statfs);
@@ -1241,7 +1241,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
                memcpy(osfs, &obd->obd_osfs, sizeof(*osfs));
                spin_unlock(&obd->obd_osfs_lock);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo,
@@ -1255,13 +1255,13 @@ static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo,
 
        set =  ptlrpc_prep_set();
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = OBP(exp->exp_obd, sync)(NULL, exp, oinfo, start, end, set);
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_sync(const struct lu_env *env, struct obd_export *exp,
@@ -1274,7 +1274,7 @@ static inline int obd_sync(const struct lu_env *env, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, sync);
 
        rc = OBP(exp->exp_obd, sync)(env, exp, oinfo, start, end, set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_punch_rqset(struct obd_export *exp,
@@ -1289,13 +1289,13 @@ static inline int obd_punch_rqset(struct obd_export *exp,
 
        set =  ptlrpc_prep_set();
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = OBP(exp->exp_obd, punch)(NULL, exp, oinfo, oti, set);
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_punch(const struct lu_env *env, struct obd_export *exp,
@@ -1308,7 +1308,7 @@ static inline int obd_punch(const struct lu_env *env, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, punch);
 
        rc = OBP(exp->exp_obd, punch)(env, exp, oinfo, oti, rqset);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_brw(int cmd, struct obd_export *exp,
@@ -1327,7 +1327,7 @@ static inline int obd_brw(int cmd, struct obd_export *exp,
        }
 
        rc = OBP(exp->exp_obd, brw)(cmd, exp, oinfo, oa_bufs, pg, oti);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_preprw(const struct lu_env *env, int cmd,
@@ -1345,7 +1345,7 @@ static inline int obd_preprw(const struct lu_env *env, int cmd,
 
        rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
                                       pages, local, oti, capa);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_commitrw(const struct lu_env *env, int cmd,
@@ -1360,7 +1360,7 @@ static inline int obd_commitrw(const struct lu_env *env, int cmd,
 
        rc = OBP(exp->exp_obd, commitrw)(env, cmd, exp, oa, objcount, obj,
                                         rnb, pages, local, oti, rc);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_merge_lvb(struct obd_export *exp,
@@ -1373,7 +1373,7 @@ static inline int obd_merge_lvb(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, merge_lvb);
 
        rc = OBP(exp->exp_obd, merge_lvb)(exp, lsm, lvb, kms_only);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_adjust_kms(struct obd_export *exp,
@@ -1386,7 +1386,7 @@ static inline int obd_adjust_kms(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, adjust_kms);
 
        rc = OBP(exp->exp_obd, adjust_kms)(exp, lsm, size, shrink);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp,
@@ -1398,7 +1398,7 @@ static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, iocontrol);
 
        rc = OBP(exp->exp_obd, iocontrol)(cmd, exp, len, karg, uarg);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_enqueue_rqset(struct obd_export *exp,
@@ -1413,13 +1413,13 @@ static inline int obd_enqueue_rqset(struct obd_export *exp,
 
        set =  ptlrpc_prep_set();
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set);
        if (rc == 0)
                rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_enqueue(struct obd_export *exp,
@@ -1433,7 +1433,7 @@ static inline int obd_enqueue(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, enqueue);
 
        rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_change_cbdata(struct obd_export *exp,
@@ -1446,7 +1446,7 @@ static inline int obd_change_cbdata(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, change_cbdata);
 
        rc = OBP(exp->exp_obd, change_cbdata)(exp, lsm, it, data);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_find_cbdata(struct obd_export *exp,
@@ -1459,7 +1459,7 @@ static inline int obd_find_cbdata(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, find_cbdata);
 
        rc = OBP(exp->exp_obd, find_cbdata)(exp, lsm, it, data);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_cancel(struct obd_export *exp,
@@ -1472,7 +1472,7 @@ static inline int obd_cancel(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, cancel);
 
        rc = OBP(exp->exp_obd, cancel)(exp, ea, mode, lockh);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_cancel_unused(struct obd_export *exp,
@@ -1486,7 +1486,7 @@ static inline int obd_cancel_unused(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, cancel_unused);
 
        rc = OBP(exp->exp_obd, cancel_unused)(exp, ea, flags, opaque);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_pin(struct obd_export *exp, const struct lu_fid *fid,
@@ -1499,7 +1499,7 @@ static inline int obd_pin(struct obd_export *exp, const struct lu_fid *fid,
        EXP_COUNTER_INCREMENT(exp, pin);
 
        rc = OBP(exp->exp_obd, pin)(exp, fid, oc, handle, flag);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_unpin(struct obd_export *exp,
@@ -1511,7 +1511,7 @@ static inline int obd_unpin(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, unpin);
 
        rc = OBP(exp->exp_obd, unpin)(exp, handle, flag);
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1538,7 +1538,7 @@ static inline int obd_llog_connect(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, llog_connect);
 
        rc = OBP(exp->exp_obd, llog_connect)(exp, body);
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1557,17 +1557,17 @@ static inline int obd_notify(struct obd_device *obd,
           by this point, and it needs to get them to execute mds_postrecov. */
        if (!obd->obd_set_up && !obd->obd_async_recov) {
                CDEBUG(D_HA, "obd %s not set up\n", obd->obd_name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (!OBP(obd, notify)) {
                CDEBUG(D_HA, "obd %s has no notify handler\n", obd->obd_name);
-               RETURN(-ENOSYS);
+               return -ENOSYS;
        }
 
        OBD_COUNTER_INCREMENT(obd, notify);
        rc = OBP(obd, notify)(obd, watched, ev, data);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_notify_observer(struct obd_device *observer,
@@ -1606,7 +1606,7 @@ static inline int obd_quotacheck(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, quotacheck);
 
        rc = OBP(exp->exp_obd, quotacheck)(exp->exp_obd, exp, oqctl);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_quotactl(struct obd_export *exp,
@@ -1618,7 +1618,7 @@ static inline int obd_quotactl(struct obd_export *exp,
        EXP_COUNTER_INCREMENT(exp, quotactl);
 
        rc = OBP(exp->exp_obd, quotactl)(exp->exp_obd, exp, oqctl);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_health_check(const struct lu_env *env,
@@ -1636,15 +1636,15 @@ static inline int obd_health_check(const struct lu_env *env,
        /* don't use EXP_CHECK_DT_OP, because NULL method is normal here */
        if (obd == NULL || !OBT(obd)) {
                CERROR("cleaned up obd\n");
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
        }
        if (!obd->obd_set_up || obd->obd_stopping)
-               RETURN(0);
+               return 0;
        if (!OBP(obd, health_check))
-               RETURN(0);
+               return 0;
 
        rc = OBP(obd, health_check)(env, obd);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_register_observer(struct obd_device *obd,
@@ -1654,11 +1654,11 @@ static inline int obd_register_observer(struct obd_device *obd,
        down_write(&obd->obd_observer_link_sem);
        if (obd->obd_observer && observer) {
                up_write(&obd->obd_observer_link_sem);
-               RETURN(-EALREADY);
+               return -EALREADY;
        }
        obd->obd_observer = observer;
        up_write(&obd->obd_observer_link_sem);
-       RETURN(0);
+       return 0;
 }
 
 static inline int obd_pin_observer(struct obd_device *obd,
@@ -1668,16 +1668,16 @@ static inline int obd_pin_observer(struct obd_device *obd,
        if (!obd->obd_observer) {
                *observer = NULL;
                up_read(&obd->obd_observer_link_sem);
-               RETURN(-ENOENT);
+               return -ENOENT;
        }
        *observer = obd->obd_observer;
-       RETURN(0);
+       return 0;
 }
 
 static inline int obd_unpin_observer(struct obd_device *obd)
 {
        up_read(&obd->obd_observer_link_sem);
-       RETURN(0);
+       return 0;
 }
 
 #if 0
@@ -1691,7 +1691,7 @@ static inline int obd_register_page_removal_cb(struct obd_export *exp,
        OBD_COUNTER_INCREMENT(exp->exp_obd, register_page_removal_cb);
 
        rc = OBP(exp->exp_obd, register_page_removal_cb)(exp, cb, pin_cb);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_unregister_page_removal_cb(struct obd_export *exp,
@@ -1703,7 +1703,7 @@ static inline int obd_unregister_page_removal_cb(struct obd_export *exp,
        OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_page_removal_cb);
 
        rc = OBP(exp->exp_obd, unregister_page_removal_cb)(exp, cb);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_register_lock_cancel_cb(struct obd_export *exp,
@@ -1715,7 +1715,7 @@ static inline int obd_register_lock_cancel_cb(struct obd_export *exp,
        OBD_COUNTER_INCREMENT(exp->exp_obd, register_lock_cancel_cb);
 
        rc = OBP(exp->exp_obd, register_lock_cancel_cb)(exp, cb);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp,
@@ -1727,7 +1727,7 @@ static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp,
        OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_lock_cancel_cb);
 
        rc = OBP(exp->exp_obd, unregister_lock_cancel_cb)(exp, cb);
-       RETURN(rc);
+       return rc;
 }
 #endif
 
@@ -1740,7 +1740,7 @@ static inline int md_getstatus(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, getstatus);
        EXP_MD_COUNTER_INCREMENT(exp, getstatus);
        rc = MDP(exp->exp_obd, getstatus)(exp, fid, pc);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_getattr(struct obd_export *exp, struct md_op_data *op_data,
@@ -1751,7 +1751,7 @@ static inline int md_getattr(struct obd_export *exp, struct md_op_data *op_data,
        EXP_CHECK_MD_OP(exp, getattr);
        EXP_MD_COUNTER_INCREMENT(exp, getattr);
        rc = MDP(exp->exp_obd, getattr)(exp, op_data, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_null_inode(struct obd_export *exp,
@@ -1762,7 +1762,7 @@ static inline int md_null_inode(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, null_inode);
        EXP_MD_COUNTER_INCREMENT(exp, null_inode);
        rc = MDP(exp->exp_obd, null_inode)(exp, fid);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_find_cbdata(struct obd_export *exp,
@@ -1774,7 +1774,7 @@ static inline int md_find_cbdata(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, find_cbdata);
        EXP_MD_COUNTER_INCREMENT(exp, find_cbdata);
        rc = MDP(exp->exp_obd, find_cbdata)(exp, fid, it, data);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_close(struct obd_export *exp, struct md_op_data *op_data,
@@ -1786,7 +1786,7 @@ static inline int md_close(struct obd_export *exp, struct md_op_data *op_data,
        EXP_CHECK_MD_OP(exp, close);
        EXP_MD_COUNTER_INCREMENT(exp, close);
        rc = MDP(exp->exp_obd, close)(exp, op_data, mod, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_create(struct obd_export *exp, struct md_op_data *op_data,
@@ -1800,7 +1800,7 @@ static inline int md_create(struct obd_export *exp, struct md_op_data *op_data,
        EXP_MD_COUNTER_INCREMENT(exp, create);
        rc = MDP(exp->exp_obd, create)(exp, op_data, data, datalen, mode,
                                       uid, gid, cap_effective, rdev, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_done_writing(struct obd_export *exp,
@@ -1812,7 +1812,7 @@ static inline int md_done_writing(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, done_writing);
        EXP_MD_COUNTER_INCREMENT(exp, done_writing);
        rc = MDP(exp->exp_obd, done_writing)(exp, op_data, mod);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_enqueue(struct obd_export *exp,
@@ -1830,7 +1830,7 @@ static inline int md_enqueue(struct obd_export *exp,
        EXP_MD_COUNTER_INCREMENT(exp, enqueue);
        rc = MDP(exp->exp_obd, enqueue)(exp, einfo, it, op_data, lockh,
                                        lmm, lmmsize, req, extra_lock_flags);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_getattr_name(struct obd_export *exp,
@@ -1842,7 +1842,7 @@ static inline int md_getattr_name(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, getattr_name);
        EXP_MD_COUNTER_INCREMENT(exp, getattr_name);
        rc = MDP(exp->exp_obd, getattr_name)(exp, op_data, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_intent_lock(struct obd_export *exp,
@@ -1859,7 +1859,7 @@ static inline int md_intent_lock(struct obd_export *exp,
        rc = MDP(exp->exp_obd, intent_lock)(exp, op_data, lmm, lmmsize,
                                            it, lookup_flags, reqp, cb_blocking,
                                            extra_lock_flags);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_link(struct obd_export *exp, struct md_op_data *op_data,
@@ -1870,7 +1870,7 @@ static inline int md_link(struct obd_export *exp, struct md_op_data *op_data,
        EXP_CHECK_MD_OP(exp, link);
        EXP_MD_COUNTER_INCREMENT(exp, link);
        rc = MDP(exp->exp_obd, link)(exp, op_data, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_rename(struct obd_export *exp, struct md_op_data *op_data,
@@ -1883,7 +1883,7 @@ static inline int md_rename(struct obd_export *exp, struct md_op_data *op_data,
        EXP_MD_COUNTER_INCREMENT(exp, rename);
        rc = MDP(exp->exp_obd, rename)(exp, op_data, old, oldlen, new,
                                       newlen, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_is_subdir(struct obd_export *exp,
@@ -1896,7 +1896,7 @@ static inline int md_is_subdir(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, is_subdir);
        EXP_MD_COUNTER_INCREMENT(exp, is_subdir);
        rc = MDP(exp->exp_obd, is_subdir)(exp, pfid, cfid, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_setattr(struct obd_export *exp, struct md_op_data *op_data,
@@ -1910,7 +1910,7 @@ static inline int md_setattr(struct obd_export *exp, struct md_op_data *op_data,
        EXP_MD_COUNTER_INCREMENT(exp, setattr);
        rc = MDP(exp->exp_obd, setattr)(exp, op_data, ea, ealen,
                                        ea2, ea2len, request, mod);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_sync(struct obd_export *exp, const struct lu_fid *fid,
@@ -1921,7 +1921,7 @@ static inline int md_sync(struct obd_export *exp, const struct lu_fid *fid,
        EXP_CHECK_MD_OP(exp, sync);
        EXP_MD_COUNTER_INCREMENT(exp, sync);
        rc = MDP(exp->exp_obd, sync)(exp, fid, oc, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_readpage(struct obd_export *exp, struct md_op_data *opdata,
@@ -1933,7 +1933,7 @@ static inline int md_readpage(struct obd_export *exp, struct md_op_data *opdata,
        EXP_CHECK_MD_OP(exp, readpage);
        EXP_MD_COUNTER_INCREMENT(exp, readpage);
        rc = MDP(exp->exp_obd, readpage)(exp, opdata, pages, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_unlink(struct obd_export *exp, struct md_op_data *op_data,
@@ -1944,7 +1944,7 @@ static inline int md_unlink(struct obd_export *exp, struct md_op_data *op_data,
        EXP_CHECK_MD_OP(exp, unlink);
        EXP_MD_COUNTER_INCREMENT(exp, unlink);
        rc = MDP(exp->exp_obd, unlink)(exp, op_data, request);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_get_lustre_md(struct obd_export *exp,
@@ -1955,7 +1955,7 @@ static inline int md_get_lustre_md(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, get_lustre_md);
        EXP_MD_COUNTER_INCREMENT(exp, get_lustre_md);
-       RETURN(MDP(exp->exp_obd, get_lustre_md)(exp, req, dt_exp, md_exp, md));
+       return MDP(exp->exp_obd, get_lustre_md)(exp, req, dt_exp, md_exp, md);
 }
 
 static inline int md_free_lustre_md(struct obd_export *exp,
@@ -1963,7 +1963,7 @@ static inline int md_free_lustre_md(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, free_lustre_md);
        EXP_MD_COUNTER_INCREMENT(exp, free_lustre_md);
-       RETURN(MDP(exp->exp_obd, free_lustre_md)(exp, md));
+       return MDP(exp->exp_obd, free_lustre_md)(exp, md);
 }
 
 static inline int md_setxattr(struct obd_export *exp,
@@ -1975,9 +1975,9 @@ static inline int md_setxattr(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, setxattr);
        EXP_MD_COUNTER_INCREMENT(exp, setxattr);
-       RETURN(MDP(exp->exp_obd, setxattr)(exp, fid, oc, valid, name, input,
+       return MDP(exp->exp_obd, setxattr)(exp, fid, oc, valid, name, input,
                                           input_size, output_size, flags,
-                                          suppgid, request));
+                                          suppgid, request);
 }
 
 static inline int md_getxattr(struct obd_export *exp,
@@ -1989,9 +1989,9 @@ static inline int md_getxattr(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, getxattr);
        EXP_MD_COUNTER_INCREMENT(exp, getxattr);
-       RETURN(MDP(exp->exp_obd, getxattr)(exp, fid, oc, valid, name, input,
+       return MDP(exp->exp_obd, getxattr)(exp, fid, oc, valid, name, input,
                                           input_size, output_size, flags,
-                                          request));
+                                          request);
 }
 
 static inline int md_set_open_replay_data(struct obd_export *exp,
@@ -2000,7 +2000,7 @@ static inline int md_set_open_replay_data(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, set_open_replay_data);
        EXP_MD_COUNTER_INCREMENT(exp, set_open_replay_data);
-       RETURN(MDP(exp->exp_obd, set_open_replay_data)(exp, och, open_req));
+       return MDP(exp->exp_obd, set_open_replay_data)(exp, och, open_req);
 }
 
 static inline int md_clear_open_replay_data(struct obd_export *exp,
@@ -2008,7 +2008,7 @@ static inline int md_clear_open_replay_data(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, clear_open_replay_data);
        EXP_MD_COUNTER_INCREMENT(exp, clear_open_replay_data);
-       RETURN(MDP(exp->exp_obd, clear_open_replay_data)(exp, och));
+       return MDP(exp->exp_obd, clear_open_replay_data)(exp, och);
 }
 
 static inline int md_set_lock_data(struct obd_export *exp,
@@ -2016,7 +2016,7 @@ static inline int md_set_lock_data(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, set_lock_data);
        EXP_MD_COUNTER_INCREMENT(exp, set_lock_data);
-       RETURN(MDP(exp->exp_obd, set_lock_data)(exp, lockh, data, bits));
+       return MDP(exp->exp_obd, set_lock_data)(exp, lockh, data, bits);
 }
 
 static inline int md_cancel_unused(struct obd_export *exp,
@@ -2033,7 +2033,7 @@ static inline int md_cancel_unused(struct obd_export *exp,
 
        rc = MDP(exp->exp_obd, cancel_unused)(exp, fid, policy, mode,
                                              flags, opaque);
-       RETURN(rc);
+       return rc;
 }
 
 static inline ldlm_mode_t md_lock_match(struct obd_export *exp, __u64 flags,
@@ -2045,8 +2045,8 @@ static inline ldlm_mode_t md_lock_match(struct obd_export *exp, __u64 flags,
 {
        EXP_CHECK_MD_OP(exp, lock_match);
        EXP_MD_COUNTER_INCREMENT(exp, lock_match);
-       RETURN(MDP(exp->exp_obd, lock_match)(exp, flags, fid, type,
-                                            policy, mode, lockh));
+       return MDP(exp->exp_obd, lock_match)(exp, flags, fid, type,
+                                            policy, mode, lockh);
 }
 
 static inline int md_init_ea_size(struct obd_export *exp, int easize,
@@ -2054,8 +2054,8 @@ static inline int md_init_ea_size(struct obd_export *exp, int easize,
 {
        EXP_CHECK_MD_OP(exp, init_ea_size);
        EXP_MD_COUNTER_INCREMENT(exp, init_ea_size);
-       RETURN(MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
-                                              cookiesize));
+       return MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
+                                              cookiesize);
 }
 
 static inline int md_get_remote_perm(struct obd_export *exp,
@@ -2065,8 +2065,8 @@ static inline int md_get_remote_perm(struct obd_export *exp,
 {
        EXP_CHECK_MD_OP(exp, get_remote_perm);
        EXP_MD_COUNTER_INCREMENT(exp, get_remote_perm);
-       RETURN(MDP(exp->exp_obd, get_remote_perm)(exp, fid, oc, suppgid,
-                                                 request));
+       return MDP(exp->exp_obd, get_remote_perm)(exp, fid, oc, suppgid,
+                                                 request);
 }
 
 static inline int md_renew_capa(struct obd_export *exp, struct obd_capa *ocapa,
@@ -2077,7 +2077,7 @@ static inline int md_renew_capa(struct obd_export *exp, struct obd_capa *ocapa,
        EXP_CHECK_MD_OP(exp, renew_capa);
        EXP_MD_COUNTER_INCREMENT(exp, renew_capa);
        rc = MDP(exp->exp_obd, renew_capa)(exp, ocapa, cb);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_unpack_capa(struct obd_export *exp,
@@ -2090,7 +2090,7 @@ static inline int md_unpack_capa(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, unpack_capa);
        EXP_MD_COUNTER_INCREMENT(exp, unpack_capa);
        rc = MDP(exp->exp_obd, unpack_capa)(exp, req, field, oc);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_intent_getattr_async(struct obd_export *exp,
@@ -2102,7 +2102,7 @@ static inline int md_intent_getattr_async(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, intent_getattr_async);
        EXP_MD_COUNTER_INCREMENT(exp, intent_getattr_async);
        rc = MDP(exp->exp_obd, intent_getattr_async)(exp, minfo, einfo);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int md_revalidate_lock(struct obd_export *exp,
@@ -2114,7 +2114,7 @@ static inline int md_revalidate_lock(struct obd_export *exp,
        EXP_CHECK_MD_OP(exp, revalidate_lock);
        EXP_MD_COUNTER_INCREMENT(exp, revalidate_lock);
        rc = MDP(exp->exp_obd, revalidate_lock)(exp, it, fid, bits);
-       RETURN(rc);
+       return rc;
 }
 
 
index db72d89573b66cd4b79326ef0af4f2cf7c8c95c7..7bbca4bf6b82aa3dd31049738e8aa3eb1411a544 100644 (file)
@@ -130,10 +130,10 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
                        cio->cui_glimpse = 0;
 
                        if (lock == NULL)
-                               RETURN(0);
+                               return 0;
 
                        if (IS_ERR(lock))
-                               RETURN(PTR_ERR(lock));
+                               return PTR_ERR(lock);
 
                        LASSERT(agl == 0);
                        result = cl_wait(env, lock);
@@ -158,7 +158,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
                }
        }
 
-       RETURN(result);
+       return result;
 }
 
 static int cl_io_get(struct inode *inode, struct lu_env **envout,
@@ -223,7 +223,7 @@ int cl_glimpse_size0(struct inode *inode, int agl)
                        goto again;
                cl_env_put(env, &refcheck);
        }
-       RETURN(result);
+       return result;
 }
 
 int cl_local_size(struct inode *inode)
@@ -238,11 +238,11 @@ int cl_local_size(struct inode *inode)
        int                   refcheck;
 
        if (!cl_i2info(inode)->lli_has_smd)
-               RETURN(0);
+               return 0;
 
        result = cl_io_get(inode, &env, &io, &refcheck);
        if (result <= 0)
-               RETURN(result);
+               return result;
 
        clob = io->ci_obj;
        result = cl_io_init(env, io, CIT_MISC, clob);
@@ -265,5 +265,5 @@ int cl_local_size(struct inode *inode)
        }
        cl_io_fini(env, io);
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
index 41168c2cbdf64fbb286f47009a7e4cfc087bc3ad..8ff38c64b7a1fcf5e28c4f148f9b7d869464bd1a 100644 (file)
@@ -181,7 +181,7 @@ int ccc_device_init(const struct lu_env *env, struct lu_device *d,
                lu_device_get(next);
                lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init);
        }
-       RETURN(rc);
+       return rc;
 }
 
 struct lu_device *ccc_device_fini(const struct lu_env *env,
@@ -203,7 +203,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
 
        OBD_ALLOC_PTR(vdv);
        if (vdv == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        lud = &vdv->cdv_cl.cd_lu_dev;
        cl_device_init(&vdv->cdv_cl, t);
@@ -226,7 +226,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
                ccc_device_free(env, lud);
                lud = ERR_PTR(rc);
        }
-       RETURN(lud);
+       return lud;
 }
 
 struct lu_device *ccc_device_free(const struct lu_env *env,
@@ -426,7 +426,7 @@ int ccc_object_glimpse(const struct lu_env *env,
         */
        if (lvb->lvb_size > 0 && lvb->lvb_blocks == 0)
                lvb->lvb_blocks = dirty_cnt(inode);
-       RETURN(0);
+       return 0;
 }
 
 
@@ -490,7 +490,7 @@ int ccc_page_is_under_lock(const struct lu_env *env,
                }
        } else
                result = 0;
-       RETURN(result);
+       return result;
 }
 
 int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice)
@@ -555,7 +555,7 @@ int ccc_transient_page_prep(const struct lu_env *env,
                                   struct cl_io *unused)
 {
        /* transient page should always be sent. */
-       RETURN(0);
+       return 0;
 }
 
 /*****************************************************************************
@@ -635,7 +635,7 @@ int ccc_lock_fits_into(const struct lu_env *env,
                result = lock->cll_state >= CLS_ENQUEUED;
        else
                result = 1;
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -715,7 +715,7 @@ int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
        descr->cld_enq_flags = enqflags;
 
        cl_io_lock_add(env, io, &cio->cui_link);
-       RETURN(0);
+       return 0;
 }
 
 void ccc_io_update_iov(const struct lu_env *env,
@@ -978,7 +978,7 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        io = ccc_env_thread_io(env);
        io->ci_obj = cl_i2info(inode)->lli_clob;
@@ -1007,7 +1007,7 @@ again:
        if (unlikely(io->ci_need_restart))
                goto again;
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
 
 /*****************************************************************************
@@ -1272,9 +1272,9 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
 __u64 cl_fid_build_ino(const struct lu_fid *fid, int api32)
 {
        if (BITS_PER_LONG == 32 || api32)
-               RETURN(fid_flatten32(fid));
+               return fid_flatten32(fid);
        else
-               RETURN(fid_flatten(fid));
+               return fid_flatten(fid);
 }
 
 /**
@@ -1286,11 +1286,11 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
 
        if (fid_is_igif(fid)) {
                gen = lu_igif_gen(fid);
-               RETURN(gen);
+               return gen;
        }
 
        gen = (fid_flatten(fid) >> 32);
-       RETURN(gen);
+       return gen;
 }
 
 /* lsm is unreliable after hsm implementation as layout can be changed at
index d59a7a94e3529a9a4f0345651979461db163d611..2b4dbeebcd5d64a495f1d661947cce5f62594cc8 100644 (file)
@@ -61,7 +61,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
        rc = obd_get_info(NULL, dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
                          &valsize, &desc, NULL);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
        lsm.lsm_stripe_count = stripes;
@@ -76,7 +76,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
               easize, cookiesize);
 
        rc = md_init_ea_size(md_exp, easize, def_easize, cookiesize);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -114,7 +114,7 @@ int cl_ocd_update(struct obd_device *host,
                       watched->obd_name);
                result = -EINVAL;
        }
-       RETURN(result);
+       return result;
 }
 
 #define GROUPLOCK_SCOPE "grouplock"
index 400d28ef703cb36754e58b8bfac4c3fcb7ed79b6..c65b13c800f96e4f2f5da959bd168644d7bebc58 100644 (file)
@@ -134,44 +134,44 @@ for (node = interval_last(root); node != NULL;      \
 static struct interval_node *interval_first(struct interval_node *node)
 {
        if (!node)
-               RETURN(NULL);
+               return NULL;
        while (node->in_left)
                node = node->in_left;
-       RETURN(node);
+       return node;
 }
 
 static struct interval_node *interval_last(struct interval_node *node)
 {
        if (!node)
-               RETURN(NULL);
+               return NULL;
        while (node->in_right)
                node = node->in_right;
-       RETURN(node);
+       return node;
 }
 
 static struct interval_node *interval_next(struct interval_node *node)
 {
        if (!node)
-               RETURN(NULL);
+               return NULL;
        if (node->in_right)
-               RETURN(interval_first(node->in_right));
+               return interval_first(node->in_right);
        while (node->in_parent && node_is_right_child(node))
                node = node->in_parent;
-       RETURN(node->in_parent);
+       return node->in_parent;
 }
 
 static struct interval_node *interval_prev(struct interval_node *node)
 {
        if (!node)
-               RETURN(NULL);
+               return NULL;
 
        if (node->in_left)
-               RETURN(interval_last(node->in_left));
+               return interval_last(node->in_left);
 
        while (node->in_parent && node_is_left_child(node))
                node = node->in_parent;
 
-       RETURN(node->in_parent);
+       return node->in_parent;
 }
 
 enum interval_iter interval_iterate(struct interval_node *root,
@@ -187,7 +187,7 @@ enum interval_iter interval_iterate(struct interval_node *root,
                        break;
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(interval_iterate);
 
@@ -204,7 +204,7 @@ enum interval_iter interval_iterate_reverse(struct interval_node *root,
                        break;
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(interval_iterate_reverse);
 
@@ -226,7 +226,7 @@ struct interval_node *interval_find(struct interval_node *root,
                        walk = walk->in_right;
        }
 
-       RETURN(walk);
+       return walk;
 }
 EXPORT_SYMBOL(interval_find);
 
@@ -374,7 +374,7 @@ struct interval_node *interval_insert(struct interval_node *node,
        while (*p) {
                parent = *p;
                if (node_equal(parent, node))
-                       RETURN(parent);
+                       return parent;
 
                /* max_high field must be updated after each iteration */
                if (parent->in_max_high < interval_high(node))
@@ -395,7 +395,7 @@ struct interval_node *interval_insert(struct interval_node *node,
        interval_insert_color(node, root);
        node->in_intree = 1;
 
-       RETURN(NULL);
+       return NULL;
 }
 EXPORT_SYMBOL(interval_insert);
 
index 92fa314c669af2f133329d51696655ad274379a6..7e316637369b71b3039133aaf134db181adfa380 100644 (file)
@@ -85,7 +85,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
                        continue;
 
                if (lck->l_policy_data.l_extent.end >= old_kms)
-                       RETURN(old_kms);
+                       return old_kms;
 
                /* This extent _has_ to be smaller than old_kms (checked above)
                 * so kms can only ever be smaller or the same as old_kms. */
@@ -94,7 +94,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
        }
        LASSERTF(kms <= old_kms, "kms "LPU64" old_kms "LPU64"\n", kms, old_kms);
 
-       RETURN(kms);
+       return kms;
 }
 EXPORT_SYMBOL(ldlm_extent_shift_kms);
 
@@ -106,11 +106,11 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock)
        LASSERT(lock->l_resource->lr_type == LDLM_EXTENT);
        OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO);
        if (node == NULL)
-               RETURN(NULL);
+               return NULL;
 
        INIT_LIST_HEAD(&node->li_group);
        ldlm_interval_attach(node, lock);
-       RETURN(node);
+       return node;
 }
 
 void ldlm_interval_free(struct ldlm_interval *node)
index 9e61144ea24f96d4ffd353c7c46ac3bcaadd94ac..c68ed27663334491c0765547ca5e5590541053cd 100644 (file)
@@ -305,12 +305,12 @@ reprocess:
                                continue;
 
                        if (!first_enq)
-                               RETURN(LDLM_ITER_CONTINUE);
+                               return LDLM_ITER_CONTINUE;
 
                        if (*flags & LDLM_FL_BLOCK_NOWAIT) {
                                ldlm_flock_destroy(req, mode, *flags);
                                *err = -EAGAIN;
-                               RETURN(LDLM_ITER_STOP);
+                               return LDLM_ITER_STOP;
                        }
 
                        if (*flags & LDLM_FL_TEST_LOCK) {
@@ -323,7 +323,7 @@ reprocess:
                                req->l_policy_data.l_flock.end =
                                        lock->l_policy_data.l_flock.end;
                                *flags |= LDLM_FL_LOCK_CHANGED;
-                               RETURN(LDLM_ITER_STOP);
+                               return LDLM_ITER_STOP;
                        }
 
                        /* add lock to blocking list before deadlock
@@ -332,18 +332,18 @@ reprocess:
                        if (rc) {
                                ldlm_flock_destroy(req, mode, *flags);
                                *err = rc;
-                               RETURN(LDLM_ITER_STOP);
+                               return LDLM_ITER_STOP;
                        }
                        if (ldlm_flock_deadlock(req, lock)) {
                                ldlm_flock_blocking_unlink(req);
                                ldlm_flock_destroy(req, mode, *flags);
                                *err = -EDEADLK;
-                               RETURN(LDLM_ITER_STOP);
+                               return LDLM_ITER_STOP;
                        }
 
                        ldlm_resource_add_lock(res, &res->lr_waiting, req);
                        *flags |= LDLM_FL_BLOCK_GRANTED;
-                       RETURN(LDLM_ITER_STOP);
+                       return LDLM_ITER_STOP;
                }
        }
 
@@ -351,7 +351,7 @@ reprocess:
                ldlm_flock_destroy(req, mode, *flags);
                req->l_req_mode = LCK_NL;
                *flags |= LDLM_FL_LOCK_CHANGED;
-               RETURN(LDLM_ITER_STOP);
+               return LDLM_ITER_STOP;
        }
 
        /* In case we had slept on this lock request take it off of the
@@ -463,7 +463,7 @@ reprocess:
                                ldlm_flock_destroy(req, lock->l_granted_mode,
                                                   *flags);
                                *err = -ENOLCK;
-                               RETURN(LDLM_ITER_STOP);
+                               return LDLM_ITER_STOP;
                        }
                        goto reprocess;
                }
@@ -530,7 +530,7 @@ reprocess:
                ldlm_flock_destroy(req, mode, *flags);
 
        ldlm_resource_dump(D_INFO, res);
-       RETURN(LDLM_ITER_CONTINUE);
+       return LDLM_ITER_CONTINUE;
 }
 
 struct ldlm_flock_wait_data {
@@ -591,7 +591,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
 
                /* Need to wake up the waiter if we were evicted */
                wake_up(&lock->l_waitq);
-               RETURN(0);
+               return 0;
        }
 
        LASSERT(flags != LDLM_FL_WAIT_NOREPROC);
@@ -603,7 +603,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
                        goto granted;
                /* CP AST RPC: lock get granted, wake it up */
                wake_up(&lock->l_waitq);
-               RETURN(0);
+               return 0;
        }
 
        LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
@@ -629,7 +629,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
        if (rc) {
                LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
                           rc);
-               RETURN(rc);
+               return rc;
        }
 
 granted:
@@ -637,18 +637,18 @@ granted:
 
        if (lock->l_flags & LDLM_FL_DESTROYED) {
                LDLM_DEBUG(lock, "client-side enqueue waking up: destroyed");
-               RETURN(0);
+               return 0;
        }
 
        if (lock->l_flags & LDLM_FL_FAILED) {
                LDLM_DEBUG(lock, "client-side enqueue waking up: failed");
-               RETURN(-EIO);
+               return -EIO;
        }
 
        if (rc) {
                LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
                           rc);
-               RETURN(rc);
+               return rc;
        }
 
        LDLM_DEBUG(lock, "client-side enqueue granted");
@@ -690,7 +690,7 @@ granted:
                ldlm_process_flock_lock(lock, &noreproc, 1, &err, NULL);
        }
        unlock_res_and_lock(lock);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_flock_completion_ast);
 
@@ -704,7 +704,7 @@ int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
        lock_res_and_lock(lock);
        ldlm_flock_blocking_unlink(lock);
        unlock_res_and_lock(lock);
-       RETURN(0);
+       return 0;
 }
 
 void ldlm_flock_policy_wire18_to_local(const ldlm_wire_policy_data_t *wpolicy,
@@ -825,9 +825,9 @@ int ldlm_init_flock_export(struct obd_export *exp)
                                &ldlm_export_flock_ops,
                                CFS_HASH_DEFAULT | CFS_HASH_NBLK_CHANGE);
        if (!exp->exp_flock_hash)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_init_flock_export);
 
index 4b03e7d8d3ae419c94ba97ca5071ab6a2d3474fd..1a8c0d7005c7a36b9e4d302ec279851cf47c1a57 100644 (file)
@@ -63,13 +63,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
 
        if (!create && !priority) {
                CDEBUG(D_HA, "Nothing to do\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        ptlrpc_conn = ptlrpc_uuid_to_connection(uuid);
        if (!ptlrpc_conn) {
                CDEBUG(D_HA, "can't find connection %s\n", uuid->uuid);
-               RETURN (-ENOENT);
+               return -ENOENT;
        }
 
        if (create) {
@@ -114,13 +114,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
        }
 
        spin_unlock(&imp->imp_lock);
-       RETURN(0);
+       return 0;
 out_free:
        if (imp_conn)
                OBD_FREE(imp_conn, sizeof(*imp_conn));
 out_put:
        ptlrpc_connection_put(ptlrpc_conn);
-       RETURN(rc);
+       return rc;
 }
 
 int import_set_conn_priority(struct obd_import *imp, struct obd_uuid *uuid)
@@ -185,7 +185,7 @@ out:
        spin_unlock(&imp->imp_lock);
        if (rc == -ENOENT)
                CERROR("connection %s not found\n", uuid->uuid);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(client_import_del_conn);
 
@@ -209,7 +209,7 @@ int client_import_find_conn(struct obd_import *imp, lnet_nid_t peer,
                }
        }
        spin_unlock(&imp->imp_lock);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(client_import_find_conn);
 
@@ -301,27 +301,27 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
        } else {
                CERROR("unknown client OBD type \"%s\", can't setup\n",
                       name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
                CERROR("requires a TARGET UUID\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) > 37) {
                CERROR("client UUID must be less than 38 characters\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1) {
                CERROR("setup requires a SERVER UUID\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 2) > 37) {
                CERROR("target UUID must be less than 38 characters\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        init_rwsem(&cli->cl_sem);
@@ -448,14 +448,14 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
 
        cli->cl_qchk_stat = CL_NOT_QUOTACHECKED;
 
-       RETURN(rc);
+       return rc;
 
 err_import:
        class_destroy_import(imp);
 err_ldlm:
        ldlm_put_ref();
 err:
-       RETURN(rc);
+       return rc;
 
 }
 EXPORT_SYMBOL(client_obd_setup);
@@ -468,7 +468,7 @@ int client_obd_cleanup(struct obd_device *obddev)
        LASSERT(obddev->u.cli.cl_import == NULL);
 
        ldlm_put_ref();
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(client_obd_cleanup);
 
@@ -548,7 +548,7 @@ int client_disconnect_export(struct obd_export *exp)
        if (!obd) {
                CERROR("invalid export for disconnect: exp %p cookie "LPX64"\n",
                       exp, exp ? exp->exp_handle.h_cookie : -1);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        cli = &obd->u.cli;
@@ -604,7 +604,7 @@ out_disconnect:
 
        up_write(&cli->cl_sem);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(client_disconnect_export);
 
@@ -622,7 +622,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
                     !exp_connect_lru_resize(req->rq_export))) {
                lustre_msg_set_slv(req->rq_repmsg, 0);
                lustre_msg_set_limit(req->rq_repmsg, 0);
-               RETURN(0);
+               return 0;
        }
 
        /* OBD is alive here as export is alive, which we checked above. */
@@ -633,7 +633,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
        lustre_msg_set_limit(req->rq_repmsg, obd->obd_pool_limit);
        read_unlock(&obd->obd_pool_lock);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(target_pack_pool_reply);
 
index e0877b20eb94b79620e079255b859eafb4fa0880..6133b3f347182f1d202f412ce4b10556fc1df3d2 100644 (file)
@@ -251,7 +251,7 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock)
 
        if (lock->l_flags & LDLM_FL_NS_SRV) {
                LASSERT(list_empty(&lock->l_lru));
-               RETURN(0);
+               return 0;
        }
 
        spin_lock(&ns->ns_lock);
@@ -439,7 +439,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
 
        OBD_SLAB_ALLOC_PTR_GFP(lock, ldlm_lock_slab, __GFP_IO);
        if (lock == NULL)
-               RETURN(NULL);
+               return NULL;
 
        spin_lock_init(&lock->l_lock);
        lock->l_resource = resource;
@@ -475,7 +475,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
 #endif
        INIT_LIST_HEAD(&lock->l_exp_list);
 
-       RETURN(lock);
+       return lock;
 }
 
 /**
@@ -497,7 +497,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
                   sizeof(lock->l_resource->lr_name)) == 0) {
                /* Nothing to do */
                unlock_res_and_lock(lock);
-               RETURN(0);
+               return 0;
        }
 
        LASSERT(new_resid->name[0] != 0);
@@ -510,7 +510,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
 
        newres = ldlm_resource_get(ns, NULL, new_resid, type, 1);
        if (newres == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        lu_ref_add(&newres->lr_reference, "lock", lock);
        /*
@@ -538,7 +538,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
        lu_ref_del(&oldres->lr_reference, "lock", lock);
        ldlm_resource_putref(oldres);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_lock_change_resource);
 
@@ -572,13 +572,13 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
 
        lock = class_handle2object(handle->cookie);
        if (lock == NULL)
-               RETURN(NULL);
+               return NULL;
 
        /* It's unlikely but possible that someone marked the lock as
         * destroyed after we did handle2object on it */
        if (flags == 0 && ((lock->l_flags & LDLM_FL_DESTROYED)== 0)) {
                lu_ref_add(&lock->l_reference, "handle", current);
-               RETURN(lock);
+               return lock;
        }
 
        lock_res_and_lock(lock);
@@ -590,20 +590,20 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
                unlock_res_and_lock(lock);
                CDEBUG(D_INFO, "lock already destroyed: lock %p\n", lock);
                LDLM_LOCK_PUT(lock);
-               RETURN(NULL);
+               return NULL;
        }
 
        if (flags && (lock->l_flags & flags)) {
                unlock_res_and_lock(lock);
                LDLM_LOCK_PUT(lock);
-               RETURN(NULL);
+               return NULL;
        }
 
        if (flags)
                lock->l_flags |= flags;
 
        unlock_res_and_lock(lock);
-       RETURN(lock);
+       return lock;
 }
 EXPORT_SYMBOL(__ldlm_handle2lock);
 /** @} ldlm_handles */
@@ -1280,7 +1280,7 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
        res = ldlm_resource_get(ns, NULL, res_id, type, 0);
        if (res == NULL) {
                LASSERT(old_lock == NULL);
-               RETURN(0);
+               return 0;
        }
 
        LDLM_RESOURCE_ADDREF(res);
@@ -1433,7 +1433,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
                                                lustre_swab_ost_lvb);
                        if (unlikely(lvb == NULL)) {
                                LDLM_ERROR(lock, "no LVB");
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                        }
 
                        memcpy(data, lvb, size);
@@ -1450,7 +1450,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
                                                lustre_swab_ost_lvb_v1);
                        if (unlikely(lvb == NULL)) {
                                LDLM_ERROR(lock, "no LVB");
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                        }
 
                        memcpy(data, lvb, size);
@@ -1460,7 +1460,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
                } else {
                        LDLM_ERROR(lock, "Replied unexpected ost LVB size %d",
                                   size);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                break;
        case LVB_T_LQUOTA:
@@ -1475,14 +1475,14 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
                                                lustre_swab_lquota_lvb);
                        if (unlikely(lvb == NULL)) {
                                LDLM_ERROR(lock, "no LVB");
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                        }
 
                        memcpy(data, lvb, size);
                } else {
                        LDLM_ERROR(lock, "Replied unexpected lquota LVB size %d",
                                   size);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                break;
        case LVB_T_LAYOUT:
@@ -1495,7 +1495,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
                        lvb = req_capsule_server_get(pill, &RMF_DLM_LVB);
                if (unlikely(lvb == NULL)) {
                        LDLM_ERROR(lock, "no LVB");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                memcpy(data, lvb, size);
@@ -1503,10 +1503,10 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
        default:
                LDLM_ERROR(lock, "Unknown LVB type: %d\n", lock->l_lvb_type);
                dump_stack();
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1526,12 +1526,12 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
 
        res = ldlm_resource_get(ns, NULL, res_id, type, 1);
        if (res == NULL)
-               RETURN(NULL);
+               return NULL;
 
        lock = ldlm_lock_new(res);
 
        if (lock == NULL)
-               RETURN(NULL);
+               return NULL;
 
        lock->l_req_mode = mode;
        lock->l_ast_data = data;
@@ -1562,7 +1562,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
        if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_NEW_LOCK))
                GOTO(out, 0);
 
-       RETURN(lock);
+       return lock;
 
 out:
        ldlm_lock_destroy(lock);
@@ -1606,11 +1606,11 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
                                LDLM_LOCK_RELEASE(lock);
                        }
                        *flags |= LDLM_FL_LOCK_CHANGED;
-                       RETURN(0);
+                       return 0;
                } else if (rc != ELDLM_OK ||
                           (rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) {
                        ldlm_lock_destroy(lock);
-                       RETURN(rc);
+                       return rc;
                }
        }
 
@@ -1692,7 +1692,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        struct ldlm_lock       *lock;
 
        if (list_empty(arg->list))
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        lock = list_entry(arg->list->next, struct ldlm_lock, l_bl_ast);
 
@@ -1713,7 +1713,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        lock->l_blocking_lock = NULL;
        LDLM_LOCK_RELEASE(lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1728,7 +1728,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        ldlm_completion_callback completion_callback;
 
        if (list_empty(arg->list))
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        lock = list_entry(arg->list->next, struct ldlm_lock, l_cp_ast);
 
@@ -1757,7 +1757,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
                rc = completion_callback(lock, 0, (void *)arg);
        LDLM_LOCK_RELEASE(lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1772,7 +1772,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        struct ldlm_lock       *lock;
 
        if (list_empty(arg->list))
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        lock = list_entry(arg->list->next, struct ldlm_lock, l_rk_ast);
        list_del_init(&lock->l_rk_ast);
@@ -1785,7 +1785,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        rc = lock->l_blocking_ast(lock, &desc, (void*)arg, LDLM_CB_BLOCKING);
        LDLM_LOCK_RELEASE(lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1799,7 +1799,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        int                              rc = 0;
 
        if (list_empty(arg->list))
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        gl_work = list_entry(arg->list->next, struct ldlm_glimpse_work,
                                 gl_list);
@@ -1819,7 +1819,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        if ((gl_work->gl_flags & LDLM_GL_WORK_NOFREE) == 0)
                OBD_FREE_PTR(gl_work);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1836,11 +1836,11 @@ int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,
        int                  rc;
 
        if (list_empty(rpc_list))
-               RETURN(0);
+               return 0;
 
        OBD_ALLOC_PTR(arg);
        if (arg == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        atomic_set(&arg->restart, 0);
        arg->list = rpc_list;
@@ -2027,7 +2027,7 @@ int ldlm_lock_set_data(struct lustre_handle *lockh, void *data)
                        rc = 0;
                LDLM_LOCK_PUT(lock);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_lock_set_data);
 
@@ -2136,7 +2136,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
        /* Just return if mode is unchanged. */
        if (new_mode == lock->l_granted_mode) {
                *flags |= LDLM_FL_BLOCK_GRANTED;
-               RETURN(lock->l_resource);
+               return lock->l_resource;
        }
 
        /* I can't check the type of lock here because the bitlock of lock
@@ -2144,7 +2144,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
        OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO);
        if (node == NULL)
                /* Actually, this causes EDEADLOCK to be returned */
-               RETURN(NULL);
+               return NULL;
 
        LASSERTF((new_mode == LCK_PW && lock->l_granted_mode == LCK_PR),
                 "new_mode %u, granted %u\n", new_mode, lock->l_granted_mode);
@@ -2203,7 +2203,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
                ldlm_run_ast_work(ns, &rpc_list, LDLM_WORK_CP_AST);
        if (node)
                OBD_SLAB_FREE(node, ldlm_interval_slab, sizeof(*node));
-       RETURN(res);
+       return res;
 }
 EXPORT_SYMBOL(ldlm_lock_convert);
 
index cce0ad70f162a0f1b56cd8eaf4064b11455fcbbc..3ede1a444afd307e18dc274932fe6810b9ecaf74 100644 (file)
@@ -127,12 +127,12 @@ struct ldlm_bl_work_item {
 
 int ldlm_del_waiting_lock(struct ldlm_lock *lock)
 {
-       RETURN(0);
+       return 0;
 }
 
 int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout)
 {
-       RETURN(0);
+       return 0;
 }
 
 
@@ -395,7 +395,7 @@ static int __ldlm_bl_to_thread(struct ldlm_bl_work_item *blwi,
        if (!(cancel_flags & LCF_ASYNC))
                wait_for_completion(&blwi->blwi_comp);
 
-       RETURN(0);
+       return 0;
 }
 
 static inline void init_blwi(struct ldlm_bl_work_item *blwi,
@@ -440,17 +440,17 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
                             ldlm_cancel_flags_t cancel_flags)
 {
        if (cancels && count == 0)
-               RETURN(0);
+               return 0;
 
        if (cancel_flags & LCF_ASYNC) {
                struct ldlm_bl_work_item *blwi;
 
                OBD_ALLOC(blwi, sizeof(*blwi));
                if (blwi == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                init_blwi(blwi, ns, ld, cancels, count, lock, cancel_flags);
 
-               RETURN(__ldlm_bl_to_thread(blwi, cancel_flags));
+               return __ldlm_bl_to_thread(blwi, cancel_flags);
        } else {
                /* if it is synchronous call do minimum mem alloc, as it could
                 * be triggered from kernel shrinker
@@ -459,7 +459,7 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
 
                memset(&blwi, 0, sizeof(blwi));
                init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags);
-               RETURN(__ldlm_bl_to_thread(&blwi, cancel_flags));
+               return __ldlm_bl_to_thread(&blwi, cancel_flags);
        }
 }
 
@@ -493,14 +493,14 @@ static int ldlm_handle_setinfo(struct ptlrpc_request *req)
        key = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
        if (key == NULL) {
                DEBUG_REQ(D_IOCTL, req, "no set_info key");
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
        keylen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_KEY,
                                      RCL_CLIENT);
        val = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL);
        if (val == NULL) {
                DEBUG_REQ(D_IOCTL, req, "no set_info val");
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
        vallen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_VAL,
                                      RCL_CLIENT);
@@ -542,7 +542,7 @@ static int ldlm_handle_qc_callback(struct ptlrpc_request *req)
        oqctl = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
        if (oqctl == NULL) {
                CERROR("Can't unpack obd_quotactl\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        oqctl->qc_stat = ptlrpc_status_ntoh(oqctl->qc_stat);
@@ -566,7 +566,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
 
        /* do nothing for sec context finalize */
        if (lustre_msg_get_opc(req->rq_reqmsg) == SEC_CTX_FINI)
-               RETURN(0);
+               return 0;
 
        req_capsule_init(&req->rq_pill, req, RCL_SERVER);
 
@@ -574,7 +574,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
                rc = ldlm_callback_reply(req, -ENOTCONN);
                ldlm_callback_errmsg(req, "Operate on unconnected server",
                                     rc, NULL);
-               RETURN(0);
+               return 0;
        }
 
        LASSERT(req->rq_export != NULL);
@@ -583,71 +583,71 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
        switch (lustre_msg_get_opc(req->rq_reqmsg)) {
        case LDLM_BL_CALLBACK:
                if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_BL_CALLBACK_NET))
-                       RETURN(0);
+                       return 0;
                break;
        case LDLM_CP_CALLBACK:
                if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CP_CALLBACK_NET))
-                       RETURN(0);
+                       return 0;
                break;
        case LDLM_GL_CALLBACK:
                if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_GL_CALLBACK_NET))
-                       RETURN(0);
+                       return 0;
                break;
        case LDLM_SET_INFO:
                rc = ldlm_handle_setinfo(req);
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        case OBD_LOG_CANCEL: /* remove this eventually - for 1.4.0 compat */
                CERROR("shouldn't be handling OBD_LOG_CANCEL on DLM thread\n");
                req_capsule_set(&req->rq_pill, &RQF_LOG_CANCEL);
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_NET))
-                       RETURN(0);
+                       return 0;
                rc = llog_origin_handle_cancel(req);
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_REP))
-                       RETURN(0);
+                       return 0;
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        case LLOG_ORIGIN_HANDLE_CREATE:
                req_capsule_set(&req->rq_pill, &RQF_LLOG_ORIGIN_HANDLE_CREATE);
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
-                       RETURN(0);
+                       return 0;
                rc = llog_origin_handle_open(req);
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        case LLOG_ORIGIN_HANDLE_NEXT_BLOCK:
                req_capsule_set(&req->rq_pill,
                                &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
-                       RETURN(0);
+                       return 0;
                rc = llog_origin_handle_next_block(req);
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        case LLOG_ORIGIN_HANDLE_READ_HEADER:
                req_capsule_set(&req->rq_pill,
                                &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER);
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
-                       RETURN(0);
+                       return 0;
                rc = llog_origin_handle_read_header(req);
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        case LLOG_ORIGIN_HANDLE_CLOSE:
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
-                       RETURN(0);
+                       return 0;
                rc = llog_origin_handle_close(req);
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        case OBD_QC_CALLBACK:
                req_capsule_set(&req->rq_pill, &RQF_QC_CALLBACK);
                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_QC_CALLBACK_NET))
-                       RETURN(0);
+                       return 0;
                rc = ldlm_handle_qc_callback(req);
                ldlm_callback_reply(req, rc);
-               RETURN(0);
+               return 0;
        default:
                CERROR("unknown opcode %u\n",
                       lustre_msg_get_opc(req->rq_reqmsg));
                ldlm_callback_reply(req, -EPROTO);
-               RETURN(0);
+               return 0;
        }
 
        ns = req->rq_export->exp_obd->obd_namespace;
@@ -660,7 +660,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
                rc = ldlm_callback_reply(req, -EPROTO);
                ldlm_callback_errmsg(req, "Operate without parameter", rc,
                                     NULL);
-               RETURN(0);
+               return 0;
        }
 
        /* Force a known safe race, send a cancel to the server for a lock
@@ -679,7 +679,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
                rc = ldlm_callback_reply(req, -EINVAL);
                ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
                                     &dlm_req->lock_handle[0]);
-               RETURN(0);
+               return 0;
        }
 
        if ((lock->l_flags & LDLM_FL_FAIL_LOC) &&
@@ -706,7 +706,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
                        rc = ldlm_callback_reply(req, -EINVAL);
                        ldlm_callback_errmsg(req, "Operate on stale lock", rc,
                                             &dlm_req->lock_handle[0]);
-                       RETURN(0);
+                       return 0;
                }
                /* BL_AST locks are not needed in LRU.
                 * Let ldlm_cancel_lru() be fast. */
@@ -752,7 +752,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
                LBUG();                  /* checked above */
        }
 
-       RETURN(0);
+       return 0;
 }
 
 
@@ -894,7 +894,7 @@ static int ldlm_bl_thread_main(void *arg)
        atomic_dec(&blp->blp_busy_threads);
        atomic_dec(&blp->blp_num_threads);
        complete(&blp->blp_comp);
-       RETURN(0);
+       return 0;
 }
 
 
@@ -913,7 +913,7 @@ int ldlm_get_ref(void)
        }
        mutex_unlock(&ldlm_ref_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_get_ref);
 
@@ -1014,9 +1014,9 @@ int ldlm_init_export(struct obd_export *exp)
                                CFS_HASH_NBLK_CHANGE);
 
        if (!exp->exp_lock_hash)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_init_export);
 
@@ -1037,11 +1037,11 @@ static int ldlm_setup(void)
        int i;
 
        if (ldlm_state != NULL)
-               RETURN(-EALREADY);
+               return -EALREADY;
 
        OBD_ALLOC(ldlm_state, sizeof(*ldlm_state));
        if (ldlm_state == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
 #ifdef LPROCFS
        rc = ldlm_proc_setup();
@@ -1121,11 +1121,11 @@ static int ldlm_setup(void)
                CERROR("Failed to initialize LDLM pools: %d\n", rc);
                GOTO(out, rc);
        }
-       RETURN(0);
+       return 0;
 
  out:
        ldlm_cleanup();
-       RETURN(rc);
+       return rc;
 }
 
 static int ldlm_cleanup(void)
@@ -1135,7 +1135,7 @@ static int ldlm_cleanup(void)
                CERROR("ldlm still has namespaces; clean these up first.\n");
                ldlm_dump_all_namespaces(LDLM_NAMESPACE_SERVER, D_DLMTRACE);
                ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
-               RETURN(-EBUSY);
+               return -EBUSY;
        }
 
        ldlm_pools_fini();
@@ -1168,7 +1168,7 @@ static int ldlm_cleanup(void)
        OBD_FREE(ldlm_state, sizeof(*ldlm_state));
        ldlm_state = NULL;
 
-       RETURN(0);
+       return 0;
 }
 
 int ldlm_init(void)
index e500506c8683baf9eed8aff039d00f59d59cde1c..00ff0edd5a2b50392d4c50bca76ee089563b994e 100644 (file)
@@ -338,13 +338,13 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
 
        recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period)
-               RETURN(0);
+               return 0;
 
        spin_lock(&pl->pl_lock);
        recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period) {
                spin_unlock(&pl->pl_lock);
-               RETURN(0);
+               return 0;
        }
        /*
         * Recalc SLV after last period. This should be done
@@ -366,7 +366,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
        lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
                            recalc_interval_sec);
        spin_unlock(&pl->pl_lock);
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -393,7 +393,7 @@ static int ldlm_srv_pool_shrink(struct ldlm_pool *pl,
         * and can't cancel anything. Let's catch this race.
         */
        if (atomic_read(&pl->pl_granted) == 0)
-               RETURN(0);
+               return 0;
 
        spin_lock(&pl->pl_lock);
 
@@ -475,7 +475,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
 
        recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period)
-               RETURN(0);
+               return 0;
 
        spin_lock(&pl->pl_lock);
        /*
@@ -484,7 +484,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
        recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
        if (recalc_interval_sec < pl->pl_recalc_period) {
                spin_unlock(&pl->pl_lock);
-               RETURN(0);
+               return 0;
        }
 
        /*
@@ -501,7 +501,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
         * Do not cancel locks in case lru resize is disabled for this ns.
         */
        if (!ns_connect_lru_resize(ldlm_pl2ns(pl)))
-               RETURN(0);
+               return 0;
 
        /*
         * In the time of canceling locks on client we do not need to maintain
@@ -509,8 +509,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
         * It may be called when SLV has changed much, this is why we do not
         * take into account pl->pl_recalc_time here.
         */
-       RETURN(ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC,
-                              LDLM_CANCEL_LRUR));
+       return ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC, LDLM_CANCEL_LRUR);
 }
 
 /**
@@ -530,7 +529,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl,
         * Do not cancel locks in case lru resize is disabled for this ns.
         */
        if (!ns_connect_lru_resize(ns))
-               RETURN(0);
+               return 0;
 
        /*
         * Make sure that pool knows last SLV and Limit from obd.
@@ -734,7 +733,7 @@ static int ldlm_pool_proc_init(struct ldlm_pool *pl)
 
        OBD_ALLOC(var_name, MAX_STRING_SIZE + 1);
        if (!var_name)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        parent_ns_proc = ns->ns_proc_dir_entry;
        if (parent_ns_proc == NULL) {
@@ -858,11 +857,11 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
        pl->pl_client_lock_volume = 0;
        rc = ldlm_pool_proc_init(pl);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_DLMTRACE, "Lock pool %s is initialized\n", pl->pl_name);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_pool_init);
 
@@ -1343,11 +1342,11 @@ static int ldlm_pools_thread_start(void)
        task_t *task;
 
        if (ldlm_pools_thread != NULL)
-               RETURN(-EALREADY);
+               return -EALREADY;
 
        OBD_ALLOC_PTR(ldlm_pools_thread);
        if (ldlm_pools_thread == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        init_completion(&ldlm_pools_comp);
        init_waitqueue_head(&ldlm_pools_thread->t_ctl_waitq);
@@ -1358,11 +1357,11 @@ static int ldlm_pools_thread_start(void)
                CERROR("Can't start pool thread, error %ld\n", PTR_ERR(task));
                OBD_FREE(ldlm_pools_thread, sizeof(*ldlm_pools_thread));
                ldlm_pools_thread = NULL;
-               RETURN(PTR_ERR(task));
+               return PTR_ERR(task);
        }
        l_wait_event(ldlm_pools_thread->t_ctl_waitq,
                     thread_is_running(ldlm_pools_thread), &lwi);
-       RETURN(0);
+       return 0;
 }
 
 static void ldlm_pools_thread_stop(void)
@@ -1397,7 +1396,7 @@ int ldlm_pools_init(void)
                        set_shrinker(DEFAULT_SEEKS,
                                         ldlm_pools_cli_shrink);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_pools_init);
 
index 6c2b94536d82d76d2d494bdc9af912520e6492ad..21cb523ac4afc47f05837dddd3772fa668a6a0e9 100644 (file)
@@ -98,7 +98,7 @@ int ldlm_expired_completion_wait(void *data)
                static cfs_time_t next_dump = 0, last_dump = 0;
 
                if (ptlrpc_check_suspend())
-                       RETURN(0);
+                       return 0;
 
                LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", "
                              CFS_DURATION_T"s ago)\n",
@@ -119,7 +119,7 @@ int ldlm_expired_completion_wait(void *data)
                        if (last_dump == 0)
                                libcfs_debug_dumplog();
                }
-               RETURN(0);
+               return 0;
        }
 
        obd = lock->l_conn_export->exp_obd;
@@ -131,7 +131,7 @@ int ldlm_expired_completion_wait(void *data)
                  cfs_time_sub(cfs_time_current_sec(), lock->l_last_activity),
                  obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_expired_completion_wait);
 
@@ -185,19 +185,19 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data)
 {
        if (flags == LDLM_FL_WAIT_NOREPROC) {
                LDLM_DEBUG(lock, "client-side enqueue waiting on pending lock");
-               RETURN(0);
+               return 0;
        }
 
        if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
                       LDLM_FL_BLOCK_CONV))) {
                wake_up(&lock->l_waitq);
-               RETURN(ldlm_completion_tail(lock));
+               return ldlm_completion_tail(lock);
        }
 
        LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
                   "going forward");
        ldlm_reprocess_all(lock->l_resource);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_completion_ast_async);
 
@@ -240,7 +240,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
        if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
                       LDLM_FL_BLOCK_CONV))) {
                wake_up(&lock->l_waitq);
-               RETURN(0);
+               return 0;
        }
 
        LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
@@ -291,10 +291,10 @@ noreproc:
        if (rc) {
                LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
                           rc);
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(ldlm_completion_tail(lock));
+       return ldlm_completion_tail(lock);
 }
 EXPORT_SYMBOL(ldlm_completion_ast);
 
@@ -330,7 +330,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock)
                LDLM_DEBUG(lock, "Lock still has references, will be "
                           "cancelled later");
        }
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_blocking_ast_nocheck);
 
@@ -352,7 +352,7 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
 {
        if (flag == LDLM_CB_CANCELING) {
                /* Don't need to do anything here. */
-               RETURN(0);
+               return 0;
        }
 
        lock_res_and_lock(lock);
@@ -363,9 +363,9 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
         * early, if so. */
        if (lock->l_blocking_ast != ldlm_blocking_ast) {
                unlock_res_and_lock(lock);
-               RETURN(0);
+               return 0;
        }
-       RETURN(ldlm_blocking_ast_nocheck(lock));
+       return ldlm_blocking_ast_nocheck(lock);
 }
 EXPORT_SYMBOL(ldlm_blocking_ast);
 
@@ -526,7 +526,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
        /* ldlm_cli_enqueue is holding a reference on this lock. */
        if (!lock) {
                LASSERT(type == LDLM_FLOCK);
-               RETURN(-ENOLCK);
+               return -ENOLCK;
        }
 
        LASSERTF(ergo(lvb_len != 0, lvb_len == lock->l_lvb_len),
@@ -782,7 +782,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
        rc = ptlrpc_request_pack(req, version, opc);
        if (rc) {
                ldlm_lock_list_put(cancels, l_bl_ast, count);
-               RETURN(rc);
+               return rc;
        }
 
        if (ns_connect_cancelset(ns)) {
@@ -802,7 +802,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
        } else {
                ldlm_lock_list_put(cancels, l_bl_ast, count);
        }
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_prep_elc_req);
 
@@ -821,17 +821,17 @@ struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp, int lvb_len)
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
        if (req == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
        ptlrpc_request_set_replen(req);
-       RETURN(req);
+       return req;
 }
 EXPORT_SYMBOL(ldlm_enqueue_pack);
 
@@ -881,7 +881,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
                                        einfo->ei_mode, &cbs, einfo->ei_cbdata,
                                        lvb_len, lvb_type);
                if (lock == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                /* for the local lock, add the reference */
                ldlm_lock_addref_internal(lock, einfo->ei_mode);
                ldlm_lock2handle(lock, lockh);
@@ -922,7 +922,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
                if (req == NULL) {
                        failed_lock_cleanup(ns, lock, einfo->ei_mode);
                        LDLM_LOCK_RELEASE(lock);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                req_passed_in = 0;
                if (reqp)
@@ -963,7 +963,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
 
        if (async) {
                LASSERT(reqp != NULL);
-               RETURN(0);
+               return 0;
        }
 
        LDLM_DEBUG(lock, "sending request");
@@ -987,7 +987,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
                        *reqp = NULL;
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_cli_enqueue);
 
@@ -1012,7 +1012,7 @@ static int ldlm_cli_convert_local(struct ldlm_lock *lock, int new_mode,
        }
        LDLM_DEBUG(lock, "client-side local convert handler END");
        LDLM_LOCK_PUT(lock);
-       RETURN(rc);
+       return rc;
 }
 
 /* FIXME: one of ldlm_cli_convert or the server side should reject attempted
@@ -1031,12 +1031,12 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags)
        lock = ldlm_handle2lock(lockh);
        if (!lock) {
                LBUG();
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        *flags = 0;
 
        if (lock->l_conn_export == NULL)
-               RETURN(ldlm_cli_convert_local(lock, new_mode, flags));
+               return ldlm_cli_convert_local(lock, new_mode, flags);
 
        LDLM_DEBUG(lock, "client-side convert");
 
@@ -1045,7 +1045,7 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags)
                                        LDLM_CONVERT);
        if (req == NULL) {
                LDLM_LOCK_PUT(lock);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_DLM_REQ);
@@ -1129,7 +1129,7 @@ static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock)
                ldlm_reprocess_all(lock->l_resource);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1184,7 +1184,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels,
        CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_PAUSE_CANCEL, cfs_fail_val);
 
        if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_RACE))
-               RETURN(count);
+               return count;
 
        free = ldlm_format_handles_avail(class_exp2cliimp(exp),
                                         &RQF_LDLM_CANCEL, RCL_CLIENT, 0);
@@ -1196,7 +1196,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels,
                if (imp == NULL || imp->imp_invalid) {
                        CDEBUG(D_DLMTRACE,
                               "skipping cancel on invalid import %p\n", imp);
-                       RETURN(count);
+                       return count;
                }
 
                req = ptlrpc_request_alloc(imp, &RQF_LDLM_CANCEL);
@@ -1275,7 +1275,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
                /*
                 * Do nothing for corner cases.
                 */
-               RETURN(0);
+               return 0;
        }
 
        /* In some cases RPC may contain SLV and limit zeroed out. This
@@ -1289,7 +1289,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
                          "(SLV: "LPU64", Limit: %u)",
                          lustre_msg_get_slv(req->rq_repmsg),
                          lustre_msg_get_limit(req->rq_repmsg));
-               RETURN(0);
+               return 0;
        }
 
        new_limit = lustre_msg_get_limit(req->rq_repmsg);
@@ -1306,7 +1306,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
        obd->obd_pool_limit = new_limit;
        write_unlock(&obd->obd_pool_lock);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_cli_update_pool);
 
@@ -1329,13 +1329,13 @@ int ldlm_cli_cancel(struct lustre_handle *lockh,
        lock = ldlm_handle2lock_long(lockh, LDLM_FL_CANCELING);
        if (lock == NULL) {
                LDLM_DEBUG_NOLOCK("lock is already being destroyed\n");
-               RETURN(0);
+               return 0;
        }
 
        rc = ldlm_cli_cancel_local(lock);
        if (rc == LDLM_FL_LOCAL_ONLY) {
                LDLM_LOCK_RELEASE(lock);
-               RETURN(0);
+               return 0;
        }
        /* Even if the lock is marked as LDLM_FL_BL_AST, this is a LDLM_CANCEL
         * RPC which goes to canceld portal, so we can cancel other LRU locks
@@ -1357,7 +1357,7 @@ int ldlm_cli_cancel(struct lustre_handle *lockh,
                                               LCF_BL_AST, flags);
        }
        ldlm_cli_cancel_list(&cancels, count, NULL, cancel_flags);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_cli_cancel);
 
@@ -1407,7 +1407,7 @@ int ldlm_cli_cancel_list_local(struct list_head *cancels, int count,
                ldlm_cli_cancel_list(&head, bl_ast, NULL, 0);
        }
 
-       RETURN(count);
+       return count;
 }
 EXPORT_SYMBOL(ldlm_cli_cancel_list_local);
 
@@ -1439,7 +1439,7 @@ static ldlm_policy_res_t ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns,
        }
 
        unlock_res_and_lock(lock);
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -1730,7 +1730,7 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, struct list_head *ca
                unused--;
        }
        spin_unlock(&ns->ns_lock);
-       RETURN(added);
+       return added;
 }
 
 int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels,
@@ -1764,9 +1764,9 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
        count = ldlm_prepare_lru_list(ns, &cancels, nr, 0, flags);
        rc = ldlm_bl_to_thread_list(ns, NULL, &cancels, count, cancel_flags);
        if (rc == 0)
-               RETURN(count);
+               return count;
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1822,7 +1822,7 @@ int ldlm_cancel_resource_local(struct ldlm_resource *res,
        }
        unlock_res(res);
 
-       RETURN(ldlm_cli_cancel_list_local(cancels, count, cancel_flags));
+       return ldlm_cli_cancel_list_local(cancels, count, cancel_flags);
 }
 EXPORT_SYMBOL(ldlm_cancel_resource_local);
 
@@ -1843,7 +1843,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
        int res = 0;
 
        if (list_empty(cancels) || count == 0)
-               RETURN(0);
+               return 0;
 
        /* XXX: requests (both batched and not) could be sent in parallel.
         * Usually it is enough to have just 1 RPC, but it is possible that
@@ -1879,7 +1879,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
                ldlm_lock_list_put(cancels, l_bl_ast, res);
        }
        LASSERT(count == 0);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_cli_cancel_list);
 
@@ -1904,7 +1904,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
        if (res == NULL) {
                /* This is not a problem. */
                CDEBUG(D_INFO, "No resource "LPU64"\n", res_id->name[0]);
-               RETURN(0);
+               return 0;
        }
 
        LDLM_RESOURCE_ADDREF(res);
@@ -1916,7 +1916,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
 
        LDLM_RESOURCE_DELREF(res);
        ldlm_resource_putref(res);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ldlm_cli_cancel_unused_resource);
 
@@ -1959,16 +1959,16 @@ int ldlm_cli_cancel_unused(struct ldlm_namespace *ns,
        };
 
        if (ns == NULL)
-               RETURN(ELDLM_OK);
+               return ELDLM_OK;
 
        if (res_id != NULL) {
-               RETURN(ldlm_cli_cancel_unused_resource(ns, res_id, NULL,
+               return ldlm_cli_cancel_unused_resource(ns, res_id, NULL,
                                                       LCK_MINMODE, flags,
-                                                      opaque));
+                                                      opaque);
        } else {
                cfs_hash_for_each_nolock(ns->ns_rs_hash,
                                         ldlm_cli_hash_cancel_unused, &arg);
-               RETURN(ELDLM_OK);
+               return ELDLM_OK;
        }
 }
 EXPORT_SYMBOL(ldlm_cli_cancel_unused);
@@ -1983,7 +1983,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
        int rc = LDLM_ITER_CONTINUE;
 
        if (!res)
-               RETURN(LDLM_ITER_CONTINUE);
+               return LDLM_ITER_CONTINUE;
 
        lock_res(res);
        list_for_each_safe(tmp, next, &res->lr_granted) {
@@ -2008,7 +2008,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
        }
  out:
        unlock_res(res);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_resource_foreach);
 
@@ -2067,13 +2067,13 @@ int ldlm_resource_iterate(struct ldlm_namespace *ns,
 
        res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
        if (res == NULL)
-               RETURN(0);
+               return 0;
 
        LDLM_RESOURCE_ADDREF(res);
        rc = ldlm_resource_foreach(res, iter, data);
        LDLM_RESOURCE_DELREF(res);
        ldlm_resource_putref(res);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_resource_iterate);
 
@@ -2147,7 +2147,7 @@ out:
        if (rc != ELDLM_OK)
                ptlrpc_connect_import(req->rq_import);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
@@ -2160,7 +2160,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
        /* Bug 11974: Do not replay a lock which is actively being canceled */
        if (lock->l_flags & LDLM_FL_CANCELING) {
                LDLM_DEBUG(lock, "Not replaying canceled lock:");
-               RETURN(0);
+               return 0;
        }
 
        /* If this is reply-less callback lock, we cannot replay it, since
@@ -2169,7 +2169,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
        if (lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK) {
                LDLM_DEBUG(lock, "Not replaying reply-less lock:");
                ldlm_lock_cancel(lock);
-               RETURN(0);
+               return 0;
        }
 
        /*
@@ -2198,7 +2198,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
        req = ptlrpc_request_alloc_pack(imp, &RQF_LDLM_ENQUEUE,
                                        LUSTRE_DLM_VERSION, LDLM_ENQUEUE);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* We're part of recovery, so don't wait for it. */
        req->rq_send_state = LUSTRE_IMP_REPLAY_LOCKS;
@@ -2228,7 +2228,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
        req->rq_interpret_reply = (ptlrpc_interpterer_t)replay_lock_interpret;
        ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -2271,7 +2271,7 @@ int ldlm_replay_locks(struct obd_import *imp)
 
        /* don't replay locks if import failed recovery */
        if (imp->imp_vbr_failed)
-               RETURN(0);
+               return 0;
 
        /* ensure this doesn't fall to 0 before all have been queued */
        atomic_inc(&imp->imp_replay_inflight);
@@ -2293,6 +2293,6 @@ int ldlm_replay_locks(struct obd_import *imp)
 
        atomic_dec(&imp->imp_replay_inflight);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ldlm_replay_locks);
index f4d367c5978f9bcec22b090e6db36c40214d4b97..78327cf400724d138107a4c6d24e7b16d43c00d8 100644 (file)
@@ -78,7 +78,7 @@ static ssize_t lprocfs_wr_dump_ns(struct file *file, const char *buffer,
 {
        ldlm_dump_all_namespaces(LDLM_NAMESPACE_SERVER, D_DLMTRACE);
        ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
-       RETURN(count);
+       return count;
 }
 LPROC_SEQ_FOPS_WR_ONLY(ldlm, dump_ns);
 
@@ -126,7 +126,7 @@ int ldlm_proc_setup(void)
 
        rc = lprocfs_add_vars(ldlm_type_proc_dir, list, NULL);
 
-       RETURN(0);
+       return 0;
 
 err_ns:
        lprocfs_remove(&ldlm_ns_proc_dir);
@@ -136,7 +136,7 @@ err:
        ldlm_svc_proc_dir = NULL;
        ldlm_type_proc_dir = NULL;
        ldlm_ns_proc_dir = NULL;
-       RETURN(rc);
+       return rc;
 }
 
 void ldlm_proc_cleanup(void)
@@ -573,7 +573,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
        rc = ldlm_get_ref();
        if (rc) {
                CERROR("ldlm_get_ref failed: %d\n", rc);
-               RETURN(NULL);
+               return NULL;
        }
 
        for (idx = 0;;idx++) {
@@ -647,7 +647,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
        }
 
        ldlm_namespace_register(ns, client);
-       RETURN(ns);
+       return ns;
 out_proc:
        ldlm_namespace_proc_unregister(ns);
        ldlm_namespace_cleanup(ns, 0);
@@ -657,7 +657,7 @@ out_ns:
        OBD_FREE_PTR(ns);
 out_ref:
        ldlm_put_ref();
-       RETURN(NULL);
+       return NULL;
 }
 EXPORT_SYMBOL(ldlm_namespace_new);
 
@@ -837,13 +837,13 @@ force_wait:
                                       "with %d resources in use, (rc=%d)\n",
                                       ldlm_ns_name(ns),
                                       atomic_read(&ns->ns_bref), rc);
-                       RETURN(ELDLM_NAMESPACE_EXISTS);
+                       return ELDLM_NAMESPACE_EXISTS;
                }
                CDEBUG(D_DLMTRACE, "dlm namespace %s free done waiting\n",
                       ldlm_ns_name(ns));
        }
 
-       RETURN(ELDLM_OK);
+       return ELDLM_OK;
 }
 
 /**
index 20682d8e7f2a5362712bf6249e3c133929969a76..cf93b6c6d906a26a057a126903ef875b9a5db0fb 100644 (file)
@@ -458,14 +458,6 @@ void libcfs_debug_set_level(unsigned int debug_level)
 
 EXPORT_SYMBOL(libcfs_debug_set_level);
 
-long libcfs_log_return(struct libcfs_debug_msg_data *msgdata, long rc)
-{
-       libcfs_debug_msg(msgdata, "Process leaving (rc=%lu : %ld : %lx)\n",
-                        rc, rc, rc);
-       return rc;
-}
-EXPORT_SYMBOL(libcfs_log_return);
-
 void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, const char *label,
                     long_ptr_t rc)
 {
index 87f52563eab0bd7a7131fe6ff183f9d13e2b7f15..0dd12c8c91b6126c0c790ef8932e033dcdc0d468 100644 (file)
@@ -1053,7 +1053,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
              CFS_HASH_NAME_LEN : CFS_HASH_BIGNAME_LEN;
        LIBCFS_ALLOC(hs, offsetof(cfs_hash_t, hs_name[len]));
        if (hs == NULL)
-               RETURN(NULL);
+               return NULL;
 
        strncpy(hs->hs_name, name, len);
        hs->hs_name[len - 1] = '\0';
@@ -1085,7 +1085,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
                return hs;
 
        LIBCFS_FREE(hs, offsetof(cfs_hash_t, hs_name[len]));
-       RETURN(NULL);
+       return NULL;
 }
 EXPORT_SYMBOL(cfs_hash_create);
 
@@ -1483,7 +1483,7 @@ cfs_hash_for_each_tight(cfs_hash_t *hs, cfs_hash_for_each_cb_t func,
        cfs_hash_unlock(hs, 0);
 
        cfs_hash_for_each_exit(hs);
-       RETURN(count);
+       return count;
 }
 
 typedef struct {
@@ -1645,18 +1645,18 @@ cfs_hash_for_each_nolock(cfs_hash_t *hs,
        if (cfs_hash_with_no_lock(hs) ||
            cfs_hash_with_rehash_key(hs) ||
            !cfs_hash_with_no_itemref(hs))
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        if (CFS_HOP(hs, get) == NULL ||
            (CFS_HOP(hs, put) == NULL &&
             CFS_HOP(hs, put_locked) == NULL))
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        cfs_hash_for_each_enter(hs);
        cfs_hash_for_each_relax(hs, func, data);
        cfs_hash_for_each_exit(hs);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(cfs_hash_for_each_nolock);
 
@@ -1691,7 +1691,7 @@ cfs_hash_for_each_empty(cfs_hash_t *hs,
                       hs->hs_name, i++);
        }
        cfs_hash_for_each_exit(hs);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(cfs_hash_for_each_empty);
 
index 39cf56a09247a43c50ac8174709f391b8f45f994..74a0db5c154a53bffa2100726a8e4309207d7ac4 100644 (file)
@@ -248,7 +248,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
        struct kkuc_reg *reg, *next;
 
        if (kkuc_groups[group].next == NULL)
-               RETURN(0);
+               return 0;
 
        if (uid == 0) {
                /* Broadcast a shutdown message */
@@ -274,7 +274,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
        }
        up_write(&kg_sem);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_rem);
 
@@ -303,7 +303,7 @@ int libcfs_kkuc_group_put(int group, void *payload)
        if (one_success)
                rc = 0;
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_put);
 
@@ -321,12 +321,12 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
 
        if (group > KUC_GRP_MAX) {
                CDEBUG(D_WARNING, "Kernelcomm: bad group %d\n", group);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* no link for this group */
        if (kkuc_groups[group].next == NULL)
-               RETURN(0);
+               return 0;
 
        down_read(&kg_sem);
        list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
@@ -336,7 +336,7 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
        }
        up_read(&kg_sem);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_foreach);
 
index 833c889348e26427d9ceb527cb5b4898bde86243..ea9e9490031fc81573e7a37f5fe6ca00b3723652 100644 (file)
@@ -215,12 +215,12 @@ int cfs_get_environ(const char *key, char *value, int *val_len)
 
        buffer = kmalloc(buf_len, GFP_USER);
        if (!buffer)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mm = get_task_mm(current);
        if (!mm) {
                kfree(buffer);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* Avoid deadlocks on mmap_sem if called from sys_mmap_pgoff(),
index 004ff71663af4608354e847c941b46c57d2408eb..55296a3591d5159a40d67a95997c2972a90496a4 100644 (file)
@@ -51,31 +51,31 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
 
        err = copy_from_user(buf, (void *)arg, sizeof(*hdr));
        if (err)
-               RETURN(err);
+               return err;
 
        if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) {
                CERROR("PORTALS: version mismatch kernel vs application\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (hdr->ioc_len + buf >= end) {
                CERROR("PORTALS: user buffer exceeds kernel buffer\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
 
        if (hdr->ioc_len < sizeof(struct libcfs_ioctl_data)) {
                CERROR("PORTALS: user buffer too small for ioctl\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        err = copy_from_user(buf, (void *)arg, hdr->ioc_len);
        if (err)
-               RETURN(err);
+               return err;
 
        if (libcfs_ioctl_is_invalid(data)) {
                CERROR("PORTALS: ioctl not correctly formatted\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (data->ioc_inllen1)
@@ -85,7 +85,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
                data->ioc_inlbuf2 = &data->ioc_bulk[0] +
                        cfs_size_round(data->ioc_inllen1);
 
-       RETURN(0);
+       return 0;
 }
 
 int libcfs_ioctl_popdata(void *arg, void *data, int size)
index 2a6db77bd0622a66ccdcfc4fcafea1c41a549f0f..432b55d3216c8c10033cbbf15b814581cb7f4a05 100644 (file)
@@ -165,7 +165,7 @@ static int libcfs_psdev_open(unsigned long flags, void *args)
        }
        *(struct libcfs_device_userstate **)args = ldu;
 
-       RETURN(0);
+       return 0;
 }
 
 /* called when closing /dev/device */
@@ -180,7 +180,7 @@ static int libcfs_psdev_release(unsigned long flags, void *args)
        }
 
        module_put(THIS_MODULE);
-       RETURN(0);
+       return 0;
 }
 
 static struct rw_semaphore ioctl_list_sem;
@@ -224,7 +224,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
        switch (cmd) {
        case IOC_LIBCFS_CLEAR_DEBUG:
                libcfs_debug_clear_buffer();
-               RETURN(0);
+               return 0;
        /*
         * case IOC_LIBCFS_PANIC:
         * Handled in arch/cfs_module.c
@@ -232,9 +232,9 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
        case IOC_LIBCFS_MARK_DEBUG:
                if (data->ioc_inlbuf1 == NULL ||
                    data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                libcfs_debug_mark_buffer(data->ioc_inlbuf1);
-               RETURN(0);
+               return 0;
 #if LWT_SUPPORT
        case IOC_LIBCFS_LWT_CONTROL:
                err = lwt_control ((data->ioc_flags & 1) != 0,
@@ -298,7 +298,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
                        ping(data);
                        symbol_put(kping_client);
                }
-               RETURN(0);
+               return 0;
        }
 
        default: {
@@ -319,7 +319,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
        }
        }
 
-       RETURN(err);
+       return err;
 }
 
 static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg)
@@ -330,7 +330,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a
 
        LIBCFS_ALLOC_GFP(buf, 1024, GFP_IOFS);
        if (buf == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* 'cmd' and permissions get checked in our arch-specific caller */
        if (libcfs_ioctl_getdata(buf, buf + 800, (void *)arg)) {
@@ -343,7 +343,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a
 
 out:
        LIBCFS_FREE(buf, 1024);
-       RETURN(err);
+       return err;
 }
 
 
index 0260e69a14dd3bcb5d52184e15034d7a29515dd4..99c9e9d2493ffbc67cbbb8d4e13c310487c191a0 100644 (file)
@@ -793,15 +793,15 @@ cfs_parse_nidlist(char *str, int len, struct list_head *nidlist)
                rc = cfs_gettok(&src, ' ', &res);
                if (rc == 0) {
                        cfs_free_nidlist(nidlist);
-                       RETURN(0);
+                       return 0;
                }
                rc = parse_nidrange(&res, nidlist);
                if (rc == 0) {
                        cfs_free_nidlist(nidlist);
-                       RETURN(0);
+                       return 0;
                }
        }
-       RETURN(1);
+       return 1;
 }
 
 /*
@@ -840,13 +840,13 @@ int cfs_match_nid(lnet_nid_t nid, struct list_head *nidlist)
                if (nr->nr_netnum != LNET_NETNUM(LNET_NIDNET(nid)))
                        continue;
                if (nr->nr_all)
-                       RETURN(1);
+                       return 1;
                list_for_each_entry(ar, &nr->nr_addrranges, ar_link)
                        if (nr->nr_netstrfns->nf_match_addr(LNET_NIDADDR(nid),
                                                       &ar->ar_numaddr_ranges))
-                               RETURN(1);
+                               return 1;
        }
-       RETURN(0);
+       return 0;
 }
 
 
index 9b15c7c4e4462e6fea0aa0701f68b79a2e35c2cb..245b46f0dd960745d9cdfea2023b357000378c10 100644 (file)
@@ -175,7 +175,7 @@ find_again:
                        new = alloc_entry(cache, key, args);
                        if (!new) {
                                CERROR("fail to alloc entry\n");
-                               RETURN(ERR_PTR(-ENOMEM));
+                               return ERR_PTR(-ENOMEM);
                        }
                        goto find_again;
                } else {
@@ -265,7 +265,7 @@ find_again:
        /* Now we know it's good */
 out:
        spin_unlock(&cache->uc_lock);
-       RETURN(entry);
+       return entry;
 }
 EXPORT_SYMBOL(upcall_cache_get_entry);
 
@@ -308,7 +308,7 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
                       cache->uc_name, key);
                /* haven't found, it's possible */
                spin_unlock(&cache->uc_lock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (err) {
@@ -350,7 +350,7 @@ out:
        wake_up_all(&entry->ue_waitq);
        put_entry(cache, entry);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(upcall_cache_downcall);
 
@@ -425,7 +425,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
 
        LIBCFS_ALLOC(cache, sizeof(*cache));
        if (!cache)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        spin_lock_init(&cache->uc_lock);
        rwlock_init(&cache->uc_upcall_rwlock);
@@ -438,7 +438,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
        cache->uc_acquire_expire = 30;
        cache->uc_ops = ops;
 
-       RETURN(cache);
+       return cache;
 }
 EXPORT_SYMBOL(upcall_cache_init);
 
index ff74783ef9d3c718a5de8d9fb6c5d10691fd1106..e7629be39739b99a7d2466262504ad66a981e20e 100644 (file)
@@ -86,10 +86,10 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
 {
        if (len != name->len)
-               RETURN(1);
+               return 1;
 
        if (memcmp(str, name->name, len))
-               RETURN(1);
+               return 1;
 
        CDEBUG(D_DENTRY, "found name %.*s(%p) flags %#x refc %d\n",
               name->len, name->name, dentry, dentry->d_flags,
@@ -97,12 +97,12 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
 
        /* mountpoint is always valid */
        if (d_mountpoint((struct dentry *)dentry))
-               RETURN(0);
+               return 0;
 
        if (d_lustre_invalid(dentry))
-               RETURN(1);
+               return 1;
 
-       RETURN(0);
+       return 0;
 }
 
 static inline int return_if_equal(struct ldlm_lock *lock, void *data)
@@ -128,16 +128,16 @@ static int find_cbdata(struct inode *inode)
        rc = md_find_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
                            return_if_equal, NULL);
        if (rc != 0)
-                RETURN(rc);
+                return rc;
 
        lsm = ccc_inode_lsm_get(inode);
        if (lsm == NULL)
-               RETURN(rc);
+               return rc;
 
        rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
        ccc_inode_lsm_put(inode, lsm);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -172,8 +172,8 @@ static int ll_ddelete(const struct dentry *de)
 #endif
 
        if (d_lustre_invalid((struct dentry *)de))
-               RETURN(1);
-       RETURN(0);
+               return 1;
+       return 0;
 }
 
 static int ll_set_dd(struct dentry *de)
@@ -196,11 +196,11 @@ static int ll_set_dd(struct dentry *de)
                                OBD_FREE_PTR(lld);
                        spin_unlock(&de->d_lock);
                } else {
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int ll_dops_init(struct dentry *de, int block, int init_sa)
@@ -304,14 +304,14 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
        int rc = 0;
 
        if (!request)
-               RETURN(0);
+               return 0;
 
        if (it_disposition(it, DISP_LOOKUP_NEG))
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        rc = ll_prep_inode(&de->d_inode, request, NULL, it);
 
-       RETURN(rc);
+       return rc;
 }
 
 void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry)
@@ -368,10 +368,10 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                   away this negative dentry and actually do the request to
                   kernel to create whatever needs to be created (if possible)*/
                if (it && (it->it_op & IT_CREAT))
-                       RETURN(0);
+                       return 0;
 
                if (d_lustre_invalid(de))
-                       RETURN(0);
+                       return 0;
 
                ibits = MDS_INODELOCK_UPDATE;
                rc = ll_have_md_lock(parent, &ibits, LCK_MINMODE);
@@ -398,7 +398,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
        LASSERT(it);
 
        if (it->it_op == IT_LOOKUP && !d_lustre_invalid(de))
-               RETURN(1);
+               return 1;
 
        if (it->it_op == IT_OPEN) {
                struct inode *inode = de->d_inode;
@@ -445,7 +445,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                           if it would be, we'll reopen the open request to
                           MDS later during file open path */
                        mutex_unlock(&lli->lli_och_mutex);
-                       RETURN(1);
+                       return 1;
                } else {
                        mutex_unlock(&lli->lli_och_mutex);
                }
@@ -464,7 +464,7 @@ do_lock:
                                     de->d_name.name, de->d_name.len,
                                     0, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        if (!IS_POSIXACL(parent) || !exp_connect_umask(exp))
                it->it_create_mode &= ~current_umask();
@@ -551,7 +551,7 @@ out:
 mark:
        if (it != NULL && it->it_op == IT_GETATTR && rc > 0)
                ll_statahead_mark(parent, de);
-       RETURN(rc);
+       return rc;
 
        /*
         * This part is here to combat evil-evil race in real_lookup on 2.6
@@ -583,7 +583,7 @@ do_lookup:
                                                         LUSTRE_OPC_CREATE :
                                                         LUSTRE_OPC_ANY), NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        rc = md_intent_lock(exp, op_data, NULL, 0,  it, 0, &req,
                            ll_md_blocking_ast, 0);
@@ -630,7 +630,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
        if (!(flags & (LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE)) &&
            ll_need_statahead(parent, dentry) > 0) {
                if (flags & LOOKUP_RCU)
-                       RETURN(-ECHILD);
+                       return -ECHILD;
 
                if (dentry->d_inode == NULL)
                        unplug = 1;
@@ -638,7 +638,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
                ll_statahead_mark(parent, dentry);
        }
 
-       RETURN(1);
+       return 1;
 }
 
 
index 09bdd3d1e6e65c7488bc92a43f112b0761430eef..09844be5eec4f09f9a4cdd24fb17127c9111019a 100644 (file)
@@ -589,7 +589,7 @@ int ll_dir_read(struct inode *inode, struct dir_context *ctx)
 
        ctx->pos = pos;
        ll_dir_chain_fini(&chain);
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_readdir(struct file *filp, struct dir_context *ctx)
@@ -629,7 +629,7 @@ out:
        if (!rc)
                ll_stats_ops_tally(sbi, LPROC_LL_READDIR, 1);
 
-       RETURN(rc);
+       return rc;
 }
 
 int ll_send_mgc_param(struct obd_export *mgc, char *string)
@@ -716,7 +716,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
                                        " %#08x != %#08x nor %#08x\n",
                                        lump->lmm_magic, LOV_USER_MAGIC_V1,
                                        LOV_USER_MAGIC_V3);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                }
        } else {
@@ -726,7 +726,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        if (lump != NULL && lump->lmm_magic == cpu_to_le32(LMV_USER_MAGIC))
                op_data->op_cli_flags |= CLI_SET_MEA;
@@ -782,7 +782,7 @@ end:
                if (param != NULL)
                        OBD_FREE(param, MGS_PARAM_MAXLEN);
        }
-       RETURN(rc);
+       return rc;
 }
 
 int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
@@ -797,13 +797,13 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
 
        rc = ll_get_max_mdsize(sbi, &lmmsize);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL,
                                     0, lmmsize, LUSTRE_OPC_ANY,
                                     NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
        rc = md_getattr(sbi->ll_md_exp, op_data, &req);
@@ -867,7 +867,7 @@ int ll_get_mdt_idx(struct inode *inode)
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0,
                                     0, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        op_data->op_flags |= MF_GET_MDT_IDX;
        rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
@@ -875,7 +875,7 @@ int ll_get_mdt_idx(struct inode *inode)
        ll_finish_md_op_data(op_data);
        if (rc < 0) {
                CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
        return mdtidx;
 }
@@ -945,7 +945,7 @@ progress:
        rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
                           &hpk, NULL);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1044,7 +1044,7 @@ progress:
        rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
                           &hpk, NULL);
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1082,7 +1082,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
        case Q_SETINFO:
                if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
                    sbi->ll_flags & LL_SBI_RMT_CLIENT)
-                       RETURN(-EPERM);
+                       return -EPERM;
                break;
        case Q_GETQUOTA:
                if (((type == USRQUOTA &&
@@ -1091,25 +1091,25 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
                      !in_egroup_p(make_kgid(&init_user_ns, id)))) &&
                    (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
                     sbi->ll_flags & LL_SBI_RMT_CLIENT))
-                       RETURN(-EPERM);
+                       return -EPERM;
                break;
        case Q_GETINFO:
                break;
        default:
                CERROR("unsupported quotactl op: %#x\n", cmd);
-               RETURN(-ENOTTY);
+               return -ENOTTY;
        }
 
        if (valid != QC_GENERAL) {
                if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
-                       RETURN(-EOPNOTSUPP);
+                       return -EOPNOTSUPP;
 
                if (cmd == Q_GETINFO)
                        qctl->qc_cmd = Q_GETOINFO;
                else if (cmd == Q_GETQUOTA)
                        qctl->qc_cmd = Q_GETOQUOTA;
                else
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                switch (valid) {
                case QC_MDTIDX:
@@ -1134,7 +1134,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
                }
 
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                qctl->qc_cmd = cmd;
        } else {
@@ -1142,7 +1142,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
 
                OBD_ALLOC_PTR(oqctl);
                if (oqctl == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                QCTL_COPY(oqctl, qctl);
                rc = obd_quotactl(sbi->ll_md_exp, oqctl);
@@ -1152,7 +1152,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
                                obd_quotactl(sbi->ll_md_exp, oqctl);
                        }
                        OBD_FREE_PTR(oqctl);
-                       RETURN(rc);
+                       return rc;
                }
                /* If QIF_SPACE is not set, client should collect the
                 * space usage from OSSs by itself */
@@ -1199,7 +1199,7 @@ out:
                OBD_FREE_PTR(oqctl);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static char *
@@ -1244,10 +1244,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        switch(cmd) {
        case FSFILT_IOC_GETFLAGS:
        case FSFILT_IOC_SETFLAGS:
-               RETURN(ll_iocontrol(inode, file, cmd, arg));
+               return ll_iocontrol(inode, file, cmd, arg);
        case FSFILT_IOC_GETVERSION_OLD:
        case FSFILT_IOC_GETVERSION:
-               RETURN(put_user(inode->i_generation, (int *)arg));
+               return put_user(inode->i_generation, (int *)arg);
        /* We need to special case any other ioctls we want to handle,
         * to send them to the MDS/OST as appropriate and to properly
         * network encode the arg field.
@@ -1259,10 +1259,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                mdtidx = ll_get_mdt_idx(inode);
                if (mdtidx < 0)
-                       RETURN(mdtidx);
+                       return mdtidx;
 
                if (put_user((int)mdtidx, (int*)arg))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                return 0;
        }
@@ -1275,7 +1275,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                data = (void *)buf;
 
                filename = data->ioc_inlbuf1;
@@ -1314,7 +1314,7 @@ out_free:
 
                rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                data = (void *)buf;
                if (data->ioc_inlbuf1 == NULL || data->ioc_inlbuf2 == NULL ||
@@ -1345,7 +1345,7 @@ out_free:
                rc = ll_dir_setdirstripe(inode, lum, filename);
 lmv_out_free:
                obd_ioctl_freedata(buf, len);
-               RETURN(rc);
+               return rc;
 
        }
        case LL_IOC_LOV_SETSTRIPE: {
@@ -1361,11 +1361,11 @@ lmv_out_free:
                        sizeof(lumv3p->lmm_objects[0]));
                /* first try with v1 which is smaller than v3 */
                if (copy_from_user(lumv1, lumv1p, sizeof(*lumv1)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                if ((lumv1->lmm_magic == LOV_USER_MAGIC_V3) ) {
                        if (copy_from_user(&lumv3, lumv3p, sizeof(lumv3)))
-                               RETURN(-EFAULT);
+                               return -EFAULT;
                }
 
                if (inode->i_sb->s_root == file->f_dentry)
@@ -1374,7 +1374,7 @@ lmv_out_free:
                /* in v1 and v3 cases lumv1 points to data */
                rc = ll_dir_setstripe(inode, lumv1, set_default);
 
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_LMV_GETSTRIPE: {
                struct lmv_user_md *lump = (struct lmv_user_md *)arg;
@@ -1385,10 +1385,10 @@ lmv_out_free:
                int mdtindex;
 
                if (copy_from_user(&lum, lump, sizeof(struct lmv_user_md)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                if (lum.lum_magic != LMV_MAGIC_V1)
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                lum_size = lmv_user_md_size(1, LMV_MAGIC_V1);
                OBD_ALLOC(tmp, lum_size);
@@ -1411,7 +1411,7 @@ lmv_out_free:
 free_lmv:
                if (tmp)
                        OBD_FREE(tmp, lum_size);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_REMOVE_ENTRY: {
                char            *filename = NULL;
@@ -1428,7 +1428,7 @@ free_lmv:
 
                filename = ll_getname((const char *)arg);
                if (IS_ERR(filename))
-                       RETURN(PTR_ERR(filename));
+                       return PTR_ERR(filename);
 
                namelen = strlen(filename);
                if (namelen < 1)
@@ -1438,12 +1438,12 @@ free_lmv:
 out_rmdir:
                if (filename)
                        ll_putname(filename);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_LOV_SWAP_LAYOUTS:
-               RETURN(-EPERM);
+               return -EPERM;
        case LL_IOC_OBD_STATFS:
-               RETURN(ll_obd_statfs(inode, (void *)arg));
+               return ll_obd_statfs(inode, (void *)arg);
        case LL_IOC_LOV_GETSTRIPE:
        case LL_IOC_MDC_GETINFO:
        case IOC_MDC_GETFILEINFO:
@@ -1459,7 +1459,7 @@ out_rmdir:
                    cmd == IOC_MDC_GETFILESTRIPE) {
                        filename = ll_getname((const char *)arg);
                        if (IS_ERR(filename))
-                               RETURN(PTR_ERR(filename));
+                               return PTR_ERR(filename);
 
                        rc = ll_lov_getstripe_ea_info(inode, filename, &lmm,
                                                      &lmmsize, &request);
@@ -1539,11 +1539,11 @@ out_rmdir:
 
                rc = ll_get_max_mdsize(sbi, &lmmsize);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                OBD_ALLOC_LARGE(lmm, lmmsize);
                if (lmm == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                if (copy_from_user(lmm, lum, lmmsize))
                        GOTO(free_lmm, rc = -EFAULT);
 
@@ -1591,7 +1591,7 @@ out_rmdir:
                return rc;
        }
        case OBD_IOC_LLOG_CATINFO: {
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
        }
        case OBD_IOC_QUOTACHECK: {
                struct obd_quotactl *oqctl;
@@ -1599,11 +1599,11 @@ out_rmdir:
 
                if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
                    sbi->ll_flags & LL_SBI_RMT_CLIENT)
-                       RETURN(-EPERM);
+                       return -EPERM;
 
                OBD_ALLOC_PTR(oqctl);
                if (!oqctl)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                oqctl->qc_type = arg;
                rc = obd_quotacheck(sbi->ll_md_exp, oqctl);
                if (rc < 0) {
@@ -1623,11 +1623,11 @@ out_rmdir:
 
                if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
                    sbi->ll_flags & LL_SBI_RMT_CLIENT)
-                       RETURN(-EPERM);
+                       return -EPERM;
 
                OBD_ALLOC_PTR(check);
                if (!check)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                rc = obd_iocontrol(cmd, sbi->ll_md_exp, 0, (void *)check,
                                   NULL);
@@ -1650,7 +1650,7 @@ out_rmdir:
                }
        out_poll:
                OBD_FREE_PTR(check);
-               RETURN(rc);
+               return rc;
        }
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0)
        case LL_IOC_QUOTACTL_18: {
@@ -1661,7 +1661,7 @@ out_rmdir:
 
                OBD_ALLOC_PTR(qctl_18);
                if (!qctl_18)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                OBD_ALLOC_PTR(qctl_20);
                if (!qctl_20)
@@ -1701,7 +1701,7 @@ out_rmdir:
                OBD_FREE_PTR(qctl_20);
        out_quotactl_18:
                OBD_FREE_PTR(qctl_18);
-               RETURN(rc);
+               return rc;
        }
 #else
 #warning "remove old LL_IOC_QUOTACTL_18 compatibility code"
@@ -1711,7 +1711,7 @@ out_rmdir:
 
                OBD_ALLOC_PTR(qctl);
                if (!qctl)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                if (copy_from_user(qctl, (void *)arg, sizeof(*qctl)))
                        GOTO(out_quotactl, rc = -EFAULT);
@@ -1723,13 +1723,13 @@ out_rmdir:
 
        out_quotactl:
                OBD_FREE_PTR(qctl);
-               RETURN(rc);
+               return rc;
        }
        case OBD_IOC_GETDTNAME:
        case OBD_IOC_GETMDNAME:
-               RETURN(ll_get_obd_name(inode, cmd, arg));
+               return ll_get_obd_name(inode, cmd, arg);
        case LL_IOC_FLUSHCTX:
-               RETURN(ll_flush_ctx(inode));
+               return ll_flush_ctx(inode);
 #ifdef CONFIG_FS_POSIX_ACL
        case LL_IOC_RMTACL: {
            if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
@@ -1740,9 +1740,9 @@ out_rmdir:
                rc = rct_add(&sbi->ll_rct, current_pid(), arg);
                if (!rc)
                        fd->fd_flags |= LL_FILE_RMTACL;
-               RETURN(rc);
+               return rc;
            } else
-               RETURN(0);
+               return 0;
        }
 #endif
        case LL_IOC_GETOBDCOUNT: {
@@ -1750,7 +1750,7 @@ out_rmdir:
                struct obd_export *exp;
 
                if (copy_from_user(&count, (int *)arg, sizeof(int)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                /* get ost count when count is zero, get mdt count otherwise */
                exp = count ? sbi->ll_md_exp : sbi->ll_dt_exp;
@@ -1759,41 +1759,41 @@ out_rmdir:
                                  KEY_TGT_COUNT, &vallen, &count, NULL);
                if (rc) {
                        CERROR("get target count failed: %d\n", rc);
-                       RETURN(rc);
+                       return rc;
                }
 
                if (copy_to_user((int *)arg, &count, sizeof(int)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
-               RETURN(0);
+               return 0;
        }
        case LL_IOC_PATH2FID:
                if (copy_to_user((void *)arg, ll_inode2fid(inode),
                                     sizeof(struct lu_fid)))
-                       RETURN(-EFAULT);
-               RETURN(0);
+                       return -EFAULT;
+               return 0;
        case LL_IOC_GET_CONNECT_FLAGS: {
-               RETURN(obd_iocontrol(cmd, sbi->ll_md_exp, 0, NULL, (void*)arg));
+               return obd_iocontrol(cmd, sbi->ll_md_exp, 0, NULL, (void*)arg);
        }
        case OBD_IOC_CHANGELOG_SEND:
        case OBD_IOC_CHANGELOG_CLEAR:
                rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
                                    sizeof(struct ioc_changelog));
-               RETURN(rc);
+               return rc;
        case OBD_IOC_FID2PATH:
-               RETURN(ll_fid2path(inode, (void *)arg));
+               return ll_fid2path(inode, (void *)arg);
        case LL_IOC_HSM_REQUEST: {
                struct hsm_user_request *hur;
                int                      totalsize;
 
                OBD_ALLOC_PTR(hur);
                if (hur == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                /* We don't know the true size yet; copy the fixed-size part */
                if (copy_from_user(hur, (void *)arg, sizeof(*hur))) {
                        OBD_FREE_PTR(hur);
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                }
 
                /* Compute the whole struct size */
@@ -1801,12 +1801,12 @@ out_rmdir:
                OBD_FREE_PTR(hur);
                OBD_ALLOC_LARGE(hur, totalsize);
                if (hur == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                /* Copy the whole struct */
                if (copy_from_user(hur, (void *)arg, totalsize)) {
                        OBD_FREE_LARGE(hur, totalsize);
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                }
 
                rc = obd_iocontrol(cmd, ll_i2mdexp(inode), totalsize,
@@ -1814,14 +1814,14 @@ out_rmdir:
 
                OBD_FREE_LARGE(hur, totalsize);
 
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_HSM_PROGRESS: {
                struct hsm_progress_kernel      hpk;
                struct hsm_progress             hp;
 
                if (copy_from_user(&hp, (void *)arg, sizeof(hp)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                hpk.hpk_fid = hp.hp_fid;
                hpk.hpk_cookie = hp.hp_cookie;
@@ -1834,12 +1834,12 @@ out_rmdir:
                 * reported to Lustre root */
                rc = obd_iocontrol(cmd, sbi->ll_md_exp, sizeof(hpk), &hpk,
                                   NULL);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_HSM_CT_START:
                rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
                                    sizeof(struct lustre_kernelcomm));
-               RETURN(rc);
+               return rc;
 
        case LL_IOC_HSM_COPY_START: {
                struct hsm_copy *copy;
@@ -1847,10 +1847,10 @@ out_rmdir:
 
                OBD_ALLOC_PTR(copy);
                if (copy == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
                        OBD_FREE_PTR(copy);
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                }
 
                rc = ll_ioc_copy_start(inode->i_sb, copy);
@@ -1858,7 +1858,7 @@ out_rmdir:
                        rc = -EFAULT;
 
                OBD_FREE_PTR(copy);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_HSM_COPY_END: {
                struct hsm_copy *copy;
@@ -1866,10 +1866,10 @@ out_rmdir:
 
                OBD_ALLOC_PTR(copy);
                if (copy == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
                        OBD_FREE_PTR(copy);
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                }
 
                rc = ll_ioc_copy_end(inode->i_sb, copy);
@@ -1877,11 +1877,10 @@ out_rmdir:
                        rc = -EFAULT;
 
                OBD_FREE_PTR(copy);
-               RETURN(rc);
+               return rc;
        }
        default:
-               RETURN(obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL,
-                                    (void *)arg));
+               return obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL, (void *)arg);
        }
 }
 
@@ -1937,12 +1936,12 @@ out:
 
 int ll_dir_open(struct inode *inode, struct file *file)
 {
-       RETURN(ll_file_open(inode, file));
+       return ll_file_open(inode, file);
 }
 
 int ll_dir_release(struct inode *inode, struct file *file)
 {
-       RETURN(ll_file_release(inode, file));
+       return ll_file_release(inode, file);
 }
 
 struct file_operations ll_dir_operations = {
index 7f5435b18b65a9100b0436b8525acba570d96aaf..253f02688f4fe32de728e73c5e03859689b3eb0a 100644 (file)
@@ -215,7 +215,7 @@ int ll_md_real_close(struct inode *inode, int flags)
        if (*och_usecount) { /* There are still users of this handle, so
                                skip freeing it. */
                mutex_unlock(&lli->lli_och_mutex);
-               RETURN(0);
+               return 0;
        }
        och=*och_p;
        *och_p = NULL;
@@ -227,7 +227,7 @@ int ll_md_real_close(struct inode *inode, int flags)
                                               inode, och);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 int ll_md_close(struct obd_export *md_exp, struct inode *inode,
@@ -281,7 +281,7 @@ int ll_md_close(struct obd_export *md_exp, struct inode *inode,
        ll_file_data_put(fd);
        ll_capa_close(inode);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* While this returns an error code, fput() the caller does not, so we need
@@ -328,7 +328,7 @@ int ll_file_release(struct inode *inode, struct file *file)
        if (inode->i_sb->s_root == file->f_dentry) {
                LUSTRE_FPRIVATE(file) = NULL;
                ll_file_data_put(fd);
-               RETURN(0);
+               return 0;
        }
 
        if (!S_ISDIR(inode->i_mode)) {
@@ -341,7 +341,7 @@ int ll_file_release(struct inode *inode, struct file *file)
        if (CFS_FAIL_TIMEOUT_MS(OBD_FAIL_PTLRPC_DUMP_LOG, cfs_fail_val))
                libcfs_debug_dumplog();
 
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_intent_file_open(struct file *file, void *lmm,
@@ -357,7 +357,7 @@ static int ll_intent_file_open(struct file *file, void *lmm,
        int rc;
 
        if (!parent)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        /* Usually we come here only for NFSD, and we want open lock.
           But we can also get here with pre 2.6.15 patchless kernels, and in
@@ -378,7 +378,7 @@ static int ll_intent_file_open(struct file *file, void *lmm,
                                      file->f_dentry->d_inode, name, len,
                                      O_RDWR, opc, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        itp->it_flags |= MDS_OPEN_BY_FID;
        rc = md_intent_lock(sbi->ll_md_exp, op_data, lmm, lmmsize, itp,
@@ -414,7 +414,7 @@ out:
        it_clear_disposition(itp, DISP_ENQ_COMPLETE);
        ll_intent_drop_lock(itp);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -468,7 +468,7 @@ int ll_local_open(struct file *file, struct lookup_intent *it,
 
                rc = ll_och_fill(ll_i2sbi(inode)->ll_md_exp, lli, it, och);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
                if ((it->it_flags & FMODE_WRITE) &&
@@ -480,7 +480,7 @@ int ll_local_open(struct file *file, struct lookup_intent *it,
        LUSTRE_FPRIVATE(file) = fd;
        ll_readahead_init(inode, &fd->fd_ras);
        fd->fd_omode = it->it_flags;
-       RETURN(0);
+       return 0;
 }
 
 /* Open a file, and (for the very first open) create objects on the OSTs at
@@ -530,7 +530,7 @@ int ll_file_open(struct inode *inode, struct file *file)
 
        if (inode->i_sb->s_root == file->f_dentry) {
                LUSTRE_FPRIVATE(file) = fd;
-               RETURN(0);
+               return 0;
        }
 
        if (!it || !it->d.lustre.it_disposition) {
@@ -724,7 +724,7 @@ static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
                                         OBD_MD_FLATIME | OBD_MD_FLMTIME |
                                         OBD_MD_FLCTIME | OBD_MD_FLSIZE |
                                         OBD_MD_FLDATAVERSION);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -752,7 +752,7 @@ int ll_inode_getattr(struct inode *inode, struct obdo *obdo,
                       (unsigned long)ll_inode_blksize(inode));
        }
        ccc_inode_lsm_put(inode, lsm);
-       RETURN(rc);
+       return rc;
 }
 
 int ll_merge_lvb(const struct lu_env *env, struct inode *inode)
@@ -795,7 +795,7 @@ int ll_merge_lvb(const struct lu_env *env, struct inode *inode)
        }
        ll_inode_size_unlock(inode);
 
-       RETURN(rc);
+       return rc;
 }
 
 int ll_glimpse_ioctl(struct ll_sb_info *sbi, struct lov_stripe_md *lsm,
@@ -973,11 +973,11 @@ static ssize_t ll_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
 
        result = ll_file_get_iov_count(iov, &nr_segs, &count);
        if (result)
-               RETURN(result);
+               return result;
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        args = vvp_env_args(env, IO_NORMAL);
        args->u.normal.via_iov = (struct iovec *)iov;
@@ -987,7 +987,7 @@ static ssize_t ll_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
        result = ll_file_io_generic(env, args, iocb->ki_filp, CIT_READ,
                                    &iocb->ki_pos, count);
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
 
 static ssize_t ll_file_read(struct file *file, char *buf, size_t count,
@@ -1001,7 +1001,7 @@ static ssize_t ll_file_read(struct file *file, char *buf, size_t count,
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        local_iov = &vvp_env_info(env)->vti_local_iov;
        kiocb = &vvp_env_info(env)->vti_kiocb;
@@ -1015,7 +1015,7 @@ static ssize_t ll_file_read(struct file *file, char *buf, size_t count,
        *ppos = kiocb->ki_pos;
 
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
 
 /*
@@ -1032,11 +1032,11 @@ static ssize_t ll_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
 
        result = ll_file_get_iov_count(iov, &nr_segs, &count);
        if (result)
-               RETURN(result);
+               return result;
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        args = vvp_env_args(env, IO_NORMAL);
        args->u.normal.via_iov = (struct iovec *)iov;
@@ -1046,7 +1046,7 @@ static ssize_t ll_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
        result = ll_file_io_generic(env, args, iocb->ki_filp, CIT_WRITE,
                                  &iocb->ki_pos, count);
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
 
 static ssize_t ll_file_write(struct file *file, const char *buf, size_t count,
@@ -1060,7 +1060,7 @@ static ssize_t ll_file_write(struct file *file, const char *buf, size_t count,
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        local_iov = &vvp_env_info(env)->vti_local_iov;
        kiocb = &vvp_env_info(env)->vti_kiocb;
@@ -1074,7 +1074,7 @@ static ssize_t ll_file_write(struct file *file, const char *buf, size_t count,
        *ppos = kiocb->ki_pos;
 
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
 
 
@@ -1093,7 +1093,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos,
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        args = vvp_env_args(env, IO_SPLICE);
        args->u.splice.via_pipe = pipe;
@@ -1101,7 +1101,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos,
 
        result = ll_file_io_generic(env, args, in_file, CIT_READ, ppos, count);
        cl_env_put(env, &refcheck);
-       RETURN(result);
+       return result;
 }
 
 static int ll_lov_recreate(struct inode *inode, struct ost_id *oi,
@@ -1116,7 +1116,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi,
 
        OBDO_ALLOC(oa);
        if (oa == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        lsm = ccc_inode_lsm_get(inode);
        if (!lsm_has_objects(lsm))
@@ -1155,15 +1155,15 @@ static int ll_lov_recreate_obj(struct inode *inode, unsigned long arg)
        struct ost_id           oi;
 
        if (!cfs_capable(CFS_CAP_SYS_ADMIN))
-               RETURN(-EPERM);
+               return -EPERM;
 
        if (copy_from_user(&ucreat, (struct ll_recreate_obj *)arg,
                           sizeof(ucreat)))
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        ostid_set_seq_mdt0(&oi);
        ostid_set_id(&oi, ucreat.lrc_id);
-       RETURN(ll_lov_recreate(inode, &oi, ucreat.lrc_ost_idx));
+       return ll_lov_recreate(inode, &oi, ucreat.lrc_ost_idx);
 }
 
 static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
@@ -1173,14 +1173,14 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
        obd_count       ost_idx;
 
        if (!cfs_capable(CFS_CAP_SYS_ADMIN))
-               RETURN(-EPERM);
+               return -EPERM;
 
        if (copy_from_user(&fid, (struct lu_fid *)arg, sizeof(fid)))
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        fid_to_ostid(&fid, &oi);
        ost_idx = (fid_seq(&fid) >> 16) & 0xffff;
-       RETURN(ll_lov_recreate(inode, &oi, ost_idx));
+       return ll_lov_recreate(inode, &oi, ost_idx);
 }
 
 int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
@@ -1195,7 +1195,7 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
                ccc_inode_lsm_put(inode, lsm);
                CDEBUG(D_IOCTL, "stripe already exists for ino %lu\n",
                       inode->i_ino);
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
 
        ll_inode_size_lock(inode);
@@ -1212,7 +1212,7 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
        ll_inode_size_unlock(inode);
        ll_intent_release(&oit);
        ccc_inode_lsm_put(inode, lsm);
-       RETURN(rc);
+       return rc;
 out_req_free:
        ptlrpc_req_finished((struct ptlrpc_request *) oit.d.lustre.it_data);
        goto out;
@@ -1231,13 +1231,13 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
 
        rc = ll_get_max_mdsize(sbi, &lmmsize);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        op_data = ll_prep_md_op_data(NULL, inode, NULL, filename,
                                     strlen(filename), lmmsize,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
        rc = md_getattr_name(sbi->ll_md_exp, op_data, &req);
@@ -1312,21 +1312,21 @@ static int ll_lov_setea(struct inode *inode, struct file *file,
        int                      rc;
 
        if (!cfs_capable(CFS_CAP_SYS_ADMIN))
-               RETURN(-EPERM);
+               return -EPERM;
 
        OBD_ALLOC_LARGE(lump, lum_size);
        if (lump == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (copy_from_user(lump, (struct lov_user_md  *)arg, lum_size)) {
                OBD_FREE_LARGE(lump, lum_size);
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
 
        rc = ll_lov_setstripe_ea_info(inode, file, flags, lump, lum_size);
 
        OBD_FREE_LARGE(lump, lum_size);
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_lov_setstripe(struct inode *inode, struct file *file,
@@ -1342,12 +1342,12 @@ static int ll_lov_setstripe(struct inode *inode, struct file *file,
        /* first try with v1 which is smaller than v3 */
        lum_size = sizeof(struct lov_user_md_v1);
        if (copy_from_user(lumv1, lumv1p, lum_size))
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        if (lumv1->lmm_magic == LOV_USER_MAGIC_V3) {
                lum_size = sizeof(struct lov_user_md_v3);
                if (copy_from_user(&lumv3, lumv3p, lum_size))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
        }
 
        rc = ll_lov_setstripe_ea_info(inode, file, flags, lumv1, lum_size);
@@ -1363,7 +1363,7 @@ static int ll_lov_setstripe(struct inode *inode, struct file *file,
                                   0, lsm, (void *)arg);
                ccc_inode_lsm_put(inode, lsm);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_lov_getstripe(struct inode *inode, unsigned long arg)
@@ -1376,7 +1376,7 @@ static int ll_lov_getstripe(struct inode *inode, unsigned long arg)
                rc = obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2dtexp(inode), 0,
                                   lsm, (void *)arg);
        ccc_inode_lsm_put(inode, lsm);
-       RETURN(rc);
+       return rc;
 }
 
 int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
@@ -1387,14 +1387,14 @@ int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
        int                  rc;
 
        if (ll_file_nolock(file))
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        spin_lock(&lli->lli_lock);
        if (fd->fd_flags & LL_FILE_GROUP_LOCKED) {
                CWARN("group lock already existed with gid %lu\n",
                      fd->fd_grouplock.cg_gid);
                spin_unlock(&lli->lli_lock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        LASSERT(fd->fd_grouplock.cg_lock == NULL);
        spin_unlock(&lli->lli_lock);
@@ -1402,14 +1402,14 @@ int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
        rc = cl_get_grouplock(cl_i2info(inode)->lli_clob,
                              arg, (file->f_flags & O_NONBLOCK), &grouplock);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        spin_lock(&lli->lli_lock);
        if (fd->fd_flags & LL_FILE_GROUP_LOCKED) {
                spin_unlock(&lli->lli_lock);
                CERROR("another thread just won the race\n");
                cl_put_grouplock(&grouplock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        fd->fd_flags |= LL_FILE_GROUP_LOCKED;
@@ -1417,7 +1417,7 @@ int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
        spin_unlock(&lli->lli_lock);
 
        CDEBUG(D_INFO, "group lock %lu obtained\n", arg);
-       RETURN(0);
+       return 0;
 }
 
 int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg)
@@ -1430,7 +1430,7 @@ int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg)
        if (!(fd->fd_flags & LL_FILE_GROUP_LOCKED)) {
                spin_unlock(&lli->lli_lock);
                CWARN("no group lock held\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        LASSERT(fd->fd_grouplock.cg_lock != NULL);
 
@@ -1438,7 +1438,7 @@ int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg)
                CWARN("group lock %lu doesn't match current id %lu\n",
                       arg, fd->fd_grouplock.cg_gid);
                spin_unlock(&lli->lli_lock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        grouplock = fd->fd_grouplock;
@@ -1448,7 +1448,7 @@ int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg)
 
        cl_put_grouplock(&grouplock);
        CDEBUG(D_INFO, "group lock %lu released\n", arg);
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1470,11 +1470,11 @@ int ll_release_openhandle(struct dentry *dentry, struct lookup_intent *it)
 
        /* Root ? Do nothing. */
        if (dentry->d_inode->i_sb->s_root == dentry)
-               RETURN(0);
+               return 0;
 
        /* No open handle to close? Move away */
        if (!it_disposition(it, DISP_OPEN_OPEN))
-               RETURN(0);
+               return 0;
 
        LASSERT(it_open_error(DISP_OPEN_OPEN, it) == 0);
 
@@ -1493,7 +1493,7 @@ int ll_release_openhandle(struct dentry *dentry, struct lookup_intent *it)
                ptlrpc_req_finished(it->d.lustre.it_data);
                it_clear_disposition(it, DISP_ENQ_OPEN_REF);
        }
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1553,7 +1553,7 @@ int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
 
 out:
        ccc_inode_lsm_put(inode, lsm);
-       RETURN(rc);
+       return rc;
 }
 
 int ll_fid2path(struct inode *inode, void *arg)
@@ -1564,22 +1564,22 @@ int ll_fid2path(struct inode *inode, void *arg)
 
        if (!cfs_capable(CFS_CAP_DAC_READ_SEARCH) &&
            !(ll_i2sbi(inode)->ll_flags & LL_SBI_USER_FID2PATH))
-               RETURN(-EPERM);
+               return -EPERM;
 
        /* Need to get the buflen */
        OBD_ALLOC_PTR(gfin);
        if (gfin == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        if (copy_from_user(gfin, arg, sizeof(*gfin))) {
                OBD_FREE_PTR(gfin);
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
 
        outsize = sizeof(*gfout) + gfin->gf_pathlen;
        OBD_ALLOC(gfout, outsize);
        if (gfout == NULL) {
                OBD_FREE_PTR(gfin);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        memcpy(gfout, gfin, sizeof(*gfout));
        OBD_FREE_PTR(gfin);
@@ -1594,7 +1594,7 @@ int ll_fid2path(struct inode *inode, void *arg)
 
 gf_free:
        OBD_FREE(gfout, outsize);
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_ioctl_fiemap(struct inode *inode, unsigned long arg)
@@ -1608,13 +1608,13 @@ static int ll_ioctl_fiemap(struct inode *inode, unsigned long arg)
         * required fiemap buffer */
        if (get_user(extent_count,
            &((struct ll_user_fiemap __user *)arg)->fm_extent_count))
-               RETURN(-EFAULT);
+               return -EFAULT;
        num_bytes = sizeof(*fiemap_s) + (extent_count *
                                         sizeof(struct ll_fiemap_extent));
 
        OBD_ALLOC_LARGE(fiemap_s, num_bytes);
        if (fiemap_s == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* get the fiemap value */
        if (copy_from_user(fiemap_s, (struct ll_user_fiemap __user *)arg,
@@ -1646,7 +1646,7 @@ static int ll_ioctl_fiemap(struct inode *inode, unsigned long arg)
 
 error:
        OBD_FREE_LARGE(fiemap_s, num_bytes);
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -1689,7 +1689,7 @@ int ll_data_version(struct inode *inode, __u64 *data_version,
        OBD_FREE_PTR(obdo);
 out:
        ccc_inode_lsm_put(inode, lsm);
-       RETURN(rc);
+       return rc;
 }
 
 struct ll_swap_stack {
@@ -1711,7 +1711,7 @@ static int ll_swap_layouts(struct file *file1, struct file *file2,
 
        OBD_ALLOC_PTR(llss);
        if (llss == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        llss->inode1 = file1->f_dentry->d_inode;
        llss->inode2 = file2->f_dentry->d_inode;
@@ -1850,7 +1850,7 @@ free:
        if (llss != NULL)
                OBD_FREE_PTR(llss);
 
-       RETURN(rc);
+       return rc;
 }
 
 long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
@@ -1865,7 +1865,7 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
        /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */
        if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */
-               RETURN(-ENOTTY);
+               return -ENOTTY;
 
        switch(cmd) {
        case LL_IOC_GETFLAGS:
@@ -1878,66 +1878,66 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                 *     not abused, and to handle any flag side effects.
                 */
                if (get_user(flags, (int *) arg))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                if (cmd == LL_IOC_SETFLAGS) {
                        if ((flags & LL_FILE_IGNORE_LOCK) &&
                            !(file->f_flags & O_DIRECT)) {
                                CERROR("%s: unable to disable locking on "
                                       "non-O_DIRECT file\n", current->comm);
-                               RETURN(-EINVAL);
+                               return -EINVAL;
                        }
 
                        fd->fd_flags |= flags;
                } else {
                        fd->fd_flags &= ~flags;
                }
-               RETURN(0);
+               return 0;
        case LL_IOC_LOV_SETSTRIPE:
-               RETURN(ll_lov_setstripe(inode, file, arg));
+               return ll_lov_setstripe(inode, file, arg);
        case LL_IOC_LOV_SETEA:
-               RETURN(ll_lov_setea(inode, file, arg));
+               return ll_lov_setea(inode, file, arg);
        case LL_IOC_LOV_SWAP_LAYOUTS: {
                struct file *file2;
                struct lustre_swap_layouts lsl;
 
                if (copy_from_user(&lsl, (char *)arg,
                                       sizeof(struct lustre_swap_layouts)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                if ((file->f_flags & O_ACCMODE) == 0) /* O_RDONLY */
-                       RETURN(-EPERM);
+                       return -EPERM;
 
                file2 = fget(lsl.sl_fd);
                if (file2 == NULL)
-                       RETURN(-EBADF);
+                       return -EBADF;
 
                rc = -EPERM;
                if ((file2->f_flags & O_ACCMODE) != 0) /* O_WRONLY or O_RDWR */
                        rc = ll_swap_layouts(file, file2, &lsl);
                fput(file2);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_LOV_GETSTRIPE:
-               RETURN(ll_lov_getstripe(inode, arg));
+               return ll_lov_getstripe(inode, arg);
        case LL_IOC_RECREATE_OBJ:
-               RETURN(ll_lov_recreate_obj(inode, arg));
+               return ll_lov_recreate_obj(inode, arg);
        case LL_IOC_RECREATE_FID:
-               RETURN(ll_lov_recreate_fid(inode, arg));
+               return ll_lov_recreate_fid(inode, arg);
        case FSFILT_IOC_FIEMAP:
-               RETURN(ll_ioctl_fiemap(inode, arg));
+               return ll_ioctl_fiemap(inode, arg);
        case FSFILT_IOC_GETFLAGS:
        case FSFILT_IOC_SETFLAGS:
-               RETURN(ll_iocontrol(inode, file, cmd, arg));
+               return ll_iocontrol(inode, file, cmd, arg);
        case FSFILT_IOC_GETVERSION_OLD:
        case FSFILT_IOC_GETVERSION:
-               RETURN(put_user(inode->i_generation, (int *)arg));
+               return put_user(inode->i_generation, (int *)arg);
        case LL_IOC_GROUP_LOCK:
-               RETURN(ll_get_grouplock(inode, file, arg));
+               return ll_get_grouplock(inode, file, arg);
        case LL_IOC_GROUP_UNLOCK:
-               RETURN(ll_put_grouplock(inode, file, arg));
+               return ll_put_grouplock(inode, file, arg);
        case IOC_OBD_STATFS:
-               RETURN(ll_obd_statfs(inode, (void *)arg));
+               return ll_obd_statfs(inode, (void *)arg);
 
        /* We need to special case any other ioctls we want to handle,
         * to send them to the MDS/OST as appropriate and to properly
@@ -1946,30 +1946,30 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case FSFILT_IOC_SETVERSION:
        */
        case LL_IOC_FLUSHCTX:
-               RETURN(ll_flush_ctx(inode));
+               return ll_flush_ctx(inode);
        case LL_IOC_PATH2FID: {
                if (copy_to_user((void *)arg, ll_inode2fid(inode),
                                 sizeof(struct lu_fid)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
-               RETURN(0);
+               return 0;
        }
        case OBD_IOC_FID2PATH:
-               RETURN(ll_fid2path(inode, (void *)arg));
+               return ll_fid2path(inode, (void *)arg);
        case LL_IOC_DATA_VERSION: {
                struct ioc_data_version idv;
                int                     rc;
 
                if (copy_from_user(&idv, (char *)arg, sizeof(idv)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                rc = ll_data_version(inode, &idv.idv_version,
                                !(idv.idv_flags & LL_DV_NOFLUSH));
 
                if (rc == 0 && copy_to_user((char *) arg, &idv, sizeof(idv)))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
-               RETURN(rc);
+               return rc;
        }
 
        case LL_IOC_GET_MDTIDX: {
@@ -1977,16 +1977,16 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                mdtidx = ll_get_mdt_idx(inode);
                if (mdtidx < 0)
-                       RETURN(mdtidx);
+                       return mdtidx;
 
                if (put_user((int)mdtidx, (int*)arg))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
-               RETURN(0);
+               return 0;
        }
        case OBD_IOC_GETDTNAME:
        case OBD_IOC_GETMDNAME:
-               RETURN(ll_get_obd_name(inode, cmd, arg));
+               return ll_get_obd_name(inode, cmd, arg);
        case LL_IOC_HSM_STATE_GET: {
                struct md_op_data       *op_data;
                struct hsm_user_state   *hus;
@@ -1994,13 +1994,13 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                OBD_ALLOC_PTR(hus);
                if (hus == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                             LUSTRE_OPC_ANY, hus);
                if (IS_ERR(op_data)) {
                        OBD_FREE_PTR(hus);
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
                }
 
                rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
@@ -2011,7 +2011,7 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                ll_finish_md_op_data(op_data);
                OBD_FREE_PTR(hus);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_HSM_STATE_SET: {
                struct md_op_data       *op_data;
@@ -2020,10 +2020,10 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                OBD_ALLOC_PTR(hss);
                if (hss == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                if (copy_from_user(hss, (char *)arg, sizeof(*hss))) {
                        OBD_FREE_PTR(hss);
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                }
 
                /* Non-root users are forbidden to set or clear flags which are
@@ -2031,14 +2031,14 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (((hss->hss_setmask | hss->hss_clearmask) & ~HSM_USER_MASK)
                    && !cfs_capable(CFS_CAP_SYS_ADMIN)) {
                        OBD_FREE_PTR(hss);
-                       RETURN(-EPERM);
+                       return -EPERM;
                }
 
                op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                             LUSTRE_OPC_ANY, hss);
                if (IS_ERR(op_data)) {
                        OBD_FREE_PTR(hss);
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
                }
 
                rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
@@ -2047,7 +2047,7 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                ll_finish_md_op_data(op_data);
 
                OBD_FREE_PTR(hss);
-               RETURN(rc);
+               return rc;
        }
        case LL_IOC_HSM_ACTION: {
                struct md_op_data               *op_data;
@@ -2056,13 +2056,13 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                OBD_ALLOC_PTR(hca);
                if (hca == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                             LUSTRE_OPC_ANY, hca);
                if (IS_ERR(op_data)) {
                        OBD_FREE_PTR(hca);
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
                }
 
                rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
@@ -2073,17 +2073,17 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                ll_finish_md_op_data(op_data);
                OBD_FREE_PTR(hca);
-               RETURN(rc);
+               return rc;
        }
        default: {
                int err;
 
                if (LLIOC_STOP ==
                     ll_iocontrol_call(inode, file, cmd, arg, &err))
-                       RETURN(err);
+                       return err;
 
-               RETURN(obd_iocontrol(cmd, ll_i2dtexp(inode), 0, NULL,
-                                    (void *)arg));
+               return obd_iocontrol(cmd, ll_i2dtexp(inode), 0, NULL,
+                                    (void *)arg);
        }
        }
 }
@@ -2104,13 +2104,13 @@ loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
        if (origin == SEEK_END || origin == SEEK_HOLE || origin == SEEK_DATA) {
                retval = ll_glimpse_size(inode);
                if (retval != 0)
-                       RETURN(retval);
+                       return retval;
                eof = i_size_read(inode);
        }
 
        retval = generic_file_llseek_size(file, offset, origin,
                                          ll_file_maxbytes(inode), eof);
-       RETURN(retval);
+       return retval;
 }
 
 int ll_flush(struct file *file, fl_owner_t id)
@@ -2155,11 +2155,11 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
 
        if (mode != CL_FSYNC_NONE && mode != CL_FSYNC_LOCAL &&
            mode != CL_FSYNC_DISCARD && mode != CL_FSYNC_ALL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        env = cl_env_nested_get(&nest);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        capa = ll_osscapa_get(inode, CAPA_OPC_OSS_WRITE);
 
@@ -2187,7 +2187,7 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
 
        capa_put(capa);
 
-       RETURN(result);
+       return result;
 }
 
 /*
@@ -2247,7 +2247,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync)
        }
 
        mutex_unlock(&inode->i_mutex);
-       RETURN(rc);
+       return rc;
 }
 
 int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
@@ -2282,7 +2282,7 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
                flock.l_flock.start = file_lock->fl_start;
                flock.l_flock.end = file_lock->fl_end;
        } else {
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        flock.l_flock.pid = file_lock->fl_pid;
 
@@ -2317,7 +2317,7 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
        default:
                CDEBUG(D_INFO, "Unknown fcntl lock type: %d\n",
                        file_lock->fl_type);
-               RETURN (-ENOTSUPP);
+               return -ENOTSUPP;
        }
 
        switch (cmd) {
@@ -2344,13 +2344,13 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
                break;
        default:
                CERROR("unknown fcntl lock command: %d\n", cmd);
-               RETURN (-EINVAL);
+               return -EINVAL;
        }
 
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        CDEBUG(D_DLMTRACE, "inode=%lu, pid=%u, flags=%#x, mode=%u, "
               "start="LPU64", end="LPU64"\n", inode->i_ino, flock.l_flock.pid,
@@ -2376,12 +2376,12 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
 
        ll_finish_md_op_data(op_data);
 
-       RETURN(rc);
+       return rc;
 }
 
 int ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
 {
-       RETURN(-ENOSYS);
+       return -ENOSYS;
 }
 
 /**
@@ -2405,7 +2405,7 @@ int ll_have_md_lock(struct inode *inode, __u64 *bits,  ldlm_mode_t l_req_mode)
        int i;
 
        if (!inode)
-              RETURN(0);
+              return 0;
 
        fid = &ll_i2info(inode)->lli_fid;
        CDEBUG(D_INFO, "trying to match res "DFID" mode %s\n", PFID(fid),
@@ -2431,7 +2431,7 @@ int ll_have_md_lock(struct inode *inode, __u64 *bits,  ldlm_mode_t l_req_mode)
                        }
                }
        }
-       RETURN(*bits == 0);
+       return *bits == 0;
 }
 
 ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,
@@ -2447,7 +2447,7 @@ ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,
        rc = md_lock_match(ll_i2mdexp(inode), LDLM_FL_BLOCK_GRANTED|flags,
                           fid, LDLM_IBITS, &policy,
                           LCK_CR|LCK_CW|LCK_PR|LCK_PW, lockh);
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_inode_revalidate_fini(struct inode *inode, int rc)
@@ -2499,7 +2499,7 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
                                             dentry->d_inode, NULL, 0, 0,
                                             LUSTRE_OPC_ANY, NULL);
                if (IS_ERR(op_data))
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
 
                oit.it_create_mode |= M_CHECK_STALE;
                rc = md_intent_lock(exp, op_data, NULL, 0,
@@ -2537,7 +2537,7 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
                if (S_ISREG(inode->i_mode)) {
                        rc = ll_get_max_mdsize(sbi, &ealen);
                        if (rc)
-                               RETURN(rc);
+                               return rc;
                        valid |= OBD_MD_FLEASIZE | OBD_MD_FLMODEASIZE;
                }
 
@@ -2545,7 +2545,7 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
                                             0, ealen, LUSTRE_OPC_ANY,
                                             NULL);
                if (IS_ERR(op_data))
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
 
                op_data->op_valid = valid;
                /* Once OBD_CONNECT_ATTRFID is not supported, we can't find one
@@ -2555,7 +2555,7 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
                ll_finish_md_op_data(op_data);
                if (rc) {
                        rc = ll_inode_revalidate_fini(inode, rc);
-                       RETURN(rc);
+                       return rc;
                }
 
                rc = ll_prep_inode(&inode, req, NULL, NULL);
@@ -2573,7 +2573,7 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
 
        rc = __ll_inode_revalidate_it(dentry, it, ibits);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        /* if object isn't regular file, don't validate size */
        if (!S_ISREG(inode->i_mode)) {
@@ -2583,7 +2583,7 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
        } else {
                rc = ll_glimpse_size(inode);
        }
-       RETURN(rc);
+       return rc;
 }
 
 int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
@@ -2639,7 +2639,7 @@ struct posix_acl * ll_get_acl(struct inode *inode, int type)
        acl = posix_acl_dup(lli->lli_posix_acl);
        spin_unlock(&lli->lli_lock);
 
-       RETURN(acl);
+       return acl;
 }
 
 
@@ -2661,7 +2661,7 @@ int ll_inode_permission(struct inode *inode, int mask)
                rc = __ll_inode_revalidate_it(inode->i_sb->s_root, &it,
                                              MDS_INODELOCK_LOOKUP);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
        CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), inode mode %x mask %o\n",
@@ -2673,7 +2673,7 @@ int ll_inode_permission(struct inode *inode, int mask)
        ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_INODE_PERM, 1);
        rc = generic_permission(inode, mask);
 
-       RETURN(rc);
+       return rc;
 }
 
 #define READ_METHOD aio_read
@@ -2768,12 +2768,12 @@ void *ll_iocontrol_register(llioc_callback_t cb, int count, unsigned int *cmd)
 
        if (cb == NULL || cmd == NULL ||
            count > LLIOC_MAX_CMD || count < 0)
-               RETURN(NULL);
+               return NULL;
 
        size = sizeof(*in_data) + count * sizeof(unsigned int);
        OBD_ALLOC(in_data, size);
        if (in_data == NULL)
-               RETURN(NULL);
+               return NULL;
 
        memset(in_data, 0, sizeof(*in_data));
        in_data->iocd_size = size;
@@ -2785,7 +2785,7 @@ void *ll_iocontrol_register(llioc_callback_t cb, int count, unsigned int *cmd)
        list_add_tail(&in_data->iocd_list, &llioc.ioc_head);
        up_write(&llioc.ioc_sem);
 
-       RETURN(in_data);
+       return in_data;
 }
 
 void ll_iocontrol_unregister(void *magic)
@@ -2850,11 +2850,11 @@ int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf)
        int result;
 
        if (lli->lli_clob == NULL)
-               RETURN(0);
+               return 0;
 
        env = cl_env_nested_get(&nest);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        result = cl_conf_set(env, lli->lli_clob, conf);
        cl_env_nested_put(&nest, env);
@@ -2872,7 +2872,7 @@ int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf)
                        ldlm_lock_allow_match(lock);
                }
        }
-       RETURN(result);
+       return result;
 }
 
 /* Fetch layout from MDT with getxattr request, if it's not ready yet */
@@ -2893,7 +2893,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
               lock->l_lvb_data, lock->l_lvb_len);
 
        if ((lock->l_lvb_data != NULL) && (lock->l_flags & LDLM_FL_LVB_READY))
-               RETURN(0);
+               return 0;
 
        /* if layout lock was granted right away, the layout is returned
         * within DLM_LVB of dlm reply; otherwise if the lock was ever
@@ -2908,7 +2908,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
                                lmmsize, 0, &req);
        capa_put(oc);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
        if (body == NULL || body->eadatasize > lmmsize)
@@ -3044,7 +3044,7 @@ out:
                CDEBUG(D_INODE, "file: "DFID" waiting layout return: %d.\n",
                        PFID(&lli->lli_fid), rc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -3078,7 +3078,7 @@ int ll_layout_refresh(struct inode *inode, __u32 *gen)
 
        *gen = lli->lli_layout_gen;
        if (!(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
-               RETURN(0);
+               return 0;
 
        /* sanity checks */
        LASSERT(fid_is_sane(ll_inode2fid(inode)));
@@ -3090,7 +3090,7 @@ int ll_layout_refresh(struct inode *inode, __u32 *gen)
        if (mode != 0) { /* hit cached lock */
                rc = ll_layout_lock_set(&lockh, mode, inode, gen, false);
                if (rc == 0)
-                       RETURN(0);
+                       return 0;
 
                /* better hold lli_layout_mutex to try again otherwise
                 * it will have starvation problem. */
@@ -3108,14 +3108,14 @@ again:
                        goto again;
 
                mutex_unlock(&lli->lli_layout_mutex);
-               RETURN(rc);
+               return rc;
        }
 
        op_data = ll_prep_md_op_data(NULL, inode, inode, NULL,
                        0, 0, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data)) {
                mutex_unlock(&lli->lli_layout_mutex);
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
        }
 
        /* have to enqueue one */
@@ -3148,5 +3148,5 @@ again:
        }
        mutex_unlock(&lli->lli_layout_mutex);
 
-       RETURN(rc);
+       return rc;
 }
index 3b4f7f82dd422c9760713b0bbe722775780d963b..1d30181e3bcdc3ce9ff86af8d607451e87e5f246 100644 (file)
@@ -279,7 +279,7 @@ static int capa_thread_main(void *unused)
 
        thread_set_flags(&ll_capa_thread, SVC_STOPPED);
        wake_up(&ll_capa_thread.t_ctl_waitq);
-       RETURN(0);
+       return 0;
 }
 
 void ll_capa_timer_callback(unsigned long unused)
@@ -297,12 +297,12 @@ int ll_capa_thread_start(void)
        if (IS_ERR(task)) {
                CERROR("cannot start expired capa thread: rc %ld\n",
                        PTR_ERR(task));
-               RETURN(PTR_ERR(task));
+               return PTR_ERR(task);
        }
        wait_event(ll_capa_thread.t_ctl_waitq,
                       thread_is_running(&ll_capa_thread));
 
-       RETURN(0);
+       return 0;
 }
 
 void ll_capa_thread_stop(void)
@@ -320,7 +320,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
        int found = 0;
 
        if ((ll_i2sbi(inode)->ll_flags & LL_SBI_OSS_CAPA) == 0)
-               RETURN(NULL);
+               return NULL;
 
        LASSERT(opc == CAPA_OPC_OSS_WRITE || opc == CAPA_OPC_OSS_RW ||
                opc == CAPA_OPC_OSS_TRUNC);
@@ -364,7 +364,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
        }
        spin_unlock(&capa_lock);
 
-       RETURN(ocapa);
+       return ocapa;
 }
 EXPORT_SYMBOL(ll_osscapa_get);
 
@@ -376,7 +376,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
        LASSERT(inode != NULL);
 
        if ((ll_i2sbi(inode)->ll_flags & LL_SBI_MDS_CAPA) == 0)
-               RETURN(NULL);
+               return NULL;
 
        spin_lock(&capa_lock);
        ocapa = capa_get(lli->lli_mds_capa);
@@ -386,7 +386,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
                atomic_set(&ll_capa_debug, 0);
        }
 
-       RETURN(ocapa);
+       return ocapa;
 }
 
 static struct obd_capa *do_add_mds_capa(struct inode *inode,
@@ -554,7 +554,7 @@ int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa)
 
                capa_put(ocapa);
                iput(inode);
-               RETURN(rc);
+               return rc;
        }
 
        spin_lock(&ocapa->c_lock);
index a9cd75f16e94671c9a260244794c439ef7311999..487ce6851d96becf0a7f8276dcdaec4396f939e0 100644 (file)
@@ -225,7 +225,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
        OBDO_ALLOC(oa);
        if (!oa) {
                CERROR("can't allocate memory for Size-on-MDS update.\n");
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        old_flags = op_data->op_flags;
@@ -255,7 +255,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
        ptlrpc_req_finished(request);
 
        OBDO_FREE(oa);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -356,7 +356,7 @@ static int ll_close_thread(void *arg)
 
        CDEBUG(D_INFO, "ll_close exiting\n");
        complete(&lcq->lcq_comp);
-       RETURN(0);
+       return 0;
 }
 
 int ll_close_thread_start(struct ll_close_queue **lcq_ret)
index 71b8fd9ff1a7f997fd71cceb689e47b8129deba9..b868c2bd58d2a78787e2336d2c4b4a6259c3dd90 100644 (file)
@@ -81,7 +81,7 @@ static struct ll_sb_info *ll_init_sbi(void)
 
        OBD_ALLOC(sbi, sizeof(*sbi));
        if (!sbi)
-               RETURN(NULL);
+               return NULL;
 
        spin_lock_init(&sbi->ll_lock);
        mutex_init(&sbi->ll_lco.lco_lock);
@@ -139,7 +139,7 @@ static struct ll_sb_info *ll_init_sbi(void)
        atomic_set(&sbi->ll_agl_total, 0);
        sbi->ll_flags |= LL_SBI_AGL_ENABLED;
 
-       RETURN(sbi);
+       return sbi;
 }
 
 void ll_free_sbi(struct super_block *sb)
@@ -178,17 +178,17 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
        obd = class_name2obd(md);
        if (!obd) {
                CERROR("MD %s: not setup or attached\n", md);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        OBD_ALLOC_PTR(data);
        if (data == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC_PTR(osfs);
        if (osfs == NULL) {
                OBD_FREE_PTR(data);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        if (proc_lustre_fs_root) {
@@ -588,7 +588,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
        if (osfs != NULL)
                OBD_FREE_PTR(osfs);
 
-       RETURN(err);
+       return err;
 out_root:
        if (root)
                iput(root);
@@ -624,7 +624,7 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
        if (rc)
                CERROR("Get max mdsize error rc %d \n", rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 void ll_dump_inode(struct inode *inode)
@@ -726,20 +726,20 @@ char *ll_read_opt(const char *opt, char *data)
 
        CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
        if (strncmp(opt, data, strlen(opt)))
-               RETURN(NULL);
+               return NULL;
        if ((value = strchr(data, '=')) == NULL)
-               RETURN(NULL);
+               return NULL;
 
        value++;
        OBD_ALLOC(retval, strlen(value) + 1);
        if (!retval) {
                CERROR("out of memory!\n");
-               RETURN(NULL);
+               return NULL;
        }
 
        memcpy(retval, value, strlen(value)+1);
        CDEBUG(D_SUPER, "Assigned option: %s, value %s\n", opt, retval);
-       RETURN(retval);
+       return retval;
 }
 
 static inline int ll_set_opt(const char *opt, char *data, int fl)
@@ -757,7 +757,7 @@ static int ll_options(char *options, int *flags)
        char *s1 = options, *s2;
 
        if (!options)
-               RETURN(0);
+               return 0;
 
        CDEBUG(D_CONFIG, "Parsing opts %s\n", options);
 
@@ -880,7 +880,7 @@ static int ll_options(char *options, int *flags)
                }
                LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n",
                                   s1);
-               RETURN(-EINVAL);
+               return -EINVAL;
 
 next:
                /* Find next opt */
@@ -889,7 +889,7 @@ next:
                        break;
                s1 = s2 + 1;
        }
-       RETURN(0);
+       return 0;
 }
 
 void ll_lli_init(struct ll_inode_info *lli)
@@ -971,7 +971,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
 
        OBD_ALLOC_PTR(cfg);
        if (cfg == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        try_module_get(THIS_MODULE);
 
@@ -980,7 +980,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
        if (!sbi) {
                module_put(THIS_MODULE);
                OBD_FREE_PTR(cfg);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        err = ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags);
@@ -1046,7 +1046,7 @@ out_free:
                LCONSOLE_WARN("Mounted %s\n", profilenm);
 
        OBD_FREE_PTR(cfg);
-       RETURN(err);
+       return err;
 } /* ll_fill_super */
 
 void ll_put_super(struct super_block *sb)
@@ -1235,7 +1235,7 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
        op_data = ll_prep_md_op_data(op_data, inode, NULL, NULL, 0, 0,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        rc = md_setattr(sbi->ll_md_exp, op_data, NULL, 0, NULL, 0,
                        &request, mod);
@@ -1255,14 +1255,14 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
                } else if (rc != -EPERM && rc != -EACCES && rc != -ETXTBSY) {
                        CERROR("md_setattr fails: rc = %d\n", rc);
                }
-               RETURN(rc);
+               return rc;
        }
 
        rc = md_get_lustre_md(sbi->ll_md_exp, request, sbi->ll_dt_exp,
                              sbi->ll_md_exp, &md);
        if (rc) {
                ptlrpc_req_finished(request);
-               RETURN(rc);
+               return rc;
        }
 
        ia_valid = op_data->op_attr.ia_valid;
@@ -1279,7 +1279,7 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
        ll_update_inode(inode, &md);
        ptlrpc_req_finished(request);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Close IO epoch and send Size-on-MDS attribute update. */
@@ -1292,7 +1292,7 @@ static int ll_setattr_done_writing(struct inode *inode,
 
        LASSERT(op_data != NULL);
        if (!S_ISREG(inode->i_mode))
-               RETURN(0);
+               return 0;
 
        CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n",
               op_data->op_ioepoch, PFID(&lli->lli_fid));
@@ -1310,7 +1310,7 @@ static int ll_setattr_done_writing(struct inode *inode,
                CERROR("inode %lu mdc truncate failed: rc = %d\n",
                       inode->i_ino, rc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_setattr_ost(struct inode *inode, struct iattr *attr)
@@ -1364,7 +1364,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
                /* Check new size against VFS/VM file size limit and rlimit */
                rc = inode_newsize_ok(inode, attr->ia_size);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                /* The maximum Lustre file size is variable, based on the
                 * OST maximum object size and number of stripes.  This
@@ -1373,7 +1373,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
                        CDEBUG(D_INODE,"file "DFID" too large %llu > "LPU64"\n",
                               PFID(&lli->lli_fid), attr->ia_size,
                               ll_file_maxbytes(inode));
-                       RETURN(-EFBIG);
+                       return -EFBIG;
                }
 
                attr->ia_valid |= ATTR_MTIME | ATTR_CTIME;
@@ -1383,7 +1383,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
        if (attr->ia_valid & TIMES_SET_FLAGS) {
                if ((!uid_eq(current_fsuid(), inode->i_uid)) &&
                    !cfs_capable(CFS_CAP_FOWNER))
-                       RETURN(-EPERM);
+                       return -EPERM;
        }
 
        /* We mark all of the fields "set" so MDS/OST does not re-set them */
@@ -1420,7 +1420,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
 
        OBD_ALLOC_PTR(op_data);
        if (op_data == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (!S_ISDIR(inode->i_mode)) {
                if (attr->ia_valid & ATTR_SIZE)
@@ -1521,7 +1521,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
        rc = obd_statfs(NULL, sbi->ll_md_exp, osfs, max_age, flags);
        if (rc) {
                CERROR("md_statfs fails: rc = %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        osfs->os_type = sb->s_magic;
@@ -1535,7 +1535,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
        rc = obd_statfs_rqset(sbi->ll_dt_exp, &obd_osfs, max_age, flags);
        if (rc) {
                CERROR("obd_statfs fails: rc = %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        CDEBUG(D_SUPER, "OSC blocks "LPU64"/"LPU64" objects "LPU64"/"LPU64"\n",
@@ -1557,7 +1557,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
                osfs->os_ffree = obd_osfs.os_ffree;
        }
 
-       RETURN(rc);
+       return rc;
 }
 int ll_statfs(struct dentry *de, struct kstatfs *sfs)
 {
@@ -1851,14 +1851,14 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                                             0, 0, LUSTRE_OPC_ANY,
                                             NULL);
                if (IS_ERR(op_data))
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
 
                op_data->op_valid = OBD_MD_FLFLAGS;
                rc = md_getattr(sbi->ll_md_exp, op_data, &req);
                ll_finish_md_op_data(op_data);
                if (rc) {
                        CERROR("failure %d inode %lu\n", rc, inode->i_ino);
-                       RETURN(-abs(rc));
+                       return -abs(rc);
                }
 
                body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
@@ -1867,7 +1867,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
                ptlrpc_req_finished(req);
 
-               RETURN(put_user(flags, (int *)arg));
+               return put_user(flags, (int *)arg);
        }
        case FSFILT_IOC_SETFLAGS: {
                struct lov_stripe_md *lsm;
@@ -1875,12 +1875,12 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                struct md_op_data *op_data;
 
                if (get_user(flags, (int *)arg))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
                                             LUSTRE_OPC_ANY, NULL);
                if (IS_ERR(op_data))
-                       RETURN(PTR_ERR(op_data));
+                       return PTR_ERR(op_data);
 
                ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags = flags;
                op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
@@ -1889,20 +1889,20 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                ll_finish_md_op_data(op_data);
                ptlrpc_req_finished(req);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                inode->i_flags = ll_ext_to_inode_flags(flags);
 
                lsm = ccc_inode_lsm_get(inode);
                if (!lsm_has_objects(lsm)) {
                        ccc_inode_lsm_put(inode, lsm);
-                       RETURN(0);
+                       return 0;
                }
 
                OBDO_ALLOC(oinfo.oi_oa);
                if (!oinfo.oi_oa) {
                        ccc_inode_lsm_put(inode, lsm);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                oinfo.oi_md = lsm;
                oinfo.oi_oa->o_oi = lsm->lsm_oi;
@@ -1919,13 +1919,13 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                if (rc && rc != -EPERM && rc != -EACCES)
                        CERROR("osc_setattr_async fails: rc = %d\n", rc);
 
-               RETURN(rc);
+               return rc;
        }
        default:
-               RETURN(-ENOSYS);
+               return -ENOSYS;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int ll_flush_ctx(struct inode *inode)
@@ -2032,7 +2032,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
        rc = md_get_lustre_md(sbi->ll_md_exp, req, sbi->ll_dt_exp,
                              sbi->ll_md_exp, &md);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (*inode) {
                ll_update_inode(*inode, &md);
@@ -2094,7 +2094,7 @@ out:
        if (md.lsm != NULL)
                obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
        md_free_lustre_md(sbi->ll_md_exp, &md);
-       RETURN(rc);
+       return rc;
 }
 
 int ll_obd_statfs(struct inode *inode, void *arg)
@@ -2270,7 +2270,7 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry)
        if (sbi->ll_flags & LL_SBI_USER_FID2PATH)
                seq_puts(seq, ",user_fid2path");
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -2286,16 +2286,16 @@ int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg)
        else if (cmd == OBD_IOC_GETMDNAME)
                obd = class_exp2obd(sbi->ll_md_exp);
        else
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (!obd)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        if (copy_to_user((void *)arg, obd->obd_name,
                             strlen(obd->obd_name) + 1))
-               RETURN(-EFAULT);
+               return -EFAULT;
 
-       RETURN(0);
+       return 0;
 }
 
 /**
index 26a5247cbc29b38d6515275a51bf5412e0f544c7..caed6423e4ef20ae30afcf81279067406d91c771 100644 (file)
@@ -82,7 +82,7 @@ struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
                        break;
                }
        }
-       RETURN(ret);
+       return ret;
 }
 
 /**
@@ -111,7 +111,7 @@ struct cl_io *ll_fault_io_init(struct vm_area_struct *vma,
 
        *env_ret = NULL;
        if (ll_file_nolock(file))
-               RETURN(ERR_PTR(-EOPNOTSUPP));
+               return ERR_PTR(-EOPNOTSUPP);
 
        /*
         * page fault can be called when lustre IO is
@@ -122,7 +122,7 @@ struct cl_io *ll_fault_io_init(struct vm_area_struct *vma,
         */
        env = cl_env_nested_get(nest);
        if (IS_ERR(env))
-                RETURN(ERR_PTR(-EINVAL));
+                return ERR_PTR(-EINVAL);
 
        *env_ret = env;
 
@@ -305,7 +305,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 
        io = ll_fault_io_init(vma, &env,  &nest, vmf->pgoff, &ra_flags);
        if (IS_ERR(io))
-               RETURN(to_fault_error(PTR_ERR(io)));
+               return to_fault_error(PTR_ERR(io));
 
        result = io->ci_result;
        if (result == 0) {
@@ -332,7 +332,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 
        CDEBUG(D_MMAP, "%s fault %d/%d\n",
               current->comm, fault_ret, result);
-       RETURN(fault_ret);
+       return fault_ret;
 }
 
 static int ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
@@ -467,7 +467,7 @@ int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last)
                                    last - first + 1, 0);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static struct vm_operations_struct ll_file_vm_ops = {
@@ -483,7 +483,7 @@ int ll_file_mmap(struct file *file, struct vm_area_struct * vma)
        int rc;
 
        if (ll_file_nolock(file))
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_MAP, 1);
        rc = generic_file_mmap(file, vma);
@@ -494,5 +494,5 @@ int ll_file_mmap(struct file *file, struct vm_area_struct * vma)
                rc = ll_glimpse_size(inode);
        }
 
-       RETURN(rc);
+       return rc;
 }
index 8b1a76da6c8687d3a1e7e4170a2a1d831090973c..1767c741fb72493f268312327e92f8735f554522 100644 (file)
@@ -96,11 +96,11 @@ struct inode *search_inode_for_lustre(struct super_block *sb,
 
        inode = ilookup5(sb, hash, ll_nfs_test_inode, (void *)fid);
        if (inode)
-               RETURN(inode);
+               return inode;
 
        rc = ll_get_max_mdsize(sbi, &eadatalen);
        if (rc)
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
 
        /* Because inode is NULL, ll_prep_md_op_data can not
         * be used here. So we allocate op_data ourselves */
@@ -118,14 +118,14 @@ struct inode *search_inode_for_lustre(struct super_block *sb,
        if (rc) {
                CERROR("can't get object attrs, fid "DFID", rc %d\n",
                       PFID(fid), rc);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
        rc = ll_prep_inode(&inode, req, sb, NULL);
        ptlrpc_req_finished(req);
        if (rc)
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
 
-       RETURN(inode);
+       return inode;
 }
 
 struct lustre_nfs_fid {
@@ -141,16 +141,16 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
 
        CDEBUG(D_INFO, "Get dentry for fid: "DFID"\n", PFID(fid));
        if (!fid_is_sane(fid))
-               RETURN(ERR_PTR(-ESTALE));
+               return ERR_PTR(-ESTALE);
 
        inode = search_inode_for_lustre(sb, fid);
        if (IS_ERR(inode))
-               RETURN(ERR_CAST(inode));
+               return ERR_CAST(inode);
 
        if (is_bad_inode(inode)) {
                /* we didn't find the right inode.. */
                iput(inode);
-               RETURN(ERR_PTR(-ESTALE));
+               return ERR_PTR(-ESTALE);
        }
 
        /**
@@ -168,11 +168,11 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
 
        result = d_obtain_alias(inode);
        if (IS_ERR(result))
-               RETURN(result);
+               return result;
 
        ll_dops_init(result, 1, 0);
 
-       RETURN(result);
+       return result;
 }
 
 #define LUSTRE_NFS_FID   0x97
@@ -196,13 +196,13 @@ static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
              (int)sizeof(struct lustre_nfs_fid));
 
        if (*plen < sizeof(struct lustre_nfs_fid) / 4)
-               RETURN(255);
+               return 255;
 
        nfs_fid->lnf_child = *ll_inode2fid(inode);
        nfs_fid->lnf_parent = *ll_inode2fid(parent);
        *plen = sizeof(struct lustre_nfs_fid) / 4;
 
-       RETURN(LUSTRE_NFS_FID);
+       return LUSTRE_NFS_FID;
 }
 
 static int ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,
@@ -255,9 +255,9 @@ static struct dentry *ll_fh_to_dentry(struct super_block *sb, struct fid *fid,
        struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
 
        if (fh_type != LUSTRE_NFS_FID)
-               RETURN(ERR_PTR(-EPROTO));
+               return ERR_PTR(-EPROTO);
 
-       RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_child, &nfs_fid->lnf_parent));
+       return ll_iget_for_nfs(sb, &nfs_fid->lnf_child, &nfs_fid->lnf_parent);
 }
 
 static struct dentry *ll_fh_to_parent(struct super_block *sb, struct fid *fid,
@@ -266,9 +266,9 @@ static struct dentry *ll_fh_to_parent(struct super_block *sb, struct fid *fid,
        struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
 
        if (fh_type != LUSTRE_NFS_FID)
-               RETURN(ERR_PTR(-EPROTO));
+               return ERR_PTR(-EPROTO);
 
-       RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL));
+       return ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL);
 }
 
 static struct dentry *ll_get_parent(struct dentry *dchild)
@@ -292,19 +292,19 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
 
        rc = ll_get_max_mdsize(sbi, &lmmsize);
        if (rc != 0)
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
 
        op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot,
                                     strlen(dotdot), lmmsize,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN((void *)op_data);
+               return (void *)op_data;
 
        rc = md_getattr_name(sbi->ll_md_exp, op_data, &req);
        ll_finish_md_op_data(op_data);
        if (rc) {
                CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
        body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
        LASSERT(body->valid & OBD_MD_FLID);
@@ -315,7 +315,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
        result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL);
 
        ptlrpc_req_finished(req);
-       RETURN(result);
+       return result;
 }
 
 struct export_operations lustre_export_operations = {
index 8485aa166e43ab2d93d3c1b2658b1472071729f6..179ea9abf68f4f297a8c8ae8193004b158a454b2 100644 (file)
@@ -384,17 +384,17 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, const char *buffer,
        buffer = lprocfs_find_named_value(buffer, "max_cached_mb:", &count);
        rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (pages_number < 0 || pages_number > totalram_pages) {
                CERROR("%s: can't set max cache more than %lu MB\n",
                       ll_get_fsname(sb, NULL, 0),
                       totalram_pages >> (20 - PAGE_CACHE_SHIFT));
-               RETURN(-ERANGE);
+               return -ERANGE;
        }
 
        if (sbi->ll_dt_exp == NULL)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        spin_lock(&sbi->ll_lock);
        diff = pages_number - cache->ccc_lru_max;
@@ -878,7 +878,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
        if (IS_ERR(sbi->ll_proc_root)) {
                err = PTR_ERR(sbi->ll_proc_root);
                sbi->ll_proc_root = NULL;
-               RETURN(err);
+               return err;
        }
 
        rc = lprocfs_seq_create(sbi->ll_proc_root, "dump_page_cache", 0444,
@@ -992,7 +992,7 @@ out:
                lprocfs_free_stats(&sbi->ll_ra_stats);
                lprocfs_free_stats(&sbi->ll_stats);
        }
-       RETURN(err);
+       return err;
 }
 
 void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi)
index 494561af27c7016f99405a86750a40af4b0ae729..34815b550e71248ce7c578c3417cec570c35a26d 100644 (file)
@@ -79,7 +79,7 @@ int ll_unlock(__u32 mode, struct lustre_handle *lockh)
 {
        ldlm_lock_decref(lockh, mode);
 
-       RETURN(0);
+       return 0;
 }
 
 
@@ -166,7 +166,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
                CDEBUG(D_VFSTRACE, "got inode: %p for "DFID"\n",
                       inode, PFID(&md->body->fid1));
        }
-       RETURN(inode);
+       return inode;
 }
 
 static void ll_invalidate_negative_children(struct inode *dir)
@@ -204,7 +204,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                rc = ldlm_cli_cancel(&lockh, LCF_ASYNC);
                if (rc < 0) {
                        CDEBUG(D_INODE, "ldlm_cli_cancel: %d\n", rc);
-                       RETURN(rc);
+                       return rc;
                }
                break;
        case LDLM_CB_CANCELING: {
@@ -296,7 +296,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                LBUG();
        }
 
-       RETURN(0);
+       return 0;
 }
 
 __u32 ll_i2suppgid(struct inode *i)
@@ -437,7 +437,7 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
        if (!it_disposition(it, DISP_LOOKUP_NEG)) {
                rc = ll_prep_inode(&inode, request, (*de)->d_sb, it);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                ll_set_lock_data(ll_i2sbi(parent)->ll_md_exp, inode, it, &bits);
 
@@ -478,7 +478,7 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
                }
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
@@ -493,7 +493,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
        int rc;
 
        if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen)
-               RETURN(ERR_PTR(-ENAMETOOLONG));
+               return ERR_PTR(-ENAMETOOLONG);
 
        CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),intent=%s\n",
               dentry->d_name.len, dentry->d_name.name, parent->i_ino,
@@ -511,7 +511,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
                rc = ll_inode_revalidate_it(parent->i_sb->s_root, it,
                                            MDS_INODELOCK_LOOKUP);
                if (rc)
-                       RETURN(ERR_PTR(rc));
+                       return ERR_PTR(rc);
        }
 
        if (it->it_op == IT_GETATTR) {
@@ -536,7 +536,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
                                     dentry->d_name.len, lookup_flags, opc,
                                     NULL);
        if (IS_ERR(op_data))
-               RETURN((void *)op_data);
+               return (void *)op_data;
 
        /* enforce umask if acl disabled or MDS doesn't support umask */
        if (!IS_POSIXACL(parent) || !exp_connect_umask(ll_i2mdexp(parent)))
@@ -623,7 +623,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
 
        OBD_ALLOC(it, sizeof(*it));
        if (!it)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        it->it_op = IT_OPEN;
        if (mode) {
@@ -682,7 +682,7 @@ out_release:
        ll_intent_release(it);
        OBD_FREE(it, sizeof(*it));
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -745,18 +745,18 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, int mode,
 
        rc = it_open_error(DISP_OPEN_CREATE, it);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
                               NULL, 0, mode, 0, it);
        if (IS_ERR(inode))
-               RETURN(PTR_ERR(inode));
+               return PTR_ERR(inode);
 
        if (filename_is_volatile(dentry->d_name.name, dentry->d_name.len, NULL))
                ll_i2info(inode)->lli_volatile = true;
 
        d_instantiate(dentry, inode);
-       RETURN(0);
+       return 0;
 }
 
 static void ll_update_times(struct ptlrpc_request *request,
@@ -852,7 +852,7 @@ static int ll_mknod_generic(struct inode *dir, struct qstr *name, int mode,
        if (!err)
                ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKNOD, 1);
 
-       RETURN(err);
+       return err;
 }
 
 /*
@@ -893,7 +893,7 @@ static int ll_symlink_generic(struct inode *dir, struct qstr *name,
        if (!err)
                ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_SYMLINK, 1);
 
-       RETURN(err);
+       return err;
 }
 
 static int ll_link_generic(struct inode *src,  struct inode *dir,
@@ -912,7 +912,7 @@ static int ll_link_generic(struct inode *src,  struct inode *dir,
        op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len,
                                     0, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        err = md_link(sbi->ll_md_exp, op_data, &request);
        ll_finish_md_op_data(op_data);
@@ -923,7 +923,7 @@ static int ll_link_generic(struct inode *src,  struct inode *dir,
        ll_stats_ops_tally(sbi, LPROC_LL_LINK, 1);
 out:
        ptlrpc_req_finished(request);
-       RETURN(err);
+       return err;
 }
 
 static int ll_mkdir_generic(struct inode *dir, struct qstr *name,
@@ -943,7 +943,7 @@ static int ll_mkdir_generic(struct inode *dir, struct qstr *name,
        if (!err)
                ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKDIR, 1);
 
-       RETURN(err);
+       return err;
 }
 
 /* Try to find the child dentry by its name.
@@ -973,12 +973,12 @@ static int ll_rmdir_generic(struct inode *dir, struct dentry *dparent,
               name->len, name->name, dir->i_ino, dir->i_generation, dir);
 
        if (unlikely(ll_d_mountpoint(dparent, dchild, name)))
-               RETURN(-EBUSY);
+               return -EBUSY;
 
        op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name, name->len,
                                     S_IFDIR, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        ll_get_child_fid(dir, name, &op_data->op_fid3);
        op_data->op_fid2 = op_data->op_fid3;
@@ -990,7 +990,7 @@ static int ll_rmdir_generic(struct inode *dir, struct dentry *dparent,
        }
 
        ptlrpc_req_finished(request);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1008,7 +1008,7 @@ int ll_rmdir_entry(struct inode *dir, char *name, int namelen)
        op_data = ll_prep_md_op_data(NULL, dir, NULL, name, strlen(name),
                                     S_IFDIR, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
        op_data->op_cli_flags |= CLI_RM_ENTRY;
        rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
        ll_finish_md_op_data(op_data);
@@ -1018,7 +1018,7 @@ int ll_rmdir_entry(struct inode *dir, char *name, int namelen)
        }
 
        ptlrpc_req_finished(request);
-       RETURN(rc);
+       return rc;
 }
 
 int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
@@ -1034,7 +1034,7 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
        /* req is swabbed so this is safe */
        body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
        if (!(body->valid & OBD_MD_FLEASIZE))
-               RETURN(0);
+               return 0;
 
        if (body->eadatasize == 0) {
                CERROR("OBD_MD_FLEASIZE set but eadatasize zero\n");
@@ -1114,12 +1114,12 @@ static int ll_unlink_generic(struct inode *dir, struct dentry *dparent,
         * just check it as vfs_unlink does.
         */
        if (unlikely(ll_d_mountpoint(dparent, dchild, name)))
-               RETURN(-EBUSY);
+               return -EBUSY;
 
        op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name,
                                     name->len, 0, LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        ll_get_child_fid(dir, name, &op_data->op_fid3);
        op_data->op_fid2 = op_data->op_fid3;
@@ -1134,7 +1134,7 @@ static int ll_unlink_generic(struct inode *dir, struct dentry *dparent,
        rc = ll_objects_destroy(request, dir);
  out:
        ptlrpc_req_finished(request);
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_rename_generic(struct inode *src, struct dentry *src_dparent,
@@ -1154,12 +1154,12 @@ static int ll_rename_generic(struct inode *src, struct dentry *src_dparent,
 
        if (unlikely(ll_d_mountpoint(src_dparent, src_dchild, src_name) ||
            ll_d_mountpoint(tgt_dparent, tgt_dchild, tgt_name)))
-               RETURN(-EBUSY);
+               return -EBUSY;
 
        op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        ll_get_child_fid(src, src_name, &op_data->op_fid3);
        ll_get_child_fid(tgt, tgt_name, &op_data->op_fid4);
@@ -1176,7 +1176,7 @@ static int ll_rename_generic(struct inode *src, struct dentry *src_dparent,
 
        ptlrpc_req_finished(request);
 
-       RETURN(err);
+       return err;
 }
 
 static int ll_mknod(struct inode *dir, struct dentry *dchild, ll_umode_t mode,
index 1d29d7ccb70cca6f89f092f4145f3337a8a9a0d5..dedd56ae1e6d52f2ee3bab2fe209c2d42f928a14 100644 (file)
@@ -125,7 +125,7 @@ static int do_check_remote_perm(struct ll_inode_info *lli, int mask)
        int found = 0, rc;
 
        if (!lli->lli_remote_perms)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        head = lli->lli_remote_perms +
                remote_perm_hashfunc(from_kuid(&init_user_ns, current_uid()));
@@ -176,7 +176,7 @@ int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm)
                       perm->rp_uid, perm->rp_gid, perm->rp_fsuid,
                       perm->rp_fsgid, current->uid, current->gid,
                       current->fsuid, current->fsgid);
-               RETURN(-EAGAIN);
+               return -EAGAIN;
        }
 #endif
 
@@ -184,7 +184,7 @@ int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm)
                perm_hash = alloc_rmtperm_hash();
                if (perm_hash == NULL) {
                        CERROR("alloc lli_remote_perms failed!\n");
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
        }
 
@@ -218,7 +218,7 @@ again:
                lrp = alloc_ll_remote_perm();
                if (!lrp) {
                        CERROR("alloc memory for ll_remote_perm failed!\n");
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                spin_lock(&lli->lli_lock);
                goto again;
@@ -239,7 +239,7 @@ again:
               lrp, lrp->lrp_uid, lrp->lrp_gid, lrp->lrp_fsuid, lrp->lrp_fsgid,
               lrp->lrp_access_perm);
 
-       RETURN(0);
+       return 0;
 }
 
 int lustre_check_remote_perm(struct inode *inode, int mask)
@@ -301,7 +301,7 @@ int lustre_check_remote_perm(struct inode *inode, int mask)
                req = NULL;
        } while (1);
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 #if 0  /* NB: remote perms can't be freed in ll_mdc_blocking_ast of UPDATE lock,
index b20f8b4635cede96b82b6c24b350120d6803a149..ae0dc441d1d9dd238ce0bfb4a5b37b46eeca607b 100644 (file)
@@ -252,7 +252,7 @@ int ll_prepare_write(struct file *file, struct page *vmpage, unsigned from,
        } else {
                result = PTR_ERR(lcc);
        }
-       RETURN(result);
+       return result;
 }
 
 int ll_commit_write(struct file *file, struct page *vmpage, unsigned from,
@@ -282,7 +282,7 @@ int ll_commit_write(struct file *file, struct page *vmpage, unsigned from,
        lu_ref_del(&page->cp_reference, "prepare_write", current);
        cl_page_put(env, page);
        ll_cl_fini(lcc);
-       RETURN(result);
+       return result;
 }
 
 struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt)
@@ -351,7 +351,7 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi,
        }
 
 out:
-       RETURN(ret);
+       return ret;
 }
 
 void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len)
@@ -483,7 +483,7 @@ static int cl_read_ahead_page(const struct lu_env *env, struct cl_io *io,
        }
        lu_ref_del(&page->cp_reference, "ra", current);
        cl_page_put(env, page);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -544,7 +544,7 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io,
                ll_ra_stats_inc(mapping, which);
                CDEBUG(D_READA, "%s\n", msg);
        }
-       RETURN(rc);
+       return rc;
 }
 
 #define RIA_DEBUG(ria)                                                \
@@ -724,11 +724,11 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
        cl_object_attr_unlock(clob);
 
        if (ret != 0)
-               RETURN(ret);
+               return ret;
        kms = attr->cat_kms;
        if (kms == 0) {
                ll_ra_stats_inc(mapping, RA_STAT_ZERO_LEN);
-               RETURN(0);
+               return 0;
        }
 
        spin_lock(&ras->ras_lock);
@@ -786,11 +786,11 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
 
        if (end == 0) {
                ll_ra_stats_inc(mapping, RA_STAT_ZERO_WINDOW);
-               RETURN(0);
+               return 0;
        }
        len = ria_page_count(ria);
        if (len == 0)
-               RETURN(0);
+               return 0;
 
        reserved = ll_ra_count_get(ll_i2sbi(inode), ria, len);
        if (reserved < len)
@@ -829,7 +829,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
                spin_unlock(&ras->ras_lock);
        }
 
-       RETURN(ret);
+       return ret;
 }
 
 static void ras_set_start(struct inode *inode, struct ll_readahead_state *ras,
@@ -1266,7 +1266,7 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc)
                        end = i_size_read(inode);
                mapping->writeback_index = (end >> PAGE_CACHE_SHIFT) + 1;
        }
-       RETURN(result);
+       return result;
 }
 
 int ll_readpage(struct file *file, struct page *vmpage)
@@ -1294,5 +1294,5 @@ int ll_readpage(struct file *file, struct page *vmpage)
                unlock_page(vmpage);
                result = PTR_ERR(lcc);
        }
-       RETURN(result);
+       return result;
 }
index 1a804773e43c58057cf2693d07c28426d8db062f..96c29ad2fc8c5cd2992e766cba674bd4981fba06 100644 (file)
@@ -180,7 +180,7 @@ static int ll_set_page_dirty(struct page *vmpage)
         */
        vvp_write_pending(obj, cpg);
 #endif
-       RETURN(__set_page_dirty_nobuffers(vmpage));
+       return __set_page_dirty_nobuffers(vmpage);
 }
 
 #define MAX_DIRECTIO_SIZE 2*1024*1024*1024UL
@@ -332,7 +332,7 @@ ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,
        cl_2queue_discard(env, io, queue);
        cl_2queue_disown(env, io, queue);
        cl_2queue_fini(env, queue);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ll_direct_rw_pages);
 
@@ -382,11 +382,11 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb,
        int refcheck;
 
        if (!lli->lli_has_smd)
-               RETURN(-EBADF);
+               return -EBADF;
 
        /* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */
        if ((file_offset & ~CFS_PAGE_MASK) || (count & ~CFS_PAGE_MASK))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), size=%lu (max %lu), "
               "offset=%lld=%llx, pages %lu (max %lu)\n",
@@ -398,7 +398,7 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb,
        for (seg = 0; seg < nr_segs; seg++) {
                if (((unsigned long)iov[seg].iov_base & ~CFS_PAGE_MASK) ||
                    (iov[seg].iov_len & ~CFS_PAGE_MASK))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
        }
 
        env = cl_env_get(&refcheck);
@@ -491,7 +491,7 @@ out:
        }
 
        cl_env_put(env, &refcheck);
-       RETURN(tot_bytes ? : result);
+       return tot_bytes ? : result;
 }
 
 static int ll_write_begin(struct file *file, struct address_space *mapping,
@@ -505,7 +505,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
 
        page = grab_cache_page_write_begin(mapping, index, flags);
        if (!page)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        *pagep = page;
 
@@ -514,7 +514,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
                unlock_page(page);
                page_cache_release(page);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int ll_write_end(struct file *file, struct address_space *mapping,
index 2fa29b3d94faa4806c1d92825601e7300597e6ed..2daca2e90b11387d9978528dbd6b3802733e9da3 100644 (file)
@@ -204,7 +204,7 @@ ll_sa_entry_alloc(struct ll_statahead_info *sai, __u64 index,
        entry_size = sizeof(struct ll_sa_entry) + (len & ~3) + 4;
        OBD_ALLOC(entry, entry_size);
        if (unlikely(entry == NULL))
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        CDEBUG(D_READA, "alloc sa entry %.*s(%p) index "LPU64"\n",
               len, name, entry, index);
@@ -253,7 +253,7 @@ ll_sa_entry_alloc(struct ll_statahead_info *sai, __u64 index,
 
        atomic_inc(&sai->sai_cache_count);
 
-       RETURN(entry);
+       return entry;
 }
 
 /*
@@ -467,7 +467,7 @@ static struct ll_statahead_info *ll_sai_alloc(void)
 
        OBD_ALLOC_PTR(sai);
        if (!sai)
-               RETURN(NULL);
+               return NULL;
 
        atomic_set(&sai->sai_refcount, 1);
 
@@ -494,7 +494,7 @@ static struct ll_statahead_info *ll_sai_alloc(void)
        }
        atomic_set(&sai->sai_cache_count, 0);
 
-       RETURN(sai);
+       return sai;
 }
 
 static inline struct ll_statahead_info *
@@ -841,7 +841,7 @@ static int do_sa_lookup(struct inode *dir, struct ll_sa_entry *entry)
 
        rc = sa_args_init(dir, NULL, entry, &minfo, &einfo, capas);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = md_intent_getattr_async(ll_i2mdexp(dir), minfo, einfo);
        if (!rc) {
@@ -851,7 +851,7 @@ static int do_sa_lookup(struct inode *dir, struct ll_sa_entry *entry)
                sa_args_fini(minfo, einfo);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -872,27 +872,27 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
        int rc;
 
        if (unlikely(inode == NULL))
-               RETURN(1);
+               return 1;
 
        if (d_mountpoint(dentry))
-               RETURN(1);
+               return 1;
 
        if (unlikely(dentry == dentry->d_sb->s_root))
-               RETURN(1);
+               return 1;
 
        entry->se_inode = igrab(inode);
        rc = md_revalidate_lock(ll_i2mdexp(dir), &it, ll_inode2fid(inode),NULL);
        if (rc == 1) {
                entry->se_handle = it.d.lustre.it_lock_handle;
                ll_intent_release(&it);
-               RETURN(1);
+               return 1;
        }
 
        rc = sa_args_init(dir, inode, entry, &minfo, &einfo, capas);
        if (rc) {
                entry->se_inode = NULL;
                iput(inode);
-               RETURN(rc);
+               return rc;
        }
 
        rc = md_intent_getattr_async(ll_i2mdexp(dir), minfo, einfo);
@@ -905,7 +905,7 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
                sa_args_fini(minfo, einfo);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static void ll_statahead_one(struct dentry *parent, const char* entry_name,
@@ -1009,7 +1009,7 @@ static int ll_agl_thread(void *arg)
        ll_sai_put(sai);
        CDEBUG(D_READA, "agl thread stopped: [pid %d] [parent %.*s]\n",
               current_pid(), parent->d_name.len, parent->d_name.name);
-       RETURN(0);
+       return 0;
 }
 
 static void ll_start_agl(struct dentry *parent, struct ll_statahead_info *sai)
@@ -1520,7 +1520,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                             list_empty(&sai->sai_entries_stated))) {
                        /* to release resource */
                        ll_stop_statahead(dir, lli->lli_opendir_key);
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
                }
 
                if ((*dentryp)->d_name.name[0] == '.') {
@@ -1546,14 +1546,14 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                                 * "sai_ls_all" enabled as above.
                                 */
                                sai->sai_miss_hidden++;
-                               RETURN(-EAGAIN);
+                               return -EAGAIN;
                        }
                }
 
                entry = ll_sa_entry_get_byname(sai, &(*dentryp)->d_name);
                if (entry == NULL || only_unplug) {
                        ll_sai_unplug(sai, entry);
-                       RETURN(entry ? 1 : -EAGAIN);
+                       return entry ? 1 : -EAGAIN;
                }
 
                /* if statahead is busy in readdir, help it do post-work */
@@ -1572,7 +1572,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                                          &lwi);
                        if (rc < 0) {
                                ll_sai_unplug(sai, entry);
-                               RETURN(-EAGAIN);
+                               return -EAGAIN;
                        }
                }
 
@@ -1602,7 +1602,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                                              inode->i_ino,
                                              inode->i_generation);
                                        ll_sai_unplug(sai, entry);
-                                       RETURN(-ESTALE);
+                                       return -ESTALE;
                                } else {
                                        iput(inode);
                                }
@@ -1616,7 +1616,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                }
 
                ll_sai_unplug(sai, entry);
-               RETURN(rc);
+               return rc;
        }
 
        /* I am the "lli_opendir_pid" owner, only me can set "lli_sai". */
@@ -1668,7 +1668,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED);
                ll_sai_put(sai);
                LASSERT(lli->lli_sai == NULL);
-               RETURN(-EAGAIN);
+               return -EAGAIN;
        }
 
        l_wait_event(thread->t_ctl_waitq,
@@ -1679,7 +1679,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
         * We don't stat-ahead for the first dirent since we are already in
         * lookup.
         */
-       RETURN(-EAGAIN);
+       return -EAGAIN;
 
 out:
        if (sai != NULL)
index f64982afe6dc13daccaedbfb8438dc116f6e89fe..ab06891f7fc7cf68c41cb82119a393d11a1797da 100644 (file)
@@ -63,13 +63,13 @@ static int ll_readlink_internal(struct inode *inode,
                CDEBUG(D_INODE, "using cached symlink %s%.*s, len = %d\n",
                       print_limit < symlen ? "..." : "", print_limit,
                       (*symname) + symlen - print_limit, symlen);
-               RETURN(0);
+               return 0;
        }
 
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, symlen,
                                     LUSTRE_OPC_ANY, NULL);
        if (IS_ERR(op_data))
-               RETURN(PTR_ERR(op_data));
+               return PTR_ERR(op_data);
 
        op_data->op_valid = OBD_MD_LINKNAME;
        rc = md_getattr(sbi->ll_md_exp, op_data, request);
@@ -109,10 +109,10 @@ static int ll_readlink_internal(struct inode *inode,
                memcpy(lli->lli_symlink_name, *symname, symlen);
                *symname = lli->lli_symlink_name;
        }
-       RETURN(0);
+       return 0;
 
 failed:
-       RETURN (rc);
+       return rc;
 }
 
 static int ll_readlink(struct dentry *dentry, char *buffer, int buflen)
@@ -133,7 +133,7 @@ static int ll_readlink(struct dentry *dentry, char *buffer, int buflen)
  out:
        ptlrpc_req_finished(request);
        ll_inode_size_unlock(inode);
-       RETURN(rc);
+       return rc;
 }
 
 static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
@@ -166,7 +166,7 @@ static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
        /* symname may contain a pointer to the request message buffer,
         * we delay request releasing until ll_put_link then.
         */
-       RETURN(request);
+       return request;
 }
 
 static void ll_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
index 760595f89e60f98b0242cb7eca0451ba3f782768..be125b98b7f0434e7078f94f2257e63bb7692e18 100644 (file)
@@ -213,7 +213,7 @@ int cl_sb_init(struct super_block *sb)
                cl_env_put(env, &refcheck);
        } else
                rc = PTR_ERR(env);
-       RETURN(rc);
+       return rc;
 }
 
 int cl_sb_fini(struct super_block *sb)
@@ -246,7 +246,7 @@ int cl_sb_fini(struct super_block *sb)
         * automatically when last device is destroyed).
         */
        lu_types_stop();
-       RETURN(result);
+       return result;
 }
 
 /****************************************************************************
index c5827b4e166525b54e6a32fb40725d70d33bd98f..3ff664ce7503b62d22b1094d34178125b4075d26 100644 (file)
@@ -180,14 +180,14 @@ static int vvp_mmap_locks(const struct lu_env *env,
        LASSERT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE);
 
        if (!cl_is_normalio(env, io))
-               RETURN(0);
+               return 0;
 
        if (vio->cui_iov == NULL) /* nfs or loop back device write */
-               RETURN(0);
+               return 0;
 
        /* No MM (e.g. NFS)? No vmas too. */
        if (mm == NULL)
-               RETURN(0);
+               return 0;
 
        for (seg = 0; seg < vio->cui_nrsegs; seg++) {
                const struct iovec *iv = &vio->cui_iov[seg];
@@ -233,7 +233,7 @@ static int vvp_mmap_locks(const struct lu_env *env,
                               descr->cld_end);
 
                        if (result < 0)
-                               RETURN(result);
+                               return result;
 
                        if (vma->vm_end - addr >= count)
                                break;
@@ -243,7 +243,7 @@ static int vvp_mmap_locks(const struct lu_env *env,
                }
                up_read(&mm->mmap_sem);
        }
-       RETURN(0);
+       return 0;
 }
 
 static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io,
@@ -262,7 +262,7 @@ static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io,
        result = vvp_mmap_locks(env, cio, io);
        if (result == 0)
                result = ccc_io_one_lock(env, io, ast_flags, mode, start, end);
-       RETURN(result);
+       return result;
 }
 
 static int vvp_io_read_lock(const struct lu_env *env,
@@ -280,7 +280,7 @@ static int vvp_io_read_lock(const struct lu_env *env,
                                        io->u.ci_rd.rd.crw_count - 1);
        else
                result = 0;
-       RETURN(result);
+       return result;
 }
 
 static int vvp_io_fault_lock(const struct lu_env *env,
@@ -580,7 +580,7 @@ static int vvp_io_write_start(const struct lu_env *env,
                                  cio->cui_fd, pos, result, WRITE);
                result = 0;
        }
-       RETURN(result);
+       return result;
 }
 
 static int vvp_io_kernel_fault(struct vvp_fault_io *cfio)
@@ -813,7 +813,7 @@ static int vvp_io_read_page(const struct lu_env *env,
                               rc == -ENODATA ? "without a lock" :
                               "match failed", rc);
                if (rc != -ENODATA)
-                       RETURN(rc);
+                       return rc;
        }
 
        if (cp->cpg_defer_uptodate) {
@@ -830,7 +830,7 @@ static int vvp_io_read_page(const struct lu_env *env,
                ll_readahead(env, io, ras,
                             vmpage->mapping, &queue->c2_qin, fd->fd_flags);
 
-       RETURN(0);
+       return 0;
 }
 
 static int vvp_page_sync_io(const struct lu_env *env, struct cl_io *io,
@@ -934,7 +934,7 @@ static int vvp_io_prepare_write(const struct lu_env *env,
                                                        pg, cp, from, to);
        } else
                CL_PAGE_HEADER(D_PAGE, env, pg, "uptodate\n");
-       RETURN(result);
+       return result;
 }
 
 static int vvp_io_commit_write(const struct lu_env *env,
@@ -1057,7 +1057,7 @@ static int vvp_io_commit_write(const struct lu_env *env,
                        cl_page_discard(env, io, pg);
        }
        ll_inode_size_unlock(inode);
-       RETURN(result);
+       return result;
 }
 
 static const struct cl_io_operations vvp_io_ops = {
@@ -1163,7 +1163,7 @@ int vvp_io_init(const struct lu_env *env, struct cl_object *obj,
                                PFID(lu_object_fid(&obj->co_lu)), result);
        }
 
-       RETURN(result);
+       return result;
 }
 
 static struct vvp_io *cl2vvp_io(const struct lu_env *env,
index a48cd5984557db7a31d0ed4e079e1a5aab530070..e16b31e4ff728b178ec6aa6558938cd79137673a 100644 (file)
@@ -63,7 +63,7 @@ static unsigned long vvp_lock_weigh(const struct lu_env *env,
 {
        struct ccc_object *cob = cl2ccc(slice->cls_obj);
 
-       RETURN(atomic_read(&cob->cob_mmap_cnt) > 0 ? ~0UL >> 2 : 0);
+       return atomic_read(&cob->cob_mmap_cnt) > 0 ? ~0UL >> 2 : 0;
 }
 
 static const struct cl_lock_operations vvp_lock_ops = {
index 78729190e74be1e4329bb53d7c2e31a8bc4e65d4..1c02c128e0ee00dc8dfe47e285d03417bcdc6cb9 100644 (file)
@@ -219,7 +219,7 @@ static int vvp_page_prep_read(const struct lu_env *env,
                              struct cl_io *unused)
 {
        /* Skip the page already marked as PG_uptodate. */
-       RETURN(PageUptodate(cl2vm_page(slice)) ? -EALREADY : 0);
+       return PageUptodate(cl2vm_page(slice)) ? -EALREADY : 0;
 }
 
 static int vvp_page_prep_write(const struct lu_env *env,
@@ -366,7 +366,7 @@ static int vvp_page_make_ready(const struct lu_env *env,
                LBUG();
        }
        unlock_page(vmpage);
-       RETURN(result);
+       return result;
 }
 
 static int vvp_page_print(const struct lu_env *env,
index cf1bb4fc36e6519bad692fd51460c5de2489fb65..bcf86bac30a9129f0ff4fb79352c556498bf6de6 100644 (file)
@@ -122,22 +122,22 @@ int ll_setxattr_common(struct inode *inode, const char *name,
        xattr_type = get_xattr_type(name);
        rc = xattr_type_filter(sbi, xattr_type);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        /* b10667: ignore lustre special xattr for now */
        if ((xattr_type == XATTR_TRUSTED_T && strcmp(name, "trusted.lov") == 0) ||
            (xattr_type == XATTR_LUSTRE_T && strcmp(name, "lustre.lov") == 0))
-               RETURN(0);
+               return 0;
 
        /* b15587: ignore security.capability xattr for now */
        if ((xattr_type == XATTR_SECURITY_T &&
            strcmp(name, "security.capability") == 0))
-               RETURN(0);
+               return 0;
 
        /* LU-549:  Disable security.selinux when selinux is disabled */
        if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
            strcmp(name, "security.selinux") == 0)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
 #ifdef CONFIG_FS_POSIX_ACL
        if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
@@ -147,7 +147,7 @@ int ll_setxattr_common(struct inode *inode, const char *name,
                if (rce == NULL ||
                    (rce->rce_ops != RMT_LSETFACL &&
                    rce->rce_ops != RMT_RSETFACL))
-                       RETURN(-EOPNOTSUPP);
+                       return -EOPNOTSUPP;
 
                if (rce->rce_ops == RMT_LSETFACL) {
                        struct eacl_entry *ee;
@@ -161,7 +161,7 @@ int ll_setxattr_common(struct inode *inode, const char *name,
                                                size, ee->ee_acl);
                                if (IS_ERR(acl)) {
                                        ee_free(ee);
-                                       RETURN(PTR_ERR(acl));
+                                       return PTR_ERR(acl);
                                }
                                size =  CFS_ACL_XATTR_SIZE(\
                                                le32_to_cpu(acl->a_count), \
@@ -174,11 +174,11 @@ int ll_setxattr_common(struct inode *inode, const char *name,
                                                (posix_acl_xattr_header *)value,
                                                size, &new_value);
                        if (unlikely(size < 0))
-                               RETURN(size);
+                               return size;
 
                        pv = (const char *)new_value;
                } else
-                       RETURN(-EOPNOTSUPP);
+                       return -EOPNOTSUPP;
 
                valid |= rce_ops2valid(rce->rce_ops);
        }
@@ -200,11 +200,11 @@ int ll_setxattr_common(struct inode *inode, const char *name,
                                      "it is not supported on the server\n");
                        sbi->ll_flags &= ~LL_SBI_USER_XATTR;
                }
-               RETURN(rc);
+               return rc;
        }
 
        ptlrpc_req_finished(req);
-       RETURN(0);
+       return 0;
 }
 
 int ll_setxattr(struct dentry *dentry, const char *name,
@@ -302,17 +302,17 @@ int ll_getxattr_common(struct inode *inode, const char *name,
        xattr_type = get_xattr_type(name);
        rc = xattr_type_filter(sbi, xattr_type);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        /* b15587: ignore security.capability xattr for now */
        if ((xattr_type == XATTR_SECURITY_T &&
            strcmp(name, "security.capability") == 0))
-               RETURN(-ENODATA);
+               return -ENODATA;
 
        /* LU-549:  Disable security.selinux when selinux is disabled */
        if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
            strcmp(name, "security.selinux") == 0)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
 #ifdef CONFIG_FS_POSIX_ACL
        if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
@@ -324,7 +324,7 @@ int ll_getxattr_common(struct inode *inode, const char *name,
                    rce->rce_ops != RMT_LGETFACL &&
                    rce->rce_ops != RMT_RSETFACL &&
                    rce->rce_ops != RMT_RGETFACL))
-                       RETURN(-EOPNOTSUPP);
+                       return -EOPNOTSUPP;
        }
 
        /* posix acl is under protection of LOOKUP lock. when calling to this,
@@ -341,14 +341,14 @@ int ll_getxattr_common(struct inode *inode, const char *name,
                spin_unlock(&lli->lli_lock);
 
                if (!acl)
-                       RETURN(-ENODATA);
+                       return -ENODATA;
 
                rc = posix_acl_to_xattr(&init_user_ns, acl, buffer, size);
                posix_acl_release(acl);
-               RETURN(rc);
+               return rc;
        }
        if (xattr_type == XATTR_ACL_DEFAULT_T && !S_ISDIR(inode->i_mode))
-               RETURN(-ENODATA);
+               return -ENODATA;
 #endif
 
 do_getxattr:
@@ -363,7 +363,7 @@ do_getxattr:
                                      "it is not supported on the server\n");
                        sbi->ll_flags &= ~LL_SBI_USER_XATTR;
                }
-               RETURN(rc);
+               return rc;
        }
 
        body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
index 7ca3fb50a9621c296c27e9fcb3a2f588bba922ae..0b2d38d1362b7a2fc796833862cca77d01d3021a 100644 (file)
@@ -69,7 +69,7 @@ int lmv_fld_lookup(struct lmv_obd *lmv,
        if (rc) {
                CERROR("Error while looking for mds number. Seq "LPX64
                       ", err = %d\n", fid_seq(fid), rc);
-               RETURN(rc);
+               return rc;
        }
 
        CDEBUG(D_INODE, "FLD lookup got mds #%x for fid="DFID"\n",
@@ -81,5 +81,5 @@ int lmv_fld_lookup(struct lmv_obd *lmv,
                       PFID(fid));
                rc = -EINVAL;
        }
-       RETURN(rc);
+       return rc;
 }
index 9d97b5b8a35ba638c596d8ef1e79016961ab360e..511b3b4b699b9a239341963da74dce72627d4aff 100644 (file)
@@ -72,7 +72,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm,
 
        body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
        if (body == NULL)
-               RETURN(-EPROTO);
+               return -EPROTO;
 
        LASSERT((body->valid & OBD_MD_MDS));
 
@@ -169,7 +169,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
 
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        /* If it is ready to open the file by FID, do not need
         * allocate FID at all, otherwise it will confuse MDT */
@@ -182,7 +182,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
                op_data->op_fid3 = op_data->op_fid2;
                rc = lmv_fid_alloc(exp, &op_data->op_fid2, op_data);
                if (rc != 0)
-                       RETURN(rc);
+                       return rc;
        }
 
        CDEBUG(D_INODE, "OPEN_INTENT with fid1="DFID", fid2="DFID","
@@ -192,7 +192,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
        rc = md_intent_lock(tgt->ltd_exp, op_data, lmm, lmmsize, it, flags,
                            reqp, cb_blocking, extra_lock_flags);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
        /*
         * Nothing is found, do not access body->fid1 as it is zero and thus
         * pointless.
@@ -200,16 +200,16 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
        if ((it->d.lustre.it_disposition & DISP_LOOKUP_NEG) &&
            !(it->d.lustre.it_disposition & DISP_OPEN_CREATE) &&
            !(it->d.lustre.it_disposition & DISP_OPEN_OPEN))
-               RETURN(rc);
+               return rc;
 
        body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
        if (body == NULL)
-               RETURN(-EPROTO);
+               return -EPROTO;
        /*
         * Not cross-ref case, just get out of here.
         */
        if (likely(!(body->valid & OBD_MD_MDS)))
-               RETURN(0);
+               return 0;
 
        /*
         * Okay, MDS has returned success. Probably name has been resolved in
@@ -229,10 +229,10 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
                       "%*s: %d\n", LL_IT2STR(it), PFID(&op_data->op_fid2),
                       PFID(&op_data->op_fid1), op_data->op_namelen,
                       op_data->op_name, rc);
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -252,7 +252,7 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
 
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        if (!fid_is_sane(&op_data->op_fid2))
                fid_zero(&op_data->op_fid2);
@@ -269,7 +269,7 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
                             flags, reqp, cb_blocking, extra_lock_flags);
 
        if (rc < 0 || *reqp == NULL)
-               RETURN(rc);
+               return rc;
 
        /*
         * MDS has returned success. Probably name has been resolved in
@@ -277,15 +277,15 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
         */
        body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
        if (body == NULL)
-               RETURN(-EPROTO);
+               return -EPROTO;
        /* Not cross-ref case, just get out of here. */
        if (likely(!(body->valid & OBD_MD_MDS)))
-               RETURN(0);
+               return 0;
 
        rc = lmv_intent_remote(exp, lmm, lmmsize, it, NULL, flags, reqp,
                               cb_blocking, extra_lock_flags);
 
-       RETURN(rc);
+       return rc;
 }
 
 int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
@@ -306,7 +306,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (it->it_op & (IT_LOOKUP | IT_GETATTR | IT_LAYOUT))
                rc = lmv_intent_lookup(exp, op_data, lmm, lmmsize, it,
@@ -318,5 +318,5 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                                     extra_lock_flags);
        else
                LBUG();
-       RETURN(rc);
+       return rc;
 }
index 48d80331f031ec1f95f2af410b70ebc03e214a02..bd2575aed08d93adc17609941666e3eb58fcb534 100644 (file)
@@ -143,7 +143,7 @@ static int lmv_notify(struct obd_device *obd, struct obd_device *watched,
                CERROR("unexpected notification of %s %s!\n",
                       watched->obd_type->typ_name,
                       watched->obd_name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        uuid = &watched->u.cli.cl_target_uuid;
@@ -158,7 +158,7 @@ static int lmv_notify(struct obd_device *obd, struct obd_device *watched,
                        CERROR("%sactivation of %s failed: %d\n",
                               ev == OBD_NOTIFY_ACTIVE ? "" : "de",
                               uuid->uuid, rc);
-                       RETURN(rc);
+                       return rc;
                }
        } else if (ev == OBD_NOTIFY_OCD) {
                conn_data = &watched->u.cli.cl_import->imp_connect_data;
@@ -183,7 +183,7 @@ static int lmv_notify(struct obd_device *obd, struct obd_device *watched,
        if (obd->obd_observer)
                rc = obd_notify(obd->obd_observer, watched, ev, data);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -207,13 +207,13 @@ static int lmv_connect(const struct lu_env *env,
        lmv->refcount++;
        if (lmv->refcount > 1) {
                *exp = NULL;
-               RETURN(0);
+               return 0;
        }
 
        rc = class_connect(&conn, obd, cluuid);
        if (rc) {
                CERROR("class_connection() returned %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        *exp = class_conn2export(&conn);
@@ -253,7 +253,7 @@ static int lmv_connect(const struct lu_env *env,
                obd->obd_proc_private = NULL;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static void lmv_set_timeouts(struct obd_device *obd)
@@ -301,10 +301,10 @@ static int lmv_init_ea_size(struct obd_export *exp, int easize,
                change = 1;
        }
        if (change == 0)
-               RETURN(0);
+               return 0;
 
        if (lmv->connected == 0)
-               RETURN(0);
+               return 0;
 
        for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
                if (lmv->tgts[i] == NULL ||
@@ -322,7 +322,7 @@ static int lmv_init_ea_size(struct obd_export *exp, int easize,
                        break;
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 #define MAX_STRING_SIZE 128
@@ -342,7 +342,7 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
                                        &obd->obd_uuid);
        if (!mdc_obd) {
                CERROR("target %s not attached\n", tgt->ltd_uuid.uuid);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        CDEBUG(D_CONFIG, "connect to %s(%s) - %s, %s FOR %s\n",
@@ -352,14 +352,14 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
 
        if (!mdc_obd->obd_set_up) {
                CERROR("target %s is not set up\n", tgt->ltd_uuid.uuid);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = obd_connect(NULL, &mdc_exp, mdc_obd, &lmv_mdc_uuid,
                         &lmv->conn_data, NULL);
        if (rc) {
                CERROR("target %s connect error %d\n", tgt->ltd_uuid.uuid, rc);
-               RETURN(rc);
+               return rc;
        }
 
        /*
@@ -367,7 +367,7 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
         */
        rc = obd_fid_init(mdc_obd, mdc_exp, LUSTRE_SEQ_METADATA);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        target.ft_srv = NULL;
        target.ft_exp = mdc_exp;
@@ -380,7 +380,7 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
                obd_disconnect(mdc_exp);
                CERROR("target %s register_observer error %d\n",
                       tgt->ltd_uuid.uuid, rc);
-               RETURN(rc);
+               return rc;
        }
 
        if (obd->obd_observer) {
@@ -392,7 +392,7 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
                                (void *)(tgt - lmv->tgts[0]));
                if (rc) {
                        obd_disconnect(mdc_exp);
-                       RETURN(rc);
+                       return rc;
                }
        }
 
@@ -427,7 +427,7 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
                        obd->obd_proc_private = NULL;
                }
        }
-       RETURN(0);
+       return 0;
 }
 
 static void lmv_del_target(struct lmv_obd *lmv, int index)
@@ -460,7 +460,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                        lmv_init_unlock(lmv);
                        CERROR("%s: Target %s not attached: rc = %d\n",
                               obd->obd_name, uuidp->uuid, -EINVAL);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
@@ -470,7 +470,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                       " rc = %d\n", obd->obd_name,
                       obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST);
                lmv_init_unlock(lmv);
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
 
        if (index >= lmv->tgts_size) {
@@ -484,7 +484,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                OBD_ALLOC(newtgts, sizeof(*newtgts) * newsize);
                if (newtgts == NULL) {
                        lmv_init_unlock(lmv);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
 
                if (lmv->tgts_size) {
@@ -507,7 +507,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
        OBD_ALLOC_PTR(tgt);
        if (!tgt) {
                lmv_init_unlock(lmv);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        mutex_init(&tgt->ltd_fid_mutex);
@@ -534,7 +534,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
        }
 
        lmv_init_unlock(lmv);
-       RETURN(rc);
+       return rc;
 }
 
 int lmv_check_connect(struct obd_device *obd)
@@ -546,18 +546,18 @@ int lmv_check_connect(struct obd_device *obd)
        int                easize;
 
        if (lmv->connected)
-               RETURN(0);
+               return 0;
 
        lmv_init_lock(lmv);
        if (lmv->connected) {
                lmv_init_unlock(lmv);
-               RETURN(0);
+               return 0;
        }
 
        if (lmv->desc.ld_tgt_count == 0) {
                lmv_init_unlock(lmv);
                CERROR("%s: no targets configured.\n", obd->obd_name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        CDEBUG(D_CONFIG, "Time to connect %s to %s\n",
@@ -580,7 +580,7 @@ int lmv_check_connect(struct obd_device *obd)
        easize = lmv_get_easize(lmv);
        lmv_init_ea_size(obd->obd_self_export, easize, 0, 0);
        lmv_init_unlock(lmv);
-       RETURN(0);
+       return 0;
 
  out_disc:
        while (i-- > 0) {
@@ -601,7 +601,7 @@ int lmv_check_connect(struct obd_device *obd)
        }
        class_disconnect(lmv->exp);
        lmv_init_unlock(lmv);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_disconnect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
@@ -645,7 +645,7 @@ static int lmv_disconnect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
 
        lmv_activate_target(lmv, tgt, 0);
        tgt->ltd_exp = NULL;
-       RETURN(0);
+       return 0;
 }
 
 static int lmv_disconnect(struct obd_export *exp)
@@ -688,7 +688,7 @@ out_local:
        rc = class_disconnect(exp);
        if (lmv->refcount == 0)
                lmv->connected = 0;
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_fid2path(struct obd_export *exp, int len, void *karg, void *uarg)
@@ -704,7 +704,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, void *uarg)
        gf = (struct getinfo_fid2path *)karg;
        tgt = lmv_find_target(lmv, &gf->gf_fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
 repeat_fid2path:
        rc = obd_iocontrol(OBD_IOC_FID2PATH, tgt->ltd_exp, len, gf, uarg);
@@ -770,7 +770,7 @@ repeat_fid2path:
 out_fid2path:
        if (remote_gf != NULL)
                OBD_FREE(remote_gf, remote_gf_size);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_hsm_req_count(struct lmv_obd *lmv,
@@ -831,7 +831,7 @@ static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len,
         * and will unregister automatically.
         */
        rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len,
@@ -862,7 +862,7 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len,
                                        obd_iocontrol(cmd,
                                                  lmv->tgts[j]->ltd_exp,
                                                  len, lk, uarg);
-                               RETURN(rc);
+                               return rc;
                        }
                        /* else: transient error.
                         * kuc will register to the missing MDT
@@ -874,17 +874,17 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len,
 
        if (!any_set)
                /* no registration done: return error */
-               RETURN(-ENOTCONN);
+               return -ENOTCONN;
 
        /* at least one registration done, with no failure */
        filp = fget(lk->lk_wfd);
        if (filp == NULL) {
-               RETURN(-EBADF);
+               return -EBADF;
        }
        rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, lk->lk_data);
        if (rc != 0 && filp != NULL)
                fput(filp);
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -901,7 +901,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
        int                count = lmv->desc.ld_tgt_count;
 
        if (count == 0)
-               RETURN(-ENOTTY);
+               return -ENOTTY;
 
        switch (cmd) {
        case IOC_OBD_STATFS: {
@@ -912,31 +912,31 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                memcpy(&index, data->ioc_inlbuf2, sizeof(__u32));
                if ((index >= count))
-                       RETURN(-ENODEV);
+                       return -ENODEV;
 
                if (lmv->tgts[index] == NULL ||
                    lmv->tgts[index]->ltd_active == 0)
-                       RETURN(-ENODATA);
+                       return -ENODATA;
 
                mdc_obd = class_exp2obd(lmv->tgts[index]->ltd_exp);
                if (!mdc_obd)
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                /* copy UUID */
                if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(mdc_obd),
                                     min((int) data->ioc_plen2,
                                         (int) sizeof(struct obd_uuid))))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                rc = obd_statfs(NULL, lmv->tgts[index]->ltd_exp, &stat_buf,
                                cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
                                0);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                if (copy_to_user(data->ioc_pbuf1, &stat_buf,
                                     min((int) data->ioc_plen1,
                                         (int) sizeof(stat_buf))))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                break;
        }
        case OBD_IOC_QUOTACTL: {
@@ -946,11 +946,11 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                if (qctl->qc_valid == QC_MDTIDX) {
                        if (qctl->qc_idx < 0 || count <= qctl->qc_idx)
-                               RETURN(-EINVAL);
+                               return -EINVAL;
 
                        tgt = lmv->tgts[qctl->qc_idx];
                        if (tgt == NULL || tgt->ltd_exp == NULL)
-                               RETURN(-EINVAL);
+                               return -EINVAL;
                } else if (qctl->qc_valid == QC_UUID) {
                        for (i = 0; i < count; i++) {
                                tgt = lmv->tgts[i];
@@ -961,21 +961,21 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                                        continue;
 
                                if (tgt->ltd_exp == NULL)
-                                       RETURN(-EINVAL);
+                                       return -EINVAL;
 
                                break;
                        }
                } else {
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (i >= count)
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
 
                LASSERT(tgt && tgt->ltd_exp);
                OBD_ALLOC_PTR(oqctl);
                if (!oqctl)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                QCTL_COPY(oqctl, qctl);
                rc = obd_quotactl(tgt->ltd_exp, oqctl);
@@ -992,19 +992,19 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                struct ioc_changelog *icc = karg;
 
                if (icc->icc_mdtindex >= count)
-                       RETURN(-ENODEV);
+                       return -ENODEV;
 
                if (lmv->tgts[icc->icc_mdtindex] == NULL ||
                    lmv->tgts[icc->icc_mdtindex]->ltd_exp == NULL ||
                    lmv->tgts[icc->icc_mdtindex]->ltd_active == 0)
-                       RETURN(-ENODEV);
+                       return -ENODEV;
                rc = obd_iocontrol(cmd, lmv->tgts[icc->icc_mdtindex]->ltd_exp,
                                   sizeof(*icc), icc, NULL);
                break;
        }
        case LL_IOC_GET_CONNECT_FLAGS: {
                if (lmv->tgts[0] == NULL)
-                       RETURN(-ENODATA);
+                       return -ENODATA;
                rc = obd_iocontrol(cmd, lmv->tgts[0]->ltd_exp, len, karg, uarg);
                break;
        }
@@ -1020,10 +1020,10 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                tgt = lmv_find_target(lmv, &op_data->op_fid1);
                if (IS_ERR(tgt))
-                               RETURN(PTR_ERR(tgt));
+                               return PTR_ERR(tgt);
 
                if (tgt->ltd_exp == NULL)
-                               RETURN(-EINVAL);
+                               return -EINVAL;
 
                rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
                break;
@@ -1034,7 +1034,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                tgt = lmv_find_target(lmv, &hpk->hpk_fid);
                if (IS_ERR(tgt))
-                       RETURN(PTR_ERR(tgt));
+                       return PTR_ERR(tgt);
                rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
                break;
        }
@@ -1044,7 +1044,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                unsigned int reqcount = hur->hur_request.hr_itemcount;
 
                if (reqcount == 0)
-                       RETURN(0);
+                       return 0;
 
                /* if the request is about a single fid
                 * or if there is a single MDS, no need to split
@@ -1053,7 +1053,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                        tgt = lmv_find_target(lmv,
                                              &hur->hur_user_item[0].hui_fid);
                        if (IS_ERR(tgt))
-                               RETURN(PTR_ERR(tgt));
+                               return PTR_ERR(tgt);
                        rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
                } else {
                        /* split fid list to their respective MDS */
@@ -1072,7 +1072,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                                         + hur->hur_request.hr_data_len;
                                OBD_ALLOC_LARGE(req, reqlen);
                                if (req == NULL)
-                                       RETURN(-ENOMEM);
+                                       return -ENOMEM;
 
                                lmv_hsm_req_build(lmv, hur, lmv->tgts[i], req);
 
@@ -1091,18 +1091,18 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                tgt1 = lmv_find_target(lmv, &op_data->op_fid1);
                if (IS_ERR(tgt1))
-                       RETURN(PTR_ERR(tgt1));
+                       return PTR_ERR(tgt1);
 
                tgt2 = lmv_find_target(lmv, &op_data->op_fid2);
                if (IS_ERR(tgt2))
-                       RETURN(PTR_ERR(tgt2));
+                       return PTR_ERR(tgt2);
 
                if ((tgt1->ltd_exp == NULL) || (tgt2->ltd_exp == NULL))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                /* only files on same MDT can have their layouts swapped */
                if (tgt1->ltd_idx != tgt2->ltd_idx)
-                       RETURN(-EPERM);
+                       return -EPERM;
 
                rc = obd_iocontrol(cmd, tgt1->ltd_exp, len, karg, uarg);
                break;
@@ -1130,7 +1130,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                        err = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp, len,
                                            karg, uarg);
                        if (err == -ENODATA && cmd == OBD_IOC_POLL_QUOTACHECK) {
-                               RETURN(err);
+                               return err;
                        } else if (err) {
                                if (lmv->tgts[i]->ltd_active) {
                                        CERROR("error: iocontrol MDC %s on MDT"
@@ -1146,7 +1146,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                if (!set && !rc)
                        rc = -EIO;
        }
-       RETURN(rc);
+       return rc;
 }
 
 #if 0
@@ -1207,7 +1207,7 @@ static int lmv_placement_policy(struct obd_device *obd,
 
        if (lmv->desc.ld_tgt_count == 1) {
                *mds = 0;
-               RETURN(0);
+               return 0;
        }
 
        /**
@@ -1225,17 +1225,17 @@ static int lmv_placement_policy(struct obd_device *obd,
                                       " rc = %d\n", obd->obd_name,
                                       lum->lum_stripe_offset,
                                       lmv->desc.ld_tgt_count, -ERANGE);
-                               RETURN(-ERANGE);
+                               return -ERANGE;
                        }
                        *mds = lum->lum_stripe_offset;
-                       RETURN(0);
+                       return 0;
                }
        }
 
        /* Allocate new fid on target according to operation type and parent
         * home mds. */
        *mds = op_data->op_mds;
-       RETURN(0);
+       return 0;
 }
 
 int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid,
@@ -1246,7 +1246,7 @@ int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid,
 
        tgt = lmv_get_target(lmv, mds);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        /*
         * New seq alloc and FLD setup should be atomic. Otherwise we may find
@@ -1286,16 +1286,16 @@ int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
        if (rc) {
                CERROR("Can't get target for allocating fid, "
                       "rc %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = __lmv_fid_alloc(lmv, fid, mds);
        if (rc) {
                CERROR("Can't alloc new fid, rc %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
@@ -1307,19 +1307,19 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
                CERROR("LMV setup requires a descriptor\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        desc = (struct lmv_desc *)lustre_cfg_buf(lcfg, 1);
        if (sizeof(*desc) > LUSTRE_CFG_BUFLEN(lcfg, 1)) {
                CERROR("Lmv descriptor size wrong: %d > %d\n",
                       (int)sizeof(*desc), LUSTRE_CFG_BUFLEN(lcfg, 1));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        OBD_ALLOC(lmv->tgts, sizeof(*lmv->tgts) * 32);
        if (lmv->tgts == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lmv->tgts_size = 32;
 
        obd_str2uuid(&lmv->desc.ld_uuid, desc->ld_uuid.uuid);
@@ -1352,7 +1352,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                GOTO(out, rc);
        }
 
-       RETURN(0);
+       return 0;
 
 out:
        return rc;
@@ -1373,7 +1373,7 @@ static int lmv_cleanup(struct obd_device *obd)
                OBD_FREE(lmv->tgts, sizeof(*lmv->tgts) * lmv->tgts_size);
                lmv->tgts_size = 0;
        }
-       RETURN(0);
+       return 0;
 }
 
 static int lmv_process_config(struct obd_device *obd, obd_count len, void *buf)
@@ -1404,7 +1404,7 @@ static int lmv_process_config(struct obd_device *obd, obd_count len, void *buf)
                GOTO(out, rc = -EINVAL);
        }
 out:
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
@@ -1418,11 +1418,11 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        OBD_ALLOC(temp, sizeof(*temp));
        if (temp == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
                if (lmv->tgts[i] == NULL || lmv->tgts[i]->ltd_exp == NULL)
@@ -1470,10 +1470,10 @@ static int lmv_getstatus(struct obd_export *exp,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = md_getstatus(lmv->tgts[0]->ltd_exp, fid, pc);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
@@ -1488,16 +1488,16 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_getxattr(tgt->ltd_exp, fid, oc, valid, name, input,
                         input_size, output_size, flags, request);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
@@ -1513,17 +1513,17 @@ static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_setxattr(tgt->ltd_exp, fid, oc, valid, name, input,
                         input_size, output_size, flags, suppgid,
                         request);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_getattr(struct obd_export *exp, struct md_op_data *op_data,
@@ -1536,20 +1536,20 @@ static int lmv_getattr(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        if (op_data->op_flags & MF_GET_MDT_IDX) {
                op_data->op_mds = tgt->ltd_idx;
-               RETURN(0);
+               return 0;
        }
 
        rc = md_getattr(tgt->ltd_exp, op_data, request);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_null_inode(struct obd_export *exp, const struct lu_fid *fid)
@@ -1561,7 +1561,7 @@ static int lmv_null_inode(struct obd_export *exp, const struct lu_fid *fid)
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "CBDATA for "DFID"\n", PFID(fid));
 
@@ -1576,7 +1576,7 @@ static int lmv_null_inode(struct obd_export *exp, const struct lu_fid *fid)
                md_null_inode(lmv->tgts[i]->ltd_exp, fid);
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static int lmv_find_cbdata(struct obd_export *exp, const struct lu_fid *fid,
@@ -1589,7 +1589,7 @@ static int lmv_find_cbdata(struct obd_export *exp, const struct lu_fid *fid,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "CBDATA for "DFID"\n", PFID(fid));
 
@@ -1603,10 +1603,10 @@ static int lmv_find_cbdata(struct obd_export *exp, const struct lu_fid *fid,
                        continue;
                rc = md_find_cbdata(lmv->tgts[i]->ltd_exp, fid, it, data);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1620,15 +1620,15 @@ static int lmv_close(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        CDEBUG(D_INODE, "CLOSE "DFID"\n", PFID(&op_data->op_fid1));
        rc = md_close(tgt->ltd_exp, op_data, mod, request);
-       RETURN(rc);
+       return rc;
 }
 
 struct lmv_tgt_desc
@@ -1658,18 +1658,18 @@ int lmv_create(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (!lmv->desc.ld_active_tgt_count)
-               RETURN(-EIO);
+               return -EIO;
 
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = lmv_fid_alloc(exp, &op_data->op_fid2, op_data);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "CREATE '%*s' on "DFID" -> mds #%x\n",
               op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1),
@@ -1681,10 +1681,10 @@ int lmv_create(struct obd_export *exp, struct md_op_data *op_data,
 
        if (rc == 0) {
                if (*request == NULL)
-                       RETURN(rc);
+                       return rc;
                CDEBUG(D_INODE, "Created - "DFID"\n", PFID(&op_data->op_fid2));
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_done_writing(struct obd_export *exp,
@@ -1698,14 +1698,14 @@ static int lmv_done_writing(struct obd_export *exp,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_done_writing(tgt->ltd_exp, op_data, mod);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -1729,7 +1729,7 @@ lmv_enqueue_remote(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
        LASSERT(body != NULL);
 
        if (!(body->valid & OBD_MD_MDS))
-               RETURN(0);
+               return 0;
 
        CDEBUG(D_INODE, "REMOTE_ENQUEUE '%s' on "DFID" -> "DFID"\n",
               LL_IT2STR(it), PFID(&op_data->op_fid1), PFID(&body->fid1));
@@ -1779,14 +1779,14 @@ lmv_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "ENQUEUE '%s' on "DFID"\n",
               LL_IT2STR(it), PFID(&op_data->op_fid1));
 
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        CDEBUG(D_INODE, "ENQUEUE '%s' on "DFID" -> mds #%d\n",
               LL_IT2STR(it), PFID(&op_data->op_fid1), tgt->ltd_idx);
@@ -1798,7 +1798,7 @@ lmv_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
                rc = lmv_enqueue_remote(exp, einfo, it, op_data, lockh,
                                        lmm, lmmsize, extra_lock_flags);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -1814,11 +1814,11 @@ lmv_getattr_name(struct obd_export *exp,struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        CDEBUG(D_INODE, "GETATTR_NAME for %*s on "DFID" -> mds #%d\n",
               op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1),
@@ -1826,7 +1826,7 @@ lmv_getattr_name(struct obd_export *exp,struct md_op_data *op_data,
 
        rc = md_getattr_name(tgt->ltd_exp, op_data, request);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        body = req_capsule_server_get(&(*request)->rq_pill,
                                      &RMF_MDT_BODY);
@@ -1840,7 +1840,7 @@ lmv_getattr_name(struct obd_export *exp,struct md_op_data *op_data,
                tgt = lmv_find_target(lmv, &rid);
                if (IS_ERR(tgt)) {
                        ptlrpc_req_finished(*request);
-                       RETURN(PTR_ERR(tgt));
+                       return PTR_ERR(tgt);
                }
 
                op_data->op_fid1 = rid;
@@ -1852,7 +1852,7 @@ lmv_getattr_name(struct obd_export *exp,struct md_op_data *op_data,
                *request = req;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 #define md_op_data_fid(op_data, fl)                 \
@@ -1873,11 +1873,11 @@ static int lmv_early_cancel(struct obd_export *exp, struct md_op_data *op_data,
        int                  rc = 0;
 
        if (!fid_is_sane(fid))
-               RETURN(0);
+               return 0;
 
        tgt = lmv_find_target(lmv, fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        if (tgt->ltd_idx != op_tgt) {
                CDEBUG(D_INODE, "EARLY_CANCEL on "DFID"\n", PFID(fid));
@@ -1892,7 +1892,7 @@ static int lmv_early_cancel(struct obd_export *exp, struct md_op_data *op_data,
                rc = 0;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -1909,7 +1909,7 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        LASSERT(op_data->op_namelen != 0);
 
@@ -1922,7 +1922,7 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
        op_data->op_cap = cfs_curproc_cap_pack();
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid2);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        /*
         * Cancel UPDATE lock on child (fid1).
@@ -1931,11 +1931,11 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
        rc = lmv_early_cancel(exp, op_data, tgt->ltd_idx, LCK_EX,
                              MDS_INODELOCK_UPDATE, MF_MDC_CANCEL_FID1);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        rc = md_link(tgt->ltd_exp, op_data, request);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
@@ -1956,18 +1956,18 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid());
        op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
        op_data->op_cap = cfs_curproc_cap_pack();
        src_tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(src_tgt))
-               RETURN(PTR_ERR(src_tgt));
+               return PTR_ERR(src_tgt);
 
        tgt_tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid2);
        if (IS_ERR(tgt_tgt))
-               RETURN(PTR_ERR(tgt_tgt));
+               return PTR_ERR(tgt_tgt);
        /*
         * LOOKUP lock on src child (fid3) should also be cancelled for
         * src_tgt in mdc_rename.
@@ -2002,7 +2002,7 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
        if (rc == 0)
                rc = md_rename(src_tgt->ltd_exp, op_data, old, oldlen,
                               new, newlen, request);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
@@ -2017,7 +2017,7 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "SETATTR for "DFID", valid 0x%x\n",
               PFID(&op_data->op_fid1), op_data->op_attr.ia_valid);
@@ -2025,12 +2025,12 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
        op_data->op_flags |= MF_MDC_CANCEL_FID1;
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_setattr(tgt->ltd_exp, op_data, ea, ealen, ea2,
                        ea2len, request, mod);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_sync(struct obd_export *exp, const struct lu_fid *fid,
@@ -2043,14 +2043,14 @@ static int lmv_sync(struct obd_export *exp, const struct lu_fid *fid,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_sync(tgt->ltd_exp, fid, oc, request);
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -2169,18 +2169,18 @@ static int lmv_readpage(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "READPAGE at "LPX64" from "DFID"\n",
               offset, PFID(&op_data->op_fid1));
 
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_readpage(tgt->ltd_exp, op_data, pages, request);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        ncfspgs = ((*request)->rq_bulk->bd_nob_transferred + PAGE_CACHE_SIZE - 1)
                 >> PAGE_CACHE_SHIFT;
@@ -2193,7 +2193,7 @@ static int lmv_readpage(struct obd_export *exp, struct md_op_data *op_data,
 
        lmv_adjust_dirpages(pages, ncfspgs, nlupgs);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data,
@@ -2207,7 +2207,7 @@ static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 retry:
        /* Send unlink requests to the MDT where the child is located */
        if (likely(!fid_is_zero(&op_data->op_fid2)))
@@ -2215,7 +2215,7 @@ retry:
        else
                tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid());
        op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
@@ -2237,22 +2237,22 @@ retry:
                              MDS_INODELOCK_FULL, MF_MDC_CANCEL_FID3);
 
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INODE, "unlink with fid="DFID"/"DFID" -> mds #%d\n",
               PFID(&op_data->op_fid1), PFID(&op_data->op_fid2), tgt->ltd_idx);
 
        rc = md_unlink(tgt->ltd_exp, op_data, request);
        if (rc != 0 && rc != -EREMOTE)
-               RETURN(rc);
+               return rc;
 
        body = req_capsule_server_get(&(*request)->rq_pill, &RMF_MDT_BODY);
        if (body == NULL)
-               RETURN(-EPROTO);
+               return -EPROTO;
 
        /* Not cross-ref case, just get out of here. */
        if (likely(!(body->valid & OBD_MD_MDS)))
-               RETURN(0);
+               return 0;
 
        CDEBUG(D_INODE, "%s: try unlink to another MDT for "DFID"\n",
               exp->exp_obd->obd_name, PFID(&body->fid1));
@@ -2300,7 +2300,7 @@ static int lmv_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
        default:
                break;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
@@ -2315,7 +2315,7 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
        if (obd == NULL) {
                CDEBUG(D_IOCTL, "Invalid client cookie "LPX64"\n",
                       exp->exp_handle.h_cookie);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        lmv = &obd->u.lmv;
@@ -2325,7 +2325,7 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
 
                rc = lmv_check_connect(obd);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                LASSERT(*vallen == sizeof(__u32));
                for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
@@ -2338,13 +2338,13 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
 
                        if (!obd_get_info(env, tgt->ltd_exp, keylen, key,
                                          vallen, val, NULL))
-                               RETURN(0);
+                               return 0;
                }
-               RETURN(-EINVAL);
+               return -EINVAL;
        } else if (KEY_IS(KEY_MAX_EASIZE) || KEY_IS(KEY_CONN_DATA)) {
                rc = lmv_check_connect(obd);
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                /*
                 * Forwarding this request to first MDS, it should know LOV
@@ -2354,14 +2354,14 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
                                  vallen, val, NULL);
                if (!rc && KEY_IS(KEY_CONN_DATA))
                        exp->exp_connect_data = *(struct obd_connect_data *)val;
-               RETURN(rc);
+               return rc;
        } else if (KEY_IS(KEY_TGT_COUNT)) {
                *((int *)val) = lmv->desc.ld_tgt_count;
-               RETURN(0);
+               return 0;
        }
 
        CDEBUG(D_IOCTL, "Invalid key\n");
-       RETURN(-EINVAL);
+       return -EINVAL;
 }
 
 int lmv_set_info_async(const struct lu_env *env, struct obd_export *exp,
@@ -2377,7 +2377,7 @@ int lmv_set_info_async(const struct lu_env *env, struct obd_export *exp,
        if (obd == NULL) {
                CDEBUG(D_IOCTL, "Invalid client cookie "LPX64"\n",
                       exp->exp_handle.h_cookie);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        lmv = &obd->u.lmv;
 
@@ -2396,10 +2396,10 @@ int lmv_set_info_async(const struct lu_env *env, struct obd_export *exp,
                                rc = err;
                }
 
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(-EINVAL);
+       return -EINVAL;
 }
 
 int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
@@ -2414,29 +2414,29 @@ int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 
        mea_size = lmv_get_easize(lmv);
        if (!lmmp)
-               RETURN(mea_size);
+               return mea_size;
 
        if (*lmmp && !lsm) {
                OBD_FREE_LARGE(*lmmp, mea_size);
                *lmmp = NULL;
-               RETURN(0);
+               return 0;
        }
 
        if (*lmmp == NULL) {
                OBD_ALLOC_LARGE(*lmmp, mea_size);
                if (*lmmp == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
        }
 
        if (!lsm)
-               RETURN(mea_size);
+               return mea_size;
 
        lsmp = (struct lmv_stripe_md *)lsm;
        meap = (struct lmv_stripe_md *)*lmmp;
 
        if (lsmp->mea_magic != MEA_MAGIC_LAST_CHAR &&
            lsmp->mea_magic != MEA_MAGIC_ALL_CHARS)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        meap->mea_magic = cpu_to_le32(lsmp->mea_magic);
        meap->mea_count = cpu_to_le32(lsmp->mea_count);
@@ -2447,7 +2447,7 @@ int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
                fid_cpu_to_le(&meap->mea_ids[i], &lsmp->mea_ids[i]);
        }
 
-       RETURN(mea_size);
+       return mea_size;
 }
 
 int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
@@ -2468,17 +2468,17 @@ int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
        if (*lsmp != NULL && lmm == NULL) {
                OBD_FREE_LARGE(*tmea, mea_size);
                *lsmp = NULL;
-               RETURN(0);
+               return 0;
        }
 
        LASSERT(mea_size == lmm_size);
 
        OBD_ALLOC_LARGE(*tmea, mea_size);
        if (*tmea == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (!lmm)
-               RETURN(mea_size);
+               return mea_size;
 
        if (mea->mea_magic == MEA_MAGIC_LAST_CHAR ||
            mea->mea_magic == MEA_MAGIC_ALL_CHARS ||
@@ -2501,7 +2501,7 @@ int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
                (*tmea)->mea_ids[i] = mea->mea_ids[i];
                fid_le_to_cpu(&(*tmea)->mea_ids[i], &(*tmea)->mea_ids[i]);
        }
-       RETURN(mea_size);
+       return mea_size;
 }
 
 static int lmv_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
@@ -2526,7 +2526,7 @@ static int lmv_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
                if (!rc)
                        rc = err;
        }
-       RETURN(rc);
+       return rc;
 }
 
 int lmv_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
@@ -2536,7 +2536,7 @@ int lmv_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
        int                   rc;
 
        rc =  md_set_lock_data(lmv->tgts[0]->ltd_exp, lockh, data, bits);
-       RETURN(rc);
+       return rc;
 }
 
 ldlm_mode_t lmv_lock_match(struct obd_export *exp, __u64 flags,
@@ -2566,10 +2566,10 @@ ldlm_mode_t lmv_lock_match(struct obd_export *exp, __u64 flags,
                rc = md_lock_match(lmv->tgts[i]->ltd_exp, flags, fid,
                                   type, policy, mode, lockh);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int lmv_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
@@ -2588,7 +2588,7 @@ int lmv_free_lustre_md(struct obd_export *exp, struct lustre_md *md)
 
        if (md->mea)
                obd_free_memmd(exp, (void *)&md->mea);
-       RETURN(md_free_lustre_md(lmv->tgts[0]->ltd_exp, md));
+       return md_free_lustre_md(lmv->tgts[0]->ltd_exp, md);
 }
 
 int lmv_set_open_replay_data(struct obd_export *exp,
@@ -2601,9 +2601,9 @@ int lmv_set_open_replay_data(struct obd_export *exp,
 
        tgt = lmv_find_target(lmv, &och->och_fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
-       RETURN(md_set_open_replay_data(tgt->ltd_exp, och, open_req));
+       return md_set_open_replay_data(tgt->ltd_exp, och, open_req);
 }
 
 int lmv_clear_open_replay_data(struct obd_export *exp,
@@ -2615,9 +2615,9 @@ int lmv_clear_open_replay_data(struct obd_export *exp,
 
        tgt = lmv_find_target(lmv, &och->och_fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
-       RETURN(md_clear_open_replay_data(tgt->ltd_exp, och));
+       return md_clear_open_replay_data(tgt->ltd_exp, och);
 }
 
 static int lmv_get_remote_perm(struct obd_export *exp,
@@ -2632,14 +2632,14 @@ static int lmv_get_remote_perm(struct obd_export *exp,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_get_remote_perm(tgt->ltd_exp, fid, oc, suppgid, request);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmv_renew_capa(struct obd_export *exp, struct obd_capa *oc,
@@ -2652,14 +2652,14 @@ static int lmv_renew_capa(struct obd_export *exp, struct obd_capa *oc,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, &oc->c_capa.lc_fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_renew_capa(tgt->ltd_exp, oc, cb);
-       RETURN(rc);
+       return rc;
 }
 
 int lmv_unpack_capa(struct obd_export *exp, struct ptlrpc_request *req,
@@ -2682,14 +2682,14 @@ int lmv_intent_getattr_async(struct obd_export *exp,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_intent_getattr_async(tgt->ltd_exp, minfo, einfo);
-       RETURN(rc);
+       return rc;
 }
 
 int lmv_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
@@ -2702,14 +2702,14 @@ int lmv_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
 
        rc = lmv_check_connect(obd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = lmv_find_target(lmv, fid);
        if (IS_ERR(tgt))
-               RETURN(PTR_ERR(tgt));
+               return PTR_ERR(tgt);
 
        rc = md_revalidate_lock(tgt->ltd_exp, it, fid, bits);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2728,12 +2728,12 @@ int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
 
        if (!lmv->desc.ld_tgt_count || !tgt->ltd_active) {
                CERROR("master lmv inactive\n");
-               RETURN(-EIO);
+               return -EIO;
        }
 
        if (oqctl->qc_cmd != Q_GETOQUOTA) {
                rc = obd_quotactl(tgt->ltd_exp, oqctl);
-               RETURN(rc);
+               return rc;
        }
 
        curspace = curinodes = 0;
@@ -2761,7 +2761,7 @@ int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
        oqctl->qc_dqblk.dqb_curspace = curspace;
        oqctl->qc_dqblk.dqb_curinodes = curinodes;
 
-       RETURN(rc);
+       return rc;
 }
 
 int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
@@ -2777,7 +2777,7 @@ int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
                tgt = lmv->tgts[i];
                if (tgt == NULL || tgt->ltd_exp == NULL || !tgt->ltd_active) {
                        CERROR("lmv idx %d inactive\n", i);
-                       RETURN(-EIO);
+                       return -EIO;
                }
 
                err = obd_quotacheck(tgt->ltd_exp, oqctl);
@@ -2785,7 +2785,7 @@ int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
                        rc = err;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 struct obd_ops lmv_obd_ops = {
index 285164116c8a4605844abc8ba34150e951e52926..a4006ef46ad2a794eede17ee883fef91e6a259ea 100644 (file)
@@ -198,7 +198,7 @@ static struct lu_device *lov_device_fini(const struct lu_env *env,
 
        LASSERT(ld->ld_lov != NULL);
        if (ld->ld_target == NULL)
-               RETURN(NULL);
+               return NULL;
 
        lov_foreach_target(ld, i) {
                struct lovsub_device *lsd;
@@ -209,7 +209,7 @@ static struct lu_device *lov_device_fini(const struct lu_env *env,
                        ld->ld_target[i] = NULL;
                }
        }
-       RETURN(NULL);
+       return NULL;
 }
 
 static int lov_device_init(const struct lu_env *env, struct lu_device *d,
@@ -221,7 +221,7 @@ static int lov_device_init(const struct lu_env *env, struct lu_device *d,
 
        LASSERT(d->ld_site != NULL);
        if (ld->ld_target == NULL)
-               RETURN(rc);
+               return rc;
 
        lov_foreach_target(ld, i) {
                struct lovsub_device *lsd;
@@ -249,7 +249,7 @@ static int lov_device_init(const struct lu_env *env, struct lu_device *d,
        else
                ld->ld_flags |= LOV_DEV_INITIALIZED;
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_req_init(const struct lu_env *env, struct cl_device *dev,
@@ -264,7 +264,7 @@ static int lov_req_init(const struct lu_env *env, struct cl_device *dev,
                result = 0;
        } else
                result = -ENOMEM;
-       RETURN(result);
+       return result;
 }
 
 static const struct cl_device_operations lov_cl_ops = {
@@ -365,7 +365,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
 
                emerg = lov_emerg_alloc(tgt_size);
                if (IS_ERR(emerg))
-                       RETURN(PTR_ERR(emerg));
+                       return PTR_ERR(emerg);
 
                OBD_ALLOC(newd, tgt_size * sz);
                if (newd != NULL) {
@@ -386,7 +386,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
                        result = -ENOMEM;
                }
        }
-       RETURN(result);
+       return result;
 }
 
 static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
@@ -407,7 +407,7 @@ static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
 
        if (!tgt->ltd_obd->obd_set_up) {
                CERROR("Target %s not set up\n", obd_uuid2str(&tgt->ltd_uuid));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = lov_expand_targets(env, ld);
@@ -429,7 +429,7 @@ static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
                }
        }
        obd_putref(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_process_config(const struct lu_env *env,
@@ -459,7 +459,7 @@ static int lov_process_config(const struct lu_env *env,
                }
        }
        obd_putref(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static const struct lu_device_operations lov_lu_ops = {
@@ -478,7 +478,7 @@ static struct lu_device *lov_device_alloc(const struct lu_env *env,
 
        OBD_ALLOC_PTR(ld);
        if (ld == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        cl_device_init(&ld->ld_cl, t);
        d = lov2lu_dev(ld);
@@ -494,11 +494,11 @@ static struct lu_device *lov_device_alloc(const struct lu_env *env,
        rc = lov_setup(obd, cfg);
        if (rc) {
                lov_device_free(env, d);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        ld->ld_lov = &obd->u.lov;
-       RETURN(d);
+       return d;
 }
 
 static const struct lu_device_type_operations lov_device_type_ops = {
index 8b978c36ab4c77ff46817456984e4d633626aeb4..b611aa4e9dcb9b9a97640317e994bd6dc08975a5 100644 (file)
@@ -207,7 +207,7 @@ static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio,
        }
        if (result != 0)
                lov_io_sub_fini(env, lio, sub);
-       RETURN(result);
+       return result;
 }
 
 struct lov_io_sub *lov_sub_get(const struct lu_env *env,
@@ -227,7 +227,7 @@ struct lov_io_sub *lov_sub_get(const struct lu_env *env,
                lov_sub_enter(sub);
        else
                sub = ERR_PTR(rc);
-       RETURN(sub);
+       return sub;
 }
 
 void lov_sub_put(struct lov_io_sub *sub)
@@ -249,7 +249,7 @@ static int lov_page_stripe(const struct cl_page *page)
                lu_object_locate(page->cp_child->cp_obj->co_lu.lo_header,
                                 &lovsub_device_type));
        LASSERT(subobj != NULL);
-       RETURN(subobj->lso_index);
+       return subobj->lso_index;
 }
 
 struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
@@ -265,7 +265,7 @@ struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
        LASSERT(lio->lis_nr_subios > 0);
 
        stripe = lov_page_stripe(page);
-       RETURN(lov_sub_get(env, lio, stripe));
+       return lov_sub_get(env, lio, stripe);
 }
 
 
@@ -290,7 +290,7 @@ static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio,
                result = 0;
        } else
                result = -ENOMEM;
-       RETURN(result);
+       return result;
 }
 
 static void lov_io_slice_init(struct lov_io *lio,
@@ -407,7 +407,7 @@ static int lov_io_iter_init(const struct lu_env *env,
                else
                        break;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_io_rw_iter_init(const struct lu_env *env,
@@ -443,7 +443,7 @@ static int lov_io_rw_iter_init(const struct lu_env *env,
         * XXX The following call should be optimized: we know, that
         * [lio->lis_pos, lio->lis_endpos) intersects with exactly one stripe.
         */
-       RETURN(lov_io_iter_init(env, ios));
+       return lov_io_iter_init(env, ios);
 }
 
 static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
@@ -463,17 +463,17 @@ static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
                if (parent->ci_result == 0)
                        parent->ci_result = sub->sub_io->ci_result;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_io_lock(const struct lu_env *env, const struct cl_io_slice *ios)
 {
-       RETURN(lov_io_call(env, cl2lov_io(env, ios), cl_io_lock));
+       return lov_io_call(env, cl2lov_io(env, ios), cl_io_lock);
 }
 
 static int lov_io_start(const struct lu_env *env, const struct cl_io_slice *ios)
 {
-       RETURN(lov_io_call(env, cl2lov_io(env, ios), cl_io_start));
+       return lov_io_call(env, cl2lov_io(env, ios), cl_io_start);
 }
 
 static int lov_io_end_wrapper(const struct lu_env *env, struct cl_io *io)
@@ -487,19 +487,19 @@ static int lov_io_end_wrapper(const struct lu_env *env, struct cl_io *io)
                cl_io_end(env, io);
        else
                io->ci_state = CIS_IO_FINISHED;
-       RETURN(0);
+       return 0;
 }
 
 static int lov_io_iter_fini_wrapper(const struct lu_env *env, struct cl_io *io)
 {
        cl_io_iter_fini(env, io);
-       RETURN(0);
+       return 0;
 }
 
 static int lov_io_unlock_wrapper(const struct lu_env *env, struct cl_io *io)
 {
        cl_io_unlock(env, io);
-       RETURN(0);
+       return 0;
 }
 
 static void lov_io_end(const struct lu_env *env, const struct cl_io_slice *ios)
@@ -585,7 +585,7 @@ static int lov_io_submit(const struct lu_env *env,
                rc = cl_io_submit_rw(sub->sub_env, sub->sub_io,
                                     crt, queue);
                lov_sub_put(sub);
-               RETURN(rc);
+               return rc;
        }
 
        LASSERT(lio->lis_subs != NULL);
@@ -593,7 +593,7 @@ static int lov_io_submit(const struct lu_env *env,
                OBD_ALLOC_LARGE(stripes_qin,
                                sizeof(*stripes_qin) * lio->lis_nr_subios);
                if (stripes_qin == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                for (stripe = 0; stripe < lio->lis_nr_subios; stripe++)
                        cl_page_list_init(&stripes_qin[stripe]);
@@ -659,7 +659,7 @@ static int lov_io_submit(const struct lu_env *env,
                mutex_unlock(&ld->ld_mutex);
        }
 
-       RETURN(rc);
+       return rc;
 #undef QIN
 }
 
@@ -680,7 +680,7 @@ static int lov_io_prepare_write(const struct lu_env *env,
                lov_sub_put(sub);
        } else
                result = PTR_ERR(sub);
-       RETURN(result);
+       return result;
 }
 
 static int lov_io_commit_write(const struct lu_env *env,
@@ -700,7 +700,7 @@ static int lov_io_commit_write(const struct lu_env *env,
                lov_sub_put(sub);
        } else
                result = PTR_ERR(sub);
-       RETURN(result);
+       return result;
 }
 
 static int lov_io_fault_start(const struct lu_env *env,
@@ -715,7 +715,7 @@ static int lov_io_fault_start(const struct lu_env *env,
        sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page));
        sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob;
        lov_sub_put(sub);
-       RETURN(lov_io_start(env, ios));
+       return lov_io_start(env, ios);
 }
 
 static void lov_io_fsync_end(const struct lu_env *env,
@@ -892,7 +892,7 @@ int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
                        atomic_inc(&lov->lo_active_ios);
                }
        }
-       RETURN(io->ci_result);
+       return io->ci_result;
 }
 
 int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
@@ -929,7 +929,7 @@ int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
        }
 
        io->ci_result = result < 0 ? result : 0;
-       RETURN(result != 0);
+       return result != 0;
 }
 
 int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
@@ -963,6 +963,6 @@ int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
        }
 
        io->ci_result = result < 0 ? result : 0;
-       RETURN(result != 0);
+       return result != 0;
 }
 /** @} lov */
index 757d6dec5245f1e9823f80584078951963b1f24f..ec297e87c2a2c2a048b8aa57a61203af92fbd0e3 100644 (file)
@@ -176,7 +176,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env,
                        OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem);
        } else
                sublock = ERR_PTR(-ENOMEM);
-       RETURN(sublock);
+       return sublock;
 }
 
 static void lov_sublock_unlock(const struct lu_env *env,
@@ -237,7 +237,7 @@ static int lov_sublock_lock(const struct lu_env *env,
                        }
                }
        }
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -273,7 +273,7 @@ static int lov_subresult(int result, int rc)
 
        if (result_rank < rc_rank)
                result = rc;
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -315,7 +315,7 @@ static int lov_lock_sub_init(const struct lu_env *env,
        LASSERT(nr > 0);
        OBD_ALLOC_LARGE(lck->lls_sub, nr * sizeof lck->lls_sub[0]);
        if (lck->lls_sub == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        lck->lls_nr = nr;
        /*
@@ -386,7 +386,7 @@ static int lov_lock_sub_init(const struct lu_env *env,
         * because enqueue will create them anyway. Main duty of this function
         * is to fill in sub-lock descriptions in a race free manner.
         */
-       RETURN(result);
+       return result;
 }
 
 static int lov_sublock_release(const struct lu_env *env, struct lov_lock *lck,
@@ -431,7 +431,7 @@ static int lov_sublock_release(const struct lu_env *env, struct lov_lock *lck,
                 * sub-lock is destroyed.
                 */
        }
-       RETURN(rc);
+       return rc;
 }
 
 static void lov_sublock_hold(const struct lu_env *env, struct lov_lock *lck,
@@ -491,7 +491,7 @@ static int lov_lock_enqueue_wait(const struct lu_env *env,
        cl_lock_mutex_put(env, lock);
        result = cl_lock_enqueue_wait(env, sublock, 0);
        cl_lock_mutex_get(env, lock);
-       RETURN(result ?: CLO_REPEAT);
+       return result ?: CLO_REPEAT;
 }
 
 /**
@@ -524,7 +524,7 @@ static int lov_lock_enqueue_one(const struct lu_env *env, struct lov_lock *lck,
        if ((result == CLO_WAIT) && (sublock->cll_state <= CLS_HELD) &&
            (enqflags & CEF_ASYNC) && (!last || (enqflags & CEF_AGL)))
                result = 0;
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -661,7 +661,7 @@ static int lov_lock_enqueue(const struct lu_env *env,
                        break;
        }
        cl_lock_closure_fini(closure);
-       RETURN(result ?: minstate >= CLS_ENQUEUED ? 0 : CLO_WAIT);
+       return result ?: minstate >= CLS_ENQUEUED ? 0 : CLO_WAIT;
 }
 
 static int lov_lock_unuse(const struct lu_env *env,
@@ -707,7 +707,7 @@ static int lov_lock_unuse(const struct lu_env *env,
                result = -ESTALE;
        }
        cl_lock_closure_fini(closure);
-       RETURN(result);
+       return result;
 }
 
 
@@ -814,7 +814,7 @@ again:
        if (result == 0 && reenqueued != 0)
                goto again;
        cl_lock_closure_fini(closure);
-       RETURN(result ?: minstate >= CLS_HELD ? 0 : CLO_WAIT);
+       return result ?: minstate >= CLS_HELD ? 0 : CLO_WAIT;
 }
 
 static int lov_lock_use(const struct lu_env *env,
@@ -882,7 +882,7 @@ static int lov_lock_use(const struct lu_env *env,
                result = -ESTALE;
        }
        cl_lock_closure_fini(closure);
-       RETURN(result);
+       return result;
 }
 
 #if 0
@@ -1027,7 +1027,7 @@ static int lov_lock_fits_into(const struct lu_env *env,
               PDESCR(&lov->lls_orig), PDESCR(&lov->lls_sub[0].sub_got),
               lov->lls_sub[0].sub_stripe, lov->lls_nr, lov_r0(obj)->lo_nr,
               result);
-       RETURN(result);
+       return result;
 }
 
 void lov_lock_unlink(const struct lu_env *env,
@@ -1060,9 +1060,9 @@ struct lov_lock_link *lov_lock_link_find(const struct lu_env *env,
 
        list_for_each_entry(scan, &sub->lss_parents, lll_list) {
                if (scan->lll_super == lck)
-                       RETURN(scan);
+                       return scan;
        }
-       RETURN(NULL);
+       return NULL;
 }
 
 /**
@@ -1165,7 +1165,7 @@ int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj,
                result = lov_lock_sub_init(env, lck, io);
        } else
                result = -ENOMEM;
-       RETURN(result);
+       return result;
 }
 
 static void lov_empty_lock_fini(const struct lu_env *env,
@@ -1200,7 +1200,7 @@ int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
                lck->lls_orig = lock->cll_descr;
                result = 0;
        }
-       RETURN(result);
+       return result;
 }
 
 static struct cl_lock_closure *lov_closure_get(const struct lu_env *env,
index 349579b59b6d546d674705fe5483b970a7815bd9..3eedd935d1bcfd891a49b84c1a628f6e4a6a4d93 100644 (file)
@@ -117,7 +117,7 @@ static int lov_llog_origin_add(const struct lu_env *env,
                /* Note that rc is always 1 if llog_obd_add was successful */
                cookies += rc;
        }
-       RETURN(cookies);
+       return cookies;
 }
 
 static int lov_llog_origin_connect(struct llog_ctxt *ctxt,
@@ -152,7 +152,7 @@ static int lov_llog_origin_connect(struct llog_ctxt *ctxt,
        }
        obd_putref(obd);
 
-       RETURN(err);
+       return err;
 }
 
 /* the replicators commit callback */
@@ -191,7 +191,7 @@ static int lov_llog_repl_cancel(const struct lu_env *env,
                }
        }
        obd_putref(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static struct llog_operations lov_mds_ost_orig_logops = {
@@ -214,7 +214,7 @@ int lov_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
        rc = llog_setup(NULL, obd, olg, LLOG_MDS_OST_ORIG_CTXT, disk_obd,
                        &lov_mds_ost_orig_logops);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = llog_setup(NULL, obd, olg, LLOG_SIZE_REPL_CTXT, disk_obd,
                        &lov_size_repl_logops);
@@ -268,5 +268,5 @@ int lov_llog_finish(struct obd_device *obd, int count)
                llog_cleanup(NULL, ctxt);
 
        /* lov->tgt llogs are cleaned during osc_cleanup. */
-       RETURN(0);
+       return 0;
 }
index f062460aaf5c1364d77d5dd6c479f5972304a9dc..d204fedea34886140f42c95693a4436b96024fa5 100644 (file)
@@ -109,7 +109,7 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
        lvb->lvb_mtime = current_mtime;
        lvb->lvb_atime = current_atime;
        lvb->lvb_ctime = current_ctime;
-       RETURN(rc);
+       return rc;
 }
 
 /** Merge the lock value block(&lvb) attributes from each of the stripes in a
@@ -136,7 +136,7 @@ int lov_merge_lvb(struct obd_export *exp,
        CDEBUG(D_INODE, "merged for ID "DOSTID" s="LPU64" m="LPU64" a="LPU64
               " c="LPU64" b="LPU64"\n", POSTID(&lsm->lsm_oi), lvb->lvb_size,
               lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
-       RETURN(rc);
+       return rc;
 }
 
 /* Must be called under the lov_stripe_lock() */
@@ -160,7 +160,7 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
                               loi->loi_kms, kms);
                        loi_kms_set(loi, loi->loi_lvb.lvb_size = kms);
                }
-               RETURN(0);
+               return 0;
        }
 
        if (size > 0)
@@ -173,7 +173,7 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
        if (kms > loi->loi_kms)
                loi_kms_set(loi, kms);
 
-       RETURN(0);
+       return 0;
 }
 
 void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_valid valid,
index ba5bf1c1f146e2e244b96586c2ea5dfad38df7f0..a8c709e26a92bd32fc268e2f58651c90737f9e5a 100644 (file)
@@ -135,14 +135,14 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
        int rc;
 
        if (!lov->lov_tgts[index])
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        tgt_uuid = &lov->lov_tgts[index]->ltd_uuid;
        tgt_obd = lov->lov_tgts[index]->ltd_obd;
 
        if (!tgt_obd->obd_set_up) {
                CERROR("Target %s not set up\n", obd_uuid2str(tgt_uuid));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* override the sp_me from lov */
@@ -167,14 +167,14 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
        if (rc) {
                CERROR("Target %s register_observer error %d\n",
                       obd_uuid2str(tgt_uuid), rc);
-               RETURN(rc);
+               return rc;
        }
 
 
        if (imp->imp_invalid) {
                CDEBUG(D_CONFIG, "not connecting OSC %s; administratively "
                       "disabled\n", obd_uuid2str(tgt_uuid));
-               RETURN(0);
+               return 0;
        }
 
        rc = obd_connect(NULL, &lov->lov_tgts[index]->ltd_exp, tgt_obd,
@@ -182,7 +182,7 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
        if (rc || !lov->lov_tgts[index]->ltd_exp) {
                CERROR("Target %s connect error %d\n",
                       obd_uuid2str(tgt_uuid), rc);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        lov->lov_tgts[index]->ltd_reap = 0;
@@ -214,7 +214,7 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
                }
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static int lov_connect(const struct lu_env *env,
@@ -231,7 +231,7 @@ static int lov_connect(const struct lu_env *env,
 
        rc = class_connect(&conn, obd, cluuid);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        *exp = class_conn2export(&conn);
 
@@ -268,7 +268,7 @@ static int lov_connect(const struct lu_env *env,
        }
        obd_putref(obd);
 
-       RETURN(0);
+       return 0;
 }
 
 static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
@@ -312,7 +312,7 @@ static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
        }
 
        tgt->ltd_exp = NULL;
-       RETURN(0);
+       return 0;
 }
 
 static int lov_disconnect(struct obd_export *exp)
@@ -346,7 +346,7 @@ static int lov_disconnect(struct obd_export *exp)
 
 out:
        rc = class_disconnect(exp); /* bz 9811 */
-       RETURN(rc);
+       return rc;
 }
 
 /* Error codes:
@@ -433,7 +433,7 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
 
  out:
        obd_putref(obd);
-       RETURN(index);
+       return index;
 }
 
 static int lov_notify(struct obd_device *obd, struct obd_device *watched,
@@ -445,7 +445,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
        down_read(&lov->lov_notify_lock);
        if (!lov->lov_connects) {
                up_read(&lov->lov_notify_lock);
-               RETURN(rc);
+               return rc;
        }
 
        if (ev == OBD_NOTIFY_ACTIVE || ev == OBD_NOTIFY_INACTIVE ||
@@ -459,7 +459,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
                        CERROR("unexpected notification of %s %s!\n",
                               watched->obd_type->typ_name,
                               watched->obd_name);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                uuid = &watched->u.cli.cl_target_uuid;
 
@@ -471,7 +471,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
                        up_read(&lov->lov_notify_lock);
                        CERROR("event(%d) of %s failed: %d\n", ev,
                               obd_uuid2str(uuid), rc);
-                       RETURN(rc);
+                       return rc;
                }
                /* active event should be pass lov target index as data */
                data = &rc;
@@ -514,7 +514,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
        }
 
        up_read(&lov->lov_notify_lock);
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
@@ -531,13 +531,13 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
        if (gen <= 0) {
                CERROR("request to add OBD %s with invalid generation: %d\n",
                       uuidp->uuid, gen);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        tgt_obd = class_find_client_obd(uuidp, LUSTRE_OSC_NAME,
                                        &obd->obd_uuid);
        if (tgt_obd == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        mutex_lock(&lov->lov_lock);
 
@@ -546,7 +546,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                CERROR("UUID %s already assigned at LOV target index %d\n",
                       obd_uuid2str(&tgt->ltd_uuid), index);
                mutex_unlock(&lov->lov_lock);
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
 
        if (index >= lov->lov_tgt_size) {
@@ -560,7 +560,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                OBD_ALLOC(newtgts, sizeof(*newtgts) * newsize);
                if (newtgts == NULL) {
                        mutex_unlock(&lov->lov_lock);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
 
                if (lov->lov_tgt_size) {
@@ -583,14 +583,14 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
        OBD_ALLOC_PTR(tgt);
        if (!tgt) {
                mutex_unlock(&lov->lov_lock);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        rc = lov_ost_pool_add(&lov->lov_packed, index, lov->lov_tgt_size);
        if (rc) {
                mutex_unlock(&lov->lov_lock);
                OBD_FREE_PTR(tgt);
-               RETURN(rc);
+               return rc;
        }
 
        tgt->ltd_uuid = *uuidp;
@@ -614,7 +614,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                /* lov_connect hasn't been called yet. We'll do the
                   lov_connect_obd on this target when that fn first runs,
                   because we don't know the connect flags yet. */
-               RETURN(0);
+               return 0;
        }
 
        obd_getref(obd);
@@ -647,7 +647,7 @@ out:
                lov_del_target(obd, index, 0, 0);
        }
        obd_putref(obd);
-       RETURN(rc);
+       return rc;
 }
 
 /* Schedule a target for deletion */
@@ -661,7 +661,7 @@ int lov_del_target(struct obd_device *obd, __u32 index,
        if (index >= count) {
                CERROR("LOV target index %d >= number of LOV OBDs %d.\n",
                       index, count);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* to make sure there's no ongoing lov_notify() now */
@@ -692,7 +692,7 @@ out:
        obd_putref(obd);
        up_write(&lov->lov_notify_lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 static void __lov_del_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
@@ -775,7 +775,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
                CERROR("LOV setup requires a descriptor\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        desc = (struct lov_desc *)lustre_cfg_buf(lcfg, 1);
@@ -783,7 +783,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        if (sizeof(*desc) > LUSTRE_CFG_BUFLEN(lcfg, 1)) {
                CERROR("descriptor size wrong: %d > %d\n",
                       (int)sizeof(*desc), LUSTRE_CFG_BUFLEN(lcfg, 1));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (desc->ld_magic != LOV_DESC_MAGIC) {
@@ -794,7 +794,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                } else {
                        CERROR("%s: Bad lov desc magic: %#x\n",
                               obd->obd_name, desc->ld_magic);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
@@ -839,7 +839,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                                    obd->obd_proc_entry,
                                                    NULL, NULL);
 
-       RETURN(0);
+       return 0;
 
 out:
        return rc;
@@ -867,7 +867,7 @@ static int lov_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                        CERROR("failed to cleanup llogging subsystems\n");
                break;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_cleanup(struct obd_device *obd)
@@ -913,7 +913,7 @@ static int lov_cleanup(struct obd_device *obd)
                         lov->lov_tgt_size);
                lov->lov_tgt_size = 0;
        }
-       RETURN(0);
+       return 0;
 }
 
 int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
@@ -977,7 +977,7 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
        }
        }
 out:
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
@@ -993,7 +993,7 @@ static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
 
        OBD_ALLOC(obj_mdp, sizeof(*obj_mdp));
        if (obj_mdp == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        ost_idx = src_oa->o_nlink;
        lsm = *ea;
@@ -1018,7 +1018,7 @@ static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
                        src_oa, &obj_mdp, oti);
 out:
        OBD_FREE(obj_mdp, sizeof(*obj_mdp));
-       RETURN(rc);
+       return rc;
 }
 
 /* the LOV expects oa->o_id to be set to the LOV object id */
@@ -1031,7 +1031,7 @@ static int lov_create(const struct lu_env *env, struct obd_export *exp,
 
        LASSERT(ea != NULL);
        if (exp == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if ((src_oa->o_valid & OBD_MD_FLFLAGS) &&
            src_oa->o_flags == OBD_FL_DELORPHAN) {
@@ -1041,7 +1041,7 @@ static int lov_create(const struct lu_env *env, struct obd_export *exp,
 
        lov = &exp->exp_obd->u.lov;
        if (!lov->desc.ld_active_tgt_count)
-               RETURN(-EIO);
+               return -EIO;
 
        obd_getref(exp->exp_obd);
        /* Recreate a specific object id at the given OST index */
@@ -1051,7 +1051,7 @@ static int lov_create(const struct lu_env *env, struct obd_export *exp,
        }
 
        obd_putref(exp->exp_obd);
-       RETURN(rc);
+       return rc;
 }
 
 #define ASSERT_LSM_MAGIC(lsmp)                                           \
@@ -1077,7 +1077,7 @@ static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
        ASSERT_LSM_MAGIC(lsm);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        if (oa->o_valid & OBD_MD_FLCOOKIE) {
                LASSERT(oti);
@@ -1117,7 +1117,7 @@ static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
        err = lov_fini_destroy_set(set);
 out:
        obd_putref(exp->exp_obd);
-       RETURN(rc ? rc : err);
+       return rc ? rc : err;
 }
 
 static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
@@ -1133,13 +1133,13 @@ static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
        ASSERT_LSM_MAGIC(oinfo->oi_md);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
 
        rc = lov_prep_getattr_set(exp, oinfo, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each (pos, &set->set_list) {
                req = list_entry(pos, struct lov_request, rq_link);
@@ -1165,7 +1165,7 @@ static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
        rc = lov_fini_getattr_set(set);
        if (err)
                rc = err;
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_getattr_interpret(struct ptlrpc_request_set *rqset,
@@ -1178,7 +1178,7 @@ static int lov_getattr_interpret(struct ptlrpc_request_set *rqset,
        if (rc)
                atomic_set(&lovset->set_completes, 0);
        err = lov_fini_getattr_set(lovset);
-       RETURN(rc ? rc : err);
+       return rc ? rc : err;
 }
 
 static int lov_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
@@ -1194,13 +1194,13 @@ static int lov_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
        ASSERT_LSM_MAGIC(oinfo->oi_md);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
 
        rc = lov_prep_getattr_set(exp, oinfo, &lovset);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INFO, "objid "DOSTID": %ux%u byte stripes\n",
               POSTID(&oinfo->oi_md->lsm_oi), oinfo->oi_md->lsm_stripe_count,
@@ -1230,13 +1230,13 @@ static int lov_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
                LASSERT (rqset->set_interpret == NULL);
                rqset->set_interpret = lov_getattr_interpret;
                rqset->set_arg = (void *)lovset;
-               RETURN(rc);
+               return rc;
        }
 out:
        if (rc)
                atomic_set(&lovset->set_completes, 0);
        err = lov_fini_getattr_set(lovset);
-       RETURN(rc ? rc : err);
+       return rc ? rc : err;
 }
 
 static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
@@ -1252,7 +1252,7 @@ static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
        ASSERT_LSM_MAGIC(oinfo->oi_md);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        /* for now, we only expect the following updates here */
        LASSERT(!(oinfo->oi_oa->o_valid & ~(OBD_MD_FLID | OBD_MD_FLTYPE |
@@ -1265,7 +1265,7 @@ static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
        lov = &exp->exp_obd->u.lov;
        rc = lov_prep_setattr_set(exp, oinfo, oti, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each (pos, &set->set_list) {
                req = list_entry(pos, struct lov_request, rq_link);
@@ -1287,7 +1287,7 @@ static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
        err = lov_fini_setattr_set(set);
        if (!rc)
                rc = err;
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_setattr_interpret(struct ptlrpc_request_set *rqset,
@@ -1299,7 +1299,7 @@ static int lov_setattr_interpret(struct ptlrpc_request_set *rqset,
        if (rc)
                atomic_set(&lovset->set_completes, 0);
        err = lov_fini_setattr_set(lovset);
-       RETURN(rc ? rc : err);
+       return rc ? rc : err;
 }
 
 /* If @oti is given, the request goes from MDS and responses from OSTs are not
@@ -1322,12 +1322,12 @@ static int lov_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
        }
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        rc = lov_prep_setattr_set(exp, oinfo, oti, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INFO, "objid "DOSTID": %ux%u byte stripes\n",
               POSTID(&oinfo->oi_md->lsm_oi),
@@ -1362,14 +1362,14 @@ static int lov_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
                if (rc)
                        atomic_set(&set->set_completes, 0);
                err = lov_fini_setattr_set(set);
-               RETURN(rc ? rc : err);
+               return rc ? rc : err;
        }
 
        LASSERT(rqset->set_interpret == NULL);
        rqset->set_interpret = lov_setattr_interpret;
        rqset->set_arg = (void *)set;
 
-       RETURN(0);
+       return 0;
 }
 
 static int lov_punch_interpret(struct ptlrpc_request_set *rqset,
@@ -1381,7 +1381,7 @@ static int lov_punch_interpret(struct ptlrpc_request_set *rqset,
        if (rc)
                atomic_set(&lovset->set_completes, 0);
        err = lov_fini_punch_set(lovset);
-       RETURN(rc ? rc : err);
+       return rc ? rc : err;
 }
 
 /* FIXME: maybe we'll just make one node the authoritative attribute node, then
@@ -1401,12 +1401,12 @@ static int lov_punch(const struct lu_env *env, struct obd_export *exp,
        ASSERT_LSM_MAGIC(oinfo->oi_md);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        rc = lov_prep_punch_set(exp, oinfo, oti, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each (pos, &set->set_list) {
                req = list_entry(pos, struct lov_request, rq_link);
@@ -1426,14 +1426,14 @@ static int lov_punch(const struct lu_env *env, struct obd_export *exp,
        if (rc || list_empty(&rqset->set_requests)) {
                int err;
                err = lov_fini_punch_set(set);
-               RETURN(rc ? rc : err);
+               return rc ? rc : err;
        }
 
        LASSERT(rqset->set_interpret == NULL);
        rqset->set_interpret = lov_punch_interpret;
        rqset->set_arg = (void *)set;
 
-       RETURN(0);
+       return 0;
 }
 
 static int lov_sync_interpret(struct ptlrpc_request_set *rqset,
@@ -1445,7 +1445,7 @@ static int lov_sync_interpret(struct ptlrpc_request_set *rqset,
        if (rc)
                atomic_set(&lovset->set_completes, 0);
        err = lov_fini_sync_set(lovset);
-       RETURN(rc ?: err);
+       return rc ?: err;
 }
 
 static int lov_sync(const struct lu_env *env, struct obd_export *exp,
@@ -1462,12 +1462,12 @@ static int lov_sync(const struct lu_env *env, struct obd_export *exp,
        LASSERT(rqset != NULL);
 
        if (!exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        rc = lov_prep_sync_set(exp, oinfo, start, end, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_INFO, "fsync objid "DOSTID" ["LPX64", "LPX64"]\n",
               POSTID(&set->set_oi->oi_oa->o_oi), start, end);
@@ -1493,14 +1493,14 @@ static int lov_sync(const struct lu_env *env, struct obd_export *exp,
        if (rc || list_empty(&rqset->set_requests)) {
                int err = lov_fini_sync_set(set);
 
-               RETURN(rc ?: err);
+               return rc ?: err;
        }
 
        LASSERT(rqset->set_interpret == NULL);
        rqset->set_interpret = lov_sync_interpret;
        rqset->set_arg = (void *)set;
 
-       RETURN(0);
+       return 0;
 }
 
 static int lov_brw_check(struct lov_obd *lov, struct obd_info *lov_oinfo,
@@ -1550,12 +1550,12 @@ static int lov_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
 
        if (cmd == OBD_BRW_CHECK) {
                rc = lov_brw_check(lov, oinfo, oa_bufs, pga);
-               RETURN(rc);
+               return rc;
        }
 
        rc = lov_prep_brw_set(exp, oinfo, oa_bufs, pga, oti, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each (pos, &set->set_list) {
                struct obd_export *sub_exp;
@@ -1574,7 +1574,7 @@ static int lov_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
        err = lov_fini_brw_set(set);
        if (!rc)
                rc = err;
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_enqueue_interpret(struct ptlrpc_request_set *rqset,
@@ -1583,7 +1583,7 @@ static int lov_enqueue_interpret(struct ptlrpc_request_set *rqset,
        struct lov_request_set *lovset = (struct lov_request_set *)data;
 
        rc = lov_fini_enqueue_set(lovset, lovset->set_ei->ei_mode, rc, rqset);
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo,
@@ -1605,12 +1605,12 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo,
        LASSERT((oinfo->oi_flags & LDLM_FL_REPLAY) == 0);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        rc = lov_prep_enqueue_set(exp, oinfo, einfo, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each (pos, &set->set_list) {
                req = list_entry(pos, struct lov_request, rq_link);
@@ -1626,11 +1626,11 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo,
                LASSERT(rqset->set_interpret == NULL);
                rqset->set_interpret = lov_enqueue_interpret;
                rqset->set_arg = (void *)set;
-               RETURN(rc);
+               return rc;
        }
 out:
        rc = lov_fini_enqueue_set(set, mode, rc, rqset);
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_change_cbdata(struct obd_export *exp,
@@ -1643,7 +1643,7 @@ static int lov_change_cbdata(struct obd_export *exp,
        ASSERT_LSM_MAGIC(lsm);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        for (i = 0; i < lsm->lsm_stripe_count; i++) {
@@ -1660,7 +1660,7 @@ static int lov_change_cbdata(struct obd_export *exp,
                rc = obd_change_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
                                       &submd, it, data);
        }
-       RETURN(rc);
+       return rc;
 }
 
 /* find any ldlm lock of the inode in lov
@@ -1677,7 +1677,7 @@ static int lov_find_cbdata(struct obd_export *exp,
        ASSERT_LSM_MAGIC(lsm);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        for (i = 0; i < lsm->lsm_stripe_count; i++) {
@@ -1693,9 +1693,9 @@ static int lov_find_cbdata(struct obd_export *exp,
                rc = obd_find_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
                                     &submd, it, data);
                if (rc != 0)
-                       RETURN(rc);
+                       return rc;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
@@ -1712,13 +1712,13 @@ static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
        ASSERT_LSM_MAGIC(lsm);
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        LASSERT(lockh);
        lov = &exp->exp_obd->u.lov;
        rc = lov_prep_cancel_set(exp, &oinfo, lsm, mode, lockh, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each(pos, &set->set_list) {
                req = list_entry(pos, struct lov_request, rq_link);
@@ -1738,7 +1738,7 @@ static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
 
        }
        lov_fini_cancel_set(set);
-       RETURN(err);
+       return err;
 }
 
 static int lov_cancel_unused(struct obd_export *exp,
@@ -1749,7 +1749,7 @@ static int lov_cancel_unused(struct obd_export *exp,
        int rc = 0, i;
 
        if (!exp || !exp->exp_obd)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        lov = &exp->exp_obd->u.lov;
        if (lsm == NULL) {
@@ -1763,7 +1763,7 @@ static int lov_cancel_unused(struct obd_export *exp,
                        if (!rc)
                                rc = err;
                }
-               RETURN(rc);
+               return rc;
        }
 
        ASSERT_LSM_MAGIC(lsm);
@@ -1795,7 +1795,7 @@ static int lov_cancel_unused(struct obd_export *exp,
                                rc = err;
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 int lov_statfs_interpret(struct ptlrpc_request_set *rqset, void *data, int rc)
@@ -1807,7 +1807,7 @@ int lov_statfs_interpret(struct ptlrpc_request_set *rqset, void *data, int rc)
                atomic_set(&lovset->set_completes, 0);
 
        err = lov_fini_statfs_set(lovset);
-       RETURN(rc ? rc : err);
+       return rc ? rc : err;
 }
 
 static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
@@ -1826,7 +1826,7 @@ static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
        lov = &obd->u.lov;
        rc = lov_prep_statfs_set(obd, oinfo, &set);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each (pos, &set->set_list) {
                req = list_entry(pos, struct lov_request, rq_link);
@@ -1841,13 +1841,13 @@ static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
                if (rc)
                        atomic_set(&set->set_completes, 0);
                err = lov_fini_statfs_set(set);
-               RETURN(rc ? rc : err);
+               return rc ? rc : err;
        }
 
        LASSERT(rqset->set_interpret == NULL);
        rqset->set_interpret = lov_statfs_interpret;
        rqset->set_arg = (void *)set;
-       RETURN(0);
+       return 0;
 }
 
 static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
@@ -1861,7 +1861,7 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
         * statfs requests */
        set = ptlrpc_prep_set();
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        oinfo.oi_osfs = osfs;
        oinfo.oi_flags = flags;
@@ -1870,7 +1870,7 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
                rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
@@ -1891,23 +1891,23 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
                memcpy(&index, data->ioc_inlbuf2, sizeof(__u32));
                if ((index >= count))
-                       RETURN(-ENODEV);
+                       return -ENODEV;
 
                if (!lov->lov_tgts[index])
                        /* Try again with the next index */
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
                if (!lov->lov_tgts[index]->ltd_active)
-                       RETURN(-ENODATA);
+                       return -ENODATA;
 
                osc_obd = class_exp2obd(lov->lov_tgts[index]->ltd_exp);
                if (!osc_obd)
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                /* copy UUID */
                if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(osc_obd),
                                     min((int) data->ioc_plen2,
                                         (int) sizeof(struct obd_uuid))))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
 
                flags = uarg ? *(__u32*)uarg : 0;
                /* got statfs data */
@@ -1915,11 +1915,11 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                                cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
                                flags);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                if (copy_to_user(data->ioc_pbuf1, &stat_buf,
                                     min((int) data->ioc_plen1,
                                         (int) sizeof(stat_buf))))
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                break;
        }
        case OBD_IOC_LOV_GET_CONFIG: {
@@ -1930,23 +1930,23 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
                len = 0;
                if (obd_ioctl_getdata(&buf, &len, (void *)uarg))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                data = (struct obd_ioctl_data *)buf;
 
                if (sizeof(*desc) > data->ioc_inllen1) {
                        obd_ioctl_freedata(buf, len);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) {
                        obd_ioctl_freedata(buf, len);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (sizeof(__u32) * count > data->ioc_inllen3) {
                        obd_ioctl_freedata(buf, len);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                desc = (struct lov_desc *)data->ioc_inlbuf1;
@@ -1983,11 +1983,11 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
                if (qctl->qc_valid == QC_OSTIDX) {
                        if (qctl->qc_idx < 0 || count <= qctl->qc_idx)
-                               RETURN(-EINVAL);
+                               return -EINVAL;
 
                        tgt = lov->lov_tgts[qctl->qc_idx];
                        if (!tgt || !tgt->ltd_exp)
-                               RETURN(-EINVAL);
+                               return -EINVAL;
                } else if (qctl->qc_valid == QC_UUID) {
                        for (i = 0; i < count; i++) {
                                tgt = lov->lov_tgts[i];
@@ -1997,21 +1997,21 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                                        continue;
 
                                if (tgt->ltd_exp == NULL)
-                                       RETURN(-EINVAL);
+                                       return -EINVAL;
 
                                break;
                        }
                } else {
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (i >= count)
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
 
                LASSERT(tgt && tgt->ltd_exp);
                OBD_ALLOC_PTR(oqctl);
                if (!oqctl)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                QCTL_COPY(oqctl, qctl);
                rc = obd_quotactl(tgt->ltd_exp, oqctl);
@@ -2027,7 +2027,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                int set = 0;
 
                if (count == 0)
-                       RETURN(-ENOTTY);
+                       return -ENOTTY;
 
                for (i = 0; i < count; i++) {
                        int err;
@@ -2044,7 +2044,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                        err = obd_iocontrol(cmd, lov->lov_tgts[i]->ltd_exp,
                                            len, karg, uarg);
                        if (err == -ENODATA && cmd == OBD_IOC_POLL_QUOTACHECK) {
-                               RETURN(err);
+                               return err;
                        } else if (err) {
                                if (lov->lov_tgts[i]->ltd_active) {
                                        CDEBUG(err == -ENOTTY ?
@@ -2065,7 +2065,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
        }
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 #define FIEMAP_BUFFER_SIZE 4096
@@ -2434,7 +2434,7 @@ static int lov_get_info(const struct lu_env *env, struct obd_export *exp,
        int i, rc;
 
        if (!vallen || !val)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        obd_getref(obddev);
 
@@ -2515,7 +2515,7 @@ static int lov_get_info(const struct lu_env *env, struct obd_export *exp,
 
 out:
        obd_putref(obddev);
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
@@ -2536,7 +2536,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
                no_set = 1;
                set = ptlrpc_prep_set();
                if (!set)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
        }
 
        obd_getref(obddev);
@@ -2628,7 +2628,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
                        rc = err;
                ptlrpc_set_destroy(set);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_extent_calc(struct obd_export *exp, struct lov_stripe_md *lsm,
@@ -2652,7 +2652,7 @@ static int lov_extent_calc(struct obd_export *exp, struct lov_stripe_md *lsm,
                LBUG();
        }
 
-       RETURN(0);
+       return 0;
 }
 
 void lov_stripe_lock(struct lov_stripe_md *md)
@@ -2688,7 +2688,7 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
            oqctl->qc_cmd != LUSTRE_Q_SETQUOTA &&
            oqctl->qc_cmd != Q_FINVALIDATE) {
                CERROR("bad quota opc %x for lov obd", oqctl->qc_cmd);
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
 
        /* for lov tgt */
@@ -2730,7 +2730,7 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
                oqctl->qc_dqblk.dqb_curspace = curspace;
                oqctl->qc_dqblk.dqb_bhardlimit = bhardlimit;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_quotacheck(struct obd_device *obd, struct obd_export *exp,
@@ -2773,7 +2773,7 @@ static int lov_quotacheck(struct obd_device *obd, struct obd_export *exp,
 out:
        obd_putref(obd);
 
-       RETURN(rc);
+       return rc;
 }
 
 struct obd_ops lov_obd_ops = {
@@ -2856,7 +2856,7 @@ int __init lov_init(void)
                lu_kmem_fini(lov_caches);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static void /*__exit*/ lov_exit(void)
index f869849135cfa5ca4a2f9a279dd3e104c9ebe540..84e55ce3ccd2217236ce176fe3ee7cb7b20cc762 100644 (file)
@@ -118,7 +118,7 @@ static struct cl_object *lov_sub_find(const struct lu_env *env,
 
        o = lu_object_find_at(env, cl2lu_dev(dev), fid, &conf->coc_lu);
        LASSERT(ergo(!IS_ERR(o), o->lo_dev->ld_type == &lovsub_device_type));
-       RETURN(lu2cl(o));
+       return lu2cl(o);
 }
 
 static int lov_init_sub(const struct lu_env *env, struct lov_object *lov,
@@ -252,7 +252,7 @@ static int lov_init_raid0(const struct lu_env *env,
        } else
                result = -ENOMEM;
 out:
-       RETURN(result);
+       return result;
 }
 
 static int lov_init_released(const struct lu_env *env,
@@ -353,7 +353,7 @@ static int lov_delete_raid0(const struct lu_env *env, struct lov_object *lov,
                }
        }
        cl_object_prune(env, &lov->lo_cl);
-       RETURN(0);
+       return 0;
 }
 
 static void lov_fini_empty(const struct lu_env *env, struct lov_object *lov,
@@ -497,7 +497,7 @@ static int lov_attr_get_raid0(const struct lu_env *env, struct cl_object *obj,
                if (attr->cat_mtime < lov_attr->cat_mtime)
                        attr->cat_mtime = lov_attr->cat_mtime;
        }
-       RETURN(result);
+       return result;
 }
 
 const static struct lov_layout_operations lov_dispatch[] = {
@@ -631,7 +631,7 @@ static int lov_layout_wait(const struct lu_env *env, struct lov_object *lov)
                l_wait_event(lov->lo_waitq,
                             atomic_read(&lov->lo_active_ios) == 0, &lwi);
        }
-       RETURN(0);
+       return 0;
 }
 
 static int lov_layout_change(const struct lu_env *unused,
@@ -659,7 +659,7 @@ static int lov_layout_change(const struct lu_env *unused,
        env = cl_env_get(&refcheck);
        if (IS_ERR(env)) {
                cl_env_reexit(cookie);
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
        }
 
        old_ops = &lov_dispatch[lov->lo_type];
@@ -689,7 +689,7 @@ static int lov_layout_change(const struct lu_env *unused,
 
        cl_env_put(env, &refcheck);
        cl_env_reexit(cookie);
-       RETURN(result);
+       return result;
 }
 
 /*****************************************************************************
@@ -719,7 +719,7 @@ int lov_object_init(const struct lu_env *env, struct lu_object *obj,
        result = ops->llo_init(env, dev, lov, cconf, set);
        if (result == 0)
                ops->llo_install(env, lov, set);
-       RETURN(result);
+       return result;
 }
 
 static int lov_conf_set(const struct lu_env *env, struct cl_object *obj,
@@ -767,7 +767,7 @@ static int lov_conf_set(const struct lu_env *env, struct cl_object *obj,
 
 out:
        lov_conf_unlock(lov);
-       RETURN(result);
+       return result;
 }
 
 static void lov_object_delete(const struct lu_env *env, struct lu_object *obj)
@@ -880,7 +880,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env,
                obj->lo_ops = &lov_lu_obj_ops;
        } else
                obj = NULL;
-       RETURN(obj);
+       return obj;
 }
 
 struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov)
@@ -965,7 +965,7 @@ int lov_read_and_clear_async_rc(struct cl_object *clob)
                }
                lov_conf_thaw(lov);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(lov_read_and_clear_async_rc);
 
index 079ad5c90566c4401b17d139409d45ac22a149bf..04863a7c5e0bd127fac135eac97a5431295f736c 100644 (file)
@@ -54,7 +54,7 @@ obd_size lov_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size,
        int magic = lsm->lsm_magic;
 
        if (ost_size == 0)
-               RETURN(0);
+               return 0;
 
        LASSERT(lsm_op_find(magic) != NULL);
        lsm_op_find(magic)->lsm_stripe_by_index(lsm, &stripeno, NULL, &swidth);
@@ -66,7 +66,7 @@ obd_size lov_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size,
        else
                lov_size = (ost_size - 1) * swidth + (stripeno + 1) * ssize;
 
-       RETURN(lov_size);
+       return lov_size;
 }
 
 /* we have an offset in file backed by an lov and want to find out where
index 5edcf8e28c0e2e88d469604203e6e1f50104121d..55ec26778f8043cb16276f7b1c35404d772c92af 100644 (file)
@@ -158,7 +158,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
            (lmm_magic != LOV_MAGIC_V3)) {
                CERROR("bad mem LOV MAGIC: 0x%08X != 0x%08X nor 0x%08X\n",
                        lmm_magic, LOV_MAGIC_V1, LOV_MAGIC_V3);
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        }
 
@@ -189,20 +189,20 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
        lmm_size = lov_mds_md_size(stripe_count, lmm_magic);
 
        if (!lmmp)
-               RETURN(lmm_size);
+               return lmm_size;
 
        if (*lmmp && !lsm) {
                stripe_count = le16_to_cpu((*lmmp)->lmm_stripe_count);
                lmm_size = lov_mds_md_size(stripe_count, lmm_magic);
                OBD_FREE_LARGE(*lmmp, lmm_size);
                *lmmp = NULL;
-               RETURN(0);
+               return 0;
        }
 
        if (!*lmmp) {
                OBD_ALLOC_LARGE(*lmmp, lmm_size);
                if (!*lmmp)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
        }
 
        CDEBUG(D_INFO, "lov_packmd: LOV_MAGIC 0x%08X, lmm_size = %d \n",
@@ -216,7 +216,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
                lmmv1->lmm_magic = cpu_to_le32(LOV_MAGIC_V1);
 
        if (!lsm)
-               RETURN(lmm_size);
+               return lmm_size;
 
        /* lmmv1 and lmmv3 point to the same struct and have the
         * same first fields
@@ -230,7 +230,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
                cplen = strlcpy(lmmv3->lmm_pool_name, lsm->lsm_pool_name,
                                sizeof(lmmv3->lmm_pool_name));
                if (cplen >= sizeof(lmmv3->lmm_pool_name))
-                       RETURN(-E2BIG);
+                       return -E2BIG;
                lmm_objects = lmmv3->lmm_objects;
        } else {
                lmm_objects = lmmv1->lmm_objects;
@@ -247,7 +247,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
                lmm_objects[i].l_ost_idx = cpu_to_le32(loi->loi_ost_idx);
        }
 
-       RETURN(lmm_size);
+       return lmm_size;
 }
 
 /* Find the max stripecount we should use */
@@ -314,7 +314,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, __u16 stripe_count,
        *lsmp = lsm_alloc_plain(stripe_count, &lsm_size);
        if (!*lsmp) {
                CERROR("can't allocate lsmp stripe_count %d\n", stripe_count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        atomic_set(&(*lsmp)->lsm_refc, 1);
@@ -331,7 +331,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, __u16 stripe_count,
        for (i = 0; i < stripe_count; i++)
                loi_init((*lsmp)->lsm_oinfo[i]);
 
-       RETURN(lsm_size);
+       return lsm_size;
 }
 
 int lov_free_memmd(struct lov_stripe_md **lsmp)
@@ -366,7 +366,7 @@ int lov_unpackmd(struct obd_export *exp,  struct lov_stripe_md **lsmp,
        if (lmm) {
                rc = lov_verify_lmm(lmm, lmm_bytes, &stripe_count);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                magic = le32_to_cpu(lmm->lmm_magic);
        } else {
                magic = LOV_MAGIC;
@@ -377,31 +377,31 @@ int lov_unpackmd(struct obd_export *exp,  struct lov_stripe_md **lsmp,
        if (!lsmp) {
                /* XXX LOV STACKING call into osc for sizes */
                LBUG();
-               RETURN(lov_stripe_md_size(stripe_count));
+               return lov_stripe_md_size(stripe_count);
        }
        /* If we are passed an allocated struct but nothing to unpack, free */
        if (*lsmp && !lmm) {
                lov_free_memmd(lsmp);
-               RETURN(0);
+               return 0;
        }
 
        pattern = le32_to_cpu(lmm->lmm_pattern);
        lsm_size = lov_alloc_memmd(lsmp, stripe_count, pattern, magic);
        if (lsm_size < 0)
-               RETURN(lsm_size);
+               return lsm_size;
 
        /* If we are passed a pointer but nothing to unpack, we only alloc */
        if (!lmm)
-               RETURN(lsm_size);
+               return lsm_size;
 
        LASSERT(lsm_op_find(magic) != NULL);
        rc = lsm_op_find(magic)->lsm_unpackmd(lov, *lsmp, lmm);
        if (rc) {
                lov_free_memmd(lsmp);
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(lsm_size);
+       return lsm_size;
 }
 
 static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
@@ -420,7 +420,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
 
        rc = lov_lum_swab_if_needed(lumv3, &lmm_magic, lump);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        /* in the rest of the tests, as *lumv1 and lumv3 have the same
         * fields, we use lumv1 to avoid code duplication */
@@ -433,7 +433,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
        if (lov_pattern(lumv1->lmm_pattern) != LOV_PATTERN_RAID0) {
                CDEBUG(D_IOCTL, "bad userland stripe pattern: %#x\n",
                       lumv1->lmm_pattern);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* 64kB is the largest common page size we see (ia64), and matches the
@@ -449,7 +449,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
             (typeof(lumv1->lmm_stripe_offset))(-1))) {
                CDEBUG(D_IOCTL, "stripe offset %u > number of OSTs %u\n",
                       lumv1->lmm_stripe_offset, lov->desc.ld_tgt_count);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        stripe_count = lov_get_stripecnt(lov, lmm_magic,
                                         lumv1->lmm_stripe_count);
@@ -479,7 +479,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
                                        lumv3->lmm_stripe_offset, pool);
                                if (rc < 0) {
                                        lov_pool_putref(pool);
-                                       RETURN(-EINVAL);
+                                       return -EINVAL;
                                }
                        }
 
@@ -508,7 +508,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
                rc = 0;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Configure object striping information on a new file.
@@ -529,7 +529,7 @@ int lov_setstripe(struct obd_export *exp, int max_lmm_size,
 
        rc = __lov_setstripe(exp, max_lmm_size, lsmp, lump);
        set_fs(seg);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
@@ -553,26 +553,26 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
                rc = obd_get_info(NULL, oexp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
                                  &len, &last_id, NULL);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                if (ostid_id(&lmm_objects[i].l_ost_oi) > last_id) {
                        CERROR("Setting EA for object > than last id on"
                               " ost idx %d "DOSTID" > "LPD64" \n",
                               lmm_objects[i].l_ost_idx,
                               POSTID(&lmm_objects[i].l_ost_oi), last_id);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
        rc = lov_setstripe(exp, 0, lsmp, lump);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        for (i = 0; i < lump->lmm_stripe_count; i++) {
                (*lsmp)->lsm_oinfo[i]->loi_ost_idx =
                        lmm_objects[i].l_ost_idx;
                (*lsmp)->lsm_oinfo[i]->loi_oi = lmm_objects[i].l_ost_oi;
        }
-       RETURN(0);
+       return 0;
 }
 
 
@@ -596,7 +596,7 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
        mm_segment_t seg;
 
        if (!lsm)
-               RETURN(-ENODATA);
+               return -ENODATA;
 
        /*
         * "Switch to kernel segment" to allow copying from kernel space by
@@ -674,5 +674,5 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
        obd_free_diskmd(exp, &lmmk);
 out_set:
        set_fs(seg);
-       RETURN(rc);
+       return rc;
 }
index 220e78f19ea7fde7601144f773161b169bf3c010..674e61781c20b852697949d6e8ea44734cfb988b 100644 (file)
@@ -95,7 +95,7 @@ static int lov_page_own(const struct lu_env *env,
                lov_sub_put(sub);
        } else
                LBUG(); /* Arrgh */
-       RETURN(0);
+       return 0;
 }
 
 static void lov_page_assume(const struct lu_env *env,
@@ -124,7 +124,7 @@ static int lov_page_cache_add(const struct lu_env *env,
                rc = PTR_ERR(sub);
                CL_PAGE_DEBUG(D_ERROR, env, slice->cpl_page, "rc = %d\n", rc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int lov_page_print(const struct lu_env *env,
@@ -221,7 +221,7 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
        memset(addr, 0, cl_page_size(obj));
        kunmap(vmpage);
        cl_page_export(env, page, 1);
-       RETURN(0);
+       return 0;
 }
 
 
index e52f14c88f9080747a474e585ec6185d5917b3ce..dd3c07d5c4de4f9974b1e2d4bc512a81877884dd 100644 (file)
@@ -330,7 +330,7 @@ int lov_ost_pool_init(struct ost_pool *op, unsigned int count)
        OBD_ALLOC(op->op_array, op->op_size * sizeof(op->op_array[0]));
        if (op->op_array == NULL) {
                op->op_size = 0;
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        return 0;
 }
@@ -399,13 +399,13 @@ int lov_ost_pool_remove(struct ost_pool *op, __u32 idx)
        }
 
        up_write(&op->op_rw_sem);
-       RETURN(-EINVAL);
+       return -EINVAL;
 }
 
 int lov_ost_pool_free(struct ost_pool *op)
 {
        if (op->op_size == 0)
-               RETURN(0);
+               return 0;
 
        down_write(&op->op_rw_sem);
 
@@ -415,7 +415,7 @@ int lov_ost_pool_free(struct ost_pool *op)
        op->op_size = 0;
 
        up_write(&op->op_rw_sem);
-       RETURN(0);
+       return 0;
 }
 
 
@@ -428,11 +428,11 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
        lov = &(obd->u.lov);
 
        if (strlen(poolname) > LOV_MAXPOOLNAME)
-               RETURN(-ENAMETOOLONG);
+               return -ENAMETOOLONG;
 
        OBD_ALLOC_PTR(new_pool);
        if (new_pool == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        strncpy(new_pool->pool_name, poolname, LOV_MAXPOOLNAME);
        new_pool->pool_name[LOV_MAXPOOLNAME] = '\0';
@@ -481,7 +481,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
        CDEBUG(D_CONFIG, LOV_POOLNAMEF" is pool #%d\n",
               poolname, lov->lov_pool_count);
 
-       RETURN(0);
+       return 0;
 
 out_err:
        spin_lock(&obd->obd_dev_lock);
@@ -508,7 +508,7 @@ int lov_pool_del(struct obd_device *obd, char *poolname)
        /* lookup and kill hash reference */
        pool = cfs_hash_del_key(lov->lov_pools_hash_body, poolname);
        if (pool == NULL)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        if (pool->pool_proc_entry != NULL) {
                CDEBUG(D_INFO, "proc entry %p\n", pool->pool_proc_entry);
@@ -524,7 +524,7 @@ int lov_pool_del(struct obd_device *obd, char *poolname)
        /* release last reference */
        lov_pool_putref(pool);
 
-       RETURN(0);
+       return 0;
 }
 
 
@@ -540,7 +540,7 @@ int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname)
 
        pool = cfs_hash_lookup(lov->lov_pools_hash_body, poolname);
        if (pool == NULL)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        obd_str2uuid(&ost_uuid, ostname);
 
@@ -585,7 +585,7 @@ int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname)
 
        pool = cfs_hash_lookup(lov->lov_pools_hash_body, poolname);
        if (pool == NULL)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        obd_str2uuid(&ost_uuid, ostname);
 
index d975fc550d8534059d3d7c04a66da70dbc69d152..61e6d0b46c98e4898a43867ea0e79b20f8ada587 100644 (file)
@@ -129,7 +129,7 @@ int lov_update_common_set(struct lov_request_set *set,
                rc = 0;
 
        /* FIXME in raid1 regime, should return 0 */
-       RETURN(rc);
+       return rc;
 }
 
 void lov_set_add_req(struct lov_request *req, struct lov_request_set *set)
@@ -250,7 +250,7 @@ int lov_update_enqueue_set(struct lov_request *req, __u32 mode, int rc)
                                    req->rq_idx, &oi->oi_md->lsm_oi, rc);
        lov_stripe_unlock(oi->oi_md);
        lov_update_set(set, req, rc);
-       RETURN(rc);
+       return rc;
 }
 
 /* The callback for osc_enqueue that updates lov info for every OSC request. */
@@ -274,7 +274,7 @@ static int enqueue_done(struct lov_request_set *set, __u32 mode)
 
        /* enqueue/match success, just return */
        if (completes && completes == atomic_read(&set->set_success))
-               RETURN(0);
+               return 0;
 
        /* cancel enqueued/matched locks */
        list_for_each_entry(req, &set->set_list, rq_link) {
@@ -300,7 +300,7 @@ static int enqueue_done(struct lov_request_set *set, __u32 mode)
        }
        if (set->set_lockh)
                lov_llh_put(set->set_lockh);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
@@ -309,7 +309,7 @@ int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
        int ret = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        /* Do enqueue_done only for sync requests and if any request
         * succeeded. */
@@ -322,7 +322,7 @@ int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
 
        lov_put_reqset(set);
 
-       RETURN(rc ? rc : ret);
+       return rc ? rc : ret;
 }
 
 static void lov_llh_addref(void *llhp)
@@ -366,7 +366,7 @@ int lov_prep_enqueue_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -438,10 +438,10 @@ int lov_prep_enqueue_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(0);
+       return 0;
 out_set:
        lov_fini_enqueue_set(set, einfo->ei_mode, rc, NULL);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_match_set(struct lov_request_set *set, __u32 mode, int flags)
@@ -449,7 +449,7 @@ int lov_fini_match_set(struct lov_request_set *set, __u32 mode, int flags)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        rc = enqueue_done(set, mode);
        if ((set->set_count == atomic_read(&set->set_success)) &&
@@ -458,7 +458,7 @@ int lov_fini_match_set(struct lov_request_set *set, __u32 mode, int flags)
 
        lov_put_reqset(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
@@ -472,7 +472,7 @@ int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -526,10 +526,10 @@ int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_match_set(set, mode, 0);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_cancel_set(struct lov_request_set *set)
@@ -537,7 +537,7 @@ int lov_fini_cancel_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
 
        LASSERT(set->set_exp);
        if (set->set_lockh)
@@ -545,7 +545,7 @@ int lov_fini_cancel_set(struct lov_request_set *set)
 
        lov_put_reqset(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
@@ -558,7 +558,7 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -606,10 +606,10 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_cancel_set(set);
-       RETURN(rc);
+       return rc;
 }
 static int common_attr_done(struct lov_request_set *set)
 {
@@ -621,10 +621,10 @@ static int common_attr_done(struct lov_request_set *set)
        LASSERT(set->set_oi != NULL);
 
        if (set->set_oi->oi_oa == NULL)
-               RETURN(0);
+               return 0;
 
        if (!atomic_read(&set->set_success))
-               RETURN(-EIO);
+               return -EIO;
 
        OBDO_ALLOC(tmp_oa);
        if (tmp_oa == NULL)
@@ -658,7 +658,7 @@ static int common_attr_done(struct lov_request_set *set)
 out:
        if (tmp_oa)
                OBDO_FREE(tmp_oa);
-       RETURN(rc);
+       return rc;
 
 }
 
@@ -681,7 +681,7 @@ static int brw_done(struct lov_request_set *set)
                        loi->loi_lvb.lvb_blocks = req->rq_oi.oi_oa->o_blocks;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int lov_fini_brw_set(struct lov_request_set *set)
@@ -689,7 +689,7 @@ int lov_fini_brw_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        if (atomic_read(&set->set_completes)) {
                rc = brw_done(set);
@@ -697,7 +697,7 @@ int lov_fini_brw_set(struct lov_request_set *set)
        }
        lov_put_reqset(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
@@ -716,7 +716,7 @@ int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -817,7 +817,7 @@ out:
        else
                lov_fini_brw_set(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_getattr_set(struct lov_request_set *set)
@@ -825,14 +825,14 @@ int lov_fini_getattr_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        if (atomic_read(&set->set_completes))
                rc = common_attr_done(set);
 
        lov_put_reqset(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* The callback for osc_getattr_async that finilizes a request info when a
@@ -854,7 +854,7 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -896,16 +896,16 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_getattr_set(set);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_destroy_set(struct lov_request_set *set)
 {
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        if (atomic_read(&set->set_completes)) {
                /* FIXME update qos data here */
@@ -913,7 +913,7 @@ int lov_fini_destroy_set(struct lov_request_set *set)
 
        lov_put_reqset(set);
 
-       RETURN(0);
+       return 0;
 }
 
 int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
@@ -927,7 +927,7 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -967,10 +967,10 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_destroy_set(set);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_setattr_set(struct lov_request_set *set)
@@ -978,7 +978,7 @@ int lov_fini_setattr_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        if (atomic_read(&set->set_completes)) {
                rc = common_attr_done(set);
@@ -986,7 +986,7 @@ int lov_fini_setattr_set(struct lov_request_set *set)
        }
 
        lov_put_reqset(set);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_update_setattr_set(struct lov_request_set *set,
@@ -1014,7 +1014,7 @@ int lov_update_setattr_set(struct lov_request_set *set,
                                req->rq_oi.oi_oa->o_atime;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /* The callback for osc_setattr_async that finilizes a request info when a
@@ -1037,7 +1037,7 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -1090,10 +1090,10 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_setattr_set(set);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_punch_set(struct lov_request_set *set)
@@ -1101,7 +1101,7 @@ int lov_fini_punch_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        if (atomic_read(&set->set_completes)) {
                rc = -EIO;
@@ -1112,7 +1112,7 @@ int lov_fini_punch_set(struct lov_request_set *set)
 
        lov_put_reqset(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 int lov_update_punch_set(struct lov_request_set *set,
@@ -1137,7 +1137,7 @@ int lov_update_punch_set(struct lov_request_set *set,
                lov_stripe_unlock(lsm);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /* The callback for osc_punch that finilizes a request info when a response
@@ -1160,7 +1160,7 @@ int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_oi = oinfo;
@@ -1212,10 +1212,10 @@ int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_punch_set(set);
-       RETURN(rc);
+       return rc;
 }
 
 int lov_fini_sync_set(struct lov_request_set *set)
@@ -1223,7 +1223,7 @@ int lov_fini_sync_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
        LASSERT(set->set_exp);
        if (atomic_read(&set->set_completes)) {
                if (!atomic_read(&set->set_success))
@@ -1233,7 +1233,7 @@ int lov_fini_sync_set(struct lov_request_set *set)
 
        lov_put_reqset(set);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* The callback for osc_sync that finilizes a request info when a
@@ -1257,7 +1257,7 @@ int lov_prep_sync_set(struct obd_export *exp, struct obd_info *oinfo,
 
        OBD_ALLOC_PTR(set);
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_exp = exp;
@@ -1302,10 +1302,10 @@ int lov_prep_sync_set(struct obd_export *exp, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_sync_set(set);
-       RETURN(rc);
+       return rc;
 }
 
 #define LOV_U64_MAX ((__u64)~0ULL)
@@ -1331,10 +1331,10 @@ int lov_fini_statfs(struct obd_device *obd, struct obd_statfs *osfs,int success)
                memcpy(&obd->obd_osfs, osfs, sizeof(*osfs));
                obd->obd_osfs_age = cfs_time_current_64();
                spin_unlock(&obd->obd_osfs_lock);
-               RETURN(0);
+               return 0;
        }
 
-       RETURN(-EIO);
+       return -EIO;
 }
 
 int lov_fini_statfs_set(struct lov_request_set *set)
@@ -1342,14 +1342,14 @@ int lov_fini_statfs_set(struct lov_request_set *set)
        int rc = 0;
 
        if (set == NULL)
-               RETURN(0);
+               return 0;
 
        if (atomic_read(&set->set_completes)) {
                rc = lov_fini_statfs(set->set_obd, set->set_oi->oi_osfs,
                                     atomic_read(&set->set_success));
        }
        lov_put_reqset(set);
-       RETURN(rc);
+       return rc;
 }
 
 void lov_update_statfs(struct obd_statfs *osfs, struct obd_statfs *lov_sfs,
@@ -1456,7 +1456,7 @@ out:
                                     atomic_read(&set->set_success));
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
@@ -1468,7 +1468,7 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
 
        OBD_ALLOC(set, sizeof(*set));
        if (set == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lov_init_set(set);
 
        set->set_obd = obd;
@@ -1511,8 +1511,8 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
        if (!set->set_count)
                GOTO(out_set, rc = -EIO);
        *reqset = set;
-       RETURN(rc);
+       return rc;
 out_set:
        lov_fini_statfs_set(set);
-       RETURN(rc);
+       return rc;
 }
index 67cb287031fce106c54c8c6c9d704ed40ae89b61..998ea1cbc7bb45f8988066fffd74149be5d7d0e8 100644 (file)
@@ -103,13 +103,13 @@ static int lovsub_device_init(const struct lu_env *env, struct lu_device *d,
        rc = ldt->ldt_ops->ldto_device_init(env, next, ldt->ldt_name, NULL);
        if (rc) {
                next->ld_site = NULL;
-               RETURN(rc);
+               return rc;
        }
 
        lu_device_get(next);
        lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init);
        lsd->acid_next = lu2cl_dev(next);
-       RETURN(rc);
+       return rc;
 }
 
 static struct lu_device *lovsub_device_fini(const struct lu_env *env,
@@ -122,7 +122,7 @@ static struct lu_device *lovsub_device_fini(const struct lu_env *env,
        next = cl2lu_dev(lsd->acid_next);
        lsd->acid_super = NULL;
        lsd->acid_next = NULL;
-       RETURN(next);
+       return next;
 }
 
 static struct lu_device *lovsub_device_free(const struct lu_env *env,
index 9a6b8c851a083da121537776fd21df54bfaac7fd..80305aa61712350e2fe23023470785699f8dfdbf 100644 (file)
@@ -136,7 +136,7 @@ static unsigned long lovsub_lock_weigh(const struct lu_env *env,
        } else
                dumbbell = 0;
 
-       RETURN(dumbbell);
+       return dumbbell;
 }
 
 /**
@@ -240,7 +240,7 @@ static int lovsub_lock_modify(const struct lu_env *env,
                lovsub_parent_unlock(env, lov);
                result = result ?: rc;
        }
-       RETURN(result);
+       return result;
 }
 
 static int lovsub_lock_closure(const struct lu_env *env,
@@ -263,7 +263,7 @@ static int lovsub_lock_closure(const struct lu_env *env,
                if (result != 0)
                        break;
        }
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -278,7 +278,7 @@ static int lovsub_lock_delete_one(const struct lu_env *env,
 
        parent = lov->lls_cl.cls_lock;
        if (parent->cll_error)
-               RETURN(0);
+               return 0;
 
        result = 0;
        switch (parent->cll_state) {
@@ -370,7 +370,7 @@ static int lovsub_lock_delete_one(const struct lu_env *env,
                break;
        }
 
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -460,7 +460,7 @@ int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
                result = 0;
        } else
                result = -ENOMEM;
-       RETURN(result);
+       return result;
 }
 
 /** @} lov */
index 13938c41a7288deed64bb8ad04610c4cf0314712..89760b3bf3f7aebb82793c5c7e3fce23a3d91e5f 100644 (file)
@@ -69,7 +69,7 @@ int lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
                result = 0;
        } else
                result = -ENOMEM;
-       RETURN(result);
+       return result;
 
 }
 
@@ -108,7 +108,7 @@ static int lovsub_attr_set(const struct lu_env *env, struct cl_object *obj,
        struct lov_object *lov = cl2lovsub(obj)->lso_super;
 
        lov_r0(lov)->lo_attr_valid = 0;
-       RETURN(0);
+       return 0;
 }
 
 static int lovsub_object_glimpse(const struct lu_env *env,
@@ -117,7 +117,7 @@ static int lovsub_object_glimpse(const struct lu_env *env,
 {
        struct lovsub_object *los = cl2lovsub(obj);
 
-       RETURN(cl_object_glimpse(env, &los->lso_super->lo_cl, lvb));
+       return cl_object_glimpse(env, &los->lso_super->lo_cl, lvb);
 }
 
 
@@ -158,7 +158,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env,
                obj->lo_ops = &lovsub_lu_obj_ops;
        } else
                obj = NULL;
-       RETURN(obj);
+       return obj;
 }
 
 /** @} lov */
index 3a738eca569266aaab3625729f0e61740fd96b10..3f00ce9677b773aa32db5cbe6b3f10c846746bef 100644 (file)
@@ -65,7 +65,7 @@ int lovsub_page_init(const struct lu_env *env, struct cl_object *obj,
        struct lovsub_page *lsb = cl_object_page_slice(obj, page);
 
        cl_page_slice_add(page, &lsb->lsb_cl, obj, &lovsub_page_ops);
-       RETURN(0);
+       return 0;
 }
 
 /** @} lov */
index ce71f805c6de8eb4a12ef76c5632a7f8bf2bcdba..e86df7356cb1ee141e637d29b7e503f883bdbace 100644 (file)
@@ -67,7 +67,7 @@ int fsfilt_register_ops(struct fsfilt_operations *fs_ops)
                        CERROR("different operations for type %s\n",
                               fs_ops->fs_type);
                        /* unlock fsfilt_types list */
-                       RETURN(-EEXIST);
+                       return -EEXIST;
                }
        } else {
                try_module_get(THIS_MODULE);
@@ -119,7 +119,7 @@ struct fsfilt_operations *fsfilt_get_ops(const char *type)
 
                if (rc) {
                        CERROR("Can't find %s interface\n", name);
-                       RETURN(ERR_PTR(rc < 0 ? rc : -rc));
+                       return ERR_PTR(rc < 0 ? rc : -rc);
                        /* unlock fsfilt_types list */
                }
        }
index 71f62695b926b6c6e1d640ad76674ea789e79ae5..18e1b47a1d65aaebf5c3312670e43017232780f8 100644 (file)
@@ -210,7 +210,7 @@ int lustre_rename(struct dentry *dir, struct vfsmount *mnt,
 
        dchild_old = ll_lookup_one_len(oldname, dir, strlen(oldname));
        if (IS_ERR(dchild_old))
-               RETURN(PTR_ERR(dchild_old));
+               return PTR_ERR(dchild_old);
 
        if (!dchild_old->d_inode)
                GOTO(put_old, err = -ENOENT);
@@ -225,7 +225,7 @@ int lustre_rename(struct dentry *dir, struct vfsmount *mnt,
        dput(dchild_new);
 put_old:
        dput(dchild_old);
-       RETURN(err);
+       return err;
 }
 EXPORT_SYMBOL(lustre_rename);
 
@@ -250,7 +250,7 @@ __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
        __s64 ret = 0;
 
        if (lc == NULL || header == NULL)
-               RETURN(0);
+               return 0;
 
        switch (field) {
                case LPROCFS_FIELDS_FLAGS_CONFIG:
@@ -280,7 +280,7 @@ __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
                        break;
        };
 
-       RETURN(ret);
+       return ret;
 }
 EXPORT_SYMBOL(lprocfs_read_helper);
 #endif /* LPROCFS */
index 30a8a1b2428dfb518166ea7635fe14e2f473351a..e0b8f18662530e83f8274410e20db3cb0276db57 100644 (file)
@@ -95,10 +95,10 @@ static ssize_t mdc_kuc_write(struct file *file, const char *buffer,
 
        rc = lprocfs_write_helper(buffer, count, &fd);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (fd < 0)
-               RETURN(-ERANGE);
+               return -ERANGE;
        CWARN("message to fd %d\n", fd);
 
        len = sizeof(*lh) + sizeof(*hal) + MTI_NAME_MAXLEN +
@@ -139,8 +139,8 @@ static ssize_t mdc_kuc_write(struct file *file, const char *buffer,
        }
        OBD_FREE(lh, len);
        if (rc < 0)
-               RETURN(rc);
-       RETURN(count);
+               return rc;
+       return count;
 }
 
 struct file_operations mdc_kuc_fops = {
index 4ab3b95faf8b40f89a4e647b6e3c80fe0172f2c3..b2de478036795a2b4c3607b474ab5ff397726218 100644 (file)
@@ -509,7 +509,7 @@ static int mdc_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
        client_obd_list_lock(&cli->cl_loi_list_lock);
        rc = list_empty(&mcw->mcw_entry);
        client_obd_list_unlock(&cli->cl_loi_list_lock);
-       RETURN(rc);
+       return rc;
 };
 
 /* We record requests in flight in cli->cl_r_in_flight here.
index b818cd987fa9279eb7148a3d3dc317356ecfb06a..fb5a9959bf7ac652880a6d16448310cbeef22cd7 100644 (file)
@@ -120,7 +120,7 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
                *bits = 0;
 
        if (!*lockh)
-               RETURN(0);
+               return 0;
 
        lock = ldlm_handle2lock((struct lustre_handle *)lockh);
 
@@ -143,7 +143,7 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
        unlock_res_and_lock(lock);
        LDLM_LOCK_PUT(lock);
 
-       RETURN(0);
+       return 0;
 }
 
 ldlm_mode_t mdc_lock_match(struct obd_export *exp, __u64 flags,
@@ -157,7 +157,7 @@ ldlm_mode_t mdc_lock_match(struct obd_export *exp, __u64 flags,
        fid_build_reg_res_name(fid, &res_id);
        rc = ldlm_lock_match(class_exp2obd(exp)->obd_namespace, flags,
                             &res_id, type, policy, mode, lockh, 0);
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_cancel_unused(struct obd_export *exp,
@@ -174,7 +174,7 @@ int mdc_cancel_unused(struct obd_export *exp,
        fid_build_reg_res_name(fid, &res_id);
        rc = ldlm_cli_cancel_unused_resource(obd->obd_namespace, &res_id,
                                             policy, mode, flags, opaque);
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_null_inode(struct obd_export *exp,
@@ -190,14 +190,14 @@ int mdc_null_inode(struct obd_export *exp,
 
        res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
        if(res == NULL)
-               RETURN(0);
+               return 0;
 
        lock_res(res);
        res->lr_lvb_inode = NULL;
        unlock_res(res);
 
        ldlm_resource_putref(res);
-       RETURN(0);
+       return 0;
 }
 
 /* find any ldlm lock of the inode in mdc
@@ -215,10 +215,10 @@ int mdc_find_cbdata(struct obd_export *exp,
        rc = ldlm_resource_iterate(class_exp2obd(exp)->obd_namespace, &res_id,
                                   it, data);
        if (rc == LDLM_ITER_STOP)
-               RETURN(1);
+               return 1;
        else if (rc == LDLM_ITER_CONTINUE)
-               RETURN(0);
-       RETURN(rc);
+               return 0;
+       return rc;
 }
 
 static inline void mdc_clear_replay_flag(struct ptlrpc_request *req, int rc)
@@ -307,7 +307,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
                                   &RQF_LDLM_INTENT_OPEN);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
        }
 
        /* parent capability */
@@ -359,7 +359,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_LDLM_INTENT_UNLINK);
        if (req == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@@ -368,7 +368,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
        rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* pack the intent */
@@ -383,7 +383,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
        req_capsule_set_size(&req->rq_pill, &RMF_ACL, RCL_SERVER,
                             obddev->u.cli.cl_max_mds_cookiesize);
        ptlrpc_request_set_replen(req);
-       RETURN(req);
+       return req;
 }
 
 static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
@@ -403,7 +403,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_LDLM_INTENT_GETATTR);
        if (req == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@@ -412,7 +412,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
        rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* pack the intent */
@@ -429,7 +429,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
                req_capsule_set_size(&req->rq_pill, &RMF_ACL, RCL_SERVER,
                                     sizeof(struct mdt_remote_perm));
        ptlrpc_request_set_replen(req);
-       RETURN(req);
+       return req;
 }
 
 static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
@@ -445,13 +445,13 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                &RQF_LDLM_INTENT_LAYOUT);
        if (req == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT, 0);
        rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* pack the intent */
@@ -467,7 +467,7 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
        req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
                        obd->u.cli.cl_max_mds_easize);
        ptlrpc_request_set_replen(req);
-       RETURN(req);
+       return req;
 }
 
 static struct ptlrpc_request *
@@ -478,17 +478,17 @@ mdc_enqueue_pack(struct obd_export *exp, int lvb_len)
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
        if (req == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
        ptlrpc_request_set_replen(req);
-       RETURN(req);
+       return req;
 }
 
 static int mdc_finish_enqueue(struct obd_export *exp,
@@ -567,7 +567,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                body = req_capsule_server_get(pill, &RMF_MDT_BODY);
                if (body == NULL) {
                        CERROR ("Can't swab mdt_body\n");
-                       RETURN (-EPROTO);
+                       return -EPROTO;
                }
 
                if (it_disposition(it, DISP_OPEN_OPEN) &&
@@ -593,7 +593,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                        eadata = req_capsule_server_sized_get(pill, &RMF_MDT_MD,
                                                              body->eadatasize);
                        if (eadata == NULL)
-                               RETURN(-EPROTO);
+                               return -EPROTO;
 
                        /* save lvb data and length in case this is for layout
                         * lock */
@@ -637,14 +637,14 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                        perm = req_capsule_server_swab_get(pill, &RMF_ACL,
                                                lustre_swab_mdt_remote_perm);
                        if (perm == NULL)
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                }
                if (body->valid & OBD_MD_FLMDSCAPA) {
                        struct lustre_capa *capa, *p;
 
                        capa = req_capsule_server_get(pill, &RMF_CAPA1);
                        if (capa == NULL)
-                               RETURN(-EPROTO);
+                               return -EPROTO;
 
                        if (it->it_op & IT_OPEN) {
                                /* client fid capa will be checked in replay */
@@ -658,7 +658,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 
                        capa = req_capsule_server_get(pill, &RMF_CAPA2);
                        if (capa == NULL)
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                }
        } else if (it->it_op & IT_LAYOUT) {
                /* maybe the lock was granted right away and layout
@@ -668,7 +668,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                        lvb_data = req_capsule_server_sized_get(pill,
                                                        &RMF_DLM_LVB, lvb_len);
                        if (lvb_data == NULL)
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                }
        }
 
@@ -683,7 +683,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                OBD_ALLOC_LARGE(lmm, lvb_len);
                if (lmm == NULL) {
                        LDLM_LOCK_PUT(lock);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                memcpy(lmm, lvb_data, lvb_len);
 
@@ -701,7 +701,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
        if (lock != NULL)
                LDLM_LOCK_PUT(lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* We always reserve enough space in the reply packet for a stripe MD, because
@@ -767,17 +767,17 @@ resend:
                req = mdc_enqueue_pack(exp, 0);
        } else if (it->it_op & IT_LAYOUT) {
                if (!imp_connect_lvb_type(class_exp2cliimp(exp)))
-                       RETURN(-EOPNOTSUPP);
+                       return -EOPNOTSUPP;
 
                req = mdc_intent_layout_pack(exp, it, op_data);
                lvb_type = LVB_T_LAYOUT;
        } else {
                LBUG();
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (IS_ERR(req))
-               RETURN(PTR_ERR(req));
+               return PTR_ERR(req);
 
        if (req != NULL && it && it->it_op & IT_CREAT)
                /* ask ptlrpc not to resend on EINPROGRESS since we have our own
@@ -800,7 +800,7 @@ resend:
                        mdc_put_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
                        mdc_clear_replay_flag(req, 0);
                        ptlrpc_req_finished(req);
-                       RETURN(rc);
+                       return rc;
                }
        }
 
@@ -817,7 +817,7 @@ resend:
                   current FLocks upon exit) that can't be trashed */
                if ((rc == -EINTR) || (rc == -ETIMEDOUT))
                        goto resend;
-               RETURN(rc);
+               return rc;
        }
 
        mdc_exit_request(&obddev->u.cli);
@@ -827,7 +827,7 @@ resend:
                CERROR("ldlm_cli_enqueue: %d\n", rc);
                mdc_clear_replay_flag(req, rc);
                ptlrpc_req_finished(req);
-               RETURN(rc);
+               return rc;
        }
 
        lockrep = req_capsule_server_get(&req->rq_pill, &RMF_DLM_REP);
@@ -852,7 +852,7 @@ resend:
                        goto resend;
                } else {
                        CDEBUG(D_HA, "resend cross eviction\n");
-                       RETURN(-EIO);
+                       return -EIO;
                }
        }
 
@@ -864,7 +864,7 @@ resend:
                }
                ptlrpc_req_finished(req);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_finish_intent_lock(struct obd_export *exp,
@@ -886,11 +886,11 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
                /* The server failed before it even started executing the
                 * intent, i.e. because it couldn't unpack the request. */
                LASSERT(it->d.lustre.it_status != 0);
-               RETURN(it->d.lustre.it_status);
+               return it->d.lustre.it_status;
        }
        rc = it_open_error(DISP_IT_EXECD, it);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        mdt_body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
        LASSERT(mdt_body != NULL);      /* mdc_enqueue checked */
@@ -912,13 +912,13 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
                        CDEBUG(D_DENTRY, "Found stale data "DFID"("DFID")/"DFID
                               "\n", PFID(&op_data->op_fid2),
                               PFID(&op_data->op_fid2), PFID(&mdt_body->fid1));
-                       RETURN(-ESTALE);
+                       return -ESTALE;
                }
        }
 
        rc = it_open_error(DISP_LOOKUP_EXECD, it);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        /* keep requests around for the multiple phases of the call
         * this shows the DISP_XX must guarantee we make it into the call
@@ -979,7 +979,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
        CDEBUG(D_DENTRY,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
               op_data->op_namelen, op_data->op_name, ldlm_it2str(it->it_op),
               it->d.lustre.it_status, it->d.lustre.it_disposition, rc);
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
@@ -1023,7 +1023,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
                it->d.lustre.it_lock_mode = 0;
        }
 
-       RETURN(!!mode);
+       return !!mode;
 }
 
 /*
@@ -1081,7 +1081,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                /* Only return failure if it was not GETATTR by cfid
                   (from inode_revalidate) */
                if (rc || op_data->op_namelen != 0)
-                       RETURN(rc);
+                       return rc;
        }
 
        /* lookup_it may be called only after revalidate_it has run, because
@@ -1105,13 +1105,13 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                        rc = mdc_fid_alloc(exp, &op_data->op_fid2, op_data);
                        if (rc < 0) {
                                CERROR("Can't alloc new fid, rc %d\n", rc);
-                               RETURN(rc);
+                               return rc;
                        }
                }
                rc = mdc_enqueue(exp, &einfo, it, op_data, &lockh,
                                 lmm, lmmsize, NULL, extra_lock_flags);
                if (rc < 0)
-                       RETURN(rc);
+                       return rc;
        } else if (!fid_is_sane(&op_data->op_fid2) ||
                   !(it->it_create_mode & M_CHECK_STALE)) {
                /* DISP_ENQ_COMPLETE set means there is extra reference on
@@ -1122,7 +1122,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
        }
        *reqp = it->d.lustre.it_data;
        rc = mdc_finish_intent_lock(exp, *reqp, op_data, it, &lockh);
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_intent_getattr_async_interpret(const struct lu_env *env,
@@ -1201,12 +1201,12 @@ int mdc_intent_getattr_async(struct obd_export *exp,
        fid_build_reg_res_name(&op_data->op_fid1, &res_id);
        req = mdc_intent_getattr_pack(exp, it, op_data);
        if (!req)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = mdc_enter_request(&obddev->u.cli);
        if (rc != 0) {
                ptlrpc_req_finished(req);
-               RETURN(rc);
+               return rc;
        }
 
        rc = ldlm_cli_enqueue(exp, &req, einfo, &res_id, &policy, &flags, NULL,
@@ -1214,7 +1214,7 @@ int mdc_intent_getattr_async(struct obd_export *exp,
        if (rc < 0) {
                mdc_exit_request(&obddev->u.cli);
                ptlrpc_req_finished(req);
-               RETURN(rc);
+               return rc;
        }
 
        CLASSERT(sizeof(*ga) <= sizeof(req->rq_async_args));
@@ -1226,5 +1226,5 @@ int mdc_intent_getattr_async(struct obd_export *exp,
        req->rq_interpret_reply = mdc_intent_getattr_async_interpret;
        ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
 
-       RETURN(0);
+       return 0;
 }
index be007a36f7df230cd9abee2b5d99251f208e5b0d..9f3a345f34e04579f316f52f905bc1c37d9acbc6 100644 (file)
@@ -83,13 +83,13 @@ int mdc_resource_get_unused(struct obd_export *exp, struct lu_fid *fid,
         * when we still want to cancel locks in advance and just cancel them
         * locally, without sending any RPC. */
        if (exp_connect_cancelset(exp) && !ns_connect_cancelset(ns))
-               RETURN(0);
+               return 0;
 
        fid_build_reg_res_name(fid, &res_id);
        res = ldlm_resource_get(exp->exp_obd->obd_namespace,
                                NULL, &res_id, 0, 0);
        if (res == NULL)
-               RETURN(0);
+               return 0;
        LDLM_RESOURCE_ADDREF(res);
        /* Initialize ibits lock policy. */
        policy.l_inodebits.bits = bits;
@@ -97,7 +97,7 @@ int mdc_resource_get_unused(struct obd_export *exp, struct lu_fid *fid,
                                           mode, 0, 0, NULL);
        LDLM_RESOURCE_DELREF(res);
        ldlm_resource_putref(res);
-       RETURN(count);
+       return count;
 }
 
 int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
@@ -125,7 +125,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
                                   &RQF_MDS_REINT_SETATTR);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        if ((op_data->op_flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) == 0)
@@ -138,7 +138,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
        rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        rpc_lock = obd->u.cli.cl_rpc_lock;
@@ -201,7 +201,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
                obd_mod_put(*mod);
                req->rq_commit_cb(req);
        }
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
@@ -225,7 +225,7 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
                rc = mdc_fid_alloc(exp, &op_data->op_fid2, op_data);
                if (rc < 0) {
                        CERROR("Can't alloc new fid, rc %d\n", rc);
-                       RETURN(rc);
+                       return rc;
                }
        }
 
@@ -241,7 +241,7 @@ rebuild:
                                   &RQF_MDS_REINT_CREATE_RMT_ACL);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@@ -252,7 +252,7 @@ rebuild:
        rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        /*
@@ -295,7 +295,7 @@ rebuild:
                        goto rebuild;
                } else {
                        CDEBUG(D_HA, "resend cross eviction\n");
-                       RETURN(-EIO);
+                       return -EIO;
                }
        } else if (rc == 0) {
                struct mdt_body *body;
@@ -312,7 +312,7 @@ rebuild:
        }
 
        *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
@@ -341,7 +341,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
                                   &RQF_MDS_REINT_UNLINK);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@@ -350,7 +350,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
        rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_unlink_pack(req, op_data);
@@ -366,7 +366,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
        rc = mdc_reint(req, obd->u.cli.cl_rpc_lock, LUSTRE_IMP_FULL);
        if (rc == -ERESTARTSYS)
                rc = 0;
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
@@ -391,7 +391,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_REINT_LINK);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        mdc_set_capa_size(req, &RMF_CAPA2, op_data->op_capa2);
@@ -401,7 +401,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
        rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_link_pack(req, op_data);
@@ -412,7 +412,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
        if (rc == -ERESTARTSYS)
                rc = 0;
 
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
@@ -449,7 +449,7 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
                                   &RQF_MDS_REINT_RENAME);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
@@ -460,7 +460,7 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
        rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        if (exp_connect_cancelset(exp) && req)
@@ -479,5 +479,5 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
        if (rc == -ERESTARTSYS)
                rc = 0;
 
-       RETURN(rc);
+       return rc;
 }
index 7da6eb8e8da5c87cb635940051a984db196d2378..ed3a7a05557f31c877b4d4f5baa99f835121097d 100644 (file)
@@ -69,16 +69,16 @@ int mdc_unpack_capa(struct obd_export *exp, struct ptlrpc_request *req,
        /* swabbed already in mdc_enqueue */
        capa = req_capsule_server_get(&req->rq_pill, field);
        if (capa == NULL)
-               RETURN(-EPROTO);
+               return -EPROTO;
 
        c = alloc_capa(CAPA_SITE_CLIENT);
        if (IS_ERR(c)) {
                CDEBUG(D_INFO, "alloc capa failed!\n");
-               RETURN(PTR_ERR(c));
+               return PTR_ERR(c);
        } else {
                c->c_capa = *capa;
                *oc = c;
-               RETURN(0);
+               return 0;
        }
 }
 
@@ -112,7 +112,7 @@ static int send_getstatus(struct obd_import *imp, struct lu_fid *rootfid,
        req = ptlrpc_request_alloc_pack(imp, &RQF_MDS_GETSTATUS,
                                        LUSTRE_MDS_VERSION, MDS_GETSTATUS);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_pack_body(req, NULL, NULL, 0, 0, -1, 0);
        lustre_msg_add_flags(req->rq_reqmsg, msg_flags);
@@ -173,12 +173,12 @@ static int mdc_getattr_common(struct obd_export *exp,
        /* Request message already built. */
        rc = ptlrpc_queue_wait(req);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        /* sanity check for the reply */
        body = req_capsule_server_get(pill, &RMF_MDT_BODY);
        if (body == NULL)
-               RETURN(-EPROTO);
+               return -EPROTO;
 
        CDEBUG(D_NET, "mode: %o\n", body->mode);
 
@@ -188,7 +188,7 @@ static int mdc_getattr_common(struct obd_export *exp,
                eadata = req_capsule_server_sized_get(pill, &RMF_MDT_MD,
                                                      body->eadatasize);
                if (eadata == NULL)
-                       RETURN(-EPROTO);
+                       return -EPROTO;
        }
 
        if (body->valid & OBD_MD_FLRMTPERM) {
@@ -198,17 +198,17 @@ static int mdc_getattr_common(struct obd_export *exp,
                perm = req_capsule_server_swab_get(pill, &RMF_ACL,
                                                lustre_swab_mdt_remote_perm);
                if (perm == NULL)
-                       RETURN(-EPROTO);
+                       return -EPROTO;
        }
 
        if (body->valid & OBD_MD_FLMDSCAPA) {
                struct lustre_capa *capa;
                capa = req_capsule_server_get(pill, &RMF_CAPA1);
                if (capa == NULL)
-                       RETURN(-EPROTO);
+                       return -EPROTO;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
@@ -220,19 +220,19 @@ int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
        /* Single MDS without an LMV case */
        if (op_data->op_flags & MF_GET_MDT_IDX) {
                op_data->op_mds = 0;
-               RETURN(0);
+               return 0;
        }
        *request = NULL;
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_GETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GETATTR);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@@ -252,7 +252,7 @@ int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
                ptlrpc_req_finished(req);
        else
                *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
@@ -265,7 +265,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_MDS_GETATTR_NAME);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@@ -274,7 +274,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GETATTR_NAME);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@@ -297,7 +297,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
                ptlrpc_req_finished(req);
        else
                *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_is_subdir(struct obd_export *exp,
@@ -313,7 +313,7 @@ static int mdc_is_subdir(struct obd_export *exp,
                                        &RQF_MDS_IS_SUBDIR, LUSTRE_MDS_VERSION,
                                        MDS_IS_SUBDIR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_is_subdir_pack(req, pfid, cfid, 0);
        ptlrpc_request_set_replen(req);
@@ -323,7 +323,7 @@ static int mdc_is_subdir(struct obd_export *exp,
                ptlrpc_req_finished(req);
        else
                *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
@@ -341,7 +341,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
        *request = NULL;
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), fmt);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, oc);
        if (xattr_name) {
@@ -358,7 +358,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, opcode);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        if (opcode == MDS_REINT) {
@@ -411,7 +411,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
                ptlrpc_req_finished(req);
        else
                *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
@@ -446,29 +446,29 @@ static int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md)
        int                  rc;
 
        if (!body->aclsize)
-               RETURN(0);
+               return 0;
 
        buf = req_capsule_server_sized_get(pill, &RMF_ACL, body->aclsize);
 
        if (!buf)
-               RETURN(-EPROTO);
+               return -EPROTO;
 
        acl = posix_acl_from_xattr(&init_user_ns, buf, body->aclsize);
        if (IS_ERR(acl)) {
                rc = PTR_ERR(acl);
                CERROR("convert xattr to acl: %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = posix_acl_valid(acl);
        if (rc) {
                CERROR("validate acl: %d\n", rc);
                posix_acl_release(acl);
-               RETURN(rc);
+               return rc;
        }
 
        md->posix_acl = acl;
-       RETURN(0);
+       return 0;
 }
 #else
 #define mdc_unpack_acl(req, md) 0
@@ -531,7 +531,7 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
                if (md->body->eadatasize == 0) {
                        CDEBUG(D_INFO, "OBD_MD_FLDIREA is set, "
                               "but eadatasize 0\n");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
                if (md->body->valid & OBD_MD_MEA) {
                        lmvsize = md->body->eadatasize;
@@ -617,7 +617,7 @@ out:
 
 int mdc_free_lustre_md(struct obd_export *exp, struct lustre_md *md)
 {
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -708,7 +708,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
        struct obd_import     *imp = open_req->rq_import;
 
        if (!open_req->rq_replay)
-               RETURN(0);
+               return 0;
 
        rec = req_capsule_client_get(&open_req->rq_pill, &RMF_REC_REINT);
        body = req_capsule_server_get(&open_req->rq_pill, &RMF_MDT_BODY);
@@ -723,7 +723,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
                if (mod == NULL) {
                        DEBUG_REQ(D_ERROR, open_req,
                                  "Can't allocate md_open_data");
-                       RETURN(0);
+                       return 0;
                }
 
                /**
@@ -755,7 +755,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
        }
 
        DEBUG_REQ(D_RPCTRACE, open_req, "Set up open replay data");
-       RETURN(0);
+       return 0;
 }
 
 int mdc_clear_open_replay_data(struct obd_export *exp,
@@ -768,7 +768,7 @@ int mdc_clear_open_replay_data(struct obd_export *exp,
         * lookup and ll_file_open().
         **/
        if (mod == NULL)
-               RETURN(0);
+               return 0;
 
        LASSERT(mod != LP_POISON);
 
@@ -776,7 +776,7 @@ int mdc_clear_open_replay_data(struct obd_export *exp,
        och->och_mod = NULL;
        obd_mod_put(mod);
 
-       RETURN(0);
+       return 0;
 }
 
 /* Prepares the request for the replay by the given reply */
@@ -805,14 +805,14 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
        *request = NULL;
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_CLOSE);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_CLOSE);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        /* To avoid a livelock (bug 7034), we need to send CLOSE RPCs to a
@@ -893,7 +893,7 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
        }
        *request = req;
        mdc_close_handle_reply(req, op_data, rc);
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
@@ -906,13 +906,13 @@ int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_MDS_DONE_WRITING);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_DONE_WRITING);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        if (mod != NULL) {
@@ -959,7 +959,7 @@ int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
 
        mdc_close_handle_reply(req, op_data, rc);
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -980,14 +980,14 @@ int mdc_readpage(struct obd_export *exp, struct md_op_data *op_data,
 restart_bulk:
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_READPAGE);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        req->rq_request_portal = MDS_READPAGE_PORTAL;
@@ -997,7 +997,7 @@ restart_bulk:
                                    MDS_BULK_PORTAL);
        if (desc == NULL) {
                ptlrpc_request_free(req);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        /* NB req now owns desc and will free it when it gets freed */
@@ -1013,12 +1013,12 @@ restart_bulk:
        if (rc) {
                ptlrpc_req_finished(req);
                if (rc != -ETIMEDOUT)
-                       RETURN(rc);
+                       return rc;
 
                resends++;
                if (!client_should_resend(resends, &exp->exp_obd->u.cli)) {
                        CERROR("too many resend retries, returning error\n");
-                       RETURN(-EIO);
+                       return -EIO;
                }
                lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL, NULL);
                l_wait_event(waitq, 0, &lwi);
@@ -1030,7 +1030,7 @@ restart_bulk:
                                          req->rq_bulk->bd_nob_transferred);
        if (rc < 0) {
                ptlrpc_req_finished(req);
-               RETURN(rc);
+               return rc;
        }
 
        if (req->rq_bulk->bd_nob_transferred & ~LU_PAGE_MASK) {
@@ -1038,11 +1038,11 @@ restart_bulk:
                        req->rq_bulk->bd_nob_transferred,
                        PAGE_CACHE_SIZE * op_data->op_npages);
                ptlrpc_req_finished(req);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        *request = req;
-       RETURN(0);
+       return 0;
 }
 
 static int mdc_statfs(const struct lu_env *env,
@@ -1064,7 +1064,7 @@ static int mdc_statfs(const struct lu_env *env,
                imp = class_import_get(obd->u.cli.cl_import);
        up_read(&obd->u.cli.cl_sem);
        if (!imp)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        req = ptlrpc_request_alloc_pack(imp, &RQF_MDS_STATFS,
                                        LUSTRE_MDS_VERSION, MDS_STATFS);
@@ -1106,15 +1106,15 @@ static int mdc_ioc_fid2path(struct obd_export *exp, struct getinfo_fid2path *gf)
        int rc;
 
        if (gf->gf_pathlen > PATH_MAX)
-               RETURN(-ENAMETOOLONG);
+               return -ENAMETOOLONG;
        if (gf->gf_pathlen < 2)
-               RETURN(-EOVERFLOW);
+               return -EOVERFLOW;
 
        /* Key is KEY_FID2PATH + getinfo_fid2path description */
        keylen = cfs_size_round(sizeof(KEY_FID2PATH)) + sizeof(*gf);
        OBD_ALLOC(key, keylen);
        if (key == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        memcpy(key, KEY_FID2PATH, sizeof(KEY_FID2PATH));
        memcpy(key + cfs_size_round(sizeof(KEY_FID2PATH)), gf, sizeof(*gf));
 
@@ -1218,14 +1218,14 @@ static int mdc_ioc_hsm_current_action(struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_MDS_HSM_ACTION);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_ACTION);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@@ -1282,14 +1282,14 @@ static int mdc_ioc_hsm_state_get(struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_MDS_HSM_STATE_GET);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_STATE_GET);
        if (rc != 0) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@@ -1323,14 +1323,14 @@ static int mdc_ioc_hsm_state_set(struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                   &RQF_MDS_HSM_STATE_SET);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_STATE_SET);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@@ -1375,7 +1375,7 @@ static int mdc_ioc_hsm_request(struct obd_export *exp,
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_REQUEST);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, NULL, NULL, OBD_MD_FLRMTPERM, 0, 0, 0);
@@ -1446,14 +1446,14 @@ static int changelog_kkuc_cb(const struct lu_env *env, struct llog_handle *llh,
                CERROR("%s: not a changelog rec %x/%d: rc = %d\n",
                       cs->cs_obd->obd_name, rec->cr_hdr.lrh_type,
                       rec->cr.cr_type, rc);
-               RETURN(rc);
+               return rc;
        }
 
        if (rec->cr.cr_index < cs->cs_startrec) {
                /* Skip entries earlier than what we are interested in */
                CDEBUG(D_CHANGELOG, "rec="LPU64" start="LPU64"\n",
                       rec->cr.cr_index, cs->cs_startrec);
-               RETURN(0);
+               return 0;
        }
 
        CDEBUG(D_CHANGELOG, LPU64" %02d%-5s "LPU64" 0x%x t="DFID" p="DFID
@@ -1472,7 +1472,7 @@ static int changelog_kkuc_cb(const struct lu_env *env, struct llog_handle *llh,
        rc = libcfs_kkuc_msg_put(cs->cs_fp, lh);
        CDEBUG(D_CHANGELOG, "kucmsg fp %p len %d rc %d\n", cs->cs_fp, len,rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_changelog_send_thread(void *csdata)
@@ -1576,7 +1576,7 @@ static int mdc_quotacheck(struct obd_device *unused, struct obd_export *exp,
                                        &RQF_MDS_QUOTACHECK, LUSTRE_MDS_VERSION,
                                        MDS_QUOTACHECK);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
        *body = *oqctl;
@@ -1590,7 +1590,7 @@ static int mdc_quotacheck(struct obd_device *unused, struct obd_export *exp,
        if (rc)
                cli->cl_qchk_stat = rc;
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_quota_poll_check(struct obd_export *exp,
@@ -1606,7 +1606,7 @@ static int mdc_quota_poll_check(struct obd_export *exp,
        /* the client is not the previous one */
        if (rc == CL_NOT_QUOTACHECKED)
                rc = -EINTR;
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
@@ -1620,7 +1620,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
                                        &RQF_MDS_QUOTACTL, LUSTRE_MDS_VERSION,
                                        MDS_QUOTACTL);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        oqc = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
        *oqc = *oqctl;
@@ -1642,7 +1642,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
        }
        ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_ioc_swap_layouts(struct obd_export *exp,
@@ -1670,7 +1670,7 @@ static int mdc_ioc_swap_layouts(struct obd_export *exp,
                                   &RQF_MDS_SWAP_LAYOUTS);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
@@ -1679,7 +1679,7 @@ static int mdc_ioc_swap_layouts(struct obd_export *exp,
        rc = mdc_prep_elc_req(exp, req, MDS_SWAP_LAYOUTS, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_swap_layouts_pack(req, op_data);
@@ -1815,7 +1815,7 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
                OBD_ALLOC_PTR(oqctl);
                if (!oqctl)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                QCTL_COPY(oqctl, qctl);
                rc = obd_quotactl(exp, oqctl);
@@ -1860,7 +1860,7 @@ int mdc_get_info_rpc(struct obd_export *exp,
 
        req = ptlrpc_request_alloc(imp, &RQF_MDS_GET_INFO);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req_capsule_set_size(&req->rq_pill, &RMF_GETINFO_KEY,
                             RCL_CLIENT, keylen);
@@ -1870,7 +1870,7 @@ int mdc_get_info_rpc(struct obd_export *exp,
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GET_INFO);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        tmp = req_capsule_client_get(&req->rq_pill, &RMF_GETINFO_KEY);
@@ -1895,7 +1895,7 @@ int mdc_get_info_rpc(struct obd_export *exp,
        }
        ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 static void lustre_swab_hai(struct hsm_action_item *h)
@@ -1973,14 +1973,14 @@ static int mdc_hsm_copytool_send(int len, void *val)
        if (len < sizeof(*lh) + sizeof(*hal)) {
                CERROR("Short HSM message %d < %d\n", len,
                       (int) (sizeof(*lh) + sizeof(*hal)));
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
        if (lh->kuc_magic == __swab16(KUC_MAGIC)) {
                lustre_swab_kuch(lh);
                lustre_swab_hal(hal);
        } else if (lh->kuc_magic != KUC_MAGIC) {
                CERROR("Bad magic %x!=%x\n", lh->kuc_magic, KUC_MAGIC);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        CDEBUG(D_HSM, " Received message mg=%x t=%d m=%d l=%d actions=%d "
@@ -1991,7 +1991,7 @@ static int mdc_hsm_copytool_send(int len, void *val)
        /* Broadcast to HSM listeners */
        rc = libcfs_kkuc_group_put(KUC_GRP_HSM, lh);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2036,7 +2036,7 @@ int mdc_set_info_async(const struct lu_env *env,
 
        if (KEY_IS(KEY_READ_ONLY)) {
                if (vallen != sizeof(int))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                spin_lock(&imp->imp_lock);
                if (*((int *)val)) {
@@ -2052,15 +2052,15 @@ int mdc_set_info_async(const struct lu_env *env,
 
                rc = do_set_info_async(imp, MDS_SET_INFO, LUSTRE_MDS_VERSION,
                                       keylen, key, vallen, val, set);
-               RETURN(rc);
+               return rc;
        }
        if (KEY_IS(KEY_SPTLRPC_CONF)) {
                sptlrpc_conf_client_adapt(exp->exp_obd);
-               RETURN(0);
+               return 0;
        }
        if (KEY_IS(KEY_FLUSH_CTX)) {
                sptlrpc_import_flush_my_ctx(imp);
-               RETURN(0);
+               return 0;
        }
        if (KEY_IS(KEY_MDS_CONN)) {
                /* mds-mds import */
@@ -2069,20 +2069,20 @@ int mdc_set_info_async(const struct lu_env *env,
                spin_unlock(&imp->imp_lock);
                imp->imp_client->cli_request_portal = MDS_MDS_PORTAL;
                CDEBUG(D_OTHER, "%s: timeout / 2\n", exp->exp_obd->obd_name);
-               RETURN(0);
+               return 0;
        }
        if (KEY_IS(KEY_CHANGELOG_CLEAR)) {
                rc = do_set_info_async(imp, MDS_SET_INFO, LUSTRE_MDS_VERSION,
                                       keylen, key, vallen, val, set);
-               RETURN(rc);
+               return rc;
        }
        if (KEY_IS(KEY_HSM_COPYTOOL_SEND)) {
                rc = mdc_hsm_copytool_send(vallen, val);
-               RETURN(rc);
+               return rc;
        }
 
        CERROR("Unknown key %s\n", (char *)key);
-       RETURN(-EINVAL);
+       return -EINVAL;
 }
 
 int mdc_get_info(const struct lu_env *env, struct obd_export *exp,
@@ -2095,30 +2095,30 @@ int mdc_get_info(const struct lu_env *env, struct obd_export *exp,
                int mdsize, *max_easize;
 
                if (*vallen != sizeof(int))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                mdsize = *(int*)val;
                if (mdsize > exp->exp_obd->u.cli.cl_max_mds_easize)
                        exp->exp_obd->u.cli.cl_max_mds_easize = mdsize;
                max_easize = val;
                *max_easize = exp->exp_obd->u.cli.cl_max_mds_easize;
-               RETURN(0);
+               return 0;
        } else if (KEY_IS(KEY_CONN_DATA)) {
                struct obd_import *imp = class_exp2cliimp(exp);
                struct obd_connect_data *data = val;
 
                if (*vallen != sizeof(*data))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                *data = imp->imp_connect_data;
-               RETURN(0);
+               return 0;
        } else if (KEY_IS(KEY_TGT_COUNT)) {
                *((int *)val) = 1;
-               RETURN(0);
+               return 0;
        }
 
        rc = mdc_get_info_rpc(exp, keylen, key, *vallen, val);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid,
@@ -2131,14 +2131,14 @@ static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_PIN);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, oc);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_PIN);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, fid, oc, 0, 0, -1, flags);
@@ -2167,11 +2167,11 @@ static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid,
        }
        handle->och_mod->mod_open_req = req; /* will be dropped by unpin */
 
-       RETURN(0);
+       return 0;
 
 err_out:
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle,
@@ -2184,7 +2184,7 @@ static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle,
        req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_MDS_UNPIN,
                                        LUSTRE_MDS_VERSION, MDS_UNPIN);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_MDT_BODY);
        body->handle = handle->och_fh;
@@ -2203,7 +2203,7 @@ static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle,
        ptlrpc_req_finished(handle->och_mod->mod_open_req);
 
        obd_mod_put(handle->och_mod);
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_sync(struct obd_export *exp, const struct lu_fid *fid,
@@ -2215,14 +2215,14 @@ int mdc_sync(struct obd_export *exp, const struct lu_fid *fid,
        *request = NULL;
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_SYNC);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, oc);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_SYNC);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, fid, oc, 0, 0, -1, 0);
@@ -2234,7 +2234,7 @@ int mdc_sync(struct obd_export *exp, const struct lu_fid *fid,
                ptlrpc_req_finished(req);
        else
                *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_import_event(struct obd_device *obd, struct obd_import *imp,
@@ -2287,7 +2287,7 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp,
                CERROR("Unknown import event %x\n", event);
                LBUG();
        }
-       RETURN(rc);
+       return rc;
 }
 
 int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
@@ -2296,7 +2296,7 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
        struct client_obd *cli = &exp->exp_obd->u.cli;
        struct lu_client_seq *seq = cli->cl_seq;
 
-       RETURN(seq_client_alloc_fid(NULL, seq, fid));
+       return seq_client_alloc_fid(NULL, seq, fid);
 }
 
 struct obd_uuid *mdc_get_uuid(struct obd_export *exp) {
@@ -2312,15 +2312,15 @@ struct obd_uuid *mdc_get_uuid(struct obd_export *exp) {
 static int mdc_cancel_for_recovery(struct ldlm_lock *lock)
 {
        if (lock->l_resource->lr_type != LDLM_IBITS)
-               RETURN(0);
+               return 0;
 
        /* FIXME: if we ever get into a situation where there are too many
         * opened files with open locks on a single node, then we really
         * should replay these open locks to reget it */
        if (lock->l_policy_data.l_inodebits.bits & MDS_INODELOCK_OPEN)
-               RETURN(0);
+               return 0;
 
-       RETURN(1);
+       return 1;
 }
 
 static int mdc_resource_inode_free(struct ldlm_resource *res)
@@ -2343,7 +2343,7 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 
        OBD_ALLOC(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
        if (!cli->cl_rpc_lock)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        mdc_init_rpc_lock(cli->cl_rpc_lock);
 
        ptlrpcd_addref();
@@ -2371,14 +2371,14 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
                CERROR("failed to setup llogging subsystems\n");
        }
 
-       RETURN(rc);
+       return rc;
 
 err_close_lock:
        OBD_FREE(cli->cl_close_lock, sizeof (*cli->cl_close_lock));
 err_rpc_lock:
        OBD_FREE(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
        ptlrpcd_decref();
-       RETURN(rc);
+       return rc;
 }
 
 /* Initialize the default and maximum LOV EA and cookie sizes.  This allows
@@ -2400,7 +2400,7 @@ static int mdc_init_ea_size(struct obd_export *exp, int easize,
        if (cli->cl_max_mds_cookiesize < cookiesize)
                cli->cl_max_mds_cookiesize = cookiesize;
 
-       RETURN(0);
+       return 0;
 }
 
 static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
@@ -2424,7 +2424,7 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                        CERROR("failed to cleanup llogging subsystems\n");
                break;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_cleanup(struct obd_device *obd)
@@ -2451,13 +2451,13 @@ static int mdc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
        rc = llog_setup(NULL, obd, olg, LLOG_CHANGELOG_REPL_CTXT, tgt,
                        &llog_client_ops);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        ctxt = llog_group_get_ctxt(olg, LLOG_CHANGELOG_REPL_CTXT);
        llog_initiator_connect(ctxt);
        llog_ctxt_put(ctxt);
 
-       RETURN(0);
+       return 0;
 }
 
 static int mdc_llog_finish(struct obd_device *obd, int count)
@@ -2468,7 +2468,7 @@ static int mdc_llog_finish(struct obd_device *obd, int count)
        if (ctxt)
                llog_cleanup(NULL, ctxt);
 
-       RETURN(0);
+       return 0;
 }
 
 static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf)
@@ -2503,14 +2503,14 @@ int mdc_get_remote_perm(struct obd_export *exp, const struct lu_fid *fid,
        *request = NULL;
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_GETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        mdc_set_capa_size(req, &RMF_CAPA1, oc);
 
        rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GETATTR);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        mdc_pack_body(req, fid, oc, OBD_MD_FLRMTPERM, 0, suppgid, 0);
@@ -2525,7 +2525,7 @@ int mdc_get_remote_perm(struct obd_export *exp, const struct lu_fid *fid,
                ptlrpc_req_finished(req);
        else
                *request = req;
-       RETURN(rc);
+       return rc;
 }
 
 static int mdc_interpret_renew_capa(const struct lu_env *env,
@@ -2563,7 +2563,7 @@ static int mdc_renew_capa(struct obd_export *exp, struct obd_capa *oc,
        req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_MDS_GETATTR,
                                        LUSTRE_MDS_VERSION, MDS_GETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* NB, OBD_MD_FLOSSCAPA is set here, but it doesn't necessarily mean the
         * capa to renew is oss capa.
@@ -2577,7 +2577,7 @@ static int mdc_renew_capa(struct obd_export *exp, struct obd_capa *oc,
        ra->ra_cb = cb;
        req->rq_interpret_reply = mdc_interpret_renew_capa;
        ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
-       RETURN(0);
+       return 0;
 }
 
 static int mdc_connect(const struct lu_env *env,
@@ -2671,7 +2671,7 @@ int __init mdc_init(void)
 
        rc = class_register_type(&mdc_obd_ops, &mdc_md_ops, lvars.module_vars,
                                 LUSTRE_MDC_NAME, NULL);
-       RETURN(rc);
+       return rc;
 }
 
 static void /*__exit*/ mdc_exit(void)
index 412f5882225dd3bdd0e56f019739e74e83855773..7b4947cec3a8247f77dfa4f95b664c1b4d474342 100644 (file)
@@ -72,13 +72,13 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                GOTO(err_cleanup, rc);
        }
 
-       RETURN(rc);
+       return rc;
 
 err_cleanup:
        client_obd_cleanup(obd);
 err_decref:
        ptlrpcd_decref();
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
@@ -94,7 +94,7 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                        CERROR("failed to cleanup llogging subsystems\n");
                break;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_cleanup(struct obd_device *obd)
@@ -107,7 +107,7 @@ static int mgc_cleanup(struct obd_device *obd)
        ptlrpcd_decref();
 
        rc = client_obd_cleanup(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
@@ -120,13 +120,13 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
        rc = llog_setup(NULL, obd, olg, LLOG_CONFIG_REPL_CTXT, tgt,
                        &llog_client_ops);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        ctxt = llog_group_get_ctxt(olg, LLOG_CONFIG_REPL_CTXT);
        llog_initiator_connect(ctxt);
        llog_ctxt_put(ctxt);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_llog_finish(struct obd_device *obd, int count)
@@ -138,7 +138,7 @@ static int mgc_llog_finish(struct obd_device *obd, int count)
        if (ctxt)
                llog_cleanup(NULL, ctxt);
 
-       RETURN(0);
+       return 0;
 }
 
 struct obd_ops mgc_obd_ops = {
index 99a4099e2e0f8992f09a0fe6eb500724742c3ca0..12a9ede21a8565a77e4e5f07c43041f35d4025f0 100644 (file)
@@ -121,7 +121,7 @@ static int config_log_get(struct config_llog_data *cld)
        atomic_inc(&cld->cld_refcount);
        CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname,
               atomic_read(&cld->cld_refcount));
-       RETURN(0);
+       return 0;
 }
 
 /* Drop a reference to a config log.  When no longer referenced,
@@ -180,7 +180,7 @@ struct config_llog_data *config_log_find(char *logname,
                LASSERT(found->cld_stopping == 0 || cld_is_sptlrpc(found) == 0);
        }
        spin_unlock(&config_list_lock);
-       RETURN(found);
+       return found;
 }
 
 static
@@ -198,7 +198,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
 
        OBD_ALLOC(cld, sizeof(*cld) + strlen(logname) + 1);
        if (!cld)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        strcpy(cld->cld_logname, logname);
        if (cfg)
@@ -228,7 +228,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
 
        if (rc) {
                config_log_put(cld);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        if (cld_is_sptlrpc(cld)) {
@@ -237,7 +237,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
                        CERROR("failed processing sptlrpc log: %d\n", rc);
        }
 
-       RETURN(cld);
+       return cld;
 }
 
 static struct config_llog_data *config_recover_log_add(struct obd_device *obd,
@@ -299,7 +299,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
        ptr = strrchr(logname, '-');
        if (ptr == NULL || ptr - logname > 8) {
                CERROR("logname %s is too long\n", logname);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        memcpy(seclogname, logname, ptr - logname);
@@ -311,7 +311,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
                                                CONFIG_T_SPTLRPC, NULL, NULL);
                if (IS_ERR(sptlrpc_cld)) {
                        CERROR("can't create sptlrpc log: %s\n", seclogname);
-                       RETURN(PTR_ERR(sptlrpc_cld));
+                       return PTR_ERR(sptlrpc_cld);
                }
        }
 
@@ -319,7 +319,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
        if (IS_ERR(cld)) {
                CERROR("can't create log: %s\n", logname);
                config_log_put(sptlrpc_cld);
-               RETURN(PTR_ERR(cld));
+               return PTR_ERR(cld);
        }
 
        cld->cld_sptlrpc = sptlrpc_cld;
@@ -331,12 +331,12 @@ static int config_log_add(struct obd_device *obd, char *logname,
                recover_cld = config_recover_log_add(obd, seclogname, cfg, sb);
                if (IS_ERR(recover_cld)) {
                        config_log_put(cld);
-                       RETURN(PTR_ERR(recover_cld));
+                       return PTR_ERR(recover_cld);
                }
                cld->cld_recover = recover_cld;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 DEFINE_MUTEX(llog_process_lock);
@@ -352,7 +352,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
 
        cld = config_log_find(logname, cfg);
        if (cld == NULL)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        mutex_lock(&cld->cld_lock);
        /*
@@ -366,7 +366,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
                mutex_unlock(&cld->cld_lock);
                /* drop the ref from the find */
                config_log_put(cld);
-               RETURN(rc);
+               return rc;
        }
 
        cld->cld_stopping = 1;
@@ -397,7 +397,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
 
        CDEBUG(D_MGC, "end config log %s (%d)\n", logname ? logname : "client",
               rc);
-       RETURN(rc);
+       return rc;
 }
 
 int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
@@ -421,7 +421,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
        }
        spin_unlock(&config_list_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 /* reenqueue any lost locks */
@@ -542,7 +542,7 @@ static int mgc_requeue_thread(void *data)
        complete(&rq_exit);
 
        CDEBUG(D_MGC, "Ending requeue thread\n");
-       RETURN(rc);
+       return rc;
 }
 
 /* Add a cld to the list to requeue.  Start the requeue thread if needed.
@@ -602,7 +602,7 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
                up(&cli->cl_mgc_sem);
                CERROR("%s: No fstype %s: rc = %ld\n", lsi->lsi_fstype,
                       obd->obd_name, PTR_ERR(obd->obd_fsops));
-               RETURN(PTR_ERR(obd->obd_fsops));
+               return PTR_ERR(obd->obd_fsops);
        }
 
        cli->cl_mgc_vfsmnt = mnt;
@@ -636,14 +636,14 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
                CDEBUG(D_MGC, "MGC using disk labelled=%s\n", label);
 
        /* We keep the cl_mgc_sem until mgc_fs_cleanup */
-       RETURN(0);
+       return 0;
 
 err_ops:
        fsfilt_put_ops(obd->obd_fsops);
        obd->obd_fsops = NULL;
        cli->cl_mgc_vfsmnt = NULL;
        up(&cli->cl_mgc_sem);
-       RETURN(err);
+       return err;
 }
 
 static int mgc_fs_cleanup(struct obd_device *obd)
@@ -668,7 +668,7 @@ static int mgc_fs_cleanup(struct obd_device *obd)
 
        up(&cli->cl_mgc_sem);
 
-       RETURN(rc);
+       return rc;
 }
 
 static atomic_t mgc_count = ATOMIC_INIT(0);
@@ -699,7 +699,7 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                        CERROR("failed to cleanup llogging subsystems\n");
                break;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_cleanup(struct obd_device *obd)
@@ -719,7 +719,7 @@ static int mgc_cleanup(struct obd_device *obd)
        ptlrpcd_decref();
 
        rc = client_obd_cleanup(obd);
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
@@ -760,13 +760,13 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                rc = 0;
        }
 
-       RETURN(rc);
+       return rc;
 
 err_cleanup:
        client_obd_cleanup(obd);
 err_decref:
        ptlrpcd_decref();
-       RETURN(rc);
+       return rc;
 }
 
 /* based on ll_mdc_blocking_ast */
@@ -824,7 +824,7 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                LBUG();
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Not sure where this should go... */
@@ -844,12 +844,12 @@ static int mgc_set_mgs_param(struct obd_export *exp,
                                        &RQF_MGS_SET_INFO, LUSTRE_MGS_VERSION,
                                        MGS_SET_INFO);
        if (!req)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req_msp = req_capsule_client_get(&req->rq_pill, &RMF_MGS_SEND_PARAM);
        if (!req_msp) {
                ptlrpc_req_finished(req);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        memcpy(req_msp, msp, sizeof(*req_msp));
@@ -865,7 +865,7 @@ static int mgc_set_mgs_param(struct obd_export *exp,
 
        ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Take a config lock so we can get cancel notifications */
@@ -895,7 +895,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
                                        &RQF_LDLM_ENQUEUE, LUSTRE_DLM_VERSION,
                                        LDLM_ENQUEUE);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, 0);
        ptlrpc_request_set_replen(req);
@@ -913,7 +913,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
        /* A failed enqueue should still call the mgc_blocking_ast,
           where it will be requeued if needed ("grant failed"). */
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
@@ -921,7 +921,7 @@ static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
 {
        ldlm_lock_decref(lockh, mode);
 
-       RETURN(0);
+       return 0;
 }
 
 static void mgc_notify_active(struct obd_device *unused)
@@ -947,12 +947,12 @@ static int mgc_target_register(struct obd_export *exp,
                                        &RQF_MGS_TARGET_REG, LUSTRE_MGS_VERSION,
                                        MGS_TARGET_REG);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req_mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO);
        if (!req_mti) {
                ptlrpc_req_finished(req);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        memcpy(req_mti, mti, sizeof(*req_mti));
@@ -971,7 +971,7 @@ static int mgc_target_register(struct obd_export *exp,
        }
        ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
@@ -985,7 +985,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                struct obd_import *imp = class_exp2cliimp(exp);
                int value;
                if (vallen != sizeof(int))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                value = *(int *)val;
                CDEBUG(D_MGC, "InitRecov %s %d/d%d:i%d:r%d:or%d:%s\n",
                       imp->imp_obd->obd_name, value,
@@ -996,46 +996,46 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                if ((imp->imp_state != LUSTRE_IMP_FULL &&
                     imp->imp_state != LUSTRE_IMP_NEW) || value > 1)
                        ptlrpc_reconnect_import(imp);
-               RETURN(0);
+               return 0;
        }
        /* FIXME move this to mgc_process_config */
        if (KEY_IS(KEY_REGISTER_TARGET)) {
                struct mgs_target_info *mti;
                if (vallen != sizeof(struct mgs_target_info))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                mti = (struct mgs_target_info *)val;
                CDEBUG(D_MGC, "register_target %s %#x\n",
                       mti->mti_svname, mti->mti_flags);
                rc =  mgc_target_register(exp, mti);
-               RETURN(rc);
+               return rc;
        }
        if (KEY_IS(KEY_SET_FS)) {
                struct super_block *sb = (struct super_block *)val;
                struct lustre_sb_info *lsi;
                if (vallen != sizeof(struct super_block))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                lsi = s2lsi(sb);
                rc = mgc_fs_setup(exp->exp_obd, sb, lsi->lsi_srv_mnt);
                if (rc) {
                        CERROR("set_fs got %d\n", rc);
                }
-               RETURN(rc);
+               return rc;
        }
        if (KEY_IS(KEY_CLEAR_FS)) {
                if (vallen != 0)
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                rc = mgc_fs_cleanup(exp->exp_obd);
                if (rc) {
                        CERROR("clear_fs got %d\n", rc);
                }
-               RETURN(rc);
+               return rc;
        }
        if (KEY_IS(KEY_SET_INFO)) {
                struct mgs_send_param *msp;
 
                msp = (struct mgs_send_param *)val;
                rc =  mgc_set_mgs_param(exp, msp);
-               RETURN(rc);
+               return rc;
        }
        if (KEY_IS(KEY_MGSSEC)) {
                struct client_obd     *cli = &exp->exp_obd->u.cli;
@@ -1050,7 +1050,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                 */
                if (vallen == 0) {
                        if (cli->cl_flvr_mgc.sf_rpc != SPTLRPC_FLVR_INVALID)
-                               RETURN(0);
+                               return 0;
                        val = "null";
                        vallen = 4;
                }
@@ -1059,7 +1059,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                if (rc) {
                        CERROR("invalid sptlrpc flavor %s to MGS\n",
                               (char *) val);
-                       RETURN(rc);
+                       return rc;
                }
 
                /*
@@ -1078,10 +1078,10 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                                       (char *) val, str);
                        rc = -EPERM;
                }
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_get_info(const struct lu_env *env, struct obd_export *exp,
@@ -1142,7 +1142,7 @@ static int mgc_import_event(struct obd_device *obd,
                CERROR("Unknown import event %#x\n", event);
                LBUG();
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
@@ -1166,12 +1166,12 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
        llog_initiator_connect(ctxt);
        llog_ctxt_put(ctxt);
 
-       RETURN(0);
+       return 0;
 out:
        ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
        if (ctxt)
                llog_cleanup(NULL, ctxt);
-       RETURN(rc);
+       return rc;
 }
 
 static int mgc_llog_finish(struct obd_device *obd, int count)
@@ -1185,7 +1185,7 @@ static int mgc_llog_finish(struct obd_device *obd, int count)
        ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
        if (ctxt)
                llog_cleanup(NULL, ctxt);
-       RETURN(0);
+       return 0;
 }
 
 enum {
@@ -1216,7 +1216,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 
        OBD_ALLOC(inst, PAGE_CACHE_SIZE);
        if (inst == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (!IS_SERVER(lsi)) {
                pos = snprintf(inst, PAGE_CACHE_SIZE, "%p", cfg->cfg_instance);
@@ -1230,7 +1230,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
                                        PAGE_CACHE_SIZE);
                if (rc) {
                        OBD_FREE(inst, PAGE_CACHE_SIZE);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                pos = strlen(inst);
        }
@@ -1388,7 +1388,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
        }
 
        OBD_FREE(inst, PAGE_CACHE_SIZE);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1560,7 +1560,7 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
         * read it up here.
         */
        if (cld_is_sptlrpc(cld) && local_only)
-               RETURN(0);
+               return 0;
 
        if (cld->cld_cfg.cfg_sb)
                lsi = s2lsi(cld->cld_cfg.cfg_sb);
@@ -1568,12 +1568,12 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
        ctxt = llog_get_context(mgc, LLOG_CONFIG_REPL_CTXT);
        if (!ctxt) {
                CERROR("missing llog context\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        OBD_ALLOC_PTR(saved_ctxt);
        if (saved_ctxt == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        lctxt = llog_get_context(mgc, LLOG_CONFIG_ORIG_CTXT);
 
@@ -1614,7 +1614,7 @@ out_pop:
                                          strlen("-sptlrpc"));
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /** Get a config log from the MGS and process it.
@@ -1636,7 +1636,7 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
        mutex_lock(&cld->cld_lock);
        if (cld->cld_stopping) {
                mutex_unlock(&cld->cld_lock);
-               RETURN(0);
+               return 0;
        }
 
        OBD_FAIL_TIMEOUT(OBD_FAIL_MGC_PAUSE_PROCESS_LOG, 20);
@@ -1685,7 +1685,7 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
                        CERROR("Can't drop cfg lock: %d\n", rcl);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1783,7 +1783,7 @@ static int mgc_process_config(struct obd_device *obd, obd_count len, void *buf)
        }
        }
 out:
-       RETURN(rc);
+       return rc;
 }
 
 struct obd_ops mgc_obd_ops = {
index 33bdf279868a04aaca626d0cf6956c698682cc1e..f0bb632a70aaf530847dbd433960e2f3cbdef201 100644 (file)
@@ -146,7 +146,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
        ext_acl_xattr_header *new;
 
        if (unlikely(size < 0))
-               RETURN(ERR_PTR(-EINVAL));
+               return ERR_PTR(-EINVAL);
        else if (!size)
                count = 0;
        else
@@ -154,7 +154,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
        esize = CFS_ACL_XATTR_SIZE(count, ext_acl_xattr);
        OBD_ALLOC(new, esize);
        if (unlikely(new == NULL))
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        new->a_count = cpu_to_le32(count);
        for (i = 0; i < count; i++) {
@@ -164,7 +164,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
                new->a_entries[i].e_stat = cpu_to_le32(ES_UNK);
        }
 
-       RETURN(new);
+       return new;
 }
 EXPORT_SYMBOL(lustre_posix_acl_xattr_2ext);
 
@@ -179,13 +179,13 @@ int lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
        posix_acl_xattr_header *new;
 
        if (unlikely(size < 0))
-               RETURN(-EINVAL);
+               return -EINVAL;
        else if (!size)
-               RETURN(0);
+               return 0;
 
        OBD_ALLOC(new, size);
        if (unlikely(new == NULL))
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
        count = CFS_ACL_XATTR_COUNT(size, posix_acl_xattr);
@@ -308,7 +308,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
                posix_size = CFS_ACL_XATTR_SIZE(posix_count, posix_acl_xattr);
                OBD_ALLOC(new, posix_size);
                if (unlikely(new == NULL))
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
                for (i = 0, j = 0; i < ext_count; i++) {
@@ -345,7 +345,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
                int ori_posix_count;
 
                if (unlikely(size < 0))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                else if (!size)
                        ori_posix_count = 0;
                else
@@ -356,7 +356,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
                        CFS_ACL_XATTR_SIZE(posix_count, posix_acl_xattr);
                OBD_ALLOC(new, posix_size);
                if (unlikely(new == NULL))
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
                /* 1. process the unchanged ACL entries
@@ -417,7 +417,7 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
        ext_acl_xattr_entry *ee, eae;
 
        if (unlikely(size < 0))
-               RETURN(ERR_PTR(-EINVAL));
+               return ERR_PTR(-EINVAL);
        else if (!size)
                posix_count = 0;
        else
@@ -428,7 +428,7 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
 
        OBD_ALLOC(new, ext_size);
        if (unlikely(new == NULL))
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        for (i = 0, j = 0; i < posix_count; i++) {
                lustre_posix_acl_le_to_cpu(&pae, &posix_header->a_entries[i]);
index 9c5a05b1c5071856f5ab63ea910369ff334d3608..fe3fa8ec9f24c8530e3c75f5f258720e416c6637 100644 (file)
@@ -282,7 +282,7 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
        tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
        if (IS_ERR(tfm)) {
                CERROR("failed to load transform for aes\n");
-               RETURN(PTR_ERR(tfm));
+               return PTR_ERR(tfm);
        }
 
        min = ll_crypto_tfm_alg_min_keysize(tfm);
@@ -332,7 +332,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
        tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
        if (IS_ERR(tfm)) {
                CERROR("failed to load transform for aes\n");
-               RETURN(PTR_ERR(tfm));
+               return PTR_ERR(tfm);
        }
 
        min = ll_crypto_tfm_alg_min_keysize(tfm);
index d5b0bb8bed82e75fdd78820a0f43650cd68ec5f9..42697934155493e5c1c5a79576bce699f3f1ee28 100644 (file)
@@ -172,7 +172,7 @@ static int cl_io_init0(const struct lu_env *env, struct cl_io *io,
        }
        if (result == 0)
                io->ci_state = CIS_INIT;
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -232,7 +232,7 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io *io,
                         io->u.ci_rw.crw_nonblock, io->u.ci_wr.wr_append);
        io->u.ci_rw.crw_pos    = pos;
        io->u.ci_rw.crw_count  = count;
-       RETURN(cl_io_init(env, io, iot, io->ci_obj));
+       return cl_io_init(env, io, iot, io->ci_obj);
 }
 EXPORT_SYMBOL(cl_io_rw_init);
 
@@ -335,9 +335,9 @@ int cl_queue_match(const struct list_head *queue,
 
        list_for_each_entry(scan, queue, cill_linkage) {
               if (cl_lock_descr_match(&scan->cill_descr, need))
-                      RETURN(+1);
+                      return +1;
        }
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(cl_queue_match);
 
@@ -353,9 +353,9 @@ static int cl_queue_merge(const struct list_head *queue,
               CDEBUG(D_VFSTRACE, "lock: %d: [%lu, %lu]\n",
                      scan->cill_descr.cld_mode, scan->cill_descr.cld_start,
                      scan->cill_descr.cld_end);
-              RETURN(+1);
+              return +1;
        }
-       RETURN(0);
+       return 0;
 
 }
 
@@ -394,7 +394,7 @@ static int cl_lockset_lock_one(const struct lu_env *env,
                        result = 0;
        } else
                result = PTR_ERR(lock);
-       RETURN(result);
+       return result;
 }
 
 static void cl_lock_link_fini(const struct lu_env *env, struct cl_io *io,
@@ -442,7 +442,7 @@ static int cl_lockset_lock(const struct lu_env *env, struct cl_io *io,
                                break;
                }
        }
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -476,7 +476,7 @@ int cl_io_lock(const struct lu_env *env, struct cl_io *io)
                cl_io_unlock(env, io);
        else
                io->ci_state = CIS_LOCKED;
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_lock);
 
@@ -542,7 +542,7 @@ int cl_io_iter_init(const struct lu_env *env, struct cl_io *io)
        }
        if (result == 0)
                io->ci_state = CIS_IT_STARTED;
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_iter_init);
 
@@ -605,7 +605,7 @@ int cl_io_lock_add(const struct lu_env *env, struct cl_io *io,
                list_add(&link->cill_linkage, &io->ci_lockset.cls_todo);
                result = 0;
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_lock_add);
 
@@ -634,7 +634,7 @@ int cl_io_lock_alloc_add(const struct lu_env *env, struct cl_io *io,
        } else
                result = -ENOMEM;
 
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_lock_alloc_add);
 
@@ -660,7 +660,7 @@ int cl_io_start(const struct lu_env *env, struct cl_io *io)
        }
        if (result >= 0)
                result = 0;
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_start);
 
@@ -779,7 +779,7 @@ int cl_io_read_page(const struct lu_env *env, struct cl_io *io,
         */
        cl_page_list_disown(env, io, &queue->c2_qin);
        cl_2queue_fini(env, queue);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_read_page);
 
@@ -812,7 +812,7 @@ int cl_io_prepare_write(const struct lu_env *env, struct cl_io *io,
                                break;
                }
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_prepare_write);
 
@@ -852,7 +852,7 @@ int cl_io_commit_write(const struct lu_env *env, struct cl_io *io,
                }
        }
        LINVRNT(result <= 0);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_commit_write);
 
@@ -886,7 +886,7 @@ int cl_io_submit_rw(const struct lu_env *env, struct cl_io *io,
         * If ->cio_submit() failed, no pages were sent.
         */
        LASSERT(ergo(result != 0, list_empty(&queue->c2_qout.pl_pages)));
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_io_submit_rw);
 
@@ -1011,7 +1011,7 @@ int cl_io_loop(const struct lu_env *env, struct cl_io *io)
        } while (result == 0 && io->ci_continue);
        if (result == 0)
                result = io->ci_result;
-       RETURN(result < 0 ? result : 0);
+       return result < 0 ? result : 0;
 }
 EXPORT_SYMBOL(cl_io_loop);
 
@@ -1202,7 +1202,7 @@ int cl_page_list_own(const struct lu_env *env,
                else
                        cl_page_list_del(env, plist, page);
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_page_list_own);
 
@@ -1251,7 +1251,7 @@ int cl_page_list_unmap(const struct lu_env *env, struct cl_io *io,
                if (result != 0)
                        break;
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_page_list_unmap);
 
@@ -1336,7 +1336,7 @@ struct cl_io *cl_io_top(struct cl_io *io)
 {
        while (io->ci_parent != NULL)
                io = io->ci_parent;
-       RETURN(io);
+       return io;
 }
 EXPORT_SYMBOL(cl_io_top);
 
@@ -1413,7 +1413,7 @@ static int cl_req_init(const struct lu_env *env, struct cl_req *req,
                }
                page = page->cp_child;
        } while (page != NULL && result == 0);
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -1467,7 +1467,7 @@ struct cl_req *cl_req_alloc(const struct lu_env *env, struct cl_page *page,
                }
        } else
                req = ERR_PTR(-ENOMEM);
-       RETURN(req);
+       return req;
 }
 EXPORT_SYMBOL(cl_req_alloc);
 
@@ -1549,7 +1549,7 @@ int cl_req_prep(const struct lu_env *env, struct cl_req *req)
                                break;
                }
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_req_prep);
 
@@ -1643,7 +1643,7 @@ int cl_sync_io_wait(const struct lu_env *env, struct cl_io *io,
        }
 
        POISON(anchor, 0x5a, sizeof *anchor);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(cl_sync_io_wait);
 
index 581e7da07bc591e404be441b8685e5b42c58431b..749eb082f97975b64114a00b8a1946715e664d25 100644 (file)
@@ -394,7 +394,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env *env,
                }
        } else
                lock = ERR_PTR(-ENOMEM);
-       RETURN(lock);
+       return lock;
 }
 
 /**
@@ -464,9 +464,9 @@ static int cl_lock_fits_into(const struct lu_env *env,
        list_for_each_entry(slice, &lock->cll_layers, cls_linkage) {
                if (slice->cls_ops->clo_fits_into != NULL &&
                    !slice->cls_ops->clo_fits_into(env, slice, need, io))
-                       RETURN(0);
+                       return 0;
        }
-       RETURN(1);
+       return 1;
 }
 
 static struct cl_lock *cl_lock_lookup(const struct lu_env *env,
@@ -494,10 +494,10 @@ static struct cl_lock *cl_lock_lookup(const struct lu_env *env,
                if (matched) {
                        cl_lock_get_trust(lock);
                        CS_LOCK_INC(obj, hit);
-                       RETURN(lock);
+                       return lock;
                }
        }
-       RETURN(NULL);
+       return NULL;
 }
 
 /**
@@ -549,7 +549,7 @@ static struct cl_lock *cl_lock_find(const struct lu_env *env,
                        }
                }
        }
-       RETURN(lock);
+       return lock;
 }
 
 /**
@@ -621,9 +621,9 @@ const struct cl_lock_slice *cl_lock_at(const struct cl_lock *lock,
 
        list_for_each_entry(slice, &lock->cll_layers, cls_linkage) {
                if (slice->cls_obj->co_lu.lo_dev->ld_type == dtype)
-                       RETURN(slice);
+                       return slice;
        }
-       RETURN(NULL);
+       return NULL;
 }
 EXPORT_SYMBOL(cl_lock_at);
 
@@ -703,7 +703,7 @@ int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock)
                cl_lock_mutex_tail(env, lock);
        } else
                result = -EBUSY;
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_lock_mutex_try);
 
@@ -955,7 +955,7 @@ int cl_lock_state_wait(const struct lu_env *env, struct cl_lock *lock)
                /* Restore old blocked signals */
                cfs_restore_sigs(blocked);
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_lock_state_wait);
 
@@ -1061,7 +1061,7 @@ int cl_use_try(const struct lu_env *env, struct cl_lock *lock, int atomic)
 
        LASSERT(lock->cll_state == CLS_CACHED);
        if (lock->cll_error)
-               RETURN(lock->cll_error);
+               return lock->cll_error;
 
        result = -ENOSYS;
        state = cl_lock_intransit(env, lock);
@@ -1101,7 +1101,7 @@ int cl_use_try(const struct lu_env *env, struct cl_lock *lock, int atomic)
 
        }
        cl_lock_extransit(env, lock, state);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_use_try);
 
@@ -1126,7 +1126,7 @@ static int cl_enqueue_kick(const struct lu_env *env,
                }
        }
        LASSERT(result != -ENOSYS);
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -1189,7 +1189,7 @@ int cl_enqueue_try(const struct lu_env *env, struct cl_lock *lock,
                        LBUG();
                }
        } while (result == CLO_REPEAT);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_enqueue_try);
 
@@ -1234,7 +1234,7 @@ int cl_lock_enqueue_wait(const struct lu_env *env,
                cl_lock_mutex_get(env, lock);
 
        LASSERT(rc <= 0);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(cl_lock_enqueue_wait);
 
@@ -1265,7 +1265,7 @@ static int cl_enqueue_locked(const struct lu_env *env, struct cl_lock *lock,
        LASSERT(ergo(result == 0 && !(enqflags & CEF_AGL),
                     lock->cll_state == CLS_ENQUEUED ||
                     lock->cll_state == CLS_HELD));
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -1290,7 +1290,7 @@ int cl_enqueue(const struct lu_env *env, struct cl_lock *lock,
                cl_lock_lockdep_release(env, lock);
        LASSERT(ergo(result == 0, lock->cll_state == CLS_ENQUEUED ||
                     lock->cll_state == CLS_HELD));
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_enqueue);
 
@@ -1315,14 +1315,14 @@ int cl_unuse_try(const struct lu_env *env, struct cl_lock *lock)
 
        if (lock->cll_users > 1) {
                cl_lock_user_del(env, lock);
-               RETURN(0);
+               return 0;
        }
 
        /* Only if the lock is in CLS_HELD or CLS_ENQUEUED state, it can hold
         * underlying resources. */
        if (!(lock->cll_state == CLS_HELD || lock->cll_state == CLS_ENQUEUED)) {
                cl_lock_user_del(env, lock);
-               RETURN(0);
+               return 0;
        }
 
        /*
@@ -1368,7 +1368,7 @@ int cl_unuse_try(const struct lu_env *env, struct cl_lock *lock)
                state = CLS_NEW;
                cl_lock_extransit(env, lock, state);
        }
-       RETURN(result ?: lock->cll_error);
+       return result ?: lock->cll_error;
 }
 EXPORT_SYMBOL(cl_unuse_try);
 
@@ -1447,7 +1447,7 @@ int cl_wait_try(const struct lu_env *env, struct cl_lock *lock)
                        cl_lock_state_set(env, lock, CLS_HELD);
                }
        } while (result == CLO_REPEAT);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_wait_try);
 
@@ -1487,7 +1487,7 @@ int cl_wait(const struct lu_env *env, struct cl_lock *lock)
        cl_lock_trace(D_DLMTRACE, env, "wait lock", lock);
        cl_lock_mutex_put(env, lock);
        LASSERT(ergo(result == 0, lock->cll_state == CLS_HELD));
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_wait);
 
@@ -1513,7 +1513,7 @@ unsigned long cl_lock_weigh(const struct lu_env *env, struct cl_lock *lock)
                                pound = ~0UL;
                }
        }
-       RETURN(pound);
+       return pound;
 }
 EXPORT_SYMBOL(cl_lock_weigh);
 
@@ -1545,7 +1545,7 @@ int cl_lock_modify(const struct lu_env *env, struct cl_lock *lock,
                if (slice->cls_ops->clo_modify != NULL) {
                        result = slice->cls_ops->clo_modify(env, slice, desc);
                        if (result != 0)
-                               RETURN(result);
+                               return result;
                }
        }
        CL_LOCK_DEBUG(D_DLMTRACE, env, lock, " -> "DDESCR"@"DFID"\n",
@@ -1558,7 +1558,7 @@ int cl_lock_modify(const struct lu_env *env, struct cl_lock *lock,
        spin_lock(&hdr->coh_lock_guard);
        lock->cll_descr = *desc;
        spin_unlock(&hdr->coh_lock_guard);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(cl_lock_modify);
 
@@ -1613,7 +1613,7 @@ int cl_lock_closure_build(const struct lu_env *env, struct cl_lock *lock,
        }
        if (result != 0)
                cl_lock_disclosure(env, closure);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_lock_closure_build);
 
@@ -1660,7 +1660,7 @@ int cl_lock_enclosure(const struct lu_env *env, struct cl_lock *lock,
                }
                result = CLO_REPEAT;
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_lock_enclosure);
 
@@ -1824,7 +1824,7 @@ struct cl_lock *cl_lock_at_pgoff(const struct lu_env *env,
                }
        }
        spin_unlock(&head->coh_lock_guard);
-       RETURN(lock);
+       return lock;
 }
 EXPORT_SYMBOL(cl_lock_at_pgoff);
 
@@ -1946,7 +1946,7 @@ int cl_lock_discard_pages(const struct lu_env *env, struct cl_lock *lock)
        } while (res != CLP_GANG_OKAY);
 out:
        cl_io_fini(env, io);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_lock_discard_pages);
 
@@ -2028,7 +2028,7 @@ static struct cl_lock *cl_lock_hold_mutex(const struct lu_env *env,
                cl_lock_mutex_put(env, lock);
                cl_lock_put(env, lock);
        }
-       RETURN(lock);
+       return lock;
 }
 
 /**
@@ -2047,7 +2047,7 @@ struct cl_lock *cl_lock_hold(const struct lu_env *env, const struct cl_io *io,
        lock = cl_lock_hold_mutex(env, io, need, scope, source);
        if (!IS_ERR(lock))
                cl_lock_mutex_put(env, lock);
-       RETURN(lock);
+       return lock;
 }
 EXPORT_SYMBOL(cl_lock_hold);
 
@@ -2094,7 +2094,7 @@ struct cl_lock *cl_lock_request(const struct lu_env *env, struct cl_io *io,
                        lock = ERR_PTR(rc);
                }
        } while (rc == 0);
-       RETURN(lock);
+       return lock;
 }
 EXPORT_SYMBOL(cl_lock_request);
 
index ea1758065c62b692feaa05d7925b8ed2c47142fe..7b0e9d26b6c10aa1ad30509eb5c13e9c5b7b6c66 100644 (file)
@@ -93,7 +93,7 @@ int cl_object_header_init(struct cl_object_header *h)
                INIT_LIST_HEAD(&h->coh_locks);
                h->coh_page_bufsize = ALIGN(sizeof(struct cl_page), 8);
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_object_header_init);
 
@@ -234,7 +234,7 @@ int cl_object_attr_get(const struct lu_env *env, struct cl_object *obj,
                        }
                }
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_object_attr_get);
 
@@ -266,7 +266,7 @@ int cl_object_attr_set(const struct lu_env *env, struct cl_object *obj,
                        }
                }
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_object_attr_set);
 
@@ -299,7 +299,7 @@ int cl_object_glimpse(const struct lu_env *env, struct cl_object *obj,
                         "ctime: "LPU64" blocks: "LPU64"\n",
                         lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_atime,
                         lvb->lvb_ctime, lvb->lvb_blocks);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_object_glimpse);
 
@@ -321,7 +321,7 @@ int cl_conf_set(const struct lu_env *env, struct cl_object *obj,
                                break;
                }
        }
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_conf_set);
 
index 028c72028fd5f3be34b01090fc2cc2526f1c7d10..2a5ce376e577747a6f820163a1adbcefdcb1be08 100644 (file)
@@ -113,11 +113,11 @@ cl_page_at_trusted(const struct cl_page *page,
        do {
                list_for_each_entry(slice, &page->cp_layers, cpl_linkage) {
                        if (slice->cpl_obj->co_lu.lo_dev->ld_type == dtype)
-                               RETURN(slice);
+                               return slice;
                }
                page = page->cp_child;
        } while (page != NULL);
-       RETURN(NULL);
+       return NULL;
 }
 
 /**
@@ -241,7 +241,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct cl_object *obj,
        }
        if (tree_lock)
                spin_unlock(&hdr->coh_page_guard);
-       RETURN(res);
+       return res;
 }
 EXPORT_SYMBOL(cl_page_gang_lookup);
 
@@ -332,7 +332,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env *env,
        } else {
                page = ERR_PTR(-ENOMEM);
        }
-       RETURN(page);
+       return page;
 }
 
 /**
@@ -389,13 +389,13 @@ static struct cl_page *cl_page_find0(const struct lu_env *env,
 
        if (page != NULL) {
                CS_PAGE_INC(o, hit);
-               RETURN(page);
+               return page;
        }
 
        /* allocate and initialize cl_page */
        page = cl_page_alloc(env, o, idx, vmpage, type);
        if (IS_ERR(page))
-               RETURN(page);
+               return page;
 
        if (type == CPT_TRANSIENT) {
                if (parent) {
@@ -403,7 +403,7 @@ static struct cl_page *cl_page_find0(const struct lu_env *env,
                        page->cp_parent = parent;
                        parent->cp_child = page;
                }
-               RETURN(page);
+               return page;
        }
 
        /*
@@ -444,7 +444,7 @@ static struct cl_page *cl_page_find0(const struct lu_env *env,
                cl_page_delete0(env, ghost, 0);
                cl_page_free(env, ghost);
        }
-       RETURN(page);
+       return page;
 }
 
 struct cl_page *cl_page_find(const struct lu_env *env, struct cl_object *o,
@@ -627,7 +627,7 @@ struct page *cl_page_vmpage(const struct lu_env *env, struct cl_page *page)
        do {
                list_for_each_entry(slice, &page->cp_layers, cpl_linkage) {
                        if (slice->cpl_ops->cpo_vmpage != NULL)
-                               RETURN(slice->cpl_ops->cpo_vmpage(env, slice));
+                               return slice->cpl_ops->cpo_vmpage(env, slice);
                }
                page = page->cp_child;
        } while (page != NULL);
@@ -657,7 +657,7 @@ struct cl_page *cl_vmpage_page(struct page *vmpage, struct cl_object *obj)
         */
        top = (struct cl_page *)vmpage->private;
        if (top == NULL)
-               RETURN(NULL);
+               return NULL;
 
        for (page = top; page != NULL; page = page->cp_child) {
                if (cl_object_same(page->cp_obj, obj)) {
@@ -666,7 +666,7 @@ struct cl_page *cl_vmpage_page(struct page *vmpage, struct cl_object *obj)
                }
        }
        LASSERT(ergo(page, page->cp_type == CPT_CACHEABLE));
-       RETURN(page);
+       return page;
 }
 EXPORT_SYMBOL(cl_vmpage_page);
 
@@ -771,10 +771,10 @@ static int cl_page_invoke(const struct lu_env *env,
 
 {
        PINVRNT(env, page, cl_object_same(page->cp_obj, io->ci_obj));
-       RETURN(CL_PAGE_INVOKE(env, page, op,
+       return CL_PAGE_INVOKE(env, page, op,
                              (const struct lu_env *,
                               const struct cl_page_slice *, struct cl_io *),
-                             io));
+                             io);
 }
 
 static void cl_page_invoid(const struct lu_env *env,
@@ -836,7 +836,7 @@ void cl_page_disown0(const struct lu_env *env,
 int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io)
 {
        LINVRNT(cl_object_same(pg->cp_obj, io->ci_obj));
-       RETURN(pg->cp_state == CPS_OWNED && pg->cp_owner == io);
+       return pg->cp_state == CPS_OWNED && pg->cp_owner == io;
 }
 EXPORT_SYMBOL(cl_page_is_owned);
 
@@ -893,7 +893,7 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
                }
        }
        PINVRNT(env, pg, ergo(result == 0, cl_page_invariant(pg)));
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -1161,13 +1161,13 @@ int cl_page_is_vmlocked(const struct lu_env *env, const struct cl_page *pg)
         */
        result = slice->cpl_ops->cpo_is_vmlocked(env, slice);
        PASSERT(env, pg, result == -EBUSY || result == -ENODATA);
-       RETURN(result == -EBUSY);
+       return result == -EBUSY;
 }
 EXPORT_SYMBOL(cl_page_is_vmlocked);
 
 static enum cl_page_state cl_req_type_state(enum cl_req_type crt)
 {
-       RETURN(crt == CRT_WRITE ? CPS_PAGEOUT : CPS_PAGEIN);
+       return crt == CRT_WRITE ? CPS_PAGEOUT : CPS_PAGEIN;
 }
 
 static void cl_page_io_start(const struct lu_env *env,
@@ -1286,7 +1286,7 @@ int cl_page_make_ready(const struct lu_env *env, struct cl_page *pg,
        PINVRNT(env, pg, crt < CRT_NR);
 
        if (crt >= CRT_NR)
-               RETURN(-EINVAL);
+               return -EINVAL;
        result = CL_PAGE_INVOKE(env, pg, CL_PAGE_OP(io[crt].cpo_make_ready),
                                (const struct lu_env *,
                                 const struct cl_page_slice *));
@@ -1295,7 +1295,7 @@ int cl_page_make_ready(const struct lu_env *env, struct cl_page *pg,
                cl_page_io_start(env, pg, crt);
        }
        CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_page_make_ready);
 
@@ -1322,7 +1322,7 @@ int cl_page_cache_add(const struct lu_env *env, struct cl_io *io,
        PINVRNT(env, pg, cl_page_invariant(pg));
 
        if (crt >= CRT_NR)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        list_for_each_entry(scan, &pg->cp_layers, cpl_linkage) {
                if (scan->cpl_ops->io[crt].cpo_cache_add == NULL)
@@ -1333,7 +1333,7 @@ int cl_page_cache_add(const struct lu_env *env, struct cl_io *io,
                        break;
        }
        CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_page_cache_add);
 
@@ -1356,7 +1356,7 @@ int cl_page_flush(const struct lu_env *env, struct cl_io *io,
        result = cl_page_invoke(env, io, pg, CL_PAGE_OP(cpo_flush));
 
        CL_PAGE_HEADER(D_TRACE, env, pg, "%d\n", result);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_page_flush);
 
@@ -1379,7 +1379,7 @@ int cl_page_is_under_lock(const struct lu_env *env, struct cl_io *io,
                             const struct cl_page_slice *, struct cl_io *),
                            io);
        PASSERT(env, page, rc != 0);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(cl_page_is_under_lock);
 
@@ -1415,7 +1415,7 @@ int cl_pages_prune(const struct lu_env *env, struct cl_object *clobj)
        result = cl_io_init(env, io, CIT_MISC, obj);
        if (result != 0) {
                cl_io_fini(env, io);
-               RETURN(io->ci_result);
+               return io->ci_result;
        }
 
        do {
@@ -1426,7 +1426,7 @@ int cl_pages_prune(const struct lu_env *env, struct cl_object *clobj)
        } while (result != CLP_GANG_OKAY);
 
        cl_io_fini(env, io);
-       RETURN(result);
+       return result;
 }
 EXPORT_SYMBOL(cl_pages_prune);
 
index 09933b2f2aff9e5774d349ab57cb618e7335e06e..44af41278a03f7a47a9e62166caf1e612425e114 100644 (file)
@@ -116,14 +116,14 @@ int lustre_get_jobid(char *jobid)
        memset(jobid, 0, JOBSTATS_JOBID_SIZE);
        /* Jobstats isn't enabled */
        if (strcmp(obd_jobid_var, JOBSTATS_DISABLE) == 0)
-               RETURN(0);
+               return 0;
 
        /* Use process name + fsuid as jobid */
        if (strcmp(obd_jobid_var, JOBSTATS_PROCNAME_UID) == 0) {
                snprintf(jobid, JOBSTATS_JOBID_SIZE, "%s.%u",
                         current_comm(),
                         from_kuid(&init_user_ns, current_fsuid()));
-               RETURN(0);
+               return 0;
        }
 
        rc = cfs_get_environ(obd_jobid_var, jobid, &jobid_len);
@@ -150,7 +150,7 @@ int lustre_get_jobid(char *jobid)
                               obd_jobid_var, rc);
                }
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(lustre_get_jobid);
 
@@ -213,7 +213,7 @@ int class_resolve_dev_name(__u32 len, const char *name)
        rc = dev;
 
 out:
-       RETURN(rc);
+       return rc;
 }
 
 int class_handle_ioctl(unsigned int cmd, unsigned long arg)
@@ -235,7 +235,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
        CDEBUG(D_IOCTL, "cmd = %x\n", cmd);
        if (obd_ioctl_getdata(&buf, &len, (void *)arg)) {
                CERROR("OBD ioctl: data error\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        data = (struct obd_ioctl_data *)buf;
 
@@ -426,7 +426,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
  out:
        if (buf)
                obd_ioctl_freedata(buf, len);
-       RETURN(err);
+       return err;
 } /* class_handle_ioctl */
 
 extern struct miscdevice obd_psdev;
@@ -522,7 +522,7 @@ static int __init init_obdclass(void)
                                         LPROCFS_STATS_FLAG_IRQ_SAFE);
        if (obd_memory == NULL) {
                CERROR("kmalloc of 'obd_memory' failed\n");
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,
index 0d4eca7a55f521208ca24fb235c54e33820f1e04..1b164c7027b14f5f137764131e272b4240cd6c7d 100644 (file)
@@ -377,11 +377,11 @@ struct dt_object *dt_find_or_create(const struct lu_env *env,
 
        dto = dt_locate(env, dt, fid);
        if (IS_ERR(dto))
-               RETURN(dto);
+               return dto;
 
        LASSERT(dto != NULL);
        if (dt_object_exists(dto))
-               RETURN(dto);
+               return dto;
 
        th = dt_trans_create(env, dt);
        if (IS_ERR(th))
@@ -412,9 +412,9 @@ trans_stop:
 out:
        if (rc) {
                lu_object_put(env, &dto->do_lu);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
-       RETURN(dto);
+       return dto;
 }
 EXPORT_SYMBOL(dt_find_or_create);
 
@@ -765,14 +765,14 @@ int dt_index_walk(const struct lu_env *env, struct dt_object *obj,
 
        nob = rdpg->rp_count;
        if (nob <= 0)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        /* Iterate through index and fill containers from @rdpg */
        iops = &obj->do_index_ops->dio_it;
        LASSERT(iops != NULL);
        it = iops->init(env, obj, rdpg->rp_attrs, BYPASS_CAPA);
        if (IS_ERR(it))
-               RETURN(PTR_ERR(it));
+               return PTR_ERR(it);
 
        rc = iops->load(env, it, rdpg->rp_hash);
        if (rc == 0) {
@@ -826,7 +826,7 @@ int dt_index_walk(const struct lu_env *env, struct dt_object *obj,
        if (rc >= 0)
                rc = min_t(unsigned int, nlupgs * LU_PAGE_SIZE, rdpg->rp_count);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(dt_index_walk);
 
@@ -854,21 +854,21 @@ int dt_index_read(const struct lu_env *env, struct dt_device *dev,
        /* rp_count shouldn't be null and should be a multiple of the container
         * size */
        if (rdpg->rp_count <= 0 && (rdpg->rp_count & (LU_PAGE_SIZE - 1)) != 0)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        if (fid_seq(&ii->ii_fid) >= FID_SEQ_NORMAL)
                /* we don't support directory transfer via OBD_IDX_READ for the
                 * time being */
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        if (!fid_is_quota(&ii->ii_fid))
                /* block access to all local files except quota files */
-               RETURN(-EPERM);
+               return -EPERM;
 
        /* lookup index object subject to the transfer */
        obj = dt_locate(env, dev, &ii->ii_fid);
        if (IS_ERR(obj))
-               RETURN(PTR_ERR(obj));
+               return PTR_ERR(obj);
        if (dt_object_exists(obj) == 0)
                GOTO(out, rc = -ENOENT);
 
index c9180656dfd4125b49fce0612bcd02b07b0778f2..bba1b35360d0f81e4a242940ec5e0e788d9a7adb 100644 (file)
@@ -169,13 +169,13 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
 
        if (class_search_type(name)) {
                CDEBUG(D_IOCTL, "Type %s already registered\n", name);
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
 
        rc = -ENOMEM;
        OBD_ALLOC(type, sizeof(*type));
        if (type == NULL)
-               RETURN(rc);
+               return rc;
 
        OBD_ALLOC_PTR(type->typ_dt_ops);
        OBD_ALLOC_PTR(type->typ_md_ops);
@@ -213,7 +213,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
        list_add(&type->typ_chain, &obd_types);
        spin_unlock(&obd_types_lock);
 
-       RETURN (0);
+       return 0;
 
  failed:
        if (type->typ_name != NULL)
@@ -223,7 +223,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
        if (type->typ_dt_ops != NULL)
                OBD_FREE_PTR(type->typ_dt_ops);
        OBD_FREE(type, sizeof(*type));
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_register_type);
 
@@ -233,7 +233,7 @@ int class_unregister_type(const char *name)
 
        if (!type) {
                CERROR("unknown obd type\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (type->typ_refcnt) {
@@ -242,7 +242,7 @@ int class_unregister_type(const char *name)
                /* Remove ops, but leave the name for debugging */
                OBD_FREE_PTR(type->typ_dt_ops);
                OBD_FREE_PTR(type->typ_md_ops);
-               RETURN(-EBUSY);
+               return -EBUSY;
        }
 
        if (type->typ_procroot) {
@@ -261,7 +261,7 @@ int class_unregister_type(const char *name)
        if (type->typ_md_ops != NULL)
                OBD_FREE_PTR(type->typ_md_ops);
        OBD_FREE(type, sizeof(*type));
-       RETURN(0);
+       return 0;
 } /* class_unregister_type */
 EXPORT_SYMBOL(class_unregister_type);
 
@@ -286,13 +286,13 @@ struct obd_device *class_newdev(const char *type_name, const char *name)
 
        if (strlen(name) >= MAX_OBD_NAME) {
                CERROR("name/uuid must be < %u bytes long\n", MAX_OBD_NAME);
-               RETURN(ERR_PTR(-EINVAL));
+               return ERR_PTR(-EINVAL);
        }
 
        type = class_get_type(type_name);
        if (type == NULL){
                CERROR("OBD: unknown type: %s\n", type_name);
-               RETURN(ERR_PTR(-ENODEV));
+               return ERR_PTR(-ENODEV);
        }
 
        newdev = obd_device_alloc();
@@ -346,7 +346,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name)
        CDEBUG(D_IOCTL, "Adding new device %s (%p)\n",
               result->obd_name, result);
 
-       RETURN(result);
+       return result;
 out:
        obd_device_free(newdev);
 out_type:
@@ -678,10 +678,10 @@ int obd_init_caches(void)
        if (!capa_cachep)
                GOTO(out, -ENOMEM);
 
-       RETURN(0);
+       return 0;
  out:
        obd_cleanup_caches();
-       RETURN(-ENOMEM);
+       return -ENOMEM;
 
 }
 
@@ -692,17 +692,17 @@ struct obd_export *class_conn2export(struct lustre_handle *conn)
 
        if (!conn) {
                CDEBUG(D_CACHE, "looking for null handle\n");
-               RETURN(NULL);
+               return NULL;
        }
 
        if (conn->cookie == -1) {  /* this means assign a new connection */
                CDEBUG(D_CACHE, "want a new connection\n");
-               RETURN(NULL);
+               return NULL;
        }
 
        CDEBUG(D_INFO, "looking for export cookie "LPX64"\n", conn->cookie);
        export = class_handle2object(conn->cookie);
-       RETURN(export);
+       return export;
 }
 EXPORT_SYMBOL(class_conn2export);
 
@@ -888,7 +888,7 @@ struct obd_export *class_new_export(struct obd_device *obd,
        export->exp_obd->obd_num_exports++;
        spin_unlock(&obd->obd_dev_lock);
        cfs_hash_putref(hash);
-       RETURN(export);
+       return export;
 
 exit_unlock:
        spin_unlock(&obd->obd_dev_lock);
@@ -1107,14 +1107,14 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd,
 
        export = class_new_export(obd, cluuid);
        if (IS_ERR(export))
-               RETURN(PTR_ERR(export));
+               return PTR_ERR(export);
 
        conn->cookie = export->exp_handle.h_cookie;
        class_export_put(export);
 
        CDEBUG(D_IOCTL, "connect: client %s, cookie "LPX64"\n",
               cluuid->uuid, conn->cookie);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(class_connect);
 
@@ -1173,7 +1173,7 @@ int class_disconnect(struct obd_export *export)
 
        if (export == NULL) {
                CWARN("attempting to free NULL export %p\n", export);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        spin_lock(&export->exp_lock);
@@ -1201,7 +1201,7 @@ int class_disconnect(struct obd_export *export)
        class_unlink_export(export);
 no_disconn:
        class_export_put(export);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(class_disconnect);
 
@@ -1622,7 +1622,7 @@ static int obd_zombie_impexp_check(void *arg)
             !test_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags);
        spin_unlock(&obd_zombie_impexp_lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1724,7 +1724,7 @@ static int obd_zombie_impexp_thread(void *unused)
 
        complete(&obd_zombie_stop);
 
-       RETURN(0);
+       return 0;
 }
 
 
@@ -1745,10 +1745,10 @@ int obd_zombie_impexp_init(void)
 
        task = kthread_run(obd_zombie_impexp_thread, NULL, "obd_zombid");
        if (IS_ERR(task))
-               RETURN(PTR_ERR(task));
+               return PTR_ERR(task);
 
        wait_for_completion(&obd_zombie_start);
-       RETURN(0);
+       return 0;
 }
 /**
  * stop destroy zombie import/export thread
index 95de95e628be11c033900300fe2086c3d89f5218..d1a57ebfda95dd79e81e5aada4cf08bc5ce54656 100644 (file)
@@ -86,23 +86,23 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
 
        err = copy_from_user(&hdr, (void *)arg, sizeof(hdr));
        if ( err )
-               RETURN(err);
+               return err;
 
        if (hdr.ioc_version != OBD_IOCTL_VERSION) {
                CERROR("Version mismatch kernel (%x) vs application (%x)\n",
                       OBD_IOCTL_VERSION, hdr.ioc_version);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (hdr.ioc_len > OBD_MAX_IOCTL_BUFFER) {
                CERROR("User buffer len %d exceeds %d max buffer\n",
                       hdr.ioc_len, OBD_MAX_IOCTL_BUFFER);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (hdr.ioc_len < sizeof(struct obd_ioctl_data)) {
                CERROR("User buffer too small for ioctl (%d)\n", hdr.ioc_len);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* When there are lots of processes calling vmalloc on multi-core
@@ -113,7 +113,7 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
        if (*buf == NULL) {
                CERROR("Cannot allocate control buffer of len %d\n",
                       hdr.ioc_len);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        *len = hdr.ioc_len;
        data = (struct obd_ioctl_data *)*buf;
@@ -121,13 +121,13 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
        err = copy_from_user(*buf, (void *)arg, hdr.ioc_len);
        if ( err ) {
                OBD_FREE_LARGE(*buf, hdr.ioc_len);
-               RETURN(err);
+               return err;
        }
 
        if (obd_ioctl_is_invalid(data)) {
                CERROR("ioctl not correctly formatted\n");
                OBD_FREE_LARGE(*buf, hdr.ioc_len);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (data->ioc_inllen1) {
@@ -168,14 +168,14 @@ EXPORT_SYMBOL(obd_ioctl_popdata);
 static int obd_class_open(struct inode * inode, struct file * file)
 {
        try_module_get(THIS_MODULE);
-       RETURN(0);
+       return 0;
 }
 
 /*  closing /dev/obd */
 static int obd_class_release(struct inode * inode, struct file * file)
 {
        module_put(THIS_MODULE);
-       RETURN(0);
+       return 0;
 }
 
 /* to control /dev/obd */
@@ -186,13 +186,13 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
 
        /* Allow non-root access for OBD_IOC_PING_TARGET - used by lfs check */
        if (!cfs_capable(CFS_CAP_SYS_ADMIN) && (cmd != OBD_IOC_PING_TARGET))
-               RETURN(err = -EACCES);
+               return err = -EACCES;
        if ((cmd & 0xffffff00) == ((int)'T') << 8) /* ignore all tty ioctls */
-               RETURN(err = -ENOTTY);
+               return err = -ENOTTY;
 
        err = class_handle_ioctl(cmd, (unsigned long)arg);
 
-       RETURN(err);
+       return err;
 }
 
 /* declare character device */
@@ -394,7 +394,7 @@ int class_procfs_init(void)
 out:
        if (rc)
                CERROR("error adding /proc/fs/lustre/devices file\n");
-       RETURN(0);
+       return 0;
 }
 
 int class_procfs_clean(void)
@@ -402,5 +402,5 @@ int class_procfs_clean(void)
        if (proc_lustre_root) {
                lprocfs_remove(&proc_lustre_root);
        }
-       RETURN(0);
+       return 0;
 }
index a154cc5e5753836eb7ebe6d57d20878434e041d3..0cb44287502b712ebe6ab6a9258790408deb4b3d 100644 (file)
@@ -117,14 +117,14 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
 
        if (index == 0) {
                CERROR("Can't cancel index 0 which is header\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        spin_lock(&loghandle->lgh_hdr_lock);
        if (!ext2_clear_bit(index, llh->llh_bitmap)) {
                spin_unlock(&loghandle->lgh_hdr_lock);
                CDEBUG(D_RPCTRACE, "Catalog index %u already clear?\n", index);
-               RETURN(-ENOENT);
+               return -ENOENT;
        }
 
        llh->llh_count--;
@@ -142,7 +142,7 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
                               loghandle->lgh_id.lgl_ogen, rc);
                        GOTO(out_err, rc);
                }
-               RETURN(1);
+               return 1;
        }
        spin_unlock(&loghandle->lgh_hdr_lock);
 
@@ -155,7 +155,7 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
                       loghandle->lgh_id.lgl_ogen, rc);
                GOTO(out_err, rc);
        }
-       RETURN(0);
+       return 0;
 out_err:
        spin_lock(&loghandle->lgh_hdr_lock);
        ext2_set_bit(index, llh->llh_bitmap);
@@ -174,10 +174,10 @@ static int llog_read_header(const struct lu_env *env,
 
        rc = llog_handle2ops(handle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (lop->lop_read_header == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        rc = lop->lop_read_header(env, handle);
        if (rc == LLOG_EEMPTY) {
@@ -209,7 +209,7 @@ int llog_init_handle(const struct lu_env *env, struct llog_handle *handle,
 
        OBD_ALLOC_PTR(llh);
        if (llh == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        handle->lgh_hdr = llh;
        /* first assign flags to use llog_client_ops */
        llh->llh_flags = flags;
@@ -261,7 +261,7 @@ out:
                OBD_FREE_PTR(llh);
                handle->lgh_hdr = NULL;
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_init_handle);
 
@@ -286,7 +286,7 @@ int llog_copy_handler(const struct lu_env *env,
               rec->lrh_index, rc, rec->lrh_len, lcfg->lcfg_command,
               lustre_cfg_string(lcfg, 0), lustre_cfg_string(lcfg, 1));
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_copy_handler);
 
@@ -308,7 +308,7 @@ static int llog_process_thread(void *arg)
        OBD_ALLOC(buf, LLOG_CHUNK_SIZE);
        if (!buf) {
                lpi->lpi_rc = -ENOMEM;
-               RETURN(0);
+               return 0;
        }
 
        if (cd != NULL) {
@@ -455,7 +455,7 @@ int llog_process_or_fork(const struct lu_env *env,
        OBD_ALLOC_PTR(lpi);
        if (lpi == NULL) {
                CERROR("cannot alloc pointer\n");
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
        lpi->lpi_loghandle = loghandle;
        lpi->lpi_cb     = cb;
@@ -473,7 +473,7 @@ int llog_process_or_fork(const struct lu_env *env,
                        CERROR("%s: cannot start thread: rc = %d\n",
                               loghandle->lgh_ctxt->loc_obd->obd_name, rc);
                        OBD_FREE_PTR(lpi);
-                       RETURN(rc);
+                       return rc;
                }
                wait_for_completion(&lpi->lpi_completion);
        } else {
@@ -482,7 +482,7 @@ int llog_process_or_fork(const struct lu_env *env,
        }
        rc = lpi->lpi_rc;
        OBD_FREE_PTR(lpi);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_process_or_fork);
 
@@ -512,7 +512,7 @@ int llog_reverse_process(const struct lu_env *env,
 
        OBD_ALLOC(buf, LLOG_CHUNK_SIZE);
        if (!buf)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (cd != NULL)
                first_index = cd->lpcd_first_idx + 1;
@@ -586,7 +586,7 @@ int llog_reverse_process(const struct lu_env *env,
 out:
        if (buf)
                OBD_FREE(buf, LLOG_CHUNK_SIZE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_reverse_process);
 
@@ -611,12 +611,12 @@ int llog_exist(struct llog_handle *loghandle)
 
        rc = llog_handle2ops(loghandle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_exist == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        rc = lop->lop_exist(loghandle);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_exist);
 
@@ -628,9 +628,9 @@ int llog_declare_create(const struct lu_env *env,
 
        rc = llog_handle2ops(loghandle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_declare_create == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
        if (!raised)
@@ -638,7 +638,7 @@ int llog_declare_create(const struct lu_env *env,
        rc = lop->lop_declare_create(env, loghandle, th);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_declare_create);
 
@@ -650,9 +650,9 @@ int llog_create(const struct lu_env *env, struct llog_handle *handle,
 
        rc = llog_handle2ops(handle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        if (lop->lop_create == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
        if (!raised)
@@ -660,7 +660,7 @@ int llog_create(const struct lu_env *env, struct llog_handle *handle,
        rc = lop->lop_create(env, handle, th);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_create);
 
@@ -674,10 +674,10 @@ int llog_declare_write_rec(const struct lu_env *env,
 
        rc = llog_handle2ops(handle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
        LASSERT(lop);
        if (lop->lop_declare_write_rec == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
        if (!raised)
@@ -685,7 +685,7 @@ int llog_declare_write_rec(const struct lu_env *env,
        rc = lop->lop_declare_write_rec(env, handle, rec, idx, th);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_declare_write_rec);
 
@@ -698,11 +698,11 @@ int llog_write_rec(const struct lu_env *env, struct llog_handle *handle,
 
        rc = llog_handle2ops(handle, &lop);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        LASSERT(lop);
        if (lop->lop_write_rec == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        if (buf)
                buflen = rec->lrh_len + sizeof(struct llog_rec_hdr) +
@@ -718,7 +718,7 @@ int llog_write_rec(const struct lu_env *env, struct llog_handle *handle,
                                buf, idx, th);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_write_rec);
 
@@ -729,7 +729,7 @@ int llog_add(const struct lu_env *env, struct llog_handle *lgh,
        int raised, rc;
 
        if (lgh->lgh_logops->lop_add == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
        if (!raised)
@@ -737,7 +737,7 @@ int llog_add(const struct lu_env *env, struct llog_handle *lgh,
        rc = lgh->lgh_logops->lop_add(env, lgh, rec, logcookies, buf, th);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_add);
 
@@ -747,7 +747,7 @@ int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh,
        int raised, rc;
 
        if (lgh->lgh_logops->lop_declare_add == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
        if (!raised)
@@ -755,7 +755,7 @@ int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh,
        rc = lgh->lgh_logops->lop_declare_add(env, lgh, rec, th);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_declare_add);
 
@@ -772,10 +772,10 @@ int llog_open_create(const struct lu_env *env, struct llog_ctxt *ctxt,
 
        rc = llog_open(env, ctxt, res, logid, name, LLOG_OPEN_NEW);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (llog_exist(*res))
-               RETURN(0);
+               return 0;
 
        if ((*res)->lgh_obj != NULL) {
                struct dt_device *d;
@@ -801,7 +801,7 @@ int llog_open_create(const struct lu_env *env, struct llog_ctxt *ctxt,
 out:
        if (rc)
                llog_close(env, *res);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_open_create);
 
@@ -816,11 +816,11 @@ int llog_erase(const struct lu_env *env, struct llog_ctxt *ctxt,
 
        /* nothing to erase */
        if (name == NULL && logid == NULL)
-               RETURN(0);
+               return 0;
 
        rc = llog_open(env, ctxt, &handle, logid, name, LLOG_OPEN_EXISTS);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        rc = llog_init_handle(env, handle, LLOG_F_IS_PLAIN, NULL);
        if (rc == 0)
@@ -829,7 +829,7 @@ int llog_erase(const struct lu_env *env, struct llog_ctxt *ctxt,
        rc2 = llog_close(env, handle);
        if (rc == 0)
                rc = rc2;
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_erase);
 
@@ -855,7 +855,7 @@ int llog_write(const struct lu_env *env, struct llog_handle *loghandle,
 
                th = dt_trans_create(env, dt);
                if (IS_ERR(th))
-                       RETURN(PTR_ERR(th));
+                       return PTR_ERR(th);
 
                rc = llog_declare_write_rec(env, loghandle, rec, idx, th);
                if (rc)
@@ -877,7 +877,7 @@ out_trans:
                                    cookiecount, buf, idx, NULL);
                up_write(&loghandle->lgh_lock);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_write);
 
@@ -893,12 +893,12 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
 
        if (ctxt->loc_logops->lop_open == NULL) {
                *lgh = NULL;
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
        }
 
        *lgh = llog_alloc_handle();
        if (*lgh == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        (*lgh)->lgh_ctxt = ctxt;
        (*lgh)->lgh_logops = ctxt->loc_logops;
 
@@ -912,7 +912,7 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
                llog_free_handle(*lgh);
                *lgh = NULL;
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_open);
 
@@ -929,6 +929,6 @@ int llog_close(const struct lu_env *env, struct llog_handle *loghandle)
        rc = lop->lop_close(env, loghandle);
 out:
        llog_handle_put(loghandle);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_close);
index 020af54e68af1813615bbca09a3a6b79e33a6143..c0f3af72574799ea72990c58db12e468beff052f 100644 (file)
@@ -76,20 +76,20 @@ static int llog_cat_new_log(const struct lu_env *env,
        /* maximum number of available slots in catlog is bitmap_size - 2 */
        if (llh->llh_cat_idx == index) {
                CERROR("no free catalog slots for log...\n");
-               RETURN(-ENOSPC);
+               return -ENOSPC;
        }
 
        if (OBD_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED))
-               RETURN(-ENOSPC);
+               return -ENOSPC;
 
        rc = llog_create(env, loghandle, th);
        /* if llog is already created, no need to initialize it */
        if (rc == -EEXIST) {
-               RETURN(0);
+               return 0;
        } else if (rc != 0) {
                CERROR("%s: can't create new plain llog in catalog: rc = %d\n",
                       loghandle->lgh_ctxt->loc_obd->obd_name, rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = llog_init_handle(env, loghandle,
@@ -133,10 +133,10 @@ static int llog_cat_new_log(const struct lu_env *env,
                GOTO(out_destroy, rc);
 
        loghandle->lgh_hdr->llh_cat_idx = index;
-       RETURN(0);
+       return 0;
 out_destroy:
        llog_destroy(env, loghandle);
-       RETURN(rc);
+       return rc;
 }
 
 /* Open an existent log handle and add it to the open list.
@@ -155,7 +155,7 @@ int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
        int                      rc = 0;
 
        if (cathandle == NULL)
-               RETURN(-EBADF);
+               return -EBADF;
 
        down_write(&cathandle->lgh_lock);
        list_for_each_entry(loghandle, &cathandle->u.chd.chd_head,
@@ -184,14 +184,14 @@ int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
                CERROR("%s: error opening log id "DOSTID":%x: rc = %d\n",
                       cathandle->lgh_ctxt->loc_obd->obd_name,
                       POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = llog_init_handle(env, loghandle, LLOG_F_IS_PLAIN, NULL);
        if (rc < 0) {
                llog_close(env, loghandle);
                loghandle = NULL;
-               RETURN(rc);
+               return rc;
        }
 
        down_write(&cathandle->lgh_lock);
@@ -240,7 +240,7 @@ int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle)
        if (cathandle->lgh_ctxt->loc_handle == cathandle)
                cathandle->lgh_ctxt->loc_handle = NULL;
        rc = llog_close(env, cathandle);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_close);
 
@@ -277,7 +277,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
                if (llh == NULL ||
                    loghandle->lgh_last_idx < LLOG_BITMAP_SIZE(llh) - 1) {
                        up_read(&cathandle->lgh_lock);
-                       RETURN(loghandle);
+                       return loghandle;
                } else {
                        up_write(&loghandle->lgh_lock);
                }
@@ -297,7 +297,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
                LASSERT(llh);
                if (loghandle->lgh_last_idx < LLOG_BITMAP_SIZE(llh) - 1) {
                        up_write(&cathandle->lgh_lock);
-                       RETURN(loghandle);
+                       return loghandle;
                } else {
                        up_write(&loghandle->lgh_lock);
                }
@@ -311,7 +311,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
        down_write_nested(&loghandle->lgh_lock, LLOGH_LOG);
        up_write(&cathandle->lgh_lock);
        LASSERT(loghandle);
-       RETURN(loghandle);
+       return loghandle;
 }
 
 /* Add a single record to the recovery log(s) using a catalog
@@ -335,7 +335,7 @@ int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
                rc = llog_cat_new_log(env, cathandle, loghandle, th);
                if (rc < 0) {
                        up_write(&loghandle->lgh_lock);
-                       RETURN(rc);
+                       return rc;
                }
        }
        /* now let's try to add the record */
@@ -353,7 +353,7 @@ int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
                        rc = llog_cat_new_log(env, cathandle, loghandle, th);
                        if (rc < 0) {
                                up_write(&loghandle->lgh_lock);
-                               RETURN(rc);
+                               return rc;
                        }
                }
                /* now let's try to add the record */
@@ -364,7 +364,7 @@ int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
                up_write(&loghandle->lgh_lock);
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_add_rec);
 
@@ -427,7 +427,7 @@ int llog_cat_declare_add_rec(const struct lu_env *env,
                llog_declare_write_rec(env, next, rec, -1, th);
        }
 out:
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_declare_add_rec);
 
@@ -450,7 +450,7 @@ int llog_cat_add(const struct lu_env *env, struct llog_handle *cathandle,
 
                th = dt_trans_create(env, dt);
                if (IS_ERR(th))
-                       RETURN(PTR_ERR(th));
+                       return PTR_ERR(th);
 
                rc = llog_cat_declare_add_rec(env, cathandle, rec, th);
                if (rc)
@@ -469,7 +469,7 @@ out_trans:
                        rc = llog_cat_add_rec(env, cathandle, rec, reccookie,
                                              buf, th);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_add);
 
@@ -521,7 +521,7 @@ int llog_cat_cancel_records(const struct lu_env *env,
                       cathandle->lgh_ctxt->loc_obd->obd_name, failed, count,
                       rc);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_cancel_records);
 
@@ -535,7 +535,7 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
 
        if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                CERROR("invalid record in catalog\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
               DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
@@ -546,12 +546,12 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
                CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
                       cat_llh->lgh_ctxt->loc_obd->obd_name,
                       POSTID(&lir->lid_id.lgl_oi), rc);
-               RETURN(rc);
+               return rc;
        }
 
        if (rec->lrh_index < d->lpd_startcat)
                /* Skip processing of the logs until startcat */
-               RETURN(0);
+               return 0;
 
        if (d->lpd_startidx > 0) {
                struct llog_process_cat_data cd;
@@ -568,7 +568,7 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
        }
        llog_handle_put(llh);
 
-       RETURN(rc);
+       return rc;
 }
 
 int llog_cat_process_or_fork(const struct lu_env *env,
@@ -597,7 +597,7 @@ int llog_cat_process_or_fork(const struct lu_env *env,
                rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb,
                                          &d, &cd, fork);
                if (rc != 0)
-                       RETURN(rc);
+                       return rc;
 
                cd.lpcd_first_idx = 0;
                cd.lpcd_last_idx = cat_llh->lgh_last_idx;
@@ -608,7 +608,7 @@ int llog_cat_process_or_fork(const struct lu_env *env,
                                          &d, NULL, fork);
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_process_or_fork);
 
@@ -631,7 +631,7 @@ static int llog_cat_reverse_process_cb(const struct lu_env *env,
 
        if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
                CERROR("invalid record in catalog\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
               DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
@@ -642,12 +642,12 @@ static int llog_cat_reverse_process_cb(const struct lu_env *env,
                CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
                       cat_llh->lgh_ctxt->loc_obd->obd_name,
                       POSTID(&lir->lid_id.lgl_oi), rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = llog_reverse_process(env, llh, d->lpd_cb, d->lpd_data, NULL);
        llog_handle_put(llh);
-       RETURN(rc);
+       return rc;
 }
 
 int llog_cat_reverse_process(const struct lu_env *env,
@@ -673,7 +673,7 @@ int llog_cat_reverse_process(const struct lu_env *env,
                                          llog_cat_reverse_process_cb,
                                          &d, &cd);
                if (rc != 0)
-                       RETURN(rc);
+                       return rc;
 
                cd.lpcd_first_idx = le32_to_cpu(llh->llh_cat_idx);
                cd.lpcd_last_idx = 0;
@@ -686,7 +686,7 @@ int llog_cat_reverse_process(const struct lu_env *env,
                                          &d, NULL);
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cat_reverse_process);
 
@@ -718,7 +718,7 @@ out:
                       POSTID(&cathandle->lgh_id.lgl_oi), llh->llh_cat_idx);
        }
 
-       RETURN(0);
+       return 0;
 }
 
 /* Cleanup deleted plain llog traces from catalog */
@@ -760,7 +760,7 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
 
        if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                CERROR("invalid record in catalog\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
@@ -776,7 +776,7 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
                        /* remove index from catalog */
                        llog_cat_cleanup(env, cathandle, NULL, rec->lrh_index);
                }
-               RETURN(rc);
+               return rc;
        }
 
        llh = loghandle->lgh_hdr;
@@ -792,7 +792,7 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
        }
        llog_handle_put(loghandle);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(cat_cancel_cb);
 
@@ -804,12 +804,12 @@ int llog_cat_init_and_process(const struct lu_env *env,
 
        rc = llog_init_handle(env, llh, LLOG_F_IS_CAT, NULL);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = llog_process_or_fork(env, llh, cat_cancel_cb, NULL, NULL, false);
        if (rc)
                CERROR("%s: llog_process() with cat_cancel_cb failed: rc = "
                       "%d\n", llh->lgh_ctxt->loc_obd->obd_name, rc);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(llog_cat_init_and_process);
index 1c83ec217ad5edd073e9c6d96f79dbb00025f920..da558a5dc92b6f19e3f6da53af74d6d0e7c1d698 100644 (file)
@@ -47,43 +47,43 @@ static int str2logid(struct llog_logid *logid, char *str, int len)
 
        start = str;
        if (*start != '#')
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        start++;
        if (start - str >= len - 1)
-               RETURN(-EINVAL);
+               return -EINVAL;
        end = strchr(start, '#');
        if (end == NULL || end == start)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        *end = '\0';
        id = simple_strtoull(start, &endp, 0);
        if (endp != end)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        start = ++end;
        if (start - str >= len - 1)
-               RETURN(-EINVAL);
+               return -EINVAL;
        end = strchr(start, '#');
        if (end == NULL || end == start)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        *end = '\0';
        seq = simple_strtoull(start, &endp, 0);
        if (endp != end)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        ostid_set_seq(&logid->lgl_oi, seq);
        ostid_set_id(&logid->lgl_oi, id);
 
        start = ++end;
        if (start - str >= len - 1)
-               RETURN(-EINVAL);
+               return -EINVAL;
        logid->lgl_ogen = simple_strtoul(start, &endp, 16);
        if (*endp != '\0')
-               RETURN(-EINVAL);
+               return -EINVAL;
 
-       RETURN(0);
+       return 0;
 }
 
 static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
@@ -103,19 +103,19 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
                        cfs_size_round(ioc_data->ioc_inllen3);
                from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
                if (*endp != '\0')
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                to = simple_strtol(ioc_data->ioc_inlbuf3, &endp, 0);
                if (*endp != '\0')
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                ioc_data->ioc_inllen1 = 0;
                out = ioc_data->ioc_bulk;
        }
 
        cur_index = rec->lrh_index;
        if (cur_index < from)
-               RETURN(0);
+               return 0;
        if (to > 0 && cur_index > to)
-               RETURN(-LLOG_EEMPTY);
+               return -LLOG_EEMPTY;
 
        if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
                struct llog_logid_rec   *lir = (struct llog_logid_rec *)rec;
@@ -128,13 +128,13 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
                                     rec->lrh_len);
                }
                if (handle->lgh_ctxt == NULL)
-                       RETURN(-EOPNOTSUPP);
+                       return -EOPNOTSUPP;
                rc = llog_cat_id2handle(env, handle, &loghandle, &lir->lid_id);
                if (rc) {
                        CDEBUG(D_IOCTL, "cannot find log #"DOSTID"#%08x\n",
                               POSTID(&lir->lid_id.lgl_oi),
                               lir->lid_id.lgl_ogen);
-                       RETURN(rc);
+                       return rc;
                }
                rc = llog_process(env, loghandle, llog_check_cb, NULL, NULL);
                llog_handle_put(loghandle);
@@ -164,10 +164,10 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
                if (remains <= 0) {
                        CERROR("%s: no space to print log records\n",
                               handle->lgh_ctxt->loc_obd->obd_name);
-                       RETURN(-LLOG_EEMPTY);
+                       return -LLOG_EEMPTY;
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
@@ -187,26 +187,26 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
                        cfs_size_round(ioc_data->ioc_inllen3);
                from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
                if (*endp != '\0')
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                to = simple_strtol(ioc_data->ioc_inlbuf3, &endp, 0);
                if (*endp != '\0')
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                out = ioc_data->ioc_bulk;
                ioc_data->ioc_inllen1 = 0;
        }
 
        cur_index = rec->lrh_index;
        if (cur_index < from)
-               RETURN(0);
+               return 0;
        if (to > 0 && cur_index > to)
-               RETURN(-LLOG_EEMPTY);
+               return -LLOG_EEMPTY;
 
        if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
                struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
 
                if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                        CERROR("invalid record in catalog\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                l = snprintf(out, remains,
@@ -218,7 +218,7 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
 
                rc = class_config_parse_rec(rec, out, remains);
                if (rc < 0)
-                       RETURN(rc);
+                       return rc;
                l = rc;
        } else {
                l = snprintf(out, remains,
@@ -229,10 +229,10 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
        remains -= l;
        if (remains <= 0) {
                CERROR("not enough space for print log records\n");
-               RETURN(-LLOG_EEMPTY);
+               return -LLOG_EEMPTY;
        }
 
-       RETURN(0);
+       return 0;
 }
 static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
                           struct llog_logid *logid)
@@ -244,7 +244,7 @@ static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
        if (rc) {
                CDEBUG(D_IOCTL, "cannot find log #"DOSTID"#%08x\n",
                       POSTID(&logid->lgl_oi), logid->lgl_ogen);
-               RETURN(-ENOENT);
+               return -ENOENT;
        }
 
        rc = llog_destroy(env, log);
@@ -255,7 +255,7 @@ static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
        llog_cat_cleanup(env, cat, log, log->u.phd.phd_cookie.lgc_index);
 out:
        llog_handle_put(log);
-       RETURN(rc);
+       return rc;
 
 }
 
@@ -266,10 +266,10 @@ static int llog_delete_cb(const struct lu_env *env, struct llog_handle *handle,
        int                      rc;
 
        if (rec->lrh_type != LLOG_LOGID_MAGIC)
-               RETURN(-EINVAL);
+               return -EINVAL;
        rc = llog_remove_log(env, handle, &lir->lid_id);
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -283,20 +283,20 @@ int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
        if (*data->ioc_inlbuf1 == '#') {
                rc = str2logid(&logid, data->ioc_inlbuf1, data->ioc_inllen1);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                rc = llog_open(env, ctxt, &handle, &logid, NULL,
                               LLOG_OPEN_EXISTS);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        } else if (*data->ioc_inlbuf1 == '$') {
                char *name = data->ioc_inlbuf1 + 1;
 
                rc = llog_open(env, ctxt, &handle, NULL, name,
                               LLOG_OPEN_EXISTS);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        } else {
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = llog_init_handle(env, handle, 0, NULL);
@@ -413,6 +413,6 @@ out_close:
                llog_cat_close(env, handle);
        else
                llog_close(env, handle);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_ioctl);
index 6543ba9b9e3db5bc564f1e1a03c5500599edb123..5385d8e658cff65b4a3c199cb51ba3691959812a 100644 (file)
@@ -85,7 +85,7 @@ static int llog_lvfs_pad(struct obd_device *obd, struct l_file *file,
        }
 
  out:
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file,
@@ -137,7 +137,7 @@ static int llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file,
        if (saved_off > file->f_pos)
                file->f_pos = saved_off;
        LASSERT(rc <= 0);
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file,
@@ -149,9 +149,9 @@ static int llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file,
        rc = fsfilt_read_record(obd, file, buf, size, &offset);
        if (rc) {
                CERROR("error reading log record: rc %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
-       RETURN(0);
+       return 0;
 }
 
 static int llog_lvfs_read_header(const struct lu_env *env,
@@ -166,7 +166,7 @@ static int llog_lvfs_read_header(const struct lu_env *env,
 
        if (i_size_read(handle->lgh_file->f_dentry->d_inode) == 0) {
                CDEBUG(D_HA, "not reading header from 0-byte log\n");
-               RETURN(LLOG_EEMPTY);
+               return LLOG_EEMPTY;
        }
 
        rc = llog_lvfs_read_blob(obd, handle->lgh_file, handle->lgh_hdr,
@@ -201,7 +201,7 @@ static int llog_lvfs_read_header(const struct lu_env *env,
        handle->lgh_last_idx = handle->lgh_hdr->llh_tail.lrt_index;
        handle->lgh_file->f_pos = i_size_read(handle->lgh_file->f_dentry->d_inode);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* returns negative in on error; 0 if success && reccookie == 0; 1 otherwise */
@@ -230,7 +230,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
        else
                rc = (reclen > LLOG_CHUNK_SIZE) ? -E2BIG : 0;
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (buf)
                /* write_blob adds header and tail to lrh_len. */
@@ -247,7 +247,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
                }
 
                if (idx && llh->llh_size && llh->llh_size != rec->lrh_len)
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                if (!ext2_test_bit(idx, llh->llh_bitmap))
                        CERROR("Modify unset record %u\n", idx);
@@ -257,7 +257,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
                rc = llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
                /* we are done if we only write the header or on error */
                if (rc || idx == 0)
-                       RETURN(rc);
+                       return rc;
 
                if (buf) {
                        /* We assume that caller has set lgh_cur_* */
@@ -271,7 +271,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
                        if (rec->lrh_index != loghandle->lgh_cur_idx) {
                                CERROR("modify idx mismatch %u/%d\n",
                                       idx, loghandle->lgh_cur_idx);
-                               RETURN(-EFAULT);
+                               return -EFAULT;
                        }
                } else {
                        /* Assumes constant lrh_len */
@@ -284,7 +284,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
                        reccookie->lgc_index = idx;
                        rc = 1;
                }
-               RETURN(rc);
+               return rc;
        }
 
        /* Make sure that records don't cross a chunk boundary, so we can
@@ -302,12 +302,12 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
                 index = loghandle->lgh_last_idx + 1;
                 rc = llog_lvfs_pad(obd, file, left, index);
                 if (rc)
-                        RETURN(rc);
+                        return rc;
                 loghandle->lgh_last_idx++; /*for pad rec*/
         }
         /* if it's the last idx in log file, then return -ENOSPC */
         if (loghandle->lgh_last_idx >= LLOG_BITMAP_SIZE(llh) - 1)
-                RETURN(-ENOSPC);
+                return -ENOSPC;
        loghandle->lgh_last_idx++;
        index = loghandle->lgh_last_idx;
        LASSERT(index < LLOG_BITMAP_SIZE(llh));
@@ -333,11 +333,11 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
 
        rc = llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = llog_lvfs_write_blob(obd, file, rec, buf, file->f_pos);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CDEBUG(D_RPCTRACE, "added record "DOSTID": idx: %u, %u \n",
               POSTID(&loghandle->lgh_id.lgl_oi), index, rec->lrh_len);
@@ -356,7 +356,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
        if (rc == 0 && rec->lrh_type == LLOG_GEN_REC)
                rc = 1;
 
-       RETURN(rc);
+       return rc;
 }
 
 /* We can skip reading at least as many log blocks as the number of
@@ -387,7 +387,7 @@ static int llog_lvfs_next_block(const struct lu_env *env,
        int rc;
 
        if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n",
               next_idx, *cur_idx, *cur_offset);
@@ -412,7 +412,7 @@ static int llog_lvfs_next_block(const struct lu_env *env,
                               POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen,
                               *cur_offset);
-                       RETURN(rc);
+                       return rc;
                }
 
                /* put number of bytes read into rc to make code simpler */
@@ -423,13 +423,13 @@ static int llog_lvfs_next_block(const struct lu_env *env,
                }
 
                if (rc == 0) /* end of file, nothing to do */
-                       RETURN(0);
+                       return 0;
 
                if (rc < sizeof(*tail)) {
                        CERROR("Invalid llog block at log id "DOSTID"/%u offset"
                               LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, *cur_offset);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                rec = buf;
@@ -454,7 +454,7 @@ static int llog_lvfs_next_block(const struct lu_env *env,
                        CERROR("Invalid llog tail at log id "DOSTID"/%u offset "
                               LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, *cur_offset);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                if (tail->lrt_index < next_idx)
                        continue;
@@ -464,11 +464,11 @@ static int llog_lvfs_next_block(const struct lu_env *env,
                if (rec->lrh_index > next_idx) {
                        CERROR("missed desired record? %u > %u\n",
                               rec->lrh_index, next_idx);
-                       RETURN(-ENOENT);
+                       return -ENOENT;
                }
-               RETURN(0);
+               return 0;
        }
-       RETURN(-EIO);
+       return -EIO;
 }
 
 static int llog_lvfs_prev_block(const struct lu_env *env,
@@ -479,7 +479,7 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
        int rc;
 
        if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        CDEBUG(D_OTHER, "looking for log index %u\n", prev_idx);
 
@@ -500,20 +500,20 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
                               POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen,
                               cur_offset);
-                       RETURN(rc);
+                       return rc;
                }
 
                /* put number of bytes read into rc to make code simpler */
                rc = cur_offset - ppos;
 
                if (rc == 0) /* end of file, nothing to do */
-                       RETURN(0);
+                       return 0;
 
                if (rc < sizeof(*tail)) {
                        CERROR("Invalid llog block at log id "DOSTID"/%u offset"
                               LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, cur_offset);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                rec = buf;
@@ -536,7 +536,7 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
                        CERROR("Invalid llog tail at log id "DOSTID"/%u offset"
                               LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, cur_offset);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                if (tail->lrt_index < prev_idx)
                        continue;
@@ -546,11 +546,11 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
                if (rec->lrh_index > prev_idx) {
                        CERROR("missed desired record? %u > %u\n",
                               rec->lrh_index, prev_idx);
-                       RETURN(-ENOENT);
+                       return -ENOENT;
                }
-               RETURN(0);
+               return 0;
        }
-       RETURN(-EIO);
+       return -EIO;
 }
 
 static struct file *llog_filp_open(char *dir, char *name, int flags, int mode)
@@ -651,12 +651,12 @@ static int llog_lvfs_open(const struct lu_env *env,  struct llog_handle *handle,
        if (open_param != LLOG_OPEN_NEW && handle->lgh_file == NULL)
                GOTO(out_name, rc = -ENOENT);
 
-       RETURN(0);
+       return 0;
 out_name:
        if (handle->lgh_name != NULL)
                OBD_FREE(handle->lgh_name, strlen(name) + 1);
 out:
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_lvfs_exist(struct llog_handle *handle)
@@ -687,7 +687,7 @@ static int llog_lvfs_create(const struct lu_env *env,
                file = llog_filp_open(MOUNT_CONFIGS_DIR, handle->lgh_name,
                                      open_flags, 0644);
                if (IS_ERR(file))
-                       RETURN(PTR_ERR(file));
+                       return PTR_ERR(file);
 
                lustre_build_llog_lvfs_oid(&handle->lgh_id,
                                file->f_dentry->d_inode->i_ino,
@@ -696,7 +696,7 @@ static int llog_lvfs_create(const struct lu_env *env,
        } else {
                OBDO_ALLOC(oa);
                if (oa == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                ostid_set_seq_llog(&oa->o_oi);
                oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
@@ -724,7 +724,7 @@ static int llog_lvfs_create(const struct lu_env *env,
 out:
                OBDO_FREE(oa);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_lvfs_close(const struct lu_env *env,
@@ -733,7 +733,7 @@ static int llog_lvfs_close(const struct lu_env *env,
        int rc;
 
        if (handle->lgh_file == NULL)
-               RETURN(0);
+               return 0;
        rc = filp_close(handle->lgh_file, 0);
        if (rc)
                CERROR("%s: error closing llog #"DOSTID"#%08x: "
@@ -745,7 +745,7 @@ static int llog_lvfs_close(const struct lu_env *env,
                OBD_FREE(handle->lgh_name, strlen(handle->lgh_name) + 1);
                handle->lgh_name = NULL;
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_lvfs_destroy(const struct lu_env *env,
@@ -780,12 +780,12 @@ static int llog_lvfs_destroy(const struct lu_env *env,
 
                dput(fdentry);
                pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-               RETURN(rc);
+               return rc;
        }
 
        OBDO_ALLOC(oa);
        if (oa == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        oa->o_oi = handle->lgh_id.lgl_oi;
        oa->o_generation = handle->lgh_id.lgl_ogen;
@@ -810,7 +810,7 @@ static int llog_lvfs_destroy(const struct lu_env *env,
                rc = rc1;
  out:
        OBDO_FREE(oa);
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_lvfs_declare_create(const struct lu_env *env,
index 7d6c94b463a375ff7c79dbf7879f2fbcedf81f30..71817af75396faf1dd26eaf7067710545b4ad7fd 100644 (file)
@@ -138,7 +138,7 @@ int llog_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
        l_wait_event(olg->olg_waitq,
                     llog_group_ctxt_null(olg, idx), &lwi);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cleanup);
 
@@ -150,13 +150,13 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
        int rc = 0;
 
        if (index < 0 || index >= LLOG_MAX_CTXTS)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        LASSERT(olg != NULL);
 
        ctxt = llog_new_ctxt(obd);
        if (!ctxt)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        ctxt->loc_obd = obd;
        ctxt->loc_olg = olg;
@@ -187,7 +187,7 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
                        }
                        rc = 0;
                }
-               RETURN(rc);
+               return rc;
        }
 
        if (op->lop_setup) {
@@ -208,7 +208,7 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
                ctxt->loc_flags &= ~LLOG_CTXT_FLAG_UNINITIALIZED;
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_setup);
 
@@ -217,12 +217,12 @@ int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags)
        int rc = 0;
 
        if (!ctxt)
-               RETURN(0);
+               return 0;
 
        if (CTXTP(ctxt, sync))
                rc = CTXTP(ctxt, sync)(ctxt, exp, flags);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_sync);
 
@@ -234,11 +234,11 @@ int llog_obd_add(const struct lu_env *env, struct llog_ctxt *ctxt,
 
        if (!ctxt) {
                CERROR("No ctxt\n");
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        if (ctxt->loc_flags & LLOG_CTXT_FLAG_UNINITIALIZED)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        CTXT_CHECK_OP(ctxt, obd_add, -EOPNOTSUPP);
        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
@@ -248,7 +248,7 @@ int llog_obd_add(const struct lu_env *env, struct llog_ctxt *ctxt,
                                  numcookies);
        if (!raised)
                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_obd_add);
 
@@ -260,12 +260,12 @@ int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
 
        if (!ctxt) {
                CERROR("No ctxt\n");
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        CTXT_CHECK_OP(ctxt, cancel, -EOPNOTSUPP);
        rc = CTXTP(ctxt, cancel)(env, ctxt, lsm, count, cookies, flags);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_cancel);
 
@@ -278,7 +278,7 @@ int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
        OBD_COUNTER_INCREMENT(obd, llog_init);
 
        rc = OBP(obd, llog_init)(obd, olg, disk_obd, index);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(obd_llog_init);
 
@@ -290,7 +290,7 @@ int obd_llog_finish(struct obd_device *obd, int count)
        OBD_COUNTER_INCREMENT(obd, llog_finish);
 
        rc = OBP(obd, llog_finish)(obd, count);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(obd_llog_finish);
 
index 7ab6f59c0dc5493c87390bb7f8aa772021c81de7..654c8e18965309bd4b8ff58472d125a35678955c 100644 (file)
@@ -120,7 +120,7 @@ static int llog_osd_pad(const struct lu_env *env, struct dt_object *o,
                       o->do_lu.lo_dev->ld_obd->obd_name, rc);
 out:
        dt_write_unlock(env, o);
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_osd_write_blob(const struct lu_env *env, struct dt_object *o,
@@ -195,7 +195,7 @@ out:
                dt_attr_set(env, o, &lgi->lgi_attr, th, BYPASS_CAPA);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_osd_read_header(const struct lu_env *env,
@@ -215,13 +215,13 @@ static int llog_osd_read_header(const struct lu_env *env,
 
        rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        LASSERT(lgi->lgi_attr.la_valid & LA_SIZE);
 
        if (lgi->lgi_attr.la_size == 0) {
                CDEBUG(D_HA, "not reading header from 0-byte log\n");
-               RETURN(LLOG_EEMPTY);
+               return LLOG_EEMPTY;
        }
 
        lgi->lgi_off = 0;
@@ -233,7 +233,7 @@ static int llog_osd_read_header(const struct lu_env *env,
                CERROR("%s: error reading log header from "DFID": rc = %d\n",
                       o->do_lu.lo_dev->ld_obd->obd_name,
                       PFID(lu_object_fid(&o->do_lu)), rc);
-               RETURN(rc);
+               return rc;
        }
 
        llh_hdr = &handle->lgh_hdr->llh_hdr;
@@ -246,7 +246,7 @@ static int llog_osd_read_header(const struct lu_env *env,
                       handle->lgh_name ? handle->lgh_name : "",
                       PFID(lu_object_fid(&o->do_lu)),
                       llh_hdr->lrh_type, LLOG_HDR_MAGIC);
-               RETURN(-EIO);
+               return -EIO;
        } else if (llh_hdr->lrh_len != LLOG_CHUNK_SIZE) {
                CERROR("%s: incorrectly sized log %s "DFID" header: "
                       "%#x (expected %#x)\n"
@@ -255,12 +255,12 @@ static int llog_osd_read_header(const struct lu_env *env,
                       handle->lgh_name ? handle->lgh_name : "",
                       PFID(lu_object_fid(&o->do_lu)),
                       llh_hdr->lrh_len, LLOG_CHUNK_SIZE);
-               RETURN(-EIO);
+               return -EIO;
        }
 
        handle->lgh_last_idx = handle->lgh_hdr->llh_tail.lrt_index;
 
-       RETURN(0);
+       return 0;
 }
 
 static int llog_osd_declare_write_rec(const struct lu_env *env,
@@ -283,18 +283,18 @@ static int llog_osd_declare_write_rec(const struct lu_env *env,
        rc = dt_declare_record_write(env, o, sizeof(struct llog_log_hdr), 0,
                                     th);
        if (rc || idx == 0) /* if error or just header */
-               RETURN(rc);
+               return rc;
 
        if (dt_object_exists(o)) {
                rc = dt_attr_get(env, o, &lgi->lgi_attr, BYPASS_CAPA);
                lgi->lgi_off = lgi->lgi_attr.la_size;
                LASSERT(ergo(rc == 0, lgi->lgi_attr.la_valid & LA_SIZE));
                if (rc)
-                       RETURN(rc);
+                       return rc;
 
                rc = dt_declare_punch(env, o, lgi->lgi_off, OBD_OBJECT_EOF, th);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        } else {
                lgi->lgi_off = 0;
        }
@@ -302,7 +302,7 @@ static int llog_osd_declare_write_rec(const struct lu_env *env,
        /* XXX: implement declared window or multi-chunks approach */
        rc = dt_declare_record_write(env, o, 32 * 1024, lgi->lgi_off, th);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* returns negative in on error; 0 if success && reccookie == 0; 1 otherwise */
@@ -338,11 +338,11 @@ static int llog_osd_write_rec(const struct lu_env *env,
        else
                rc = (reclen > LLOG_CHUNK_SIZE) ? -E2BIG : 0;
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (buf)
                /* write_blob adds header and tail to lrh_len. */
@@ -355,7 +355,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
                        LBUG();
 
                if (idx && llh->llh_size && llh->llh_size != rec->lrh_len)
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                if (!ext2_test_bit(idx, llh->llh_bitmap))
                        CERROR("%s: modify unset record %u\n",
@@ -370,7 +370,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
                                         &lgi->lgi_off, th);
                /* we are done if we only write the header or on error */
                if (rc || idx == 0)
-                       RETURN(rc);
+                       return rc;
 
                if (buf) {
                        /* We assume that caller has set lgh_cur_* */
@@ -386,7 +386,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
                                CERROR("%s: modify idx mismatch %u/%d\n",
                                       o->do_lu.lo_dev->ld_obd->obd_name, idx,
                                       loghandle->lgh_cur_idx);
-                               RETURN(-EFAULT);
+                               return -EFAULT;
                        }
                } else {
                        /* Assumes constant lrh_len */
@@ -399,7 +399,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
                        reccookie->lgc_index = idx;
                        rc = 1;
                }
-               RETURN(rc);
+               return rc;
        }
 
        /* Make sure that records don't cross a chunk boundary, so we can
@@ -418,12 +418,12 @@ static int llog_osd_write_rec(const struct lu_env *env,
                index = loghandle->lgh_last_idx + 1;
                rc = llog_osd_pad(env, o, &lgi->lgi_off, left, index, th);
                if (rc)
-                       RETURN(rc);
+                       return rc;
                loghandle->lgh_last_idx++; /*for pad rec*/
        }
        /* if it's the last idx in log file, then return -ENOSPC */
        if (loghandle->lgh_last_idx >= LLOG_BITMAP_SIZE(llh) - 1)
-               RETURN(-ENOSPC);
+               return -ENOSPC;
 
        loghandle->lgh_last_idx++;
        index = loghandle->lgh_last_idx;
@@ -495,7 +495,7 @@ out:
                        reccookie->lgc_subsys = -1;
                rc = 1;
        }
-       RETURN(rc);
+       return rc;
 }
 
 /* We can skip reading at least as many log blocks as the number of
@@ -531,7 +531,7 @@ static int llog_osd_next_block(const struct lu_env *env,
        LASSERT(lgi);
 
        if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n",
               next_idx, *cur_idx, *cur_offset);
@@ -653,7 +653,7 @@ static int llog_osd_prev_block(const struct lu_env *env,
        int                      rc;
 
        if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        CDEBUG(D_OTHER, "looking for log index %u\n", prev_idx);
 
@@ -789,7 +789,7 @@ static int llog_osd_open(const struct lu_env *env, struct llog_handle *handle,
 
        ls = ls_device_get(dt);
        if (IS_ERR(ls))
-               RETURN(PTR_ERR(ls));
+               return PTR_ERR(ls);
 
        mutex_lock(&ls->ls_los_mutex);
        los = dt_los_find(ls, name != NULL ? FID_SEQ_LLOG_NAME : FID_SEQ_LLOG);
@@ -844,7 +844,7 @@ static int llog_osd_open(const struct lu_env *env, struct llog_handle *handle,
        handle->private_data = los;
        LASSERT(handle->lgh_ctxt);
 
-       RETURN(rc);
+       return rc;
 
 out_put:
        lu_object_put(env, &o->do_lu);
@@ -853,7 +853,7 @@ out_name:
                OBD_FREE(handle->lgh_name, strlen(name) + 1);
 out:
        dt_los_put(los);
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_osd_exist(struct llog_handle *handle)
@@ -877,25 +877,25 @@ static int llog_osd_declare_create(const struct lu_env *env,
        /* object can be created by another thread */
        o = res->lgh_obj;
        if (dt_object_exists(o))
-               RETURN(0);
+               return 0;
 
        los = res->private_data;
        LASSERT(los);
 
        rc = llog_osd_declare_new_object(env, los, o, th);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = dt_declare_record_write(env, o, LLOG_CHUNK_SIZE, 0, th);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (res->lgh_name) {
                struct dt_object *llog_dir;
 
                llog_dir = llog_osd_dir_get(env, res->lgh_ctxt);
                if (IS_ERR(llog_dir))
-                       RETURN(PTR_ERR(llog_dir));
+                       return PTR_ERR(llog_dir);
                logid_to_fid(&res->lgh_id, &lgi->lgi_fid);
                rc = dt_declare_insert(env, llog_dir,
                                       (struct dt_rec *)&lgi->lgi_fid,
@@ -906,7 +906,7 @@ static int llog_osd_declare_create(const struct lu_env *env,
                               o->do_lu.lo_dev->ld_obd->obd_name,
                               res->lgh_name, rc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 /* This is a callback from the llog_* functions.
@@ -925,7 +925,7 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
 
        /* llog can be already created */
        if (dt_object_exists(o))
-               RETURN(-EEXIST);
+               return -EEXIST;
 
        los = res->private_data;
        LASSERT(los);
@@ -938,14 +938,14 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
 
        dt_write_unlock(env, o);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (res->lgh_name) {
                struct dt_object *llog_dir;
 
                llog_dir = llog_osd_dir_get(env, res->lgh_ctxt);
                if (IS_ERR(llog_dir))
-                       RETURN(PTR_ERR(llog_dir));
+                       return PTR_ERR(llog_dir);
 
                logid_to_fid(&res->lgh_id, &lgi->lgi_fid);
                dt_read_lock(env, llog_dir, 0);
@@ -960,7 +960,7 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
                               o->do_lu.lo_dev->ld_obd->obd_name,
                               res->lgh_name, rc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_osd_close(const struct lu_env *env, struct llog_handle *handle)
@@ -979,7 +979,7 @@ static int llog_osd_close(const struct lu_env *env, struct llog_handle *handle)
        if (handle->lgh_name)
                OBD_FREE(handle->lgh_name, strlen(handle->lgh_name) + 1);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_osd_destroy(const struct lu_env *env,
@@ -1004,7 +1004,7 @@ static int llog_osd_destroy(const struct lu_env *env,
 
        th = dt_trans_create(env, d);
        if (IS_ERR(th))
-               RETURN(PTR_ERR(th));
+               return PTR_ERR(th);
 
        if (loghandle->lgh_name) {
                llog_dir = llog_osd_dir_get(env, ctxt);
@@ -1054,7 +1054,7 @@ out_trans:
        dt_trans_stop(env, d, th);
        if (llog_dir != NULL)
                lu_object_put(env, &llog_dir->do_lu);
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_osd_setup(const struct lu_env *env, struct obd_device *obd,
@@ -1101,7 +1101,7 @@ static int llog_osd_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
        dt = ctxt->loc_exp->exp_obd->obd_lvfs_ctxt.dt;
        ls = ls_device_get(dt);
        if (IS_ERR(ls))
-               RETURN(PTR_ERR(ls));
+               return PTR_ERR(ls);
 
        mutex_lock(&ls->ls_los_mutex);
        los = dt_los_find(ls, FID_SEQ_LLOG);
@@ -1154,7 +1154,7 @@ int llog_osd_get_cat_list(const struct lu_env *env, struct dt_device *d,
 
        o = dt_locate(env, d, &lgi->lgi_fid);
        if (IS_ERR(o))
-               RETURN(PTR_ERR(o));
+               return PTR_ERR(o);
 
        if (!dt_object_exists(o)) {
                th = dt_trans_create(env, d);
@@ -1223,7 +1223,7 @@ out_trans:
 
 out:
        lu_object_put(env, &o->do_lu);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_osd_get_cat_list);
 
@@ -1237,7 +1237,7 @@ int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d,
        int                      rc, size;
 
        if (!count)
-               RETURN(0);
+               return 0;
 
        LASSERT(d);
 
@@ -1248,7 +1248,7 @@ int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d,
 
        o = dt_locate(env, d, &lgi->lgi_fid);
        if (IS_ERR(o))
-               RETURN(PTR_ERR(o));
+               return PTR_ERR(o);
 
        if (!dt_object_exists(o))
                GOTO(out, rc = -ENOENT);
@@ -1285,6 +1285,6 @@ out_trans:
        dt_trans_stop(env, d, th);
 out:
        lu_object_put(env, &o->do_lu);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_osd_put_cat_list);
index d3fd2461a07ab2e48b7ea5d35a342652a0fbe2bc..d9e6d12215f904307b7d42483fbac272a19b002e 100644 (file)
@@ -78,22 +78,22 @@ static int verify_handle(char *test, struct llog_handle *llh, int num_recs)
        if (active_recs != num_recs) {
                CERROR("%s: expected %d active recs after write, found %d\n",
                       test, num_recs, active_recs);
-               RETURN(-ERANGE);
+               return -ERANGE;
        }
 
        if (llh->lgh_hdr->llh_count != num_recs) {
                CERROR("%s: handle->count is %d, expected %d after write\n",
                       test, llh->lgh_hdr->llh_count, num_recs);
-               RETURN(-ERANGE);
+               return -ERANGE;
        }
 
        if (llh->lgh_last_idx < last_idx) {
                CERROR("%s: handle->last_idx is %d, expected %d after write\n",
                       test, llh->lgh_last_idx, last_idx);
-               RETURN(-ERANGE);
+               return -ERANGE;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 /* Test named-log create/open, close */
@@ -132,7 +132,7 @@ out_close:
        }
 out:
        llog_ctxt_put(ctxt);
-       RETURN(rc);
+       return rc;
 }
 
 /* Test named-log reopen; returns opened log on success */
@@ -209,7 +209,7 @@ out_close_llh:
 out_put:
        llog_ctxt_put(ctxt);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Test record writing, single and in bulk */
@@ -228,12 +228,12 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
        num_recs++;
        if (rc < 0) {
                CERROR("3a: write one log record failed: %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        rc = verify_handle("3a", llh, num_recs);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CWARN("3b: write 10 cfg log records with 8 bytes bufs\n");
        for (i = 0; i < 10; i++) {
@@ -247,14 +247,14 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
                if (rc < 0) {
                        CERROR("3b: write 10 records failed at #%d: %d\n",
                               i + 1, rc);
-                       RETURN(rc);
+                       return rc;
                }
                num_recs++;
        }
 
        rc = verify_handle("3b", llh, num_recs);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CWARN("3c: write 1000 more log records\n");
        for (i = 0; i < 1000; i++) {
@@ -262,14 +262,14 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
                if (rc < 0) {
                        CERROR("3c: write 1000 records failed at #%d: %d\n",
                               i + 1, rc);
-                       RETURN(rc);
+                       return rc;
                }
                num_recs++;
        }
 
        rc = verify_handle("3c", llh, num_recs);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        CWARN("3d: write log more than BITMAP_SIZE, return -ENOSPC\n");
        for (i = 0; i < LLOG_BITMAP_SIZE(llh->lgh_hdr) + 1; i++) {
@@ -293,20 +293,20 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
                } else if (rc < 0) {
                        CERROR("3d: write recs failed at #%d: %d\n",
                               i + 1, rc);
-                       RETURN(rc);
+                       return rc;
                }
                num_recs++;
        }
        if (rc != -ENOSPC) {
                CWARN("3d: write record more than BITMAP size!\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        CWARN("3d: wrote %d more records before end of llog is reached\n",
              num_recs);
 
        rc = verify_handle("3d", llh, num_recs);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Test catalogue additions */
@@ -416,7 +416,7 @@ out:
        }
 ctxt_release:
        llog_ctxt_put(ctxt);
-       RETURN(rc);
+       return rc;
 }
 
 static int cat_counter;
@@ -429,7 +429,7 @@ static int cat_print_cb(const struct lu_env *env, struct llog_handle *llh,
 
        if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                CERROR("invalid record in catalog\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        logid_to_fid(&lir->lid_id, &fid);
@@ -440,7 +440,7 @@ static int cat_print_cb(const struct lu_env *env, struct llog_handle *llh,
 
        cat_counter++;
 
-       RETURN(0);
+       return 0;
 }
 
 static int plain_counter;
@@ -452,7 +452,7 @@ static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
 
        if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
                CERROR("log is not plain\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        logid_to_fid(&llh->lgh_id, &fid);
@@ -462,7 +462,7 @@ static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
 
        plain_counter++;
 
-       RETURN(0);
+       return 0;
 }
 
 static int cancel_count;
@@ -475,7 +475,7 @@ static int llog_cancel_rec_cb(const struct lu_env *env,
 
        if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
                CERROR("log is not plain\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        cookie.lgc_lgl = llh->lgh_id;
@@ -484,8 +484,8 @@ static int llog_cancel_rec_cb(const struct lu_env *env,
        llog_cat_cancel_records(env, llh->u.phd.phd_cat_handle, 1, &cookie);
        cancel_count++;
        if (cancel_count == LLOG_TEST_RECNUM)
-               RETURN(-LLOG_EEMPTY);
-       RETURN(0);
+               return -LLOG_EEMPTY;
+       return 0;
 }
 
 /* Test log and catalogue processing */
@@ -592,7 +592,7 @@ out:
 out_put:
        llog_ctxt_put(ctxt);
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Test client api; open log by name and process */
@@ -676,7 +676,7 @@ nctxt_put:
        llog_ctxt_put(nctxt);
 ctxt_release:
        llog_ctxt_put(ctxt);
-       RETURN(rc);
+       return rc;
 }
 
 static union {
@@ -721,7 +721,7 @@ static int llog_test_7_sub(const struct lu_env *env, struct llog_ctxt *ctxt)
        rc = llog_open_create(env, ctxt, &llh, NULL, NULL);
        if (rc) {
                CERROR("7_sub: create log failed\n");
-               RETURN(rc);
+               return rc;
        }
 
        rc = llog_init_handle(env, llh,
@@ -792,7 +792,7 @@ out_close:
        if (rc)
                llog_destroy(env, llh);
        llog_close(env, llh);
-       RETURN(rc);
+       return rc;
 }
 
 /* Test all llog records writing and processing */
@@ -881,7 +881,7 @@ static int llog_test_7(const struct lu_env *env, struct obd_device *obd)
        }
 out:
        llog_ctxt_put(ctxt);
-       RETURN(rc);
+       return rc;
 }
 
 /* -------------------------------------------------------------------------
@@ -957,14 +957,14 @@ static int llog_test_cleanup(struct obd_device *obd)
 
        rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        tgt = obd->obd_lvfs_ctxt.dt->dd_lu_dev.ld_obd;
        rc = llog_cleanup(&env, llog_get_context(tgt, LLOG_TEST_ORIG_CTXT));
        if (rc)
                CERROR("failed to llog_test_llog_finish: %d\n", rc);
        lu_env_fini(&env);
-       RETURN(rc);
+       return rc;
 }
 
 static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
@@ -978,12 +978,12 @@ static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        if (lcfg->lcfg_bufcount < 2) {
                CERROR("requires a TARGET OBD name\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (lcfg->lcfg_buflens[1] < 1) {
                CERROR("requires a TARGET OBD name\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* disk obd */
@@ -991,12 +991,12 @@ static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        if (!tgt || !tgt->obd_attached || !tgt->obd_set_up) {
                CERROR("target device not attached or not set up (%s)\n",
                       lustre_cfg_string(lcfg, 1));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = lu_context_init(&test_session, LCT_SESSION);
        if (rc)
@@ -1037,7 +1037,7 @@ cleanup_session:
        lu_context_fini(&test_session);
 cleanup_env:
        lu_env_fini(&env);
-       RETURN(rc);
+       return rc;
 }
 
 static struct obd_ops llog_obd_ops = {
index 6d8d7e7aec50dfe81c3b74250eac67e8c04d0157..cc19fbab0207cb3070f6a33e6766894050218586 100644 (file)
@@ -49,11 +49,11 @@ static int ls_object_init(const struct lu_env *env, struct lu_object *o,
        under = &ls->ls_osd->dd_lu_dev;
        below = under->ld_ops->ldo_object_alloc(env, o->lo_header, under);
        if (below == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        lu_object_add(o, below);
 
-       RETURN(0);
+       return 0;
 }
 
 static void ls_object_free(const struct lu_env *env, struct lu_object *o)
@@ -166,7 +166,7 @@ struct ls_device *ls_device_get(struct dt_device *dev)
        list_add(&ls->ls_linkage, &ls_list_head);
 out_ls:
        mutex_unlock(&ls_list_mutex);
-       RETURN(ls);
+       return ls;
 }
 
 void ls_device_put(const struct lu_env *env, struct ls_device *ls)
@@ -226,18 +226,18 @@ int local_object_declare_create(const struct lu_env *env,
                rc = dt_declare_record_write(env, los->los_obj,
                                             sizeof(struct los_ondisk), 0, th);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
        rc = dt_declare_create(env, o, attr, NULL, dof, th);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        dti->dti_lb.lb_buf = NULL;
        dti->dti_lb.lb_len = sizeof(dti->dti_lma);
        rc = dt_declare_xattr_set(env, o, &dti->dti_lb, XATTR_NAME_LMA, 0, th);
 
-       RETURN(rc);
+       return rc;
 }
 
 int local_object_create(const struct lu_env *env,
@@ -251,10 +251,10 @@ int local_object_create(const struct lu_env *env,
 
        rc = dt_create(env, o, attr, NULL, dof, th);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (los == NULL)
-               RETURN(rc);
+               return rc;
 
        LASSERT(los->los_obj);
        LASSERT(dt_object_exists(los->los_obj));
@@ -275,7 +275,7 @@ int local_object_create(const struct lu_env *env,
                             th);
        mutex_unlock(&los->los_id_lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -296,7 +296,7 @@ struct dt_object *__local_file_create(const struct lu_env *env,
 
        dto = ls_locate(env, ls, fid);
        if (unlikely(IS_ERR(dto)))
-               RETURN(dto);
+               return dto;
 
        LASSERT(dto != NULL);
        if (dt_object_exists(dto))
@@ -369,7 +369,7 @@ out:
                lu_object_put_nocache(env, &dto->do_lu);
                dto = ERR_PTR(rc);
        }
-       RETURN(dto);
+       return dto;
 }
 
 /*
@@ -582,13 +582,13 @@ int local_object_unlink(const struct lu_env *env, struct dt_device *dt,
 
        rc = dt_lookup_dir(env, parent, name, &dti->dti_fid);
        if (rc == -ENOENT)
-               RETURN(0);
+               return 0;
        else if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        dto = dt_locate(env, dt, &dti->dti_fid);
        if (unlikely(IS_ERR(dto)))
-               RETURN(PTR_ERR(dto));
+               return PTR_ERR(dto);
 
        th = dt_trans_create(env, dt);
        if (IS_ERR(th))
@@ -753,7 +753,7 @@ int local_oid_storage_init(const struct lu_env *env, struct dt_device *dev,
 
        ls = ls_device_get(dev);
        if (IS_ERR(ls))
-               RETURN(PTR_ERR(ls));
+               return PTR_ERR(ls);
 
        mutex_lock(&ls->ls_los_mutex);
        *los = dt_los_find(ls, fid_seq(first_fid));
index eaf45cb07b32a6fa375fb8bffa25939844c624d5..6d9f25291757c6bc8b69893e4f551c5feb468ede 100644 (file)
@@ -1503,13 +1503,13 @@ static int lprocfs_nid_stats_clear_write_cb(void *obj, void *data)
                spin_lock(&stat->nid_obd->obd_nid_lock);
                list_move(&stat->nid_list, data);
                spin_unlock(&stat->nid_obd->obd_nid_lock);
-               RETURN(1);
+               return 1;
        }
        /* we has reference to object - only clear data*/
        if (stat->nid_stats)
                lprocfs_clear_stats(stat->nid_stats);
 
-       RETURN(0);
+       return 0;
 }
 
 int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
@@ -1545,13 +1545,13 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
 
        if (!exp || !exp->exp_obd || !exp->exp_obd->obd_proc_exports_entry ||
            !exp->exp_obd->obd_nid_stats_hash)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* not test against zero because eric say:
         * You may only test nid against another nid, or LNET_NID_ANY.
         * Anything else is nonsense.*/
        if (!nid || *nid == LNET_NID_ANY)
-               RETURN(0);
+               return 0;
 
        obd = exp->exp_obd;
 
@@ -1559,7 +1559,7 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
 
        OBD_ALLOC_PTR(new_stat);
        if (new_stat == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        new_stat->nid          = *nid;
        new_stat->nid_obd          = exp->exp_obd;
@@ -1627,7 +1627,7 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
        list_add(&new_stat->nid_list, &obd->obd_nid_stats);
        spin_unlock(&obd->obd_nid_lock);
 
-       RETURN(rc);
+       return rc;
 
 destroy_new_ns:
        if (new_stat->nid_proc != NULL)
@@ -1637,7 +1637,7 @@ destroy_new_ns:
 destroy_new:
        nidstat_putref(new_stat);
        OBD_FREE_PTR(new_stat);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(lprocfs_exp_setup);
 
@@ -1646,7 +1646,7 @@ int lprocfs_exp_cleanup(struct obd_export *exp)
        struct nid_stat *stat = exp->exp_nid_stats;
 
        if(!stat || !exp->exp_obd)
-               RETURN(0);
+               return 0;
 
        nidstat_putref(exp->exp_nid_stats);
        exp->exp_nid_stats = NULL;
@@ -1912,9 +1912,9 @@ int lprocfs_seq_create(proc_dir_entry_t *parent,
        entry = proc_create_data(name, mode, parent, seq_fops, data);
 
        if (entry == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(lprocfs_seq_create);
 
index 9efa8dc255b5720a89a11dddedb6ebb196ebde6f..c29ac1c2defd1850fabfd2186dc80ee0920af7eb 100644 (file)
@@ -209,9 +209,9 @@ static struct lu_object *lu_object_alloc(const struct lu_env *env,
         */
        top = dev->ld_ops->ldo_object_alloc(env, NULL, dev);
        if (top == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
        if (IS_ERR(top))
-               RETURN(top);
+               return top;
        /*
         * This is the only place where object fid is assigned. It's constant
         * after this point.
@@ -232,7 +232,7 @@ static struct lu_object *lu_object_alloc(const struct lu_env *env,
                        result = scan->lo_ops->loo_object_init(env, scan, conf);
                        if (result != 0) {
                                lu_object_free(env, top);
-                               RETURN(ERR_PTR(result));
+                               return ERR_PTR(result);
                        }
                        scan->lo_flags |= LU_OBJECT_ALLOCATED;
                }
@@ -243,13 +243,13 @@ static struct lu_object *lu_object_alloc(const struct lu_env *env,
                        result = scan->lo_ops->loo_object_start(env, scan);
                        if (result != 0) {
                                lu_object_free(env, top);
-                               RETURN(ERR_PTR(result));
+                               return ERR_PTR(result);
                        }
                }
        }
 
        lprocfs_counter_incr(dev->ld_site->ls_stats, LU_SS_CREATED);
-       RETURN(top);
+       return top;
 }
 
 /**
@@ -316,7 +316,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr)
        int                   i;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OBD_NO_LRU))
-               RETURN(0);
+               return 0;
 
        INIT_LIST_HEAD(&dispose);
        /*
@@ -1039,7 +1039,7 @@ int lu_site_init(struct lu_site *s, struct lu_device *top)
 
        lu_dev_add_linkage(s, top);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(lu_site_init);
 
index a748d8e70ec95d9c26118b1a094e7fae0fe473cb..be31d32b82c888740192aaa9a028d7bf4abf0f1e 100644 (file)
@@ -174,7 +174,7 @@ void *class_handle2object(__u64 cookie)
        }
        rcu_read_unlock();
 
-       RETURN(retval);
+       return retval;
 }
 EXPORT_SYMBOL(class_handle2object);
 
index 81ced81d32af5eb090b01e99f53a758901b8b656..df4936ad23750f994b107cfab46efcebe92c5e96 100644 (file)
@@ -212,6 +212,6 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid)
                break;
        }
        spin_unlock(&g_uuid_lock);
-       RETURN(found);
+       return found;
 }
 EXPORT_SYMBOL(class_check_uuid);
index 03795f3cbd7143722a1d802bce05f2c215acb1e4..f7187829e276fb5c5558ea5ccecc7ac776751b7b 100644 (file)
@@ -102,15 +102,15 @@ int lustre_buf2som(void *buf, int rc, struct md_som_data *msd)
 
        if (rc == 0 ||  rc == -ENODATA)
                /* no SOM attributes */
-               RETURN(-ENODATA);
+               return -ENODATA;
 
        if (rc < 0)
                /* error hit while fetching xattr */
-               RETURN(rc);
+               return rc;
 
        /* check SOM compatibility */
        if (attrs->som_incompat & ~cpu_to_le32(SOM_INCOMPAT_SUPP))
-               RETURN(-ENODATA);
+               return -ENODATA;
 
        /* unpack SOM attributes */
        lustre_som_swab(attrs);
@@ -123,7 +123,7 @@ int lustre_buf2som(void *buf, int rc, struct md_som_data *msd)
        msd->msd_blocks   = attrs->som_blocks;
        msd->msd_mountid  = attrs->som_mountid;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(lustre_buf2som);
 
@@ -158,11 +158,11 @@ int lustre_buf2hsm(void *buf, int rc, struct md_hsm *mh)
 
        if (rc == 0 ||  rc == -ENODATA)
                /* no HSM attributes */
-               RETURN(-ENODATA);
+               return -ENODATA;
 
        if (rc < 0)
                /* error hit while fetching xattr */
-               RETURN(rc);
+               return rc;
 
        /* unpack HSM attributes */
        lustre_hsm_swab(attrs);
@@ -173,7 +173,7 @@ int lustre_buf2hsm(void *buf, int rc, struct md_hsm *mh)
        mh->mh_arch_id  = attrs->hsm_arch_id;
        mh->mh_arch_ver = attrs->hsm_arch_ver;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(lustre_buf2hsm);
 
index 6981f3ce63f3deead67b759247985f1b876be59c..d0a64ff53581e5871abf99379fe387e0b979dd2c 100644 (file)
@@ -93,7 +93,7 @@ struct cfg_interop_param *class_find_old_param(const char *param,
        int   name_len = 0;
 
        if (param == NULL || ptr == NULL)
-               RETURN(NULL);
+               return NULL;
 
        value = strchr(param, '=');
        if (value == NULL)
@@ -104,11 +104,11 @@ struct cfg_interop_param *class_find_old_param(const char *param,
        while (ptr->old_param != NULL) {
                if (strncmp(param, ptr->old_param, name_len) == 0 &&
                    name_len == strlen(ptr->old_param))
-                       RETURN(ptr);
+                       return ptr;
                ptr++;
        }
 
-       RETURN(NULL);
+       return NULL;
 }
 EXPORT_SYMBOL(class_find_old_param);
 
@@ -338,19 +338,19 @@ int class_attach(struct lustre_cfg *lcfg)
 
        if (!LUSTRE_CFG_BUFLEN(lcfg, 1)) {
                CERROR("No type passed!\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        typename = lustre_cfg_string(lcfg, 1);
 
        if (!LUSTRE_CFG_BUFLEN(lcfg, 0)) {
                CERROR("No name passed!\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        name = lustre_cfg_string(lcfg, 0);
 
        if (!LUSTRE_CFG_BUFLEN(lcfg, 2)) {
                CERROR("No UUID passed!\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        uuid = lustre_cfg_string(lcfg, 2);
 
@@ -432,7 +432,7 @@ int class_attach(struct lustre_cfg *lcfg)
        obd->obd_attached = 1;
        CDEBUG(D_IOCTL, "OBD: dev %d attached type %s with refcount %d\n",
               obd->obd_minor, typename, atomic_read(&obd->obd_refcount));
-       RETURN(0);
+       return 0;
  out:
        if (obd != NULL) {
                class_release_dev(obd);
@@ -460,13 +460,13 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        /* have we attached a type to this device? */
        if (!obd->obd_attached) {
                CERROR("Device %d not attached\n", obd->obd_minor);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        if (obd->obd_set_up) {
                CERROR("Device %d already setup (type %s)\n",
                       obd->obd_minor, obd->obd_type->typ_name);
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
 
        /* is someone else setting us up right now? (attach inits spinlock) */
@@ -475,7 +475,7 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                spin_unlock(&obd->obd_dev_lock);
                CERROR("Device %d setup in progress (type %s)\n",
                       obd->obd_minor, obd->obd_type->typ_name);
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
        /* just leave this on forever.  I can't use obd_set_up here because
           other fns check that status, and we're not actually set up yet. */
@@ -540,7 +540,7 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        CDEBUG(D_IOCTL, "finished setup of obd %s (uuid %s)\n",
               obd->obd_name, obd->obd_uuid.uuid);
 
-       RETURN(0);
+       return 0;
 err_exp:
        if (obd->obd_self_export) {
                class_unlink_export(obd->obd_self_export);
@@ -572,14 +572,14 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
        if (obd->obd_set_up) {
                CERROR("OBD device %d still set up\n", obd->obd_minor);
-               RETURN(-EBUSY);
+               return -EBUSY;
        }
 
        spin_lock(&obd->obd_dev_lock);
        if (!obd->obd_attached) {
                spin_unlock(&obd->obd_dev_lock);
                CERROR("OBD device %d not attached\n", obd->obd_minor);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
        obd->obd_attached = 0;
        spin_unlock(&obd->obd_dev_lock);
@@ -588,7 +588,7 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg)
               obd->obd_name, obd->obd_uuid.uuid);
 
        class_decref(obd, "attach", obd);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(class_detach);
 
@@ -605,14 +605,14 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        if (!obd->obd_set_up) {
                CERROR("Device %d not setup\n", obd->obd_minor);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        spin_lock(&obd->obd_dev_lock);
        if (obd->obd_stopping) {
                spin_unlock(&obd->obd_dev_lock);
                CERROR("OBD %d already stopping\n", obd->obd_minor);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
        /* Leave this on forever */
        obd->obd_stopping = 1;
@@ -691,7 +691,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
        class_decref(obd, "setup", obd);
        obd->obd_set_up = 0;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(class_cleanup);
 
@@ -766,7 +766,7 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1 ||
            LUSTRE_CFG_BUFLEN(lcfg, 1) > sizeof(struct obd_uuid)) {
                CERROR("invalid conn_uuid\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
            strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) &&
@@ -774,19 +774,19 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
            strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) &&
            strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME)) {
                CERROR("can't add connection on non-client dev\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        imp = obd->u.cli.cl_import;
        if (!imp) {
                CERROR("try to add conn on immature client dev\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        obd_str2uuid(&uuid, lustre_cfg_string(lcfg, 1));
        rc = obd_add_conn(imp, &uuid, lcfg->lcfg_num);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_add_conn);
 
@@ -801,24 +801,24 @@ int class_del_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1 ||
            LUSTRE_CFG_BUFLEN(lcfg, 1) > sizeof(struct obd_uuid)) {
                CERROR("invalid conn_uuid\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
            strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME)) {
                CERROR("can't del connection on non-client dev\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        imp = obd->u.cli.cl_import;
        if (!imp) {
                CERROR("try to del conn on immature client dev\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        obd_str2uuid(&uuid, lustre_cfg_string(lcfg, 1));
        rc = obd_del_conn(imp, &uuid);
 
-       RETURN(rc);
+       return rc;
 }
 
 LIST_HEAD(lustre_profile_list);
@@ -829,10 +829,10 @@ struct lustre_profile *class_get_profile(const char * prof)
 
        list_for_each_entry(lprof, &lustre_profile_list, lp_list) {
                if (!strcmp(lprof->lp_profile, prof)) {
-                       RETURN(lprof);
+                       return lprof;
                }
        }
-       RETURN(NULL);
+       return NULL;
 }
 EXPORT_SYMBOL(class_get_profile);
 
@@ -850,7 +850,7 @@ int class_add_profile(int proflen, char *prof, int osclen, char *osc,
 
        OBD_ALLOC(lprof, sizeof(*lprof));
        if (lprof == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        INIT_LIST_HEAD(&lprof->lp_list);
 
        LASSERT(proflen == (strlen(prof) + 1));
@@ -874,7 +874,7 @@ int class_add_profile(int proflen, char *prof, int osclen, char *osc,
        }
 
        list_add(&lprof->lp_list, &lustre_profile_list);
-       RETURN(err);
+       return err;
 
 out:
        if (lprof->lp_md)
@@ -884,7 +884,7 @@ out:
        if (lprof->lp_profile)
                OBD_FREE(lprof->lp_profile, proflen);
        OBD_FREE(lprof, sizeof(*lprof));
-       RETURN(err);
+       return err;
 }
 
 void class_del_profile(const char *prof)
@@ -937,10 +937,10 @@ static int class_set_global(char *ptr, int val, struct lustre_cfg *lcfg)
                strlcpy(obd_jobid_var, lustre_cfg_string(lcfg, 2),
                        JOBSTATS_JOBID_VAR_MAX_LEN + 1);
        else
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        CDEBUG(D_IOCTL, "global %s = %d\n", ptr, val);
-       RETURN(0);
+       return 0;
 }
 
 
@@ -979,11 +979,11 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
        int                      new_len = 0;
 
        if (cfg == NULL || new_name == NULL)
-               RETURN(ERR_PTR(-EINVAL));
+               return ERR_PTR(-EINVAL);
 
        param = lustre_cfg_string(cfg, 1);
        if (param == NULL)
-               RETURN(ERR_PTR(-EINVAL));
+               return ERR_PTR(-EINVAL);
 
        value = strchr(param, '=');
        if (value == NULL)
@@ -995,7 +995,7 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
 
        OBD_ALLOC(new_param, new_len);
        if (new_param == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        strcpy(new_param, new_name);
        if (value != NULL)
@@ -1004,7 +1004,7 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
        OBD_ALLOC_PTR(bufs);
        if (bufs == NULL) {
                OBD_FREE(new_param, new_len);
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
        }
 
        lustre_cfg_bufs_reset(bufs, NULL);
@@ -1016,14 +1016,14 @@ struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
        OBD_FREE(new_param, new_len);
        OBD_FREE_PTR(bufs);
        if (new_cfg == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        new_cfg->lcfg_num = cfg->lcfg_num;
        new_cfg->lcfg_flags = cfg->lcfg_flags;
        new_cfg->lcfg_nid = cfg->lcfg_nid;
        new_cfg->lcfg_nal = cfg->lcfg_nal;
 
-       RETURN(new_cfg);
+       return new_cfg;
 }
 EXPORT_SYMBOL(lustre_cfg_rename);
 
@@ -1232,7 +1232,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 
        if (lcfg->lcfg_command != LCFG_PARAM) {
                CERROR("Unknown command: %d\n", lcfg->lcfg_command);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* fake a seq file so that var->fops->write can work... */
@@ -1279,7 +1279,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                        /* If the prefix doesn't match, return error so we
                           can pass it down the stack */
                        if (strnchr(key, keylen, '.'))
-                           RETURN(-ENOSYS);
+                           return -ENOSYS;
                        CERROR("%s: unknown param %s\n",
                               (char *)lustre_cfg_string(lcfg, 0), key);
                        /* rc = -EINVAL;        continue parsing other params */
@@ -1300,7 +1300,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                rc = 0;
        if (!rc && skip)
                rc = skip;
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_process_proc_param);
 
@@ -1499,7 +1499,7 @@ out:
                       handle->lgh_ctxt->loc_obd->obd_name, rc);
                class_config_dump_handler(NULL, handle, rec, data);
        }
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_config_llog_handler);
 
@@ -1514,7 +1514,7 @@ int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
        CDEBUG(D_INFO, "looking up llog %s\n", name);
        rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL);
        if (rc)
@@ -1540,7 +1540,7 @@ int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
 
 parse_out:
        llog_close(env, llh);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_config_parse_llog);
 
@@ -1559,7 +1559,7 @@ int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size)
        LASSERT(rec->lrh_type == OBD_CFG_REC);
        rc = lustre_cfg_sanity_check(lcfg, rec->lrh_len);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        ptr += snprintf(ptr, end-ptr, "cmd=%05x ", lcfg->lcfg_command);
        if (lcfg->lcfg_flags)
@@ -1590,7 +1590,7 @@ int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size)
        }
        /* return consumed bytes */
        rc = ptr - buf;
-       RETURN(rc);
+       return rc;
 }
 
 int class_config_dump_handler(const struct lu_env *env,
@@ -1602,7 +1602,7 @@ int class_config_dump_handler(const struct lu_env *env,
 
        OBD_ALLOC(outstr, 256);
        if (outstr == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (rec->lrh_type == OBD_CFG_REC) {
                class_config_parse_rec(rec, outstr, 256);
@@ -1613,7 +1613,7 @@ int class_config_dump_handler(const struct lu_env *env,
        }
 
        OBD_FREE(outstr, 256);
-       RETURN(rc);
+       return rc;
 }
 
 int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
@@ -1626,7 +1626,7 @@ int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
 
        rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL);
        if (rc)
@@ -1637,7 +1637,7 @@ parse_out:
        llog_close(env, llh);
 
        LCONSOLE_INFO("End config log %s\n", name);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_config_dump_llog);
 
@@ -1653,7 +1653,7 @@ int class_manual_cleanup(struct obd_device *obd)
 
        if (!obd) {
                CERROR("empty cleanup\n");
-               RETURN(-EALREADY);
+               return -EALREADY;
        }
 
        if (obd->obd_force)
@@ -1668,7 +1668,7 @@ int class_manual_cleanup(struct obd_device *obd)
        lustre_cfg_bufs_set_string(&bufs, 1, flags);
        lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs);
        if (!lcfg)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = class_process_config(lcfg);
        if (rc) {
@@ -1683,7 +1683,7 @@ int class_manual_cleanup(struct obd_device *obd)
                CERROR("detach failed %d: %s\n", rc, obd->obd_name);
 out:
        lustre_cfg_free(lcfg);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(class_manual_cleanup);
 
@@ -1775,7 +1775,7 @@ nid_key(struct hlist_node *hnode)
 
        exp = hlist_entry(hnode, struct obd_export, exp_nid_hash);
 
-       RETURN(&exp->exp_connection->c_peer.nid);
+       return &exp->exp_connection->c_peer.nid;
 }
 
 /*
@@ -1790,8 +1790,8 @@ nid_kepcmp(const void *key, struct hlist_node *hnode)
        LASSERT(key);
        exp = hlist_entry(hnode, struct obd_export, exp_nid_hash);
 
-       RETURN(exp->exp_connection->c_peer.nid == *(lnet_nid_t *)key &&
-              !exp->exp_failed);
+       return exp->exp_connection->c_peer.nid == *(lnet_nid_t *)key &&
+              !exp->exp_failed;
 }
 
 static void *
index 607dfa7fa6acae99a992dfa51506290e07afb2a1..68a4d6a0eb0362b30d0ed308203014bd0927681a 100644 (file)
@@ -86,7 +86,7 @@ int lustre_process_log(struct super_block *sb, char *logname,
 
        OBD_ALLOC_PTR(bufs);
        if (bufs == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* mgc_process_config */
        lustre_cfg_bufs_reset(bufs, mgc->obd_name);
@@ -116,7 +116,7 @@ int lustre_process_log(struct super_block *sb, char *logname,
                                   rc);
 
        /* class_obd_list(); */
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(lustre_process_log);
 
@@ -131,7 +131,7 @@ int lustre_end_log(struct super_block *sb, char *logname,
        int rc;
 
        if (!mgc)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        /* mgc_process_config */
        lustre_cfg_bufs_reset(&bufs, mgc->obd_name);
@@ -141,7 +141,7 @@ int lustre_end_log(struct super_block *sb, char *logname,
        lcfg = lustre_cfg_new(LCFG_LOG_END, &bufs);
        rc = obd_process_config(mgc, sizeof(*lcfg), lcfg);
        lustre_cfg_free(lcfg);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(lustre_end_log);
 
@@ -249,7 +249,7 @@ int lustre_start_mgc(struct super_block *sb)
        }
        if (i == 0) {
                CERROR("No valid MGS nids found.\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        mutex_lock(&mgc_start_lock);
@@ -473,7 +473,7 @@ out_free:
                OBD_FREE(mgcname, len);
        if (niduuid)
                OBD_FREE(niduuid, len + 2);
-       RETURN(rc);
+       return rc;
 }
 
 static int lustre_stop_mgc(struct super_block *sb)
@@ -484,10 +484,10 @@ static int lustre_stop_mgc(struct super_block *sb)
        int i, rc = 0, len = 0;
 
        if (!lsi)
-               RETURN(-ENOENT);
+               return -ENOENT;
        obd = lsi->lsi_mgc;
        if (!obd)
-               RETURN(-ENOENT);
+               return -ENOENT;
        lsi->lsi_mgc = NULL;
 
        mutex_lock(&mgc_start_lock);
@@ -543,7 +543,7 @@ out:
 
        /* class_import_put will get rid of the additional connections */
        mutex_unlock(&mgc_start_lock);
-       RETURN(rc);
+       return rc;
 }
 
 /***************** lustre superblock **************/
@@ -554,11 +554,11 @@ struct lustre_sb_info *lustre_init_lsi(struct super_block *sb)
 
        OBD_ALLOC_PTR(lsi);
        if (!lsi)
-               RETURN(NULL);
+               return NULL;
        OBD_ALLOC_PTR(lsi->lsi_lmd);
        if (!lsi->lsi_lmd) {
                OBD_FREE_PTR(lsi);
-               RETURN(NULL);
+               return NULL;
        }
 
        lsi->lsi_lmd->lmd_exclude_count = 0;
@@ -571,7 +571,7 @@ struct lustre_sb_info *lustre_init_lsi(struct super_block *sb)
        /* Default umount style */
        lsi->lsi_flags = LSI_UMOUNT_FAILOVER;
 
-       RETURN(lsi);
+       return lsi;
 }
 
 static int lustre_free_lsi(struct super_block *sb)
@@ -617,7 +617,7 @@ static int lustre_free_lsi(struct super_block *sb)
        OBD_FREE(lsi, sizeof(*lsi));
        s2lsi_nocast(sb) = NULL;
 
-       RETURN(0);
+       return 0;
 }
 
 /* The lsi has one reference for every server that is using the disk -
@@ -636,9 +636,9 @@ int lustre_put_lsi(struct super_block *sb)
                        obd_zombie_barrier();
                }
                lustre_free_lsi(sb);
-               RETURN(1);
+               return 1;
        }
-       RETURN(0);
+       return 0;
 }
 
 /*** SERVER NAME ***
@@ -765,7 +765,7 @@ int lustre_common_put_super(struct super_block *sb)
        if (rc && (rc != -ENOENT)) {
                if (rc != -EBUSY) {
                        CERROR("Can't stop MGC: %d\n", rc);
-                       RETURN(rc);
+                       return rc;
                }
                /* BUSY just means that there's some other obd that
                   needs the mgc.  Let him clean it up. */
@@ -774,7 +774,7 @@ int lustre_common_put_super(struct super_block *sb)
        /* Drop a ref to the mounted disk */
        lustre_put_lsi(sb);
        lu_types_stop();
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(lustre_common_put_super);
 
@@ -816,7 +816,7 @@ int lustre_check_exclusion(struct super_block *sb, char *svname)
        rc = server_name2index(svname, &index, NULL);
        if (rc != LDD_F_SV_TYPE_OST)
                /* Only exclude OSTs */
-               RETURN(0);
+               return 0;
 
        CDEBUG(D_MOUNT, "Check exclusion %s (%d) in %d of %s\n", svname,
               index, lmd->lmd_exclude_count, lmd->lmd_dev);
@@ -824,10 +824,10 @@ int lustre_check_exclusion(struct super_block *sb, char *svname)
        for(i = 0; i < lmd->lmd_exclude_count; i++) {
                if (index == lmd->lmd_exclude[i]) {
                        CWARN("Excluding %s (on exclusion list)\n", svname);
-                       RETURN(1);
+                       return 1;
                }
        }
-       RETURN(0);
+       return 0;
 }
 
 /* mount -v  -o exclude=lustre-OST0001:lustre-OST0002 -t lustre ... */
@@ -845,7 +845,7 @@ static int lmd_make_exclusion(struct lustre_mount_data *lmd, const char *ptr)
        /* temp storage until we figure out how many we have */
        OBD_ALLOC(exclude_list, sizeof(index) * devmax);
        if (!exclude_list)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* we enter this fn pointing at the '=' */
        while (*s1 && *s1 != ' ' && *s1 != ',') {
@@ -883,7 +883,7 @@ static int lmd_make_exclusion(struct lustre_mount_data *lmd, const char *ptr)
                }
        }
        OBD_FREE(exclude_list, sizeof(index) * devmax);
-       RETURN(rc);
+       return rc;
 }
 
 static int lmd_parse_mgssec(struct lustre_mount_data *lmd, char *ptr)
@@ -992,7 +992,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
        if (!options) {
                LCONSOLE_ERROR_MSG(0x162, "Missing mount data: check that "
                                   "/sbin/mount.lustre is installed.\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* Options should be a string - try to detect old lmd data */
@@ -1000,13 +1000,13 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
                LCONSOLE_ERROR_MSG(0x163, "You're using an old version of "
                                   "/sbin/mount.lustre.  Please install "
                                   "version %s\n", LUSTRE_VERSION_STRING);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        lmd->lmd_magic = LMD_MAGIC;
 
        OBD_ALLOC(lmd->lmd_params, 4096);
        if (lmd->lmd_params == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lmd->lmd_params[0] = '\0';
 
        /* Set default flags here */
@@ -1145,14 +1145,14 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
                /* Freed in lustre_free_lsi */
                OBD_ALLOC(lmd->lmd_profile, strlen(s1) + 8);
                if (!lmd->lmd_profile)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                sprintf(lmd->lmd_profile, "%s-client", s1);
        }
 
        /* Freed in lustre_free_lsi */
        OBD_ALLOC(lmd->lmd_dev, strlen(devname) + 1);
        if (!lmd->lmd_dev)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        strcpy(lmd->lmd_dev, devname);
 
        /* Save mount options */
@@ -1163,18 +1163,18 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
                /* Freed in lustre_free_lsi */
                OBD_ALLOC(lmd->lmd_opts, strlen(options) + 1);
                if (!lmd->lmd_opts)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                strcpy(lmd->lmd_opts, options);
        }
 
        lmd_print(lmd);
        lmd->lmd_magic = LMD_MAGIC;
 
-       RETURN(rc);
+       return rc;
 
 invalid:
        CERROR("Bad mount options %s\n", options);
-       RETURN(-EINVAL);
+       return -EINVAL;
 }
 
 struct lustre_mount_data2 {
@@ -1198,7 +1198,7 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent)
 
        lsi = lustre_init_lsi(sb);
        if (!lsi)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        lmd = lsi->lsi_lmd;
 
        /*
index e0f49b083f7f8ec00b3ef1e8c5d0198c80bbaabf..debb9cec4900ab6b6b7ef51a3c69f2163df5ed8b 100644 (file)
@@ -99,7 +99,7 @@ static int echo_destroy_export(struct obd_export *exp)
        target_destroy_export(exp);
        ldlm_destroy_export(exp);
 
-       RETURN(0);
+       return 0;
 }
 
  static __u64 echo_next_id(struct obd_device *obddev)
@@ -152,21 +152,21 @@ static int echo_destroy(const struct lu_env *env, struct obd_export *exp,
        if (!obd) {
                CERROR("invalid client cookie "LPX64"\n",
                       exp->exp_handle.h_cookie);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (!(oa->o_valid & OBD_MD_FLID)) {
                CERROR("obdo missing FLID valid flag: "LPX64"\n", oa->o_valid);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (ostid_id(&oa->o_oi) > obd->u.echo.eo_lastino ||
            ostid_id(&oa->o_oi) < ECHO_INIT_OID) {
                CERROR("bad destroy objid: "DOSTID"\n", POSTID(&oa->o_oi));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
@@ -178,20 +178,20 @@ static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
        if (!obd) {
                CERROR("invalid client cookie "LPX64"\n",
                       exp->exp_handle.h_cookie);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (!(oinfo->oi_oa->o_valid & OBD_MD_FLID)) {
                CERROR("obdo missing FLID valid flag: "LPX64"\n",
                       oinfo->oi_oa->o_valid);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        obdo_cpy_md(oinfo->oi_oa, &obd->u.echo.eo_oa, oinfo->oi_oa->o_valid);
        ostid_set_seq_echo(&oinfo->oi_oa->o_oi);
        ostid_set_id(&oinfo->oi_oa->o_oi, id);
 
-       RETURN(0);
+       return 0;
 }
 
 static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
@@ -202,13 +202,13 @@ static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
        if (!obd) {
                CERROR("invalid client cookie "LPX64"\n",
                       exp->exp_handle.h_cookie);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (!(oinfo->oi_oa->o_valid & OBD_MD_FLID)) {
                CERROR("obdo missing FLID valid flag: "LPX64"\n",
                       oinfo->oi_oa->o_valid);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        memcpy(&obd->u.echo.eo_oa, oinfo->oi_oa, sizeof(*oinfo->oi_oa));
@@ -220,7 +220,7 @@ static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
                oti->oti_ack_locks[0].lock = obd->u.echo.eo_nl_lock;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static void
@@ -408,7 +408,7 @@ static int echo_preprw(const struct lu_env *env, int cmd,
 
        obd = export->exp_obd;
        if (obd == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* Temp fix to stop falling foul of osc_announce_cached() */
        oa->o_valid &= ~(OBD_MD_FLBLOCKS | OBD_MD_FLGRANT);
@@ -450,7 +450,7 @@ static int echo_preprw(const struct lu_env *env, int cmd,
        CDEBUG(D_PAGE, "%d pages allocated after prep\n",
               atomic_read(&obd->u.echo.eo_prep));
 
-       RETURN(0);
+       return 0;
 
 preprw_cleanup:
        /* It is possible that we would rather handle errors by  allow
@@ -484,7 +484,7 @@ static int echo_commitrw(const struct lu_env *env, int cmd,
 
        obd = export->exp_obd;
        if (obd == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (rc)
                GOTO(commitrw_cleanup, rc);
@@ -499,7 +499,7 @@ static int echo_commitrw(const struct lu_env *env, int cmd,
 
        if (niocount && res == NULL) {
                CERROR("NULL res niobuf with niocount %d\n", niocount);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        LASSERT(oti == NULL || oti->oti_handle == (void *)DESC_PRIV);
@@ -530,7 +530,7 @@ static int echo_commitrw(const struct lu_env *env, int cmd,
 
        CDEBUG(D_PAGE, "%d pages remain after commit\n",
               atomic_read(&obd->u.echo.eo_prep));
-       RETURN(rc);
+       return rc;
 
 commitrw_cleanup:
        atomic_sub(pgs, &obd->u.echo.eo_prep);
@@ -570,7 +570,7 @@ static int echo_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                                LDLM_NS_TYPE_OST);
        if (obd->obd_namespace == NULL) {
                LBUG();
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        rc = ldlm_cli_enqueue_local(obd->obd_namespace, &res_id, LDLM_PLAIN,
@@ -592,7 +592,7 @@ static int echo_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        ptlrpc_init_client (LDLM_CB_REQUEST_PORTAL, LDLM_CB_REPLY_PORTAL,
                            "echo_ldlm_cb_client", &obd->obd_ldlm_client);
-       RETURN(0);
+       return 0;
 }
 
 static int echo_cleanup(struct obd_device *obd)
@@ -615,7 +615,7 @@ static int echo_cleanup(struct obd_device *obd)
        if (leaked != 0)
                CERROR("%d prep/commitrw pages leaked\n", leaked);
 
-       RETURN(0);
+       return 0;
 }
 
 struct obd_ops echo_obd_ops = {
index 80e3a951b95ad5497f6b922c2846182651c75e85..25151b13fefdd8916f8fb7e8061eea1dc5864e9e 100644 (file)
@@ -413,7 +413,7 @@ static int echo_page_init(const struct lu_env *env, struct cl_object *obj,
        mutex_init(&ep->ep_lock);
        cl_page_slice_add(page, &ep->ep_cl, obj, &echo_page_ops);
        atomic_inc(&eco->eo_npages);
-       RETURN(0);
+       return 0;
 }
 
 static int echo_io_init(const struct lu_env *env, struct cl_object *obj,
@@ -435,7 +435,7 @@ static int echo_lock_init(const struct lu_env *env,
                INIT_LIST_HEAD(&el->el_chain);
                atomic_set(&el->el_refcount, 0);
        }
-       RETURN(el == NULL ? -ENOMEM : 0);
+       return el == NULL ? -ENOMEM : 0;
 }
 
 static int echo_conf_set(const struct lu_env *env, struct cl_object *obj,
@@ -473,7 +473,7 @@ static int echo_object_init(const struct lu_env *env, struct lu_object *obj,
                below = under->ld_ops->ldo_object_alloc(env, obj->lo_header,
                                                        under);
                if (below == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                lu_object_add(obj, below);
        }
 
@@ -497,7 +497,7 @@ static int echo_object_init(const struct lu_env *env, struct lu_object *obj,
        list_add_tail(&eco->eo_obj_chain, &ec->ec_objects);
        spin_unlock(&ec->ec_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 /* taken from osc_unpackmd() */
@@ -515,19 +515,19 @@ static int echo_alloc_memmd(struct echo_device *ed,
        LASSERT(*lsmp == NULL);
        OBD_ALLOC(*lsmp, lsm_size);
        if (*lsmp == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
        if ((*lsmp)->lsm_oinfo[0] == NULL) {
                OBD_FREE(*lsmp, lsm_size);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        loi_init((*lsmp)->lsm_oinfo[0]);
        (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
        ostid_set_seq_echo(&(*lsmp)->lsm_oi);
 
-       RETURN(lsm_size);
+       return lsm_size;
 }
 
 static int echo_free_memmd(struct echo_device *ed, struct lov_stripe_md **lsmp)
@@ -544,7 +544,7 @@ static int echo_free_memmd(struct echo_device *ed, struct lov_stripe_md **lsmp)
        OBD_FREE((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
        OBD_FREE(*lsmp, lsm_size);
        *lsmp = NULL;
-       RETURN(0);
+       return 0;
 }
 
 static void echo_object_free(const struct lu_env *env, struct lu_object *obj)
@@ -611,7 +611,7 @@ static struct lu_object *echo_object_alloc(const struct lu_env *env,
                eco->eo_cl.co_ops = &echo_cl_obj_ops;
                obj->lo_ops       = &echo_lu_obj_ops;
        }
-       RETURN(obj);
+       return obj;
 }
 
 static struct lu_device_operations echo_device_lu_ops = {
@@ -729,7 +729,7 @@ static int echo_fid_init(struct echo_device *ed, char *obd_name,
 
        OBD_ALLOC_PTR(ed->ed_cl_seq);
        if (ed->ed_cl_seq == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
        if (prefix == NULL)
@@ -746,12 +746,12 @@ static int echo_fid_init(struct echo_device *ed, char *obd_name,
        if (rc)
                GOTO(out_free_seq, rc);
 
-       RETURN(0);
+       return 0;
 
 out_free_seq:
        OBD_FREE_PTR(ed->ed_cl_seq);
        ed->ed_cl_seq = NULL;
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_fid_fini(struct obd_device *obddev)
@@ -764,7 +764,7 @@ static int echo_fid_fini(struct obd_device *obddev)
                ed->ed_cl_seq = NULL;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static struct lu_device *echo_device_alloc(const struct lu_env *env,
@@ -902,7 +902,7 @@ static struct lu_device *echo_device_alloc(const struct lu_env *env,
        }
 
        ed->ed_next = next;
-       RETURN(&cd->cd_lu_dev);
+       return &cd->cd_lu_dev;
 out:
        switch(cleanup) {
        case 4: {
@@ -1072,11 +1072,11 @@ static struct echo_object *cl_echo_object_find(struct echo_device *d,
 
        /* Never return an object if the obd is to be freed. */
        if (echo_dev2cl(d)->cd_lu_dev.ld_obd->obd_stopping)
-               RETURN(ERR_PTR(-ENODEV));
+               return ERR_PTR(-ENODEV);
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN((void *)env);
+               return (void *)env;
 
        info = echo_env_info(env);
        conf = &info->eti_conf;
@@ -1116,7 +1116,7 @@ static struct echo_object *cl_echo_object_find(struct echo_device *d,
 
 out:
        cl_env_put(env, &refcheck);
-       RETURN(eco);
+       return eco;
 }
 
 static int cl_echo_object_put(struct echo_object *eco)
@@ -1127,7 +1127,7 @@ static int cl_echo_object_put(struct echo_object *eco)
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        /* an external function to kill an object? */
        if (eco->eo_deleted) {
@@ -1138,7 +1138,7 @@ static int cl_echo_object_put(struct echo_object *eco)
 
        cl_object_put(env, obj);
        cl_env_put(env, &refcheck);
-       RETURN(0);
+       return 0;
 }
 
 static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
@@ -1184,7 +1184,7 @@ static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
                        cl_lock_release(env, lck, "ec enqueue", current);
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int cl_echo_enqueue(struct echo_object *eco, obd_off start, obd_off end,
@@ -1198,7 +1198,7 @@ static int cl_echo_enqueue(struct echo_object *eco, obd_off start, obd_off end,
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        info = echo_env_info(env);
        io = &info->eti_io;
@@ -1242,10 +1242,10 @@ static int cl_echo_cancel0(struct lu_env *env, struct echo_device *ed,
        spin_unlock(&ec->ec_lock);
 
        if (!found)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        echo_lock_release(env, ecl, still_used);
-       RETURN(0);
+       return 0;
 }
 
 static int cl_echo_cancel(struct echo_device *ed, __u64 cookie)
@@ -1256,12 +1256,12 @@ static int cl_echo_cancel(struct echo_device *ed, __u64 cookie)
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        rc = cl_echo_cancel0(env, ed, cookie);
 
        cl_env_put(env, &refcheck);
-       RETURN(rc);
+       return rc;
 }
 
 static int cl_echo_async_brw(const struct lu_env *env, struct cl_io *io,
@@ -1278,7 +1278,7 @@ static int cl_echo_async_brw(const struct lu_env *env, struct cl_io *io,
                        continue;
                result = result ?: rc;
        }
-       RETURN(result);
+       return result;
 }
 
 static int cl_echo_object_brw(struct echo_object *eco, int rw, obd_off offset,
@@ -1301,7 +1301,7 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, obd_off offset,
        LASSERT(ed->ed_next != NULL);
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        info    = echo_env_info(env);
        io      = &info->eti_io;
@@ -1447,7 +1447,7 @@ static int echo_big_lmm_get(const struct lu_env *env, struct md_object *o,
 
        rc = mo_xattr_get(env, o, &LU_BUF_NULL, XATTR_NAME_LOV);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        /* big_lmm may need to be grown */
        if (info->eti_big_lmmsize < rc) {
@@ -1464,7 +1464,7 @@ static int echo_big_lmm_get(const struct lu_env *env, struct md_object *o,
 
                OBD_ALLOC_LARGE(info->eti_big_lmm, size);
                if (info->eti_big_lmm == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                info->eti_big_lmmsize = size;
        }
        LASSERT(info->eti_big_lmmsize >= rc);
@@ -1473,13 +1473,13 @@ static int echo_big_lmm_get(const struct lu_env *env, struct md_object *o,
        info->eti_buf.lb_len = info->eti_big_lmmsize;
        rc = mo_xattr_get(env, o, &info->eti_buf, XATTR_NAME_LOV);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        ma->ma_valid |= MA_LOV;
        ma->ma_lmm = info->eti_big_lmm;
        ma->ma_lmm_size = rc;
 
-       RETURN(0);
+       return 0;
 }
 
 int echo_attr_get_complex(const struct lu_env *env, struct md_object *next,
@@ -1543,7 +1543,7 @@ out:
        ma->ma_need = need;
        CDEBUG(D_INODE, "after getattr rc = %d, ma_valid = "LPX64" ma_lmm=%p\n",
               rc, ma->ma_valid, ma->ma_lmm);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -1570,7 +1570,7 @@ echo_md_create_internal(const struct lu_env *env, struct echo_device *ed,
        if (IS_ERR(ec_child)) {
                CERROR("Can not find the child "DFID": rc = %ld\n", PFID(fid),
                        PTR_ERR(ec_child));
-               RETURN(PTR_ERR(ec_child));
+               return PTR_ERR(ec_child);
        }
 
        child = lu_object_locate(ec_child->lo_header, ld->ld_type);
@@ -1636,7 +1636,7 @@ static int echo_create_md_object(const struct lu_env *env,
                return -1;
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        memset(ma, 0, sizeof(*ma));
        memset(spec, 0, sizeof(*spec));
@@ -1666,7 +1666,7 @@ static int echo_create_md_object(const struct lu_env *env,
                /* If name is specified, only create one object by name */
                rc = echo_md_create_internal(env, ed, lu2md(parent), fid, lname,
                                             spec, ma);
-               RETURN(rc);
+               return rc;
        }
 
        /* Create multiple object sequenced by id */
@@ -1686,7 +1686,7 @@ static int echo_create_md_object(const struct lu_env *env,
                fid->f_oid++;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static struct lu_object *echo_md_lookup(const struct lu_env *env,
@@ -1704,7 +1704,7 @@ static struct lu_object *echo_md_lookup(const struct lu_env *env,
        rc = mdo_lookup(env, parent, lname, fid, NULL);
        if (rc) {
                CERROR("lookup %s: rc = %d\n", lname->ln_name, rc);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* In the function below, .hs_keycmp resolves to
@@ -1712,7 +1712,7 @@ static struct lu_object *echo_md_lookup(const struct lu_env *env,
        /* coverity[overrun-buffer-val] */
        child = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
 
-       RETURN(child);
+       return child;
 }
 
 static int echo_setattr_object(const struct lu_env *env,
@@ -1733,7 +1733,7 @@ static int echo_setattr_object(const struct lu_env *env,
                return -1;
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        for (i = 0; i < count; i++) {
                struct lu_object *ec_child, *child;
@@ -1744,7 +1744,7 @@ static int echo_setattr_object(const struct lu_env *env,
                if (IS_ERR(ec_child)) {
                        CERROR("Can't find child %s: rc = %ld\n",
                                lname->ln_name, PTR_ERR(ec_child));
-                       RETURN(PTR_ERR(ec_child));
+                       return PTR_ERR(ec_child);
                }
 
                child = lu_object_locate(ec_child->lo_header, ld->ld_type);
@@ -1775,7 +1775,7 @@ static int echo_setattr_object(const struct lu_env *env,
                id++;
                lu_object_put(env, ec_child);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_getattr_object(const struct lu_env *env,
@@ -1796,7 +1796,7 @@ static int echo_getattr_object(const struct lu_env *env,
                return -1;
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        memset(ma, 0, sizeof(*ma));
        ma->ma_need |= MA_INODE | MA_LOV | MA_PFID | MA_HSM | MA_ACL_DEF;
@@ -1814,14 +1814,14 @@ static int echo_getattr_object(const struct lu_env *env,
                if (IS_ERR(ec_child)) {
                        CERROR("Can't find child %s: rc = %ld\n",
                               lname->ln_name, PTR_ERR(ec_child));
-                       RETURN(PTR_ERR(ec_child));
+                       return PTR_ERR(ec_child);
                }
 
                child = lu_object_locate(ec_child->lo_header, ld->ld_type);
                if (child == NULL) {
                        CERROR("Can not locate the child %s\n", lname->ln_name);
                        lu_object_put(env, ec_child);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                CDEBUG(D_RPCTRACE, "Start getattr object "DFID"\n",
@@ -1839,7 +1839,7 @@ static int echo_getattr_object(const struct lu_env *env,
                lu_object_put(env, ec_child);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_lookup_object(const struct lu_env *env,
@@ -1897,7 +1897,7 @@ static int echo_md_destroy_internal(const struct lu_env *env,
        if (IS_ERR(ec_child)) {
                CERROR("Can't find child %s: rc = %ld\n", lname->ln_name,
                        PTR_ERR(ec_child));
-               RETURN(PTR_ERR(ec_child));
+               return PTR_ERR(ec_child);
        }
 
        child = lu_object_locate(ec_child->lo_header, ld->ld_type);
@@ -1939,7 +1939,7 @@ static int echo_destroy_object(const struct lu_env *env,
 
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        memset(ma, 0, sizeof(*ma));
        ma->ma_attr.la_mode = mode;
@@ -1953,7 +1953,7 @@ static int echo_destroy_object(const struct lu_env *env,
                lname->ln_namelen = namelen;
                rc = echo_md_destroy_internal(env, ed, lu2md(parent), lname,
                                              ma);
-               RETURN(rc);
+               return rc;
        }
 
        /*prepare the requests*/
@@ -1972,7 +1972,7 @@ static int echo_destroy_object(const struct lu_env *env,
                id++;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static struct lu_object *echo_resolve_path(const struct lu_env *env,
@@ -1992,7 +1992,7 @@ static struct lu_object *echo_resolve_path(const struct lu_env *env,
        rc = md->md_ops->mdo_root_get(env, md, fid);
        if (rc) {
                CERROR("get root error: rc = %d\n", rc);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* In the function below, .hs_keycmp resolves to
@@ -2002,7 +2002,7 @@ static struct lu_object *echo_resolve_path(const struct lu_env *env,
        if (IS_ERR(parent)) {
                CERROR("Can not find the parent "DFID": rc = %ld\n",
                        PFID(fid), PTR_ERR(parent));
-               RETURN(parent);
+               return parent;
        }
 
        while (1) {
@@ -2041,9 +2041,9 @@ static struct lu_object *echo_resolve_path(const struct lu_env *env,
                parent = child;
        }
        if (rc)
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
 
-       RETURN(parent);
+       return parent;
 }
 
 static void echo_ucred_init(struct lu_env *env)
@@ -2094,17 +2094,17 @@ static int echo_md_handler(struct echo_device *ed, int command,
 
        if (ld == NULL) {
                CERROR("MD echo client is not being initialized properly\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (strcmp(ld->ld_type->ldt_name, LUSTRE_MDD_NAME)) {
                CERROR("Only support MDD layer right now!\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        rc = lu_env_refill_by_tags(env, ECHO_MD_CTX_TAG, ECHO_MD_SES_TAG);
        if (rc != 0)
@@ -2209,7 +2209,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
            (on_target ||                      /* set_stripe */
             ec->ec_nstripes != 0)) {      /* LOV */
                CERROR ("No valid oid\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = echo_alloc_memmd(ed, &lsm);
@@ -2296,12 +2296,12 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
        if ((oa->o_valid & OBD_MD_FLID) == 0 || ostid_id(&oa->o_oi) == 0) {
                /* disallow use of object id 0 */
                CERROR ("No valid oid\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = echo_alloc_memmd(ed, &lsm);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        lsm->lsm_oi = oa->o_oi;
        if (!(oa->o_valid & OBD_MD_FLGROUP))
@@ -2315,7 +2315,7 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
                rc = PTR_ERR(eco);
        if (lsm)
                echo_free_memmd(ed, &lsm);
-       RETURN(rc);
+       return rc;
 }
 
 static void echo_put_object(struct echo_object *eco)
@@ -2447,7 +2447,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 
        if (count <= 0 ||
            (count & (~CFS_PAGE_MASK)) != 0)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* XXX think again with misaligned I/O */
        npages = count >> PAGE_CACHE_SHIFT;
@@ -2457,12 +2457,12 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 
        OBD_ALLOC(pga, npages * sizeof(*pga));
        if (pga == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC(pages, npages * sizeof(*pages));
        if (pages == NULL) {
                OBD_FREE(pga, npages * sizeof(*pga));
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        for (i = 0, pgp = pga, off = offset;
@@ -2511,7 +2511,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
        }
        OBD_FREE(pga, npages * sizeof(*pga));
        OBD_FREE(pages, npages * sizeof(*pages));
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_client_prep_commit(const struct lu_env *env,
@@ -2531,7 +2531,7 @@ static int echo_client_prep_commit(const struct lu_env *env,
 
        if (count <= 0 || (count & (~CFS_PAGE_MASK)) != 0 ||
            (lsm != NULL && ostid_id(&lsm->lsm_oi) != ostid_id(&oa->o_oi)))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        npages = batch >> PAGE_CACHE_SHIFT;
        tot_pages = count >> PAGE_CACHE_SHIFT;
@@ -2616,7 +2616,7 @@ out:
                OBD_FREE(lnb, npages * sizeof(struct niobuf_local));
        if (rnb)
                OBD_FREE(rnb, npages * sizeof(struct niobuf_remote));
-       RETURN(ret);
+       return ret;
 }
 
 static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
@@ -2637,7 +2637,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
 
        rc = echo_get_object(&eco, ed, oa);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        oa->o_valid &= ~OBD_MD_FLHANDLE;
 
@@ -2673,7 +2673,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
                rc = -EINVAL;
        }
        echo_put_object(eco);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -2687,18 +2687,18 @@ echo_client_enqueue(struct obd_export *exp, struct obdo *oa,
        int                  rc;
 
        if (ed->ed_next == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        if (!(mode == LCK_PR || mode == LCK_PW))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if ((offset & (~CFS_PAGE_MASK)) != 0 ||
            (nob & (~CFS_PAGE_MASK)) != 0)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        rc = echo_get_object (&eco, ed, oa);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        end = (nob == 0) ? ((obd_off) -1) : (offset + nob - 1);
        rc = cl_echo_enqueue(eco, offset, end, mode, &ulh->cookie);
@@ -2707,7 +2707,7 @@ echo_client_enqueue(struct obd_export *exp, struct obdo *oa,
                CDEBUG(D_INFO, "Cookie is "LPX64"\n", ulh->cookie);
        }
        echo_put_object(eco);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -2752,11 +2752,11 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
        /* This FID is unpacked just for validation at this point */
        rc = ostid_to_fid(&fid, &oa->o_oi, 0);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        OBD_ALLOC_PTR(env);
        if (env == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = lu_env_init(env, LCT_DT_THREAD);
        if (rc)
@@ -2958,14 +2958,14 @@ static int echo_client_setup(const struct lu_env *env,
 
        if (lcfg->lcfg_bufcount < 2 || LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
                CERROR("requires a TARGET OBD name\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        tgt = class_name2obd(lustre_cfg_string(lcfg, 1));
        if (!tgt || !tgt->obd_attached || !tgt->obd_set_up) {
                CERROR("device not attached or not set up (%s)\n",
                       lustre_cfg_string(lcfg, 1));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        spin_lock_init(&ec->ec_lock);
@@ -2977,7 +2977,7 @@ static int echo_client_setup(const struct lu_env *env,
        if (!strcmp(tgt->obd_type->typ_name, LUSTRE_MDT_NAME)) {
                lu_context_tags_update(ECHO_MD_CTX_TAG);
                lu_session_tags_update(ECHO_MD_SES_TAG);
-               RETURN(0);
+               return 0;
        }
 
        OBD_ALLOC(ocd, sizeof(*ocd));
@@ -3012,7 +3012,7 @@ static int echo_client_setup(const struct lu_env *env,
                return (rc);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_client_cleanup(struct obd_device *obddev)
@@ -3023,17 +3023,17 @@ static int echo_client_cleanup(struct obd_device *obddev)
 
        /*Do nothing for Metadata echo client*/
        if (ed == NULL )
-               RETURN(0);
+               return 0;
 
        if (ed->ed_next_ismd) {
                lu_context_tags_clear(ECHO_MD_CTX_TAG);
                lu_session_tags_clear(ECHO_MD_SES_TAG);
-               RETURN(0);
+               return 0;
        }
 
        if (!list_empty(&obddev->obd_exports)) {
                CERROR("still has clients!\n");
-               RETURN(-EBUSY);
+               return -EBUSY;
        }
 
        LASSERT(atomic_read(&ec->ec_exp->exp_refcount) > 0);
@@ -3041,7 +3041,7 @@ static int echo_client_cleanup(struct obd_device *obddev)
        if (rc != 0)
                CERROR("fail to disconnect device: %d\n", rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_client_connect(const struct lu_env *env,
@@ -3057,7 +3057,7 @@ static int echo_client_connect(const struct lu_env *env,
                *exp = class_conn2export(&conn);
        }
 
-       RETURN (rc);
+       return rc;
 }
 
 static int echo_client_disconnect(struct obd_export *exp)
@@ -3151,7 +3151,7 @@ static int __init obdecho_init(void)
 
        rc = echo_client_init();
 
-       RETURN(rc);
+       return rc;
 }
 
 static void /*__exit*/ obdecho_exit(void)
index daaab369c88b5f67c343ff92e3c91263f6c1762b..00295da4ab3dde634962ff6f475f91213365a570 100644 (file)
@@ -571,7 +571,7 @@ int osc_extent_release(const struct lu_env *env, struct osc_extent *ext)
                osc_io_unplug_async(env, osc_cli(obj), obj);
        }
        osc_extent_put(env, ext);
-       RETURN(rc);
+       return rc;
 }
 
 static inline int overlapped(struct osc_extent *ex1, struct osc_extent *ex2)
@@ -604,7 +604,7 @@ struct osc_extent *osc_extent_find(const struct lu_env *env,
 
        cur = osc_extent_alloc(obj);
        if (cur == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        lock = cl_lock_at_pgoff(env, osc2cl(obj), index, NULL, 1, 0);
        LASSERT(lock != NULL);
@@ -842,7 +842,7 @@ int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext,
        osc_extent_remove(ext);
        /* put the refcount for RPC */
        osc_extent_put(env, ext);
-       RETURN(0);
+       return 0;
 }
 
 static int extent_wait_cb(struct osc_extent *ext, int state)
@@ -897,7 +897,7 @@ static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext,
        }
        if (rc == 0 && ext->oe_rc < 0)
                rc = ext->oe_rc;
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1015,7 +1015,7 @@ static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
 out:
        cl_io_fini(env, io);
        cl_env_nested_put(&nest, env);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1089,7 +1089,7 @@ static int osc_extent_make_ready(const struct lu_env *env,
        /* get a refcount for RPC. */
        osc_extent_get(ext);
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1138,7 +1138,7 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index, int *grants)
 
 out:
        osc_object_unlock(obj);
-       RETURN(rc);
+       return rc;
 }
 
 static void osc_extent_tree_dump0(int level, struct osc_object *obj,
@@ -1201,7 +1201,7 @@ static int osc_make_ready(const struct lu_env *env, struct osc_async_page *oap,
        result = cl_page_make_ready(env, page, CRT_WRITE);
        if (result == 0)
                opg->ops_submit_time = cfs_time_current();
-       RETURN(result);
+       return result;
 }
 
 static int osc_refresh_count(const struct lu_env *env,
@@ -1293,7 +1293,7 @@ static int osc_completion(const struct lu_env *env, struct osc_async_page *oap,
 
        cl_page_completion(env, page, crt, rc);
 
-       RETURN(0);
+       return 0;
 }
 
 #define OSC_DUMP_GRANT(cli, fmt, args...) do {                               \
@@ -1543,7 +1543,7 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli,
 out:
        client_obd_list_unlock(&cli->cl_loi_list_lock);
        OSC_DUMP_GRANT(cli, "returned %d.\n", rc);
-       RETURN(rc);
+       return rc;
 }
 
 /* caller must hold loi_list_lock */
@@ -1602,42 +1602,42 @@ static int osc_makes_rpc(struct client_obd *cli, struct osc_object *osc,
 
        if (cmd & OBD_BRW_WRITE) {
                if (atomic_read(&osc->oo_nr_writes) == 0)
-                       RETURN(0);
+                       return 0;
                if (invalid_import) {
                        CDEBUG(D_CACHE, "invalid import forcing RPC\n");
-                       RETURN(1);
+                       return 1;
                }
                if (!list_empty(&osc->oo_hp_exts)) {
                        CDEBUG(D_CACHE, "high prio request forcing RPC\n");
-                       RETURN(1);
+                       return 1;
                }
                if (!list_empty(&osc->oo_urgent_exts)) {
                        CDEBUG(D_CACHE, "urgent request forcing RPC\n");
-                       RETURN(1);
+                       return 1;
                }
                /* trigger a write rpc stream as long as there are dirtiers
                 * waiting for space.  as they're waiting, they're not going to
                 * create more pages to coalesce with what's waiting.. */
                if (!list_empty(&cli->cl_cache_waiters)) {
                        CDEBUG(D_CACHE, "cache waiters forcing RPC\n");
-                       RETURN(1);
+                       return 1;
                }
                if (atomic_read(&osc->oo_nr_writes) >=
                    cli->cl_max_pages_per_rpc)
-                       RETURN(1);
+                       return 1;
        } else {
                if (atomic_read(&osc->oo_nr_reads) == 0)
-                       RETURN(0);
+                       return 0;
                if (invalid_import) {
                        CDEBUG(D_CACHE, "invalid import forcing RPC\n");
-                       RETURN(1);
+                       return 1;
                }
                /* all read are urgent. */
                if (!list_empty(&osc->oo_reading_exts))
-                       RETURN(1);
+                       return 1;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static void osc_update_pending(struct osc_object *obj, int cmd, int delta)
@@ -1776,7 +1776,7 @@ static int try_to_add_extent_for_io(struct client_obd *cli,
 
        *max_pages = max(ext->oe_mppr, *max_pages);
        if (*pc + ext->oe_nr_pages > *max_pages)
-               RETURN(0);
+               return 0;
 
        list_for_each_entry(tmp, rpclist, oe_link) {
                EASSERT(tmp->oe_owner == current, tmp);
@@ -1789,7 +1789,7 @@ static int try_to_add_extent_for_io(struct client_obd *cli,
 
                if (tmp->oe_srvlock != ext->oe_srvlock ||
                    !tmp->oe_grants != !ext->oe_grants)
-                       RETURN(0);
+                       return 0;
 
                /* remove break for strict check */
                break;
@@ -1798,7 +1798,7 @@ static int try_to_add_extent_for_io(struct client_obd *cli,
        *pc += ext->oe_nr_pages;
        list_move_tail(&ext->oe_link, rpclist);
        ext->oe_owner = current;
-       RETURN(1);
+       return 1;
 }
 
 /**
@@ -1894,7 +1894,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
        LASSERT(equi(page_count == 0, list_empty(&rpclist)));
 
        if (list_empty(&rpclist))
-               RETURN(0);
+               return 0;
 
        osc_update_pending(osc, OBD_BRW_WRITE, -page_count);
 
@@ -1935,7 +1935,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
        }
 
        osc_object_lock(osc);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1982,7 +1982,7 @@ osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli,
 
                osc_object_lock(osc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 #define list_to_obj(list, item) ({                                           \
@@ -1999,9 +1999,9 @@ static struct osc_object *osc_next_obj(struct client_obd *cli)
         * will be flushed quickly and other clients can get the lock,
         * then objects which have pages ready to be stuffed into RPCs */
        if (!list_empty(&cli->cl_loi_hp_ready_list))
-               RETURN(list_to_obj(&cli->cl_loi_hp_ready_list, hp_ready_item));
+               return list_to_obj(&cli->cl_loi_hp_ready_list, hp_ready_item);
        if (!list_empty(&cli->cl_loi_ready_list))
-               RETURN(list_to_obj(&cli->cl_loi_ready_list, ready_item));
+               return list_to_obj(&cli->cl_loi_ready_list, ready_item);
 
        /* then if we have cache waiters, return all objects with queued
         * writes.  This is especially important when many small files
@@ -2009,19 +2009,17 @@ static struct osc_object *osc_next_obj(struct client_obd *cli)
         * they don't pass the nr_pending/object threshhold */
        if (!list_empty(&cli->cl_cache_waiters) &&
            !list_empty(&cli->cl_loi_write_list))
-               RETURN(list_to_obj(&cli->cl_loi_write_list, write_item));
+               return list_to_obj(&cli->cl_loi_write_list, write_item);
 
        /* then return all queued objects when we have an invalid import
         * so that they get flushed */
        if (cli->cl_import == NULL || cli->cl_import->imp_invalid) {
                if (!list_empty(&cli->cl_loi_write_list))
-                       RETURN(list_to_obj(&cli->cl_loi_write_list,
-                                          write_item));
+                       return list_to_obj(&cli->cl_loi_write_list, write_item);
                if (!list_empty(&cli->cl_loi_read_list))
-                       RETURN(list_to_obj(&cli->cl_loi_read_list,
-                                          read_item));
+                       return list_to_obj(&cli->cl_loi_read_list, read_item);
        }
-       RETURN(NULL);
+       return NULL;
 }
 
 /* called with the loi list lock held */
@@ -2157,7 +2155,7 @@ int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops,
        spin_lock_init(&oap->oap_lock);
        CDEBUG(D_INFO, "oap %p page %p obj off "LPU64"\n",
               oap, page, oap->oap_obj_off);
-       RETURN(0);
+       return 0;
 }
 
 int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
@@ -2176,14 +2174,14 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
        int    rc = 0;
 
        if (oap->oap_magic != OAP_MAGIC)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (cli->cl_import == NULL || cli->cl_import->imp_invalid)
-               RETURN(-EIO);
+               return -EIO;
 
        if (!list_empty(&oap->oap_pending_item) ||
            !list_empty(&oap->oap_rpc_item))
-               RETURN(-EBUSY);
+               return -EBUSY;
 
        /* Set the OBD_BRW_SRVLOCK before the page is queued. */
        brw_flags |= ops->ops_srvlock ? OBD_BRW_SRVLOCK : 0;
@@ -2211,7 +2209,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
                if (rc == 0 && osc_quota_chkdq(cli, qid) == NO_QUOTA)
                        rc = -EDQUOT;
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
        oap->oap_cmd = cmd;
@@ -2319,7 +2317,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
                list_add_tail(&oap->oap_pending_item, &ext->oe_pages);
                osc_object_unlock(osc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 int osc_teardown_async_page(const struct lu_env *env,
@@ -2352,7 +2350,7 @@ int osc_teardown_async_page(const struct lu_env *env,
        osc_object_unlock(obj);
        if (ext != NULL)
                osc_extent_put(env, ext);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2491,7 +2489,7 @@ int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops)
        }
 
        osc_list_maint(cli, obj);
-       RETURN(rc);
+       return rc;
 }
 
 int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
@@ -2521,7 +2519,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
                        list_del_init(&oap->oap_pending_item);
                        osc_ap_completion(env, cli, oap, 0, -ENOMEM);
                }
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        ext->oe_rw = !!(cmd & OBD_BRW_READ);
@@ -2547,7 +2545,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
        osc_object_unlock(obj);
 
        osc_io_unplug(env, cli, obj, PDL_POLICY_ROUND);
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -2668,7 +2666,7 @@ again:
                waiting = NULL;
                goto again;
        }
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -2756,7 +2754,7 @@ again:
        osc_object_unlock(obj);
 
        OSC_IO_DEBUG(obj, "sync file range.\n");
-       RETURN(result);
+       return result;
 }
 
 /**
@@ -2871,7 +2869,7 @@ int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj,
        }
 
        OSC_IO_DEBUG(obj, "cache page out.\n");
-       RETURN(result);
+       return result;
 }
 
 /** @} osc */
index 4059591f25b064cdc6dfe2575fa48737b57a6ff4..35f25786763719a0b1ac407a5b3dae0015612fb6 100644 (file)
@@ -171,7 +171,7 @@ LU_TYPE_INIT_FINI(osc, &osc_key, &osc_session_key);
 static int osc_cl_process_config(const struct lu_env *env,
                                 struct lu_device *d, struct lustre_cfg *cfg)
 {
-       RETURN(osc_process_config_base(d->ld_obd, cfg));
+       return osc_process_config_base(d->ld_obd, cfg);
 }
 
 static const struct lu_device_operations osc_lu_ops = {
@@ -187,7 +187,7 @@ static const struct cl_device_operations osc_cl_ops = {
 static int osc_device_init(const struct lu_env *env, struct lu_device *d,
                           const char *name, struct lu_device *next)
 {
-       RETURN(0);
+       return 0;
 }
 
 static struct lu_device *osc_device_fini(const struct lu_env *env,
@@ -217,7 +217,7 @@ static struct lu_device *osc_device_alloc(const struct lu_env *env,
 
        OBD_ALLOC_PTR(od);
        if (od == NULL)
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
 
        cl_device_init(&od->od_cl, t);
        d = osc2lu_dev(od);
@@ -230,10 +230,10 @@ static struct lu_device *osc_device_alloc(const struct lu_env *env,
        rc = osc_setup(obd, cfg);
        if (rc) {
                osc_device_free(env, d);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
        od->od_exp = obd->obd_self_export;
-       RETURN(d);
+       return d;
 }
 
 static const struct lu_device_type_operations osc_device_type_ops = {
index 60e5c9d5cfa08d4ce611b965986d723d8ab4f351..3aeaf845cf278f69b917198aba4460c60ac50a7a 100644 (file)
@@ -275,7 +275,7 @@ static int osc_io_prepare_write(const struct lu_env *env,
                 * [from, to) bytes of this page to OST. -jay */
                cl_page_export(env, slice->cpl_page, 1);
 
-       RETURN(result);
+       return result;
 }
 
 static int osc_io_commit_write(const struct lu_env *env,
@@ -304,7 +304,7 @@ static int osc_io_commit_write(const struct lu_env *env,
                /* see osc_io_prepare_write() for lockless io handling. */
                cl_page_clip(env, slice->cpl_page, from, to);
 
-       RETURN(0);
+       return 0;
 }
 
 static int osc_io_fault_start(const struct lu_env *env,
@@ -325,7 +325,7 @@ static int osc_io_fault_start(const struct lu_env *env,
        if (fio->ft_writable)
                osc_page_touch_at(env, ios->cis_obj,
                                  fio->ft_index, fio->ft_nob);
-       RETURN(0);
+       return 0;
 }
 
 static int osc_async_upcall(void *a, int rc)
@@ -524,7 +524,7 @@ static int osc_io_read_start(const struct lu_env *env,
                }
                cl_object_attr_unlock(obj);
        }
-       RETURN(result);
+       return result;
 }
 
 static int osc_io_write_start(const struct lu_env *env,
@@ -547,7 +547,7 @@ static int osc_io_write_start(const struct lu_env *env,
                }
                cl_object_attr_unlock(obj);
        }
-       RETURN(result);
+       return result;
 }
 
 static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
@@ -578,7 +578,7 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
 
        rc = osc_sync_base(osc_export(obj), oinfo, osc_async_upcall, cbargs,
                           PTLRPCD_SET);
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_io_fsync_start(const struct lu_env *env,
@@ -617,7 +617,7 @@ static int osc_io_fsync_start(const struct lu_env *env,
                        result = rc;
        }
 
-       RETURN(result);
+       return result;
 }
 
 static void osc_io_fsync_end(const struct lu_env *env,
index d8fb36780070d13b9421691b021b87d32160dd74..5d7bdbfc871af2c9e0e2dd3b4bad76e3771f1a31 100644 (file)
@@ -580,7 +580,7 @@ static int osc_lock_upcall(void *cookie, int errcode)
                /* should never happen, similar to osc_ldlm_blocking_ast(). */
                LBUG();
        }
-       RETURN(errcode);
+       return errcode;
 }
 
 /**
@@ -1084,7 +1084,7 @@ static int osc_lock_enqueue_wait(const struct lu_env *env,
                        rc = CLO_WAIT;
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1160,7 +1160,7 @@ static int osc_lock_enqueue(const struct lu_env *env,
                }
        }
        LASSERT(ergo(ols->ols_glimpse, !osc_lock_is_lockless(ols)));
-       RETURN(result);
+       return result;
 }
 
 static int osc_lock_wait(const struct lu_env *env,
@@ -1280,7 +1280,7 @@ static int osc_lock_flush(struct osc_lock *ols, int discard)
                ols->ols_flush = 1;
                LINVRNT(!osc_lock_has_pages(ols));
        }
-       RETURN(result);
+       return result;
 }
 
 /**
index 5d6c7630784c424bc196445fa8529b45ad1ac2af..9d34de873fac8e5062d112c05b3bddf0cddec8dd 100644 (file)
@@ -193,7 +193,7 @@ static int osc_object_glimpse(const struct lu_env *env,
 
        lvb->lvb_size   = oinfo->loi_kms;
        lvb->lvb_blocks = oinfo->loi_lvb.lvb_blocks;
-       RETURN(0);
+       return 0;
 }
 
 
index 6aa59e93a047a25d6b432c84face06f3bcaecb7e..ed84df0a4e600442006fd2d4a94a97b9c0a9c2f4 100644 (file)
@@ -239,7 +239,7 @@ static int osc_page_cache_add(const struct lu_env *env,
                }
        }
 
-       RETURN(result);
+       return result;
 }
 
 void osc_index2policy(ldlm_policy_data_t *policy, const struct cl_object *obj,
@@ -300,7 +300,7 @@ static int osc_page_is_under_lock(const struct lu_env *env,
                        result = -EBUSY;
                cl_lock_put(env, lock);
        }
-       RETURN(result);
+       return result;
 }
 
 static void osc_page_disown(const struct lu_env *env,
@@ -479,7 +479,7 @@ static int osc_page_flush(const struct lu_env *env,
        int rc = 0;
 
        rc = osc_flush_async_page(env, io, opg);
-       RETURN(rc);
+       return rc;
 }
 
 static const struct cl_page_operations osc_page_ops = {
@@ -665,11 +665,11 @@ int osc_lru_shrink(struct client_obd *cli, int target)
 
        LASSERT(atomic_read(&cli->cl_lru_in_list) >= 0);
        if (atomic_read(&cli->cl_lru_in_list) == 0 || target <= 0)
-               RETURN(0);
+               return 0;
 
        env = cl_env_nested_get(&nest);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        pvec = osc_env_info(env)->oti_pvec;
        io = &osc_env_info(env)->oti_io;
@@ -752,7 +752,7 @@ int osc_lru_shrink(struct client_obd *cli, int target)
        cl_env_nested_put(&nest, env);
 
        atomic_dec(&cli->cl_lru_shrinkers);
-       RETURN(count > 0 ? count : rc);
+       return count > 0 ? count : rc;
 }
 
 static void osc_lru_add(struct client_obd *cli, struct osc_page *opg)
@@ -878,7 +878,7 @@ static int osc_lru_reserve(const struct lu_env *env, struct osc_object *obj,
        int rc = 0;
 
        if (cli->cl_cache == NULL) /* shall not be in LRU */
-               RETURN(0);
+               return 0;
 
        LASSERT(atomic_read(cli->cl_lru_left) >= 0);
        while (!cfs_atomic_add_unless(cli->cl_lru_left, -1, 0)) {
@@ -915,7 +915,7 @@ static int osc_lru_reserve(const struct lu_env *env, struct osc_object *obj,
                rc = 0;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /** @} osc */
index b178e213eecdf845cb68da8b71ef93be9d50c72d..9720c0e865c8d49c55f6d6b6d0360561523d1178 100644 (file)
@@ -61,11 +61,11 @@ int osc_quota_chkdq(struct client_obd *cli, const unsigned int qid[])
                         * quota space on this OST */
                        CDEBUG(D_QUOTA, "chkdq found noquota for %s %d\n",
                               type == USRQUOTA ? "user" : "grout", qid[type]);
-                       RETURN(NO_QUOTA);
+                       return NO_QUOTA;
                }
        }
 
-       RETURN(QUOTA_OK);
+       return QUOTA_OK;
 }
 
 #define MD_QUOTA_FLAG(type) ((type == USRQUOTA) ? OBD_MD_FLUSRQUOTA \
@@ -80,7 +80,7 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
        int rc = 0;
 
        if ((valid & (OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA)) == 0)
-               RETURN(0);
+               return 0;
 
        for (type = 0; type < MAXQUOTAS; type++) {
                struct osc_quota_info *oqi;
@@ -132,7 +132,7 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
                }
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -225,12 +225,12 @@ int osc_quota_setup(struct obd_device *obd)
        }
 
        if (type == MAXQUOTAS)
-               RETURN(0);
+               return 0;
 
        for (i = 0; i < type; i++)
                cfs_hash_putref(cli->cl_quota_hash[i]);
 
-       RETURN(-ENOMEM);
+       return -ENOMEM;
 }
 
 int osc_quota_cleanup(struct obd_device *obd)
@@ -241,7 +241,7 @@ int osc_quota_cleanup(struct obd_device *obd)
        for (type = 0; type < MAXQUOTAS; type++)
                cfs_hash_putref(cli->cl_quota_hash[type]);
 
-       RETURN(0);
+       return 0;
 }
 
 int osc_quotactl(struct obd_device *unused, struct obd_export *exp,
@@ -255,7 +255,7 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp,
                                        &RQF_OST_QUOTACTL, LUSTRE_OST_VERSION,
                                        OST_QUOTACTL);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        oqc = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
        *oqc = *oqctl;
@@ -277,7 +277,7 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp,
        }
        ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 int osc_quotacheck(struct obd_device *unused, struct obd_export *exp,
@@ -292,7 +292,7 @@ int osc_quotacheck(struct obd_device *unused, struct obd_export *exp,
                                        &RQF_OST_QUOTACHECK, LUSTRE_OST_VERSION,
                                        OST_QUOTACHECK);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
        *body = *oqctl;
@@ -306,7 +306,7 @@ int osc_quotacheck(struct obd_device *unused, struct obd_export *exp,
        if (rc)
                cli->cl_qchk_stat = rc;
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 int osc_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk)
@@ -321,5 +321,5 @@ int osc_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk)
        /* the client is not the previous one */
        if (rc == CL_NOT_QUOTACHECKED)
                rc = -EINTR;
-       RETURN(rc);
+       return rc;
 }
index 1f73a698baef60d129c0ac3e8b4dc82748917a45..611678c407a6ab7048b4242f694ddbb5d37809b5 100644 (file)
@@ -72,26 +72,26 @@ static int osc_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 
        lmm_size = sizeof(**lmmp);
        if (lmmp == NULL)
-               RETURN(lmm_size);
+               return lmm_size;
 
        if (*lmmp != NULL && lsm == NULL) {
                OBD_FREE(*lmmp, lmm_size);
                *lmmp = NULL;
-               RETURN(0);
+               return 0;
        } else if (unlikely(lsm != NULL && ostid_id(&lsm->lsm_oi) == 0)) {
-               RETURN(-EBADF);
+               return -EBADF;
        }
 
        if (*lmmp == NULL) {
                OBD_ALLOC(*lmmp, lmm_size);
                if (*lmmp == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
        }
 
        if (lsm)
                ostid_cpu_to_le(&lsm->lsm_oi, &(*lmmp)->lmm_oi);
 
-       RETURN(lmm_size);
+       return lmm_size;
 }
 
 /* Unpack OSC object metadata from disk storage (LE byte order). */
@@ -106,40 +106,40 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
                        CERROR("%s: lov_mds_md too small: %d, need %d\n",
                               exp->exp_obd->obd_name, lmm_bytes,
                               (int)sizeof(*lmm));
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
                /* XXX LOV_MAGIC etc check? */
 
                if (unlikely(ostid_id(&lmm->lmm_oi) == 0)) {
                        CERROR("%s: zero lmm_object_id: rc = %d\n",
                               exp->exp_obd->obd_name, -EINVAL);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
        lsm_size = lov_stripe_md_size(1);
        if (lsmp == NULL)
-               RETURN(lsm_size);
+               return lsm_size;
 
        if (*lsmp != NULL && lmm == NULL) {
                OBD_FREE((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
                OBD_FREE(*lsmp, lsm_size);
                *lsmp = NULL;
-               RETURN(0);
+               return 0;
        }
 
        if (*lsmp == NULL) {
                OBD_ALLOC(*lsmp, lsm_size);
                if (unlikely(*lsmp == NULL))
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                OBD_ALLOC((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
                if (unlikely((*lsmp)->lsm_oinfo[0] == NULL)) {
                        OBD_FREE(*lsmp, lsm_size);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                loi_init((*lsmp)->lsm_oinfo[0]);
        } else if (unlikely(ostid_id(&(*lsmp)->lsm_oi) == 0)) {
-               RETURN(-EBADF);
+               return -EBADF;
        }
 
        if (lmm != NULL)
@@ -152,7 +152,7 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
        else
                (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
 
-       RETURN(lsm_size);
+       return lsm_size;
 }
 
 static inline void osc_pack_capa(struct ptlrpc_request *req,
@@ -220,7 +220,7 @@ static int osc_getattr_interpret(const struct lu_env *env,
        }
 out:
        rc = aa->aa_oi->oi_cb_up(aa->aa_oi, rc);
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
@@ -232,13 +232,13 @@ static int osc_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_GETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GETATTR);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        osc_pack_req_body(req, oinfo);
@@ -251,7 +251,7 @@ static int osc_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
        aa->aa_oi = oinfo;
 
        ptlrpc_set_add_req(set, req);
-       RETURN(0);
+       return 0;
 }
 
 static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
@@ -263,13 +263,13 @@ static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_GETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GETATTR);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        osc_pack_req_body(req, oinfo);
@@ -307,13 +307,13 @@ static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_SETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SETATTR);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        osc_pack_req_body(req, oinfo);
@@ -333,7 +333,7 @@ static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
 
 out:
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_setattr_interpret(const struct lu_env *env,
@@ -353,7 +353,7 @@ static int osc_setattr_interpret(const struct lu_env *env,
                             &body->oa);
 out:
        rc = sa->sa_upcall(sa->sa_cookie, rc);
-       RETURN(rc);
+       return rc;
 }
 
 int osc_setattr_async_base(struct obd_export *exp, struct obd_info *oinfo,
@@ -367,13 +367,13 @@ int osc_setattr_async_base(struct obd_export *exp, struct obd_info *oinfo,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_SETATTR);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SETATTR);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        if (oti && oinfo->oi_oa->o_valid & OBD_MD_FLCOOKIE)
@@ -403,7 +403,7 @@ int osc_setattr_async_base(struct obd_export *exp, struct obd_info *oinfo,
                        ptlrpc_set_add_req(rqset, req);
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static int osc_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
@@ -429,7 +429,7 @@ int osc_real_create(struct obd_export *exp, struct obdo *oa,
        if (!lsm) {
                rc = obd_alloc_memmd(exp, &lsm);
                if (rc < 0)
-                       RETURN(rc);
+                       return rc;
        }
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_CREATE);
@@ -495,7 +495,7 @@ out_req:
 out:
        if (rc && !*ea)
                obd_free_memmd(exp, &lsm);
-       RETURN(rc);
+       return rc;
 }
 
 int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
@@ -509,13 +509,13 @@ int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_PUNCH);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_PUNCH);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
        req->rq_request_portal = OST_IO_PORTAL; /* bug 7198 */
        ptlrpc_at_set_req_timeout(req);
@@ -539,7 +539,7 @@ int osc_punch_base(struct obd_export *exp, struct obd_info *oinfo,
        else
                ptlrpc_set_add_req(rqset, req);
 
-       RETURN(0);
+       return 0;
 }
 
 static int osc_punch(const struct lu_env *env, struct obd_export *exp,
@@ -572,7 +572,7 @@ static int osc_sync_interpret(const struct lu_env *env,
        *fa->fa_oi->oi_oa = body->oa;
 out:
        rc = fa->fa_upcall(fa->fa_cookie, rc);
-       RETURN(rc);
+       return rc;
 }
 
 int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
@@ -586,13 +586,13 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_SYNC);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_set_capa_size(req, &RMF_CAPA1, oinfo->oi_capa);
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SYNC);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        /* overload the size and blocks fields in the oa with start/end */
@@ -616,7 +616,7 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
        else
                ptlrpc_set_add_req(rqset, req);
 
-       RETURN (0);
+       return 0;
 }
 
 static int osc_sync(const struct lu_env *env, struct obd_export *exp,
@@ -625,14 +625,14 @@ static int osc_sync(const struct lu_env *env, struct obd_export *exp,
 {
        if (!oinfo->oi_oa) {
                CDEBUG(D_INFO, "oa NULL\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        oinfo->oi_oa->o_size = start;
        oinfo->oi_oa->o_blocks = end;
        oinfo->oi_oa->o_valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS);
 
-       RETURN(osc_sync_base(exp, oinfo, oinfo->oi_cb_up, oinfo, set));
+       return osc_sync_base(exp, oinfo, oinfo->oi_cb_up, oinfo, set);
 }
 
 /* Find and cancel locally locks matched by @mode in the resource found by
@@ -654,19 +654,19 @@ static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
         * when we still want to cancel locks in advance and just cancel them
         * locally, without sending any RPC. */
        if (exp_connect_cancelset(exp) && !ns_connect_cancelset(ns))
-               RETURN(0);
+               return 0;
 
        ostid_build_res_name(&oa->o_oi, &res_id);
        res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
        if (res == NULL)
-               RETURN(0);
+               return 0;
 
        LDLM_RESOURCE_ADDREF(res);
        count = ldlm_cancel_resource_local(res, cancels, NULL, mode,
                                           lock_flags, 0, NULL);
        LDLM_RESOURCE_DELREF(res);
        ldlm_resource_putref(res);
-       RETURN(count);
+       return count;
 }
 
 static int osc_destroy_interpret(const struct lu_env *env,
@@ -710,16 +710,16 @@ int osc_create(const struct lu_env *env, struct obd_export *exp,
 
        if ((oa->o_valid & OBD_MD_FLFLAGS) &&
            oa->o_flags == OBD_FL_RECREATE_OBJS) {
-               RETURN(osc_real_create(exp, oa, ea, oti));
+               return osc_real_create(exp, oa, ea, oti);
        }
 
        if (!fid_seq_is_mdt(ostid_seq(&oa->o_oi)))
-               RETURN(osc_real_create(exp, oa, ea, oti));
+               return osc_real_create(exp, oa, ea, oti);
 
        /* we should not get here anymore */
        LBUG();
 
-       RETURN(rc);
+       return rc;
 }
 
 /* Destroy requests can be async always on the client, and we don't even really
@@ -745,7 +745,7 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
 
        if (!oa) {
                CDEBUG(D_INFO, "oa NULL\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        count = osc_resource_get_unused(exp, oa, &cancels, LCK_PW,
@@ -754,7 +754,7 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_OST_DESTROY);
        if (req == NULL) {
                ldlm_lock_list_put(&cancels, l_bl_ast, count);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        osc_set_capa_size(req, &RMF_CAPA1, (struct obd_capa *)capa);
@@ -762,7 +762,7 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
                               0, &cancels, count);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        req->rq_request_portal = OST_IO_PORTAL; /* bug 7198 */
@@ -798,7 +798,7 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
 
        /* Do not wait for response */
        ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1);
-       RETURN(0);
+       return 0;
 }
 
 static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,
@@ -939,13 +939,13 @@ int osc_shrink_grant_to_target(struct client_obd *cli, __u64 target_bytes)
 
        if (target_bytes >= cli->cl_avail_grant) {
                client_obd_list_unlock(&cli->cl_loi_list_lock);
-               RETURN(0);
+               return 0;
        }
        client_obd_list_unlock(&cli->cl_loi_list_lock);
 
        OBD_ALLOC_PTR(body);
        if (!body)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        osc_announce_cached(cli, &body->oa, 0);
 
@@ -966,7 +966,7 @@ int osc_shrink_grant_to_target(struct client_obd *cli, __u64 target_bytes)
        if (rc != 0)
                __osc_update_grant(cli, body->oa.o_grant);
        OBD_FREE_PTR(body);
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_should_shrink_grant(struct client_obd *client)
@@ -1237,9 +1237,9 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
        struct brw_page *pg_prev;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ))
-               RETURN(-ENOMEM); /* Recoverable */
+               return -ENOMEM; /* Recoverable */
        if (OBD_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ2))
-               RETURN(-EINVAL); /* Fatal */
+               return -EINVAL; /* Fatal */
 
        if ((cmd & OBD_BRW_WRITE) != 0) {
                opc = OST_WRITE;
@@ -1251,7 +1251,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
                req = ptlrpc_request_alloc(cli->cl_import, &RQF_OST_BRW_READ);
        }
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        for (niocount = i = 1; i < page_count; i++) {
                if (!can_merge_pages(pga[i - 1], pga[i]))
@@ -1268,7 +1268,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, opc);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
        req->rq_request_portal = OST_IO_PORTAL; /* bug 7198 */
        ptlrpc_at_set_req_timeout(req);
@@ -1414,11 +1414,11 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
                aa->aa_ocapa = capa_get(ocapa);
 
        *reqp = req;
-       RETURN(0);
+       return 0;
 
  out:
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer,
@@ -1478,14 +1478,14 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
 
        if (rc < 0 && rc != -EDQUOT) {
                DEBUG_REQ(D_INFO, req, "Failed request with rc = %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        LASSERTF(req->rq_repmsg != NULL, "rc = %d\n", rc);
        body = req_capsule_server_get(&req->rq_pill, &RMF_OST_BODY);
        if (body == NULL) {
                DEBUG_REQ(D_INFO, req, "Can't unpack body\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        /* set/clear over quota flag for a uid/gid */
@@ -1502,7 +1502,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
        osc_update_grant(cli, body);
 
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        if (aa->aa_oa->o_valid & OBD_MD_FLCKSUM)
                client_cksum = aa->aa_oa->o_cksum; /* save for later */
@@ -1510,19 +1510,19 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
        if (lustre_msg_get_opc(req->rq_reqmsg) == OST_WRITE) {
                if (rc > 0) {
                        CERROR("Unexpected +ve rc %d\n", rc);
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
                LASSERT(req->rq_bulk->bd_nob == aa->aa_requested_nob);
 
                if (sptlrpc_cli_unwrap_bulk_write(req, req->rq_bulk))
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
 
                if ((aa->aa_oa->o_valid & OBD_MD_FLCKSUM) && client_cksum &&
                    check_write_checksum(&body->oa, peer, client_cksum,
                                         body->oa.o_cksum, aa->aa_requested_nob,
                                         aa->aa_page_count, aa->aa_ppga,
                                         cksum_type_unpack(aa->aa_oa->o_flags)))
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
 
                rc = check_write_rcs(req, aa->aa_requested_nob,aa->aa_nio_count,
                                     aa->aa_page_count, aa->aa_ppga);
@@ -1539,7 +1539,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
        if (rc > aa->aa_requested_nob) {
                CERROR("Unexpected rc %d (%d requested)\n", rc,
                       aa->aa_requested_nob);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (rc != req->rq_bulk->bd_nob_transferred) {
@@ -1619,7 +1619,7 @@ out:
                lustre_get_wire_obdo(&req->rq_import->imp_connect_data,
                                     aa->aa_oa, &body->oa);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_brw_internal(int cmd, struct obd_export *exp, struct obdo *oa,
@@ -1687,7 +1687,7 @@ restart_bulk:
 out:
        if (rc == -EAGAIN || rc == -EINPROGRESS)
                rc = -EIO;
-       RETURN (rc);
+       return rc;
 }
 
 static int osc_brw_redo_request(struct ptlrpc_request *request,
@@ -1707,7 +1707,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
                                  aa->aa_page_count, aa->aa_ppga,
                                  &new_req, aa->aa_ocapa, 0, 1);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        list_for_each_entry(oap, &aa->aa_oaps, oap_rpc_item) {
                if (oap->oap_request != NULL) {
@@ -1716,7 +1716,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
                                 request, oap->oap_request);
                        if (oap->oap_interrupted) {
                                ptlrpc_req_finished(new_req);
-                               RETURN(-EINTR);
+                               return -EINTR;
                        }
                }
        }
@@ -1759,7 +1759,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
        ptlrpcd_add_req(new_req, PDL_POLICY_SAME, -1);
 
        DEBUG_REQ(D_INFO, new_req, "new request");
-       RETURN(0);
+       return 0;
 }
 
 /*
@@ -1857,8 +1857,8 @@ static int osc_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
                 * I/O can succeed */
 
                if (imp->imp_invalid)
-                       RETURN(-EIO);
-               RETURN(0);
+                       return -EIO;
+               return 0;
        }
 
        /* test_brw with a failed create can trip this, maybe others. */
@@ -1868,7 +1868,7 @@ static int osc_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
 
        orig = ppga = osc_build_ppga(pga, page_count);
        if (ppga == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        page_count_orig = page_count;
 
        sort_brw_pages(ppga, page_count);
@@ -1909,7 +1909,7 @@ out:
        if (saved_oa != NULL)
                OBDO_FREE(saved_oa);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int brw_interpret(const struct lu_env *env,
@@ -1943,7 +1943,7 @@ static int brw_interpret(const struct lu_env *env,
                }
 
                if (rc == 0)
-                       RETURN(0);
+                       return 0;
                else if (rc == -EAGAIN || rc == -EINPROGRESS)
                        rc = -EIO;
        }
@@ -2013,7 +2013,7 @@ static int brw_interpret(const struct lu_env *env,
        client_obd_list_unlock(&cli->cl_loi_list_lock);
 
        osc_io_unplug(env, cli, NULL, PDL_POLICY_SAME);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2228,7 +2228,7 @@ out:
                if (clerq && !IS_ERR(clerq))
                        cl_req_completion(env, clerq, rc);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_set_lock_data_with_check(struct ldlm_lock *lock,
@@ -2333,7 +2333,7 @@ static int osc_enqueue_fini(struct ptlrpc_request *req, struct ost_lvb *lvb,
 
        /* Call the update callback. */
        rc = (*upcall)(cookie, rc);
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_enqueue_interpret(const struct lu_env *env,
@@ -2507,7 +2507,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                         * Return -ECANCELED to tell the caller. */
                        ldlm_lock_decref(lockh, mode);
                        LDLM_LOCK_PUT(matched);
-                       RETURN(-ECANCELED);
+                       return -ECANCELED;
                } else if (osc_set_lock_data_with_check(matched, einfo)) {
                        *flags |= LDLM_FL_LVB_READY;
                        /* addref the lock only if not async requests and PW
@@ -2532,7 +2532,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                                /* For async requests, decref the lock. */
                                ldlm_lock_decref(lockh, einfo->ei_mode);
                        LDLM_LOCK_PUT(matched);
-                       RETURN(ELDLM_OK);
+                       return ELDLM_OK;
                } else {
                        ldlm_lock_decref(lockh, mode);
                        LDLM_LOCK_PUT(matched);
@@ -2545,12 +2545,12 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                           &RQF_LDLM_ENQUEUE_LVB);
                if (req == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                rc = ldlm_prep_enqueue_req(exp, req, &cancels, 0);
                if (rc) {
                        ptlrpc_request_free(req);
-                       RETURN(rc);
+                       return rc;
                }
 
                req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
@@ -2586,14 +2586,14 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                } else if (intent) {
                        ptlrpc_req_finished(req);
                }
-               RETURN(rc);
+               return rc;
        }
 
        rc = osc_enqueue_fini(req, lvb, upcall, cookie, flags, agl, rc);
        if (intent)
                ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_enqueue(struct obd_export *exp, struct obd_info *oinfo,
@@ -2609,7 +2609,7 @@ static int osc_enqueue(struct obd_export *exp, struct obd_info *oinfo,
                              oinfo->oi_md->lsm_oinfo[0]->loi_kms_valid,
                              oinfo->oi_cb_up, oinfo, einfo, oinfo->oi_lockh,
                              rqset, rqset != NULL, 0);
-       RETURN(rc);
+       return rc;
 }
 
 int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
@@ -2622,7 +2622,7 @@ int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
        ldlm_mode_t rc;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OSC_MATCH))
-               RETURN(-EIO);
+               return -EIO;
 
        /* Filesystem lock extents are extended to page boundaries so that
         * dealing with the page cache is a little smoother */
@@ -2643,16 +2643,16 @@ int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
                        if (!osc_set_data_with_check(lockh, data)) {
                                if (!(lflags & LDLM_FL_TEST_LOCK))
                                        ldlm_lock_decref(lockh, rc);
-                               RETURN(0);
+                               return 0;
                        }
                }
                if (!(lflags & LDLM_FL_TEST_LOCK) && mode != rc) {
                        ldlm_lock_addref(lockh, LCK_PR);
                        ldlm_lock_decref(lockh, LCK_PW);
                }
-               RETURN(rc);
+               return rc;
        }
-       RETURN(rc);
+       return rc;
 }
 
 int osc_cancel_base(struct lustre_handle *lockh, __u32 mode)
@@ -2662,13 +2662,13 @@ int osc_cancel_base(struct lustre_handle *lockh, __u32 mode)
        else
                ldlm_lock_decref(lockh, mode);
 
-       RETURN(0);
+       return 0;
 }
 
 static int osc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
                      __u32 mode, struct lustre_handle *lockh)
 {
-       RETURN(osc_cancel_base(lockh, mode));
+       return osc_cancel_base(lockh, mode);
 }
 
 static int osc_cancel_unused(struct obd_export *exp,
@@ -2699,7 +2699,7 @@ static int osc_statfs_interpret(const struct lu_env *env,
                 * Exit immediately since the caller is
                 * aware of the problem and takes care
                 * of the clean up */
-                RETURN(rc);
+                return rc;
 
        if ((rc == -ENOTCONN || rc == -EAGAIN) &&
            (aa->aa_oi->oi_flags & OBD_STATFS_NODELAY))
@@ -2716,7 +2716,7 @@ static int osc_statfs_interpret(const struct lu_env *env,
        *aa->aa_oi->oi_osfs = *msfs;
 out:
        rc = aa->aa_oi->oi_cb_up(aa->aa_oi, rc);
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_statfs_async(struct obd_export *exp,
@@ -2736,12 +2736,12 @@ static int osc_statfs_async(struct obd_export *exp,
         * timestamps are not ideal because they need time synchronization. */
        req = ptlrpc_request_alloc(obd->u.cli.cl_import, &RQF_OST_STATFS);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_STATFS);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
        ptlrpc_request_set_replen(req);
        req->rq_request_portal = OST_CREATE_PORTAL;
@@ -2759,7 +2759,7 @@ static int osc_statfs_async(struct obd_export *exp,
        aa->aa_oi = oinfo;
 
        ptlrpc_set_add_req(rqset, req);
-       RETURN(0);
+       return 0;
 }
 
 static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
@@ -2778,7 +2778,7 @@ static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
                imp = class_import_get(obd->u.cli.cl_import);
        up_read(&obd->u.cli.cl_sem);
        if (!imp)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        /* We could possibly pass max_age in the request (as an absolute
         * timestamp or a "seconds.usec ago") so the target can avoid doing
@@ -2791,12 +2791,12 @@ static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
        class_import_put(imp);
 
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_STATFS);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
        ptlrpc_request_set_replen(req);
        req->rq_request_portal = OST_CREATE_PORTAL;
@@ -2838,17 +2838,17 @@ static int osc_getstripe(struct lov_stripe_md *lsm, struct lov_user_md *lump)
        int rc = 0, lum_size;
 
        if (!lsm)
-               RETURN(-ENODATA);
+               return -ENODATA;
 
        /* we only need the header part from user space to get lmm_magic and
         * lmm_stripe_count, (the header part is common to v1 and v3) */
        lum_size = sizeof(struct lov_user_md_v1);
        if (copy_from_user(&lum, lump, lum_size))
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        if ((lum.lmm_magic != LOV_USER_MAGIC_V1) &&
            (lum.lmm_magic != LOV_USER_MAGIC_V3))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* lov_user_md_vX and lov_mds_md_vX must have the same size */
        LASSERT(sizeof(struct lov_user_md_v1) == sizeof(struct lov_mds_md_v1));
@@ -2861,7 +2861,7 @@ static int osc_getstripe(struct lov_stripe_md *lsm, struct lov_user_md *lump)
                lum_size = lov_mds_md_size(lum.lmm_stripe_count, lum.lmm_magic);
                OBD_ALLOC(lumk, lum_size);
                if (!lumk)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                if (lum.lmm_magic == LOV_USER_MAGIC_V1)
                        lmm_objects =
@@ -2883,7 +2883,7 @@ static int osc_getstripe(struct lov_stripe_md *lsm, struct lov_user_md *lump)
        if (lumk != &lum)
                OBD_FREE(lumk, lum_size);
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -2977,13 +2977,13 @@ static int osc_get_info(const struct lu_env *env, struct obd_export *exp,
                        struct lov_stripe_md *lsm)
 {
        if (!vallen || !val)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        if (KEY_IS(KEY_LOCK_TO_STRIPE)) {
                __u32 *stripe = val;
                *vallen = sizeof(*stripe);
                *stripe = 0;
-               RETURN(0);
+               return 0;
        } else if (KEY_IS(KEY_LAST_ID)) {
                struct ptlrpc_request *req;
                obd_id          *reply;
@@ -2993,14 +2993,14 @@ static int osc_get_info(const struct lu_env *env, struct obd_export *exp,
                req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                           &RQF_OST_GET_INFO_LAST_ID);
                if (req == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_KEY,
                                     RCL_CLIENT, keylen);
                rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GET_INFO);
                if (rc) {
                        ptlrpc_request_free(req);
-                       RETURN(rc);
+                       return rc;
                }
 
                tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
@@ -3019,7 +3019,7 @@ static int osc_get_info(const struct lu_env *env, struct obd_export *exp,
                *((obd_id *)val) = *reply;
        out:
                ptlrpc_req_finished(req);
-               RETURN(rc);
+               return rc;
        } else if (KEY_IS(KEY_FIEMAP)) {
                struct ll_fiemap_info_key *fm_key =
                                (struct ll_fiemap_info_key *)key;
@@ -3101,10 +3101,10 @@ fini_req:
 drop_lock:
                if (mode)
                        ldlm_lock_decref(&lockh, LCK_PR);
-               RETURN(rc);
+               return rc;
        }
 
-       RETURN(-EINVAL);
+       return -EINVAL;
 }
 
 static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
@@ -3121,19 +3121,19 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
 
        if (KEY_IS(KEY_CHECKSUM)) {
                if (vallen != sizeof(int))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                exp->exp_obd->u.cli.cl_checksum = (*(int *)val) ? 1 : 0;
-               RETURN(0);
+               return 0;
        }
 
        if (KEY_IS(KEY_SPTLRPC_CONF)) {
                sptlrpc_conf_client_adapt(obd);
-               RETURN(0);
+               return 0;
        }
 
        if (KEY_IS(KEY_FLUSH_CTX)) {
                sptlrpc_import_flush_my_ctx(imp);
-               RETURN(0);
+               return 0;
        }
 
        if (KEY_IS(KEY_CACHE_SET)) {
@@ -3150,7 +3150,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                list_add(&cli->cl_lru_osc, &cli->cl_cache->ccc_lru);
                spin_unlock(&cli->cl_cache->ccc_lru_lock);
 
-               RETURN(0);
+               return 0;
        }
 
        if (KEY_IS(KEY_CACHE_LRU_SHRINK)) {
@@ -3160,11 +3160,11 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
 
                nr = osc_lru_shrink(cli, min(nr, target));
                *(int *)val -= nr;
-               RETURN(0);
+               return 0;
        }
 
        if (!set && !KEY_IS(KEY_GRANT_SHRINK))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* We pass all other commands directly to OST. Since nobody calls osc
           methods directly and everybody is supposed to go through LOV, we
@@ -3177,7 +3177,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                                                &RQF_OST_SET_GRANT_INFO :
                                                &RQF_OBD_SET_INFO);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_KEY,
                             RCL_CLIENT, keylen);
@@ -3187,7 +3187,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_SET_INFO);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
@@ -3206,7 +3206,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
                OBDO_ALLOC(oa);
                if (!oa) {
                        ptlrpc_req_finished(req);
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                *oa = ((struct ost_body *)val)->oa;
                aa->aa_oa = oa;
@@ -3221,7 +3221,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
        } else
                ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1);
 
-       RETURN(0);
+       return 0;
 }
 
 
@@ -3247,7 +3247,7 @@ static int osc_llog_finish(struct obd_device *obd, int count)
        ctxt = llog_get_context(obd, LLOG_SIZE_REPL_CTXT);
        if (ctxt)
                llog_cleanup(NULL, ctxt);
-       RETURN(0);
+       return 0;
 }
 
 static int osc_reconnect(const struct lu_env *env,
@@ -3273,7 +3273,7 @@ static int osc_reconnect(const struct lu_env *env,
                       data->ocd_version, data->ocd_grant, lost_grant);
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static int osc_disconnect(struct obd_export *exp)
@@ -3388,7 +3388,7 @@ static int osc_import_event(struct obd_device *obd,
                CERROR("Unknown import event %d\n", event);
                LBUG();
        }
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -3412,9 +3412,9 @@ static int osc_cancel_for_recovery(struct ldlm_lock *lock)
            (lock->l_granted_mode == LCK_PR ||
             lock->l_granted_mode == LCK_CR) &&
            (osc_dlm_lock_pageref(lock) == 0))
-               RETURN(1);
+               return 1;
 
-       RETURN(0);
+       return 0;
 }
 
 static int brw_queue_work(const struct lu_env *env, void *data)
@@ -3424,7 +3424,7 @@ static int brw_queue_work(const struct lu_env *env, void *data)
        CDEBUG(D_CACHE, "Run writeback work for client obd %p.\n", cli);
 
        osc_io_unplug(env, cli, NULL, PDL_POLICY_SAME);
-       RETURN(0);
+       return 0;
 }
 
 int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
@@ -3436,7 +3436,7 @@ int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        rc = ptlrpcd_addref();
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = client_obd_setup(obd, lcfg);
        if (rc)
@@ -3471,7 +3471,7 @@ int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        INIT_LIST_HEAD(&cli->cl_grant_shrink_list);
        ns_register_cancel(obd->obd_namespace, osc_cancel_for_recovery);
-       RETURN(rc);
+       return rc;
 
 out_ptlrpcd_work:
        ptlrpcd_destroy_work(handler);
@@ -3479,7 +3479,7 @@ out_client_setup:
        client_obd_cleanup(obd);
 out_ptlrpcd:
        ptlrpcd_decref();
-       RETURN(rc);
+       return rc;
 }
 
 static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
@@ -3523,7 +3523,7 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                break;
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 int osc_cleanup(struct obd_device *obd)
@@ -3548,7 +3548,7 @@ int osc_cleanup(struct obd_device *obd)
        rc = client_obd_cleanup(obd);
 
        ptlrpcd_decref();
-       RETURN(rc);
+       return rc;
 }
 
 int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg)
@@ -3630,7 +3630,7 @@ int __init osc_init(void)
 
        rc = lu_kmem_init(osc_caches);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        lprocfs_osc_init_vars(&lvars);
 
@@ -3638,13 +3638,13 @@ int __init osc_init(void)
                                 LUSTRE_OSC_NAME, &osc_device_type);
        if (rc) {
                lu_kmem_fini(osc_caches);
-               RETURN(rc);
+               return rc;
        }
 
        spin_lock_init(&osc_ast_guard);
        lockdep_set_class(&osc_ast_guard, &osc_ast_guard_class);
 
-       RETURN(rc);
+       return rc;
 }
 
 static void /*__exit*/ osc_exit(void)
index 9bcfc4f65356dd8cfe7c9f8d8d10cbf419d17ae9..810a458caed73aaea8a34e0ba1abb65f12336d0a 100644 (file)
@@ -140,7 +140,7 @@ struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req,
        LASSERT(type == BULK_PUT_SINK || type == BULK_GET_SOURCE);
        desc = ptlrpc_new_bulk(npages, max_brw, type, portal);
        if (desc == NULL)
-               RETURN(NULL);
+               return NULL;
 
        desc->bd_import_generation = req->rq_import_generation;
        desc->bd_import = class_import_get(imp);
@@ -340,7 +340,7 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
        rc = sptlrpc_cli_unwrap_early_reply(req, &early_req);
        if (rc) {
                spin_lock(&req->rq_lock);
-               RETURN(rc);
+               return rc;
        }
 
        rc = unpack_reply(early_req);
@@ -356,7 +356,7 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
 
        if (rc != 0) {
                spin_lock(&req->rq_lock);
-               RETURN(rc);
+               return rc;
        }
 
        /* Adjust the local timeout for this req */
@@ -375,7 +375,7 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
                  cfs_time_sub(req->rq_deadline, cfs_time_current_sec()),
                  cfs_time_sub(req->rq_deadline, olddl));
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -596,7 +596,7 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
 
        lustre_msg_set_opc(request->rq_reqmsg, opcode);
 
-       RETURN(0);
+       return 0;
 out_ctx:
        sptlrpc_cli_ctx_put(request->rq_cli_ctx, 1);
 out_free:
@@ -819,7 +819,7 @@ struct ptlrpc_request_set *ptlrpc_prep_set(void)
 
        OBD_ALLOC(set, sizeof *set);
        if (!set)
-               RETURN(NULL);
+               return NULL;
        atomic_set(&set->set_refcount, 1);
        INIT_LIST_HEAD(&set->set_requests);
        init_waitqueue_head(&set->set_waitq);
@@ -833,7 +833,7 @@ struct ptlrpc_request_set *ptlrpc_prep_set(void)
        set->set_producer_arg = NULL;
        set->set_rc        = 0;
 
-       RETURN(set);
+       return set;
 }
 EXPORT_SYMBOL(ptlrpc_prep_set);
 
@@ -853,13 +853,13 @@ struct ptlrpc_request_set *ptlrpc_prep_fcset(int max, set_producer_func func,
 
        set = ptlrpc_prep_set();
        if (!set)
-               RETURN(NULL);
+               return NULL;
 
        set->set_max_inflight  = max;
        set->set_producer      = func;
        set->set_producer_arg  = arg;
 
-       RETURN(set);
+       return set;
 }
 EXPORT_SYMBOL(ptlrpc_prep_fcset);
 
@@ -933,13 +933,13 @@ int ptlrpc_set_add_cb(struct ptlrpc_request_set *set,
 
        OBD_ALLOC_PTR(cbdata);
        if (cbdata == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        cbdata->psc_interpret = fn;
        cbdata->psc_data = data;
        list_add_tail(&cbdata->psc_item, &set->set_cblist);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_set_add_cb);
 
@@ -1069,7 +1069,7 @@ static int ptlrpc_import_delay_req(struct obd_import *imp,
                }
        }
 
-       RETURN(delay);
+       return delay;
 }
 
 /**
@@ -1123,7 +1123,7 @@ static int ptlrpc_check_status(struct ptlrpc_request *req)
                                           libcfs_nid2str(
                                           imp->imp_connection->c_peer.nid),
                                           ll_opcode2str(opc), err);
-               RETURN(err < 0 ? err : -EINVAL);
+               return err < 0 ? err : -EINVAL;
        }
 
        if (err < 0) {
@@ -1133,7 +1133,7 @@ static int ptlrpc_check_status(struct ptlrpc_request *req)
                DEBUG_REQ(D_INFO, req, "status is %d", err);
        }
 
-       RETURN(err);
+       return err;
 }
 
 /**
@@ -1180,7 +1180,7 @@ static int after_reply(struct ptlrpc_request *req)
                        DEBUG_REQ(D_ERROR, req, "reply buffer overflow,"
                                  " expected: %d, actual size: %d",
                                  req->rq_nob_received, req->rq_repbuf_len);
-                       RETURN(-EOVERFLOW);
+                       return -EOVERFLOW;
                }
 
                sptlrpc_cli_free_repbuf(req);
@@ -1191,7 +1191,7 @@ static int after_reply(struct ptlrpc_request *req)
                req->rq_replen       = req->rq_nob_received;
                req->rq_nob_received = 0;
                req->rq_resend       = 1;
-               RETURN(0);
+               return 0;
        }
 
        /*
@@ -1201,18 +1201,18 @@ static int after_reply(struct ptlrpc_request *req)
        rc = sptlrpc_cli_unwrap_reply(req);
        if (rc) {
                DEBUG_REQ(D_ERROR, req, "unwrap reply failed (%d):", rc);
-               RETURN(rc);
+               return rc;
        }
 
        /*
         * Security layer unwrap might ask resend this request.
         */
        if (req->rq_resend)
-               RETURN(0);
+               return 0;
 
        rc = unpack_reply(req);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        /* retry indefinitely on EINPROGRESS */
        if (lustre_msg_get_status(req->rq_repmsg) == -EINPROGRESS &&
@@ -1243,7 +1243,7 @@ static int after_reply(struct ptlrpc_request *req)
                else
                        req->rq_sent = now + req->rq_nr_resend;
 
-               RETURN(0);
+               return 0;
        }
 
        do_gettimeofday(&work_start);
@@ -1258,7 +1258,7 @@ static int after_reply(struct ptlrpc_request *req)
            lustre_msg_get_type(req->rq_repmsg) != PTL_RPC_MSG_ERR) {
                DEBUG_REQ(D_ERROR, req, "invalid packet received (type=%u)",
                          lustre_msg_get_type(req->rq_repmsg));
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (lustre_msg_get_opc(req->rq_reqmsg) != OBD_PING)
@@ -1279,10 +1279,10 @@ static int after_reply(struct ptlrpc_request *req)
                if (ll_rpc_recoverable_error(rc)) {
                        if (req->rq_send_state != LUSTRE_IMP_FULL ||
                            imp->imp_obd->obd_no_recov || imp->imp_dlm_fake) {
-                               RETURN(rc);
+                               return rc;
                        }
                        ptlrpc_request_handle_notconn(req);
-                       RETURN(rc);
+                       return rc;
                }
        } else {
                /*
@@ -1346,7 +1346,7 @@ static int after_reply(struct ptlrpc_request *req)
                spin_unlock(&imp->imp_lock);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1363,7 +1363,7 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
        if (req->rq_sent && (req->rq_sent > cfs_time_current_sec()) &&
            (!req->rq_generation_set ||
             req->rq_import_generation == imp->imp_generation))
-               RETURN (0);
+               return 0;
 
        ptlrpc_rqphase_move(req, RQ_PHASE_RPC);
 
@@ -1385,14 +1385,14 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
                list_add_tail(&req->rq_list, &imp->imp_delayed_list);
                atomic_inc(&req->rq_import->imp_inflight);
                spin_unlock(&imp->imp_lock);
-               RETURN(0);
+               return 0;
        }
 
        if (rc != 0) {
                spin_unlock(&imp->imp_lock);
                req->rq_status = rc;
                ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
-               RETURN(rc);
+               return rc;
        }
 
        LASSERT(list_empty(&req->rq_list));
@@ -1406,10 +1406,10 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
        if (rc) {
                if (req->rq_err) {
                        req->rq_status = rc;
-                       RETURN(1);
+                       return 1;
                } else {
                        req->rq_wait_ctx = 1;
-                       RETURN(0);
+                       return 0;
                }
        }
 
@@ -1424,9 +1424,9 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
        if (rc) {
                DEBUG_REQ(D_HA, req, "send failed (%d); expect timeout", rc);
                req->rq_net_err = 1;
-               RETURN(rc);
+               return rc;
        }
-       RETURN(0);
+       return 0;
 }
 
 static inline int ptlrpc_set_producer(struct ptlrpc_request_set *set)
@@ -1445,11 +1445,11 @@ static inline int ptlrpc_set_producer(struct ptlrpc_request_set *set)
                        /* no more RPC to produce */
                        set->set_producer     = NULL;
                        set->set_producer_arg = NULL;
-                       RETURN(0);
+                       return 0;
                }
        }
 
-       RETURN((atomic_read(&set->set_remaining) - remaining));
+       return (atomic_read(&set->set_remaining) - remaining);
 }
 
 /**
@@ -1464,7 +1464,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
        int force_timer_recalc = 0;
 
        if (atomic_read(&set->set_remaining) == 0)
-               RETURN(1);
+               return 1;
 
        list_for_each_safe(tmp, next, &set->set_requests) {
                struct ptlrpc_request *req =
@@ -1817,7 +1817,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
        }
 
        /* If we hit an error, we want to recover promptly. */
-       RETURN(atomic_read(&set->set_remaining) == 0 || force_timer_recalc);
+       return atomic_read(&set->set_remaining) == 0 || force_timer_recalc;
 }
 EXPORT_SYMBOL(ptlrpc_check_set);
 
@@ -1855,14 +1855,14 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink)
 
        if (imp == NULL) {
                DEBUG_REQ(D_HA, req, "NULL import: already cleaned up?");
-               RETURN(1);
+               return 1;
        }
 
        atomic_inc(&imp->imp_timeouts);
 
        /* The DLM server doesn't want recovery run on its imports. */
        if (imp->imp_dlm_fake)
-               RETURN(1);
+               return 1;
 
        /* If this request is for recovery or other primordial tasks,
         * then error it out here. */
@@ -1876,7 +1876,7 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink)
                req->rq_status = -ETIMEDOUT;
                req->rq_err = 1;
                spin_unlock(&req->rq_lock);
-               RETURN(1);
+               return 1;
        }
 
        /* if a request can't be resent we can't wait for an answer after
@@ -1888,7 +1888,7 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink)
 
        ptlrpc_fail_import(imp, lustre_msg_get_conn_cnt(req->rq_reqmsg));
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1936,7 +1936,7 @@ int ptlrpc_expired_set(void *data)
         * sleep so we can recalculate the timeout, or enable interrupts
         * if everyone's timed out.
         */
-       RETURN(1);
+       return 1;
 }
 EXPORT_SYMBOL(ptlrpc_expired_set);
 
@@ -2025,7 +2025,7 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
                else if (timeout == 0 || timeout > deadline - now)
                        timeout = deadline - now;
        }
-       RETURN(timeout);
+       return timeout;
 }
 EXPORT_SYMBOL(ptlrpc_set_next_timeout);
 
@@ -2053,7 +2053,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set)
                }
 
        if (list_empty(&set->set_requests))
-               RETURN(0);
+               return 0;
 
        do {
                timeout = ptlrpc_set_next_timeout(set);
@@ -2150,7 +2150,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set)
                }
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_set_wait);
 
@@ -2240,13 +2240,13 @@ EXPORT_SYMBOL(ptlrpc_req_finished_with_imp_lock);
 static int __ptlrpc_req_finished(struct ptlrpc_request *request, int locked)
 {
        if (request == NULL)
-               RETURN(1);
+               return 1;
 
        if (request == LP_POISON ||
            request->rq_reqmsg == LP_POISON) {
                CERROR("dereferencing freed request (bug 575)\n");
                LBUG();
-               RETURN(1);
+               return 1;
        }
 
        DEBUG_REQ(D_INFO, request, "refcount now %u",
@@ -2254,10 +2254,10 @@ static int __ptlrpc_req_finished(struct ptlrpc_request *request, int locked)
 
        if (atomic_dec_and_test(&request->rq_refcount)) {
                __ptlrpc_free_req(request, locked);
-               RETURN(1);
+               return 1;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -2307,7 +2307,7 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
         * Nothing left to do.
         */
        if (!ptlrpc_client_recv_or_unlink(request))
-               RETURN(1);
+               return 1;
 
        LNetMDUnlink(request->rq_reply_md_h);
 
@@ -2315,7 +2315,7 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
         * Let's check it once again.
         */
        if (!ptlrpc_client_recv_or_unlink(request))
-               RETURN(1);
+               return 1;
 
        /*
         * Move to "Unregistering" phase as reply was not unlinked yet.
@@ -2326,7 +2326,7 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
         * Do not wait for unlink to finish.
         */
        if (async)
-               RETURN(0);
+               return 0;
 
        /*
         * We have to l_wait_event() whatever the result, to give liblustre
@@ -2347,7 +2347,7 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
                                  &lwi);
                if (rc == 0) {
                        ptlrpc_rqphase_move(request, request->rq_next_phase);
-                       RETURN(1);
+                       return 1;
                }
 
                LASSERT(rc == -ETIMEDOUT);
@@ -2355,7 +2355,7 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
                          "rvcng=%d unlnk=%d", request->rq_receiving_reply,
                          request->rq_must_unlink);
        }
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_unregister_reply);
 
@@ -2485,7 +2485,7 @@ EXPORT_SYMBOL(ptlrpc_restart_req);
 struct ptlrpc_request *ptlrpc_request_addref(struct ptlrpc_request *req)
 {
        atomic_inc(&req->rq_refcount);
-       RETURN(req);
+       return req;
 }
 EXPORT_SYMBOL(ptlrpc_request_addref);
 
@@ -2561,7 +2561,7 @@ int ptlrpc_queue_wait(struct ptlrpc_request *req)
        set = ptlrpc_prep_set();
        if (set == NULL) {
                CERROR("Unable to allocate ptlrpc set.");
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        /* for distributed debugging */
@@ -2573,7 +2573,7 @@ int ptlrpc_queue_wait(struct ptlrpc_request *req)
        rc = ptlrpc_set_wait(set);
        ptlrpc_set_destroy(set);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_queue_wait);
 
@@ -2674,7 +2674,7 @@ static int ptlrpc_replay_interpret(const struct lu_env *env,
                /* this replay failed, so restart recovery */
                ptlrpc_connect_import(imp);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2714,7 +2714,7 @@ int ptlrpc_replay_req(struct ptlrpc_request *req)
        ptlrpc_request_addref(req); /* ptlrpcd needs a ref */
 
        ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_replay_req);
 
@@ -2933,13 +2933,13 @@ void *ptlrpcd_alloc_work(struct obd_import *imp,
        might_sleep();
 
        if (cb == NULL)
-               RETURN(ERR_PTR(-EINVAL));
+               return ERR_PTR(-EINVAL);
 
        /* copy some code from deprecated fakereq. */
        OBD_ALLOC_PTR(req);
        if (req == NULL) {
                CERROR("ptlrpc: run out of memory!\n");
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
        }
 
        req->rq_send_state = LUSTRE_IMP_FULL;
@@ -2968,7 +2968,7 @@ void *ptlrpcd_alloc_work(struct obd_import *imp,
        args->cb     = cb;
        args->cbdata = cbdata;
 
-       RETURN(req);
+       return req;
 }
 EXPORT_SYMBOL(ptlrpcd_alloc_work);
 
index 37a1e20ea716f424c793a2d27215acc179118437..17ca84208873f51bc9025b1b306606c1fe803e1c 100644 (file)
@@ -56,7 +56,7 @@ ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
 
        OBD_ALLOC_PTR(conn);
        if (!conn)
-               RETURN(NULL);
+               return NULL;
 
        conn->c_peer = peer;
        conn->c_self = self;
@@ -92,7 +92,7 @@ int ptlrpc_connection_put(struct ptlrpc_connection *conn)
        int rc = 0;
 
        if (!conn)
-               RETURN(rc);
+               return rc;
 
        LASSERT(atomic_read(&conn->c_refcount) > 1);
 
@@ -119,7 +119,7 @@ int ptlrpc_connection_put(struct ptlrpc_connection *conn)
               conn, atomic_read(&conn->c_refcount),
               libcfs_nid2str(conn->c_peer.nid));
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_connection_put);
 
@@ -131,7 +131,7 @@ ptlrpc_connection_addref(struct ptlrpc_connection *conn)
               conn, atomic_read(&conn->c_refcount),
               libcfs_nid2str(conn->c_peer.nid));
 
-       RETURN(conn);
+       return conn;
 }
 EXPORT_SYMBOL(ptlrpc_connection_addref);
 
@@ -145,9 +145,9 @@ int ptlrpc_connection_init(void)
                                    CFS_HASH_MAX_THETA,
                                    &conn_hash_ops, CFS_HASH_DEFAULT);
        if (!conn_hash)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_connection_init);
 
index 6e34395422959134199e6a98fb549b8058ee5e44..b518d8a0aaba9f6253b2c31801f92dc8e5162ebc 100644 (file)
@@ -103,7 +103,7 @@ int gss_cli_ctx_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
        bsd->bsd_svc = SPTLRPC_FLVR_BULK_SVC(req->rq_flvr.sf_rpc);
 
        if (bsd->bsd_svc == SPTLRPC_BULK_SVC_NULL)
-               RETURN(0);
+               return 0;
 
        LASSERT(bsd->bsd_svc == SPTLRPC_BULK_SVC_INTG ||
                bsd->bsd_svc == SPTLRPC_BULK_SVC_PRIV);
@@ -131,18 +131,18 @@ int gss_cli_ctx_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
                                           &token);
                        if (maj != GSS_S_COMPLETE) {
                                CWARN("failed to sign bulk data: %x\n", maj);
-                               RETURN(-EACCES);
+                               return -EACCES;
                        }
                } else {
                        /* privacy mode */
                        if (desc->bd_iov_count == 0)
-                               RETURN(0);
+                               return 0;
 
                        rc = sptlrpc_enc_pool_get_pages(desc);
                        if (rc) {
                                CERROR("bulk write: failed to allocate "
                                       "encryption pages: %d\n", rc);
-                               RETURN(rc);
+                               return rc;
                        }
 
                        token.data = bsd->bsd_data;
@@ -152,12 +152,12 @@ int gss_cli_ctx_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
                        maj = lgss_wrap_bulk(gctx->gc_mechctx, desc, &token, 0);
                        if (maj != GSS_S_COMPLETE) {
                                CWARN("fail to encrypt bulk data: %x\n", maj);
-                               RETURN(-EACCES);
+                               return -EACCES;
                        }
                }
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
@@ -218,7 +218,7 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                       "(%u,%u,%u) != (%u,%u,%u)\n",
                       bsdr->bsd_version, bsdr->bsd_type, bsdr->bsd_svc,
                       bsdv->bsd_version, bsdv->bsd_type, bsdv->bsd_svc);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        LASSERT(bsdv->bsd_svc == SPTLRPC_BULK_SVC_NULL ||
@@ -233,7 +233,7 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
        if (req->rq_bulk_write) {
                if (bsdv->bsd_flags & BSD_FL_ERR) {
                        CERROR("server reported bulk i/o failure\n");
-                       RETURN(-EIO);
+                       return -EIO;
                }
 
                if (bsdv->bsd_svc == SPTLRPC_BULK_SVC_PRIV)
@@ -268,12 +268,12 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                                              &token);
                        if (maj != GSS_S_COMPLETE) {
                                CERROR("failed to verify bulk read: %x\n", maj);
-                               RETURN(-EACCES);
+                               return -EACCES;
                        }
                } else if (bsdv->bsd_svc == SPTLRPC_BULK_SVC_PRIV) {
                        desc->bd_nob = bsdv->bsd_nob;
                        if (desc->bd_nob == 0)
-                               RETURN(0);
+                               return 0;
 
                        token.data = bsdv->bsd_data;
                        token.len = lustre_msg_buflen(vmsg, voff) -
@@ -284,14 +284,14 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                        if (maj != GSS_S_COMPLETE) {
                                CERROR("failed to decrypt bulk read: %x\n",
                                       maj);
-                               RETURN(-EACCES);
+                               return -EACCES;
                        }
 
                        desc->bd_nob_transferred = desc->bd_nob;
                }
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static int gss_prep_bulk(struct ptlrpc_bulk_desc *desc,
@@ -322,14 +322,14 @@ int gss_cli_prep_bulk(struct ptlrpc_request *req,
        LASSERT(req->rq_bulk_read);
 
        if (SPTLRPC_FLVR_BULK_SVC(req->rq_flvr.sf_rpc) != SPTLRPC_BULK_SVC_PRIV)
-               RETURN(0);
+               return 0;
 
        rc = gss_prep_bulk(desc, ctx2gctx(req->rq_cli_ctx)->gc_mechctx);
        if (rc)
                CERROR("bulk read: failed to prepare encryption "
                       "pages: %d\n", rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 int gss_svc_prep_bulk(struct ptlrpc_request *req,
@@ -351,14 +351,14 @@ int gss_svc_prep_bulk(struct ptlrpc_request *req,
 
        bsd = grctx->src_reqbsd;
        if (bsd->bsd_svc != SPTLRPC_BULK_SVC_PRIV)
-               RETURN(0);
+               return 0;
 
        rc = gss_prep_bulk(desc, grctx->src_ctx->gsc_mechctx);
        if (rc)
                CERROR("bulk write: failed to prepare encryption "
                       "pages: %d\n", rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
@@ -399,7 +399,7 @@ int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
                if (maj != GSS_S_COMPLETE) {
                        bsdv->bsd_flags |= BSD_FL_ERR;
                        CERROR("failed to verify bulk signature: %x\n", maj);
-                       RETURN(-EACCES);
+                       return -EACCES;
                }
                break;
        case SPTLRPC_BULK_SVC_PRIV:
@@ -407,7 +407,7 @@ int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
                        bsdv->bsd_flags |= BSD_FL_ERR;
                        CERROR("prepared nob %d doesn't match the actual "
                               "nob %d\n", desc->bd_nob, bsdr->bsd_nob);
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (desc->bd_iov_count == 0) {
@@ -423,12 +423,12 @@ int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
                if (maj != GSS_S_COMPLETE) {
                        bsdv->bsd_flags |= BSD_FL_ERR;
                        CERROR("failed decrypt bulk data: %x\n", maj);
-                       RETURN(-EACCES);
+                       return -EACCES;
                }
                break;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int gss_svc_wrap_bulk(struct ptlrpc_request *req,
@@ -470,7 +470,7 @@ int gss_svc_wrap_bulk(struct ptlrpc_request *req,
                if (maj != GSS_S_COMPLETE) {
                        bsdv->bsd_flags |= BSD_FL_ERR;
                        CERROR("failed to sign bulk data: %x\n", maj);
-                       RETURN(-EACCES);
+                       return -EACCES;
                }
                break;
        case SPTLRPC_BULK_SVC_PRIV:
@@ -486,7 +486,7 @@ int gss_svc_wrap_bulk(struct ptlrpc_request *req,
                        bsdv->bsd_flags |= BSD_FL_ERR;
                        CERROR("bulk read: failed to allocate encryption "
                               "pages: %d\n", rc);
-                       RETURN(rc);
+                       return rc;
                }
 
                token.data = bsdv->bsd_data;
@@ -497,10 +497,10 @@ int gss_svc_wrap_bulk(struct ptlrpc_request *req,
                if (maj != GSS_S_COMPLETE) {
                        bsdv->bsd_flags |= BSD_FL_ERR;
                        CERROR("failed to encrypt bulk data: %x\n", maj);
-                       RETURN(-EACCES);
+                       return -EACCES;
                }
                break;
        }
 
-       RETURN(0);
+       return 0;
 }
index ca0640c1e9470f78f1f7bdf72518b0513c58a886..55247af3910e6a6da051cd3299fb69d66db59571 100644 (file)
@@ -243,41 +243,41 @@ int gss_do_ctx_init_rpc(__user char *buffer, unsigned long count)
        if (count != sizeof(param)) {
                CERROR("ioctl size %lu, expect %lu, please check lgss_keyring "
                       "version\n", count, (unsigned long) sizeof(param));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        if (copy_from_user(&param, buffer, sizeof(param))) {
                CERROR("failed copy data from lgssd\n");
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
 
        if (param.version != GSSD_INTERFACE_VERSION) {
                CERROR("gssd interface version %d (expect %d)\n",
                        param.version, GSSD_INTERFACE_VERSION);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* take name */
        if (strncpy_from_user(obdname, param.uuid, sizeof(obdname)) <= 0) {
                CERROR("Invalid obdname pointer\n");
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
 
        obd = class_name2obd(obdname);
        if (!obd) {
                CERROR("no such obd %s\n", obdname);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (unlikely(!obd->obd_set_up)) {
                CERROR("obd %s not setup\n", obdname);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        spin_lock(&obd->obd_dev_lock);
        if (obd->obd_stopping) {
                CERROR("obd %s has stopped\n", obdname);
                spin_unlock(&obd->obd_dev_lock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
@@ -285,7 +285,7 @@ int gss_do_ctx_init_rpc(__user char *buffer, unsigned long count)
            strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME)) {
                CERROR("obd %s is not a client device\n", obdname);
                spin_unlock(&obd->obd_dev_lock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        spin_unlock(&obd->obd_dev_lock);
 
@@ -293,7 +293,7 @@ int gss_do_ctx_init_rpc(__user char *buffer, unsigned long count)
        if (obd->u.cli.cl_import == NULL) {
                CERROR("obd %s: import has gone\n", obd->obd_name);
                up_read(&obd->u.cli.cl_sem);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        imp = class_import_get(obd->u.cli.cl_import);
        up_read(&obd->u.cli.cl_sem);
@@ -301,7 +301,7 @@ int gss_do_ctx_init_rpc(__user char *buffer, unsigned long count)
        if (imp->imp_deactive) {
                CERROR("import has been deactivated\n");
                class_import_put(imp);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        req = ptlrpc_request_alloc_pack(imp, &RQF_SEC_CTX, LUSTRE_OBD_VERSION,
@@ -368,7 +368,7 @@ out_copy:
 
        class_import_put(imp);
        ptlrpc_req_finished(req);
-       RETURN(rc);
+       return rc;
 }
 
 int gss_do_ctx_fini_rpc(struct gss_cli_ctx *gctx)
@@ -385,7 +385,7 @@ int gss_do_ctx_fini_rpc(struct gss_cli_ctx *gctx)
                CDEBUG(D_SEC, "ctx %p(%u->%s) not uptodate, "
                       "don't send destroy rpc\n", ctx,
                       ctx->cc_vcred.vc_uid, sec2target_str(ctx->cc_sec));
-               RETURN(0);
+               return 0;
        }
 
        might_sleep();
@@ -433,7 +433,7 @@ int gss_do_ctx_fini_rpc(struct gss_cli_ctx *gctx)
 out_ref:
        ptlrpc_req_finished(req);
 out:
-       RETURN(rc);
+       return rc;
 }
 
 int __init gss_init_cli_upcall(void)
index 5c51b82933afda77e72d96439b64f27cddf014a0..188dbbfbd2f495c3aeee906f71ae51900abfef71 100644 (file)
@@ -571,7 +571,7 @@ struct ptlrpc_sec * gss_sec_create_kr(struct obd_import *imp,
 
        OBD_ALLOC(gsec_kr, sizeof(*gsec_kr));
        if (gsec_kr == NULL)
-               RETURN(NULL);
+               return NULL;
 
        INIT_HLIST_HEAD(&gsec_kr->gsk_clist);
        gsec_kr->gsk_root_ctx = NULL;
@@ -590,11 +590,11 @@ struct ptlrpc_sec * gss_sec_create_kr(struct obd_import *imp,
                goto err_free;
        }
 
-       RETURN(&gsec_kr->gsk_base.gs_base);
+       return &gsec_kr->gsk_base.gs_base;
 
 err_free:
        OBD_FREE(gsec_kr, sizeof(*gsec_kr));
-       RETURN(NULL);
+       return NULL;
 }
 
 static
@@ -694,7 +694,7 @@ struct ptlrpc_cli_ctx * gss_sec_lookup_ctx_kr(struct ptlrpc_sec *sec,
                 * always succeed.
                 */
                if (ctx || sec_is_reverse(sec))
-                       RETURN(ctx);
+                       return ctx;
        }
 
        LASSERT(create != 0);
@@ -818,7 +818,7 @@ struct ptlrpc_cli_ctx * gss_sec_lookup_ctx_kr(struct ptlrpc_sec *sec,
 out:
        if (is_root)
                mutex_unlock(&gsec_kr->gsk_root_uc_lock);
-       RETURN(ctx);
+       return ctx;
 }
 
 static
@@ -942,7 +942,7 @@ int gss_sec_flush_ctx_cache_kr(struct ptlrpc_sec *sec,
        else
                flush_spec_ctx_cache_kr(sec, uid, grace, force);
 
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -1021,7 +1021,7 @@ int gss_sec_display_kr(struct ptlrpc_sec *sec, struct seq_file *seq)
        }
        spin_unlock(&sec->ps_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 /****************************************
@@ -1140,12 +1140,12 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
 
        if (data != NULL || datalen != 0) {
                CERROR("invalid: data %p, len %lu\n", data, (long)datalen);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (key->payload.data != 0) {
                CERROR("key already have payload\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* link the key to session keyring, so following context negotiation
@@ -1167,11 +1167,11 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
                CERROR("failed to link key %08x to keyring %08x: %d\n",
                       key->serial,
                       key_tgcred(current)->session_keyring->serial, rc);
-               RETURN(rc);
+               return rc;
        }
 
        CDEBUG(D_SEC, "key %p instantiated, ctx %p\n", key, key->payload.data);
-       RETURN(0);
+       return 0;
 }
 
 /*
@@ -1189,7 +1189,7 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
 
        if (data == NULL || datalen == 0) {
                CWARN("invalid: data %p, len %lu\n", data, (long)datalen);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        /* if upcall finished negotiation too fast (mostly likely because
@@ -1203,9 +1203,9 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
 
                rc = key_validate(key);
                if (rc == 0)
-                       RETURN(-EAGAIN);
+                       return -EAGAIN;
                else
-                       RETURN(rc);
+                       return rc;
        }
 
        LASSERT(atomic_read(&ctx->cc_refcount) > 0);
@@ -1216,7 +1216,7 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
        /* don't proceed if already refreshed */
        if (cli_ctx_is_refreshed(ctx)) {
                CWARN("ctx already done refresh\n");
-               RETURN(0);
+               return 0;
        }
 
        sptlrpc_cli_ctx_get(ctx);
@@ -1291,7 +1291,7 @@ out:
 
        /* let user space think it's a success */
        sptlrpc_cli_ctx_put(ctx, 1);
-       RETURN(0);
+       return 0;
 }
 
 static
index 4847f11b797aaa0d1a3a9364b8fa6a48ce865e6e..8fa802dd1f909907fcd268dfc62cb02793a0fc67 100644 (file)
@@ -920,7 +920,7 @@ int krb5_encrypt_rawobjs(struct ll_crypto_cipher *tfm,
 
                if (rc) {
                        CERROR("encrypt error %d\n", rc);
-                       RETURN(rc);
+                       return rc;
                }
 
                datalen += inobjs[i].len;
@@ -928,7 +928,7 @@ int krb5_encrypt_rawobjs(struct ll_crypto_cipher *tfm,
        }
 
        outobj->len = datalen;
-       RETURN(0);
+       return 0;
 }
 
 /*
index f2bd67f54f565070f99da0d9e831622d7a42e0a0..c624518c181ad3e709d604882ab70b656fdebc92 100644 (file)
@@ -301,16 +301,16 @@ int gss_install_rvs_cli_ctx_pf(struct gss_sec *gsec,
 
        cli_ctx = ctx_create_pf(&gsec->gs_base, &vcred);
        if (!cli_ctx)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = gss_copy_rvc_cli_ctx(cli_ctx, svc_ctx);
        if (rc) {
                ctx_destroy_pf(cli_ctx->cc_sec, cli_ctx);
-               RETURN(rc);
+               return rc;
        }
 
        gss_sec_ctx_replace_pf(gsec, cli_ctx);
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -356,7 +356,7 @@ struct ptlrpc_sec* gss_sec_create_pf(struct obd_import *imp,
 
        OBD_ALLOC(gsec_pf, alloc_size);
        if (!gsec_pf)
-               RETURN(NULL);
+               return NULL;
 
        gsec_pf->gsp_chash_size = hash_size;
        for (i = 0; i < hash_size; i++)
@@ -374,13 +374,13 @@ struct ptlrpc_sec* gss_sec_create_pf(struct obd_import *imp,
                        goto err_destroy;
        }
 
-       RETURN(&gsec_pf->gsp_base.gs_base);
+       return &gsec_pf->gsp_base.gs_base;
 
 err_destroy:
        gss_sec_destroy_common(&gsec_pf->gsp_base);
 err_free:
        OBD_FREE(gsec_pf, alloc_size);
-       RETURN(NULL);
+       return NULL;
 }
 
 static
@@ -466,7 +466,7 @@ retry:
                /* don't allocate for reverse sec */
                if (sec_is_reverse(sec)) {
                        spin_unlock(&sec->ps_lock);
-                       RETURN(NULL);
+                       return NULL;
                }
 
                if (new) {
@@ -497,7 +497,7 @@ retry:
        }
 
        ctx_list_destroy_pf(&freelist);
-       RETURN(ctx);
+       return ctx;
 }
 
 static
@@ -576,7 +576,7 @@ int gss_sec_flush_ctx_cache_pf(struct ptlrpc_sec *sec,
        spin_unlock(&sec->ps_lock);
 
        ctx_list_destroy_pf(&freelist);
-       RETURN(busy);
+       return busy;
 }
 
 /****************************************
@@ -804,12 +804,12 @@ ssize_t gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
        left = copy_to_user(dst, data, mlen);
        if (left < 0) {
                msg->errno = left;
-               RETURN(left);
+               return left;
        }
        mlen -= left;
        msg->copied += mlen;
        msg->errno = 0;
-       RETURN(mlen);
+       return mlen;
 }
 
 static
@@ -829,7 +829,7 @@ ssize_t gss_pipe_downcall(struct file *filp, const char *src, size_t mlen)
 
        OBD_ALLOC(buf, mlen);
        if (!buf)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (copy_from_user(buf, src, mlen)) {
                CERROR("failed copy user space data\n");
@@ -927,7 +927,7 @@ out_free:
         * hack pipefs: always return asked length unless all following
         * downcalls might be messed up. */
        rc = mlen;
-       RETURN(rc);
+       return rc;
 }
 
 static
@@ -1033,14 +1033,14 @@ int gss_ctx_refresh_pf(struct ptlrpc_cli_ctx *ctx)
        imp = ctx->cc_sec->ps_import;
        if (!imp->imp_connection) {
                CERROR("import has no connection set\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        gsec = container_of(ctx->cc_sec, struct gss_sec, gs_base);
 
        OBD_ALLOC_PTR(gmsg);
        if (!gmsg)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        /* initialize pipefs base msg */
        INIT_LIST_HEAD(&gmsg->gum_base.list);
@@ -1088,10 +1088,10 @@ int gss_ctx_refresh_pf(struct ptlrpc_cli_ctx *ctx)
                goto err_free;
        }
 
-       RETURN(0);
+       return 0;
 err_free:
        OBD_FREE_PTR(gmsg);
-       RETURN(rc);
+       return rc;
 }
 
 static
index 474ecf805307eae0a2558aab0945974ca2ec2092..fb298aef66ebdfda4291fc67127576523b698b9c 100644 (file)
@@ -65,7 +65,7 @@ int rawobj_alloc(rawobj_t *obj, char *buf, int len)
                OBD_ALLOC_LARGE(obj->data, len);
                if (!obj->data) {
                        obj->len = 0;
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                }
                memcpy(obj->data, buf, len);
        } else
index 245044b6d77a7c831a45f154560a533a1517d742..5b5365b4629ff6aba47842a5a4ffd75951728566 100644 (file)
@@ -339,7 +339,7 @@ out:
 
        if (status)
                CERROR("rsi parse error %d\n", status);
-       RETURN(status);
+       return status;
 }
 
 static struct cache_detail rsi_cache = {
@@ -787,7 +787,7 @@ out:
        if (rc)
                CERROR("create reverse svc ctx: idx "LPX64", rc %d\n",
                       gsec->gs_rvs_hdl, rc);
-       RETURN(rc);
+       return rc;
 }
 
 int gss_svc_upcall_expire_rvs_ctx(rawobj_t *handle)
@@ -1010,7 +1010,7 @@ out:
 
                COMPAT_RSC_PUT(&rsci->h, &rsc_cache);
        }
-       RETURN(rc);
+       return rc;
 }
 
 struct gss_svc_ctx *gss_svc_upcall_get_ctx(struct ptlrpc_request *req,
index 95e4536f04847fe9cfde75c3413e65068f4ffc84..b42ddda9ee25e70ee428f4fa1b5dbe5fd8e62a77 100644 (file)
@@ -283,7 +283,7 @@ __u32 gss_unseal_msg(struct gss_ctx *mechctx,
 
        if (msgbuf->lm_bufcount != 2) {
                CERROR("invalid bufcount %d\n", msgbuf->lm_bufcount);
-               RETURN(GSS_S_FAILURE);
+               return GSS_S_FAILURE;
        }
 
        /* allocate a temporary clear text buffer, same sized as token,
@@ -291,7 +291,7 @@ __u32 gss_unseal_msg(struct gss_ctx *mechctx,
        clear_buflen = lustre_msg_buflen(msgbuf, 1);
        OBD_ALLOC_LARGE(clear_buf, clear_buflen);
        if (!clear_buf)
-               RETURN(GSS_S_FAILURE);
+               return GSS_S_FAILURE;
 
        /* buffer objects */
        hdrobj.len = lustre_msg_buflen(msgbuf, 0);
@@ -316,7 +316,7 @@ __u32 gss_unseal_msg(struct gss_ctx *mechctx,
        major = GSS_S_COMPLETE;
 out_free:
        OBD_FREE_LARGE(clear_buf, clear_buflen);
-       RETURN(major);
+       return major;
 }
 
 /********************************************
@@ -652,7 +652,7 @@ int gss_cli_ctx_sign(struct ptlrpc_cli_ctx *ctx,
 
        /* nothing to do for context negotiation RPCs */
        if (req->rq_ctx_init)
-               RETURN(0);
+               return 0;
 
        svc = SPTLRPC_FLVR_SVC(req->rq_flvr.sf_rpc);
        if (req->rq_pack_bulk)
@@ -668,7 +668,7 @@ redo:
                          flags, gctx->gc_proc, seq, svc,
                          &gctx->gc_handle);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        /* gss_sign_msg() msg might take long time to finish, in which period
         * more rpcs could be wrapped up and sent out. if we found too many
@@ -687,7 +687,7 @@ redo:
        }
 
        req->rq_reqdata_len = rc;
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -774,12 +774,12 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
        if (req->rq_ctx_init && !req->rq_early) {
                req->rq_repmsg = lustre_msg_buf(msg, 1, 0);
                req->rq_replen = msg->lm_buflens[1];
-               RETURN(0);
+               return 0;
        }
 
        if (msg->lm_bufcount < 2 || msg->lm_bufcount > 4) {
                CERROR("unexpected bufcount %u\n", msg->lm_bufcount);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        swabbed = ptlrpc_rep_need_swab(req);
@@ -787,7 +787,7 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
        ghdr = gss_swab_header(msg, 0, swabbed);
        if (ghdr == NULL) {
                CERROR("can't decode gss header\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        /* sanity checks */
@@ -797,7 +797,7 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
        if (ghdr->gh_version != reqhdr->gh_version) {
                CERROR("gss version %u mismatch, expect %u\n",
                       ghdr->gh_version, reqhdr->gh_version);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        switch (ghdr->gh_proc) {
@@ -807,19 +807,19 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
                if (!req->rq_early && !equi(req->rq_pack_bulk == 1, pack_bulk)){
                        CERROR("%s bulk flag in reply\n",
                               req->rq_pack_bulk ? "missing" : "unexpected");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (ghdr->gh_seq != reqhdr->gh_seq) {
                        CERROR("seqnum %u mismatch, expect %u\n",
                               ghdr->gh_seq, reqhdr->gh_seq);
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (ghdr->gh_svc != reqhdr->gh_svc) {
                        CERROR("svc %u mismatch, expect %u\n",
                               ghdr->gh_svc, reqhdr->gh_svc);
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (swabbed)
@@ -828,7 +828,7 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
                major = gss_verify_msg(msg, gctx->gc_mechctx, reqhdr->gh_svc);
                if (major != GSS_S_COMPLETE) {
                        CERROR("failed to verify reply: %x\n", major);
-                       RETURN(-EPERM);
+                       return -EPERM;
                }
 
                if (req->rq_early && reqhdr->gh_svc == SPTLRPC_SVC_NULL) {
@@ -840,7 +840,7 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
                        if (cksum != msg->lm_cksum) {
                                CWARN("early reply checksum mismatch: "
                                      "%08x != %08x\n", cksum, msg->lm_cksum);
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                        }
                }
 
@@ -849,13 +849,13 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
                        if (msg->lm_bufcount < 3) {
                                CERROR("Invalid reply bufcount %u\n",
                                       msg->lm_bufcount);
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                        }
 
                        rc = bulk_sec_desc_unpack(msg, 2, swabbed);
                        if (rc) {
                                CERROR("unpack bulk desc: %d\n", rc);
-                               RETURN(rc);
+                               return rc;
                        }
                }
 
@@ -875,7 +875,7 @@ int gss_cli_ctx_verify(struct ptlrpc_cli_ctx *ctx,
                rc = -EPROTO;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 int gss_cli_ctx_seal(struct ptlrpc_cli_ctx *ctx,
@@ -911,7 +911,7 @@ int gss_cli_ctx_seal(struct ptlrpc_cli_ctx *ctx,
        } else {
                OBD_ALLOC_LARGE(req->rq_reqbuf, wiresize);
                if (!req->rq_reqbuf)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                req->rq_reqbuf_len = wiresize;
        }
 
@@ -965,7 +965,7 @@ redo:
 
        /* now set the final wire data length */
        req->rq_reqdata_len = lustre_shrink_msg(req->rq_reqbuf, 1, token.len,0);
-       RETURN(0);
+       return 0;
 
 err_free:
        if (!req->rq_pool) {
@@ -973,7 +973,7 @@ err_free:
                req->rq_reqbuf = NULL;
                req->rq_reqbuf_len = 0;
        }
-       RETURN(rc);
+       return rc;
 }
 
 int gss_cli_ctx_unseal(struct ptlrpc_cli_ctx *ctx,
@@ -995,14 +995,14 @@ int gss_cli_ctx_unseal(struct ptlrpc_cli_ctx *ctx,
        ghdr = gss_swab_header(msg, 0, swabbed);
        if (ghdr == NULL) {
                CERROR("can't decode gss header\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        /* sanity checks */
        if (ghdr->gh_version != PTLRPC_GSS_VERSION) {
                CERROR("gss version %u mismatch, expect %u\n",
                       ghdr->gh_version, PTLRPC_GSS_VERSION);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        switch (ghdr->gh_proc) {
@@ -1012,7 +1012,7 @@ int gss_cli_ctx_unseal(struct ptlrpc_cli_ctx *ctx,
                if (!req->rq_early && !equi(req->rq_pack_bulk == 1, pack_bulk)){
                        CERROR("%s bulk flag in reply\n",
                               req->rq_pack_bulk ? "missing" : "unexpected");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (swabbed)
@@ -1033,25 +1033,25 @@ int gss_cli_ctx_unseal(struct ptlrpc_cli_ctx *ctx,
                swabbed = __lustre_unpack_msg(msg, msglen);
                if (swabbed < 0) {
                        CERROR("Failed to unpack after decryption\n");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (msg->lm_bufcount < 1) {
                        CERROR("Invalid reply buffer: empty\n");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (pack_bulk) {
                        if (msg->lm_bufcount < 2) {
                                CERROR("bufcount %u: missing bulk sec desc\n",
                                       msg->lm_bufcount);
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                        }
 
                        /* bulk checksum is the last segment */
                        if (bulk_sec_desc_unpack(msg, msg->lm_bufcount - 1,
                                                 swabbed))
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                }
 
                req->rq_repmsg = lustre_msg_buf(msg, 0, 0);
@@ -1072,7 +1072,7 @@ int gss_cli_ctx_unseal(struct ptlrpc_cli_ctx *ctx,
                rc = -EPERM;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /*********************************************
@@ -1303,7 +1303,7 @@ int gss_alloc_reqbuf_intg(struct ptlrpc_sec *sec,
 
                OBD_ALLOC_LARGE(req->rq_reqbuf, bufsize);
                if (!req->rq_reqbuf)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                req->rq_reqbuf_len = bufsize;
        } else {
@@ -1322,7 +1322,7 @@ int gss_alloc_reqbuf_intg(struct ptlrpc_sec *sec,
        if (req->rq_pack_udesc)
                sptlrpc_pack_user_desc(req->rq_reqbuf, 2);
 
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -1389,7 +1389,7 @@ int gss_alloc_reqbuf_priv(struct ptlrpc_sec *sec,
 
                OBD_ALLOC_LARGE(req->rq_clrbuf, clearsize);
                if (!req->rq_clrbuf)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
        }
        req->rq_clrbuf_len = clearsize;
 
@@ -1399,7 +1399,7 @@ int gss_alloc_reqbuf_priv(struct ptlrpc_sec *sec,
        if (req->rq_pack_udesc)
                sptlrpc_pack_user_desc(req->rq_clrbuf, 1);
 
-       RETURN(0);
+       return 0;
 }
 
 /*
@@ -1683,7 +1683,7 @@ int gss_enlarge_reqbuf_intg(struct ptlrpc_sec *sec,
 
                OBD_ALLOC_LARGE(newbuf, newbuf_size);
                if (newbuf == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                memcpy(newbuf, req->rq_reqbuf, req->rq_reqbuf_len);
 
@@ -1703,7 +1703,7 @@ int gss_enlarge_reqbuf_intg(struct ptlrpc_sec *sec,
        _sptlrpc_enlarge_msg_inplace(req->rq_reqmsg, segment, newsize);
 
        req->rq_reqlen = newmsg_size;
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -1772,7 +1772,7 @@ int gss_enlarge_reqbuf_priv(struct ptlrpc_sec *sec,
 
                OBD_ALLOC_LARGE(newclrbuf, newclrbuf_size);
                if (newclrbuf == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                memcpy(newclrbuf, req->rq_clrbuf, req->rq_clrbuf_len);
 
@@ -1792,7 +1792,7 @@ int gss_enlarge_reqbuf_priv(struct ptlrpc_sec *sec,
        _sptlrpc_enlarge_msg_inplace(req->rq_reqmsg, segment, newsize);
        req->rq_reqlen = newmsg_size;
 
-       RETURN(0);
+       return 0;
 }
 
 int gss_enlarge_reqbuf(struct ptlrpc_sec *sec,
@@ -1891,7 +1891,7 @@ int gss_svc_sign(struct ptlrpc_request *req,
                          LUSTRE_SP_ANY, flags, PTLRPC_GSS_PROC_DATA,
                          grctx->src_wirectx.gw_seq, svc, NULL);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        rs->rs_repdata_len = rc;
 
@@ -1908,7 +1908,7 @@ int gss_svc_sign(struct ptlrpc_request *req,
                req->rq_reply_off = 0;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int gss_pack_err_notify(struct ptlrpc_request *req, __u32 major, __u32 minor)
@@ -1920,7 +1920,7 @@ int gss_pack_err_notify(struct ptlrpc_request *req, __u32 major, __u32 minor)
        int                     rc;
 
        //if (OBD_FAIL_CHECK_ORSET(OBD_FAIL_SVCGSS_ERR_NOTIFY, OBD_FAIL_ONCE))
-       //      RETURN(-EINVAL);
+       //      return -EINVAL;
 
        grctx->src_err_notify = 1;
        grctx->src_reserve_len = 0;
@@ -1928,7 +1928,7 @@ int gss_pack_err_notify(struct ptlrpc_request *req, __u32 major, __u32 minor)
        rc = lustre_pack_reply_v2(req, 1, &replen, NULL, 0);
        if (rc) {
                CERROR("could not pack reply, err %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
 
        /* gss hdr */
@@ -1947,7 +1947,7 @@ int gss_pack_err_notify(struct ptlrpc_request *req, __u32 major, __u32 minor)
 
        CDEBUG(D_SEC, "prepare gss error notify(0x%x/0x%x) to %s\n",
               major, minor, libcfs_nid2str(req->rq_peer.nid));
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -1970,18 +1970,18 @@ int gss_svc_handle_init(struct ptlrpc_request *req,
 
        if (gw->gw_flags & LUSTRE_GSS_PACK_BULK) {
                CERROR("unexpected bulk flag\n");
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        if (gw->gw_proc == PTLRPC_GSS_PROC_INIT && gw->gw_handle.len != 0) {
                CERROR("proc %u: invalid handle length %u\n",
                       gw->gw_proc, gw->gw_handle.len);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        if (reqbuf->lm_bufcount < 3 || reqbuf->lm_bufcount > 4){
                CERROR("Invalid bufcount %d\n", reqbuf->lm_bufcount);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        swabbed = ptlrpc_req_need_swab(req);
@@ -1992,7 +1992,7 @@ int gss_svc_handle_init(struct ptlrpc_request *req,
 
        if (seclen < 4 + 4) {
                CERROR("sec size %d too small\n", seclen);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        /* lustre svc type */
@@ -2003,7 +2003,7 @@ int gss_svc_handle_init(struct ptlrpc_request *req,
         * because touched internal structure of obd_uuid */
        if (rawobj_extract(&uuid_obj, &secdata, &seclen)) {
                CERROR("failed to extract target uuid\n");
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
        uuid_obj.data[uuid_obj.len - 1] = '\0';
 
@@ -2013,25 +2013,25 @@ int gss_svc_handle_init(struct ptlrpc_request *req,
                CERROR("target '%s' is not available for context init (%s)\n",
                       uuid->uuid, target == NULL ? "no target" :
                       (target->obd_stopping ? "stopping" : "not set up"));
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        /* extract reverse handle */
        if (rawobj_extract(&rvs_hdl, &secdata, &seclen)) {
                CERROR("failed extract reverse handle\n");
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        /* extract token */
        if (rawobj_extract(&in_token, &secdata, &seclen)) {
                CERROR("can't extract token\n");
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        rc = gss_svc_upcall_handle_init(req, grctx, gw, target, lustre_svc,
                                        &rvs_hdl, &in_token);
        if (rc != SECSVC_OK)
-               RETURN(rc);
+               return rc;
 
        if (grctx->src_ctx->gsc_usr_mds || grctx->src_ctx->gsc_usr_oss ||
            grctx->src_ctx->gsc_usr_root)
@@ -2047,11 +2047,11 @@ int gss_svc_handle_init(struct ptlrpc_request *req,
        if (gw->gw_flags & LUSTRE_GSS_PACK_USER) {
                if (reqbuf->lm_bufcount < 4) {
                        CERROR("missing user descriptor\n");
-                       RETURN(SECSVC_DROP);
+                       return SECSVC_DROP;
                }
                if (sptlrpc_unpack_user_desc(reqbuf, 2, swabbed)) {
                        CERROR("Mal-formed user descriptor\n");
-                       RETURN(SECSVC_DROP);
+                       return SECSVC_DROP;
                }
 
                req->rq_pack_udesc = 1;
@@ -2061,7 +2061,7 @@ int gss_svc_handle_init(struct ptlrpc_request *req,
        req->rq_reqmsg = lustre_msg_buf(reqbuf, 1, 0);
        req->rq_reqlen = lustre_msg_buflen(reqbuf, 1);
 
-       RETURN(rc);
+       return rc;
 }
 
 /*
@@ -2082,7 +2082,7 @@ int gss_svc_verify_request(struct ptlrpc_request *req,
 
        if (msg->lm_bufcount < 2) {
                CERROR("Too few segments (%u) in request\n", msg->lm_bufcount);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (gw->gw_svc == SPTLRPC_SVC_NULL)
@@ -2091,20 +2091,20 @@ int gss_svc_verify_request(struct ptlrpc_request *req,
        if (gss_check_seq_num(&gctx->gsc_seqdata, gw->gw_seq, 0)) {
                CERROR("phase 0: discard replayed req: seq %u\n", gw->gw_seq);
                *major = GSS_S_DUPLICATE_TOKEN;
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
        *major = gss_verify_msg(msg, gctx->gsc_mechctx, gw->gw_svc);
        if (*major != GSS_S_COMPLETE) {
                CERROR("failed to verify request: %x\n", *major);
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
        if (gctx->gsc_reverse == 0 &&
            gss_check_seq_num(&gctx->gsc_seqdata, gw->gw_seq, 1)) {
                CERROR("phase 1+: discard replayed req: seq %u\n", gw->gw_seq);
                *major = GSS_S_DUPLICATE_TOKEN;
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
 verified:
@@ -2114,12 +2114,12 @@ verified:
        if (gw->gw_flags & LUSTRE_GSS_PACK_USER) {
                if (msg->lm_bufcount < (offset + 1)) {
                        CERROR("no user desc included\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (sptlrpc_unpack_user_desc(msg, offset, swabbed)) {
                        CERROR("Mal-formed user descriptor\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                req->rq_pack_udesc = 1;
@@ -2131,11 +2131,11 @@ verified:
        if (gw->gw_flags & LUSTRE_GSS_PACK_BULK) {
                if (msg->lm_bufcount < (offset + 1)) {
                        CERROR("missing bulk sec descriptor\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (bulk_sec_desc_unpack(msg, offset, swabbed))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                req->rq_pack_bulk = 1;
                grctx->src_reqbsd = lustre_msg_buf(msg, offset, 0);
@@ -2144,7 +2144,7 @@ verified:
 
        req->rq_reqmsg = lustre_msg_buf(msg, 1, 0);
        req->rq_reqlen = msg->lm_buflens[1];
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -2160,43 +2160,43 @@ int gss_svc_unseal_request(struct ptlrpc_request *req,
        if (gss_check_seq_num(&gctx->gsc_seqdata, gw->gw_seq, 0)) {
                CERROR("phase 0: discard replayed req: seq %u\n", gw->gw_seq);
                *major = GSS_S_DUPLICATE_TOKEN;
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
        *major = gss_unseal_msg(gctx->gsc_mechctx, msg,
                               &msglen, req->rq_reqdata_len);
        if (*major != GSS_S_COMPLETE) {
                CERROR("failed to unwrap request: %x\n", *major);
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
        if (gss_check_seq_num(&gctx->gsc_seqdata, gw->gw_seq, 1)) {
                CERROR("phase 1+: discard replayed req: seq %u\n", gw->gw_seq);
                *major = GSS_S_DUPLICATE_TOKEN;
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
        swabbed = __lustre_unpack_msg(msg, msglen);
        if (swabbed < 0) {
                CERROR("Failed to unpack after decryption\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        req->rq_reqdata_len = msglen;
 
        if (msg->lm_bufcount < 1) {
                CERROR("Invalid buffer: is empty\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (gw->gw_flags & LUSTRE_GSS_PACK_USER) {
                if (msg->lm_bufcount < offset + 1) {
                        CERROR("no user descriptor included\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (sptlrpc_unpack_user_desc(msg, offset, swabbed)) {
                        CERROR("Mal-formed user descriptor\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                req->rq_pack_udesc = 1;
@@ -2207,11 +2207,11 @@ int gss_svc_unseal_request(struct ptlrpc_request *req,
        if (gw->gw_flags & LUSTRE_GSS_PACK_BULK) {
                if (msg->lm_bufcount < offset + 1) {
                        CERROR("no bulk checksum included\n");
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                if (bulk_sec_desc_unpack(msg, offset, swabbed))
-                       RETURN(-EINVAL);
+                       return -EINVAL;
 
                req->rq_pack_bulk = 1;
                grctx->src_reqbsd = lustre_msg_buf(msg, offset, 0);
@@ -2220,7 +2220,7 @@ int gss_svc_unseal_request(struct ptlrpc_request *req,
 
        req->rq_reqmsg = lustre_msg_buf(req->rq_reqbuf, 0, 0);
        req->rq_reqlen = req->rq_reqbuf->lm_buflens[0];
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -2252,7 +2252,7 @@ int gss_svc_handle_data(struct ptlrpc_request *req,
        }
 
        if (rc == 0)
-               RETURN(SECSVC_OK);
+               return SECSVC_OK;
 
        CERROR("svc %u failed: major 0x%08x: req xid "LPU64" ctx %p idx "
               LPX64"(%u->%s)\n", gw->gw_svc, major, req->rq_xid,
@@ -2263,9 +2263,9 @@ error:
         * might happen after server reboot, to allow recovery. */
        if ((major == GSS_S_NO_CONTEXT || major == GSS_S_BAD_SIG) &&
            gss_pack_err_notify(req, major, 0) == 0)
-               RETURN(SECSVC_COMPLETE);
+               return SECSVC_COMPLETE;
 
-       RETURN(SECSVC_DROP);
+       return SECSVC_DROP;
 }
 
 static
@@ -2281,16 +2281,16 @@ int gss_svc_handle_destroy(struct ptlrpc_request *req,
        grctx->src_ctx = gss_svc_upcall_get_ctx(req, gw);
        if (!grctx->src_ctx) {
                CDEBUG(D_SEC, "invalid gss context handle for destroy.\n");
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        if (gw->gw_svc != SPTLRPC_SVC_INTG) {
                CERROR("svc %u is not supported in destroy.\n", gw->gw_svc);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        if (gss_svc_verify_request(req, grctx, gw, &major))
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
 
        CWARN("destroy svc ctx %p idx "LPX64" (%u->%s)\n",
              grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle),
@@ -2301,19 +2301,19 @@ int gss_svc_handle_destroy(struct ptlrpc_request *req,
        if (gw->gw_flags & LUSTRE_GSS_PACK_USER) {
                if (req->rq_reqbuf->lm_bufcount < 4) {
                        CERROR("missing user descriptor, ignore it\n");
-                       RETURN(SECSVC_OK);
+                       return SECSVC_OK;
                }
                if (sptlrpc_unpack_user_desc(req->rq_reqbuf, 2,
                                             ptlrpc_req_need_swab(req))) {
                        CERROR("Mal-formed user descriptor, ignore it\n");
-                       RETURN(SECSVC_OK);
+                       return SECSVC_OK;
                }
 
                req->rq_pack_udesc = 1;
                req->rq_user_desc = lustre_msg_buf(req->rq_reqbuf, 2, 0);
        }
 
-       RETURN(SECSVC_OK);
+       return SECSVC_OK;
 }
 
 int gss_svc_accept(struct ptlrpc_sec_policy *policy, struct ptlrpc_request *req)
@@ -2328,7 +2328,7 @@ int gss_svc_accept(struct ptlrpc_sec_policy *policy, struct ptlrpc_request *req)
 
        if (req->rq_reqbuf->lm_bufcount < 2) {
                CERROR("buf count only %d\n", req->rq_reqbuf->lm_bufcount);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        swabbed = ptlrpc_req_need_swab(req);
@@ -2336,14 +2336,14 @@ int gss_svc_accept(struct ptlrpc_sec_policy *policy, struct ptlrpc_request *req)
        ghdr = gss_swab_header(req->rq_reqbuf, 0, swabbed);
        if (ghdr == NULL) {
                CERROR("can't decode gss header\n");
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        /* sanity checks */
        if (ghdr->gh_version != PTLRPC_GSS_VERSION) {
                CERROR("gss version %u, expect %u\n", ghdr->gh_version,
                       PTLRPC_GSS_VERSION);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        req->rq_sp_from = ghdr->gh_sp;
@@ -2351,7 +2351,7 @@ int gss_svc_accept(struct ptlrpc_sec_policy *policy, struct ptlrpc_request *req)
        /* alloc grctx data */
        OBD_ALLOC_PTR(grctx);
        if (!grctx)
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
 
        grctx->src_base.sc_policy = sptlrpc_policy_get(policy);
        atomic_set(&grctx->src_base.sc_refcount, 1);
@@ -2406,7 +2406,7 @@ int gss_svc_accept(struct ptlrpc_sec_policy *policy, struct ptlrpc_request *req)
                break;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 void gss_svc_invalidate_ctx(struct ptlrpc_svc_ctx *svc_ctx)
@@ -2475,7 +2475,7 @@ int gss_svc_alloc_rs(struct ptlrpc_request *req, int msglen)
 
        if (req->rq_pack_bulk && !req->rq_bulk_read && !req->rq_bulk_write) {
                CERROR("client request bulk sec on non-bulk rpc\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        svc = SPTLRPC_FLVR_SVC(req->rq_flvr.sf_rpc);
@@ -2548,7 +2548,7 @@ int gss_svc_alloc_rs(struct ptlrpc_request *req, int msglen)
        } else {
                OBD_ALLOC_LARGE(rs, rs_size);
                if (rs == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                rs->rs_size = rs_size;
        }
@@ -2578,7 +2578,7 @@ int gss_svc_alloc_rs(struct ptlrpc_request *req, int msglen)
 
        LASSERT(rs->rs_msg);
        req->rq_reply_state = rs;
-       RETURN(0);
+       return 0;
 }
 
 static int gss_svc_seal(struct ptlrpc_request *req,
@@ -2619,7 +2619,7 @@ static int gss_svc_seal(struct ptlrpc_request *req,
        token_buflen = gss_mech_payload(gctx->gsc_mechctx, msglen, 1);
        OBD_ALLOC_LARGE(token_buf, token_buflen);
        if (token_buf == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        hdrobj.len = PTLRPC_GSS_HEADER_SIZE;
        hdrobj.data = (__u8 *) ghdr;
@@ -2675,7 +2675,7 @@ static int gss_svc_seal(struct ptlrpc_request *req,
        rc = 0;
 out_free:
        OBD_FREE_LARGE(token_buf, token_buflen);
-       RETURN(rc);
+       return rc;
 }
 
 int gss_svc_authorize(struct ptlrpc_request *req)
@@ -2691,7 +2691,7 @@ int gss_svc_authorize(struct ptlrpc_request *req)
                LASSERT(rs->rs_repdata_len != 0);
 
                req->rq_reply_off = gss_at_reply_off_integ;
-               RETURN(0);
+               return 0;
        }
 
        /* early reply could happen in many cases */
@@ -2699,7 +2699,7 @@ int gss_svc_authorize(struct ptlrpc_request *req)
            gw->gw_proc != PTLRPC_GSS_PROC_DATA &&
            gw->gw_proc != PTLRPC_GSS_PROC_DESTROY) {
                CERROR("proc %d not support\n", gw->gw_proc);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        LASSERT(grctx->src_ctx);
@@ -2720,7 +2720,7 @@ int gss_svc_authorize(struct ptlrpc_request *req)
        rc = 0;
 
 out:
-       RETURN(rc);
+       return rc;
 }
 
 void gss_svc_free_rs(struct ptlrpc_reply_state *rs)
index b8a00f562597cbdea3b4c0f696e2a248dddac2d2..2cdbb4d909c97eb5758345e467bab5003d5fd208 100644 (file)
@@ -462,7 +462,7 @@ static int import_select_connection(struct obd_import *imp)
                CERROR("%s: no connections available\n",
                       imp->imp_obd->obd_name);
                spin_unlock(&imp->imp_lock);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
@@ -551,7 +551,7 @@ static int import_select_connection(struct obd_import *imp)
 
        spin_unlock(&imp->imp_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 /*
@@ -600,15 +600,15 @@ int ptlrpc_connect_import(struct obd_import *imp)
        if (imp->imp_state == LUSTRE_IMP_CLOSED) {
                spin_unlock(&imp->imp_lock);
                CERROR("can't connect to a closed import\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        } else if (imp->imp_state == LUSTRE_IMP_FULL) {
                spin_unlock(&imp->imp_lock);
                CERROR("already connected\n");
-               RETURN(0);
+               return 0;
        } else if (imp->imp_state == LUSTRE_IMP_CONNECTING) {
                spin_unlock(&imp->imp_lock);
                CERROR("already connecting\n");
-               RETURN(-EALREADY);
+               return -EALREADY;
        }
 
        IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_CONNECTING);
@@ -708,7 +708,7 @@ out:
                IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON);
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_connect_import);
 
@@ -753,7 +753,7 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
        if (imp->imp_state == LUSTRE_IMP_CLOSED) {
                imp->imp_connect_tried = 1;
                spin_unlock(&imp->imp_lock);
-               RETURN(0);
+               return 0;
        }
 
        if (rc) {
@@ -975,7 +975,7 @@ finish:
                               imp->imp_connection->c_remote_uuid.uuid);
                        ptlrpc_connect_import(imp);
                        imp->imp_connect_tried = 1;
-                       RETURN(0);
+                       return 0;
                }
        } else {
 
@@ -1128,7 +1128,7 @@ out:
 
                        /* reply message might not be ready */
                        if (request->rq_repmsg == NULL)
-                               RETURN(-EPROTO);
+                               return -EPROTO;
 
                        ocd = req_capsule_server_get(&request->rq_pill,
                                                     &RMF_CONNECT_DATA);
@@ -1152,7 +1152,7 @@ out:
                                ptlrpc_deactivate_import(imp);
                                IMPORT_SET_STATE(imp, LUSTRE_IMP_CLOSED);
                        }
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                ptlrpc_maybe_ping_import_soon(imp);
@@ -1163,7 +1163,7 @@ out:
        }
 
        wake_up_all(&imp->imp_recovery_waitq);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1192,7 +1192,7 @@ static int completed_replay_interpret(const struct lu_env *env,
                ptlrpc_connect_import(req->rq_import);
        }
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1204,7 +1204,7 @@ static int signal_completed_replay(struct obd_import *imp)
        struct ptlrpc_request *req;
 
        if (unlikely(OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_FINISH_REPLAY)))
-               RETURN(0);
+               return 0;
 
        LASSERT(atomic_read(&imp->imp_replay_inflight) == 0);
        atomic_inc(&imp->imp_replay_inflight);
@@ -1213,7 +1213,7 @@ static int signal_completed_replay(struct obd_import *imp)
                                        OBD_PING);
        if (req == NULL) {
                atomic_dec(&imp->imp_replay_inflight);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        ptlrpc_request_set_replen(req);
@@ -1225,7 +1225,7 @@ static int signal_completed_replay(struct obd_import *imp)
        req->rq_interpret_reply = completed_replay_interpret;
 
        ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1);
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1254,7 +1254,7 @@ static int ptlrpc_invalidate_import_thread(void *data)
        ptlrpc_import_recovery_state_machine(imp);
 
        class_import_put(imp);
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1320,7 +1320,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
                } else {
                        rc = 0;
                }
-               RETURN(rc);
+               return rc;
                }
        }
 
@@ -1379,7 +1379,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
        }
 
 out:
-       RETURN(rc);
+       return rc;
 }
 
 int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
@@ -1398,7 +1398,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
        default:
                CERROR("don't know how to disconnect from %s (connect_op %d)\n",
                       obd2cli_tgt(imp->imp_obd), imp->imp_connect_op);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (ptlrpc_import_in_recovery(imp)) {
@@ -1461,7 +1461,7 @@ out:
        memset(&imp->imp_remote_handle, 0, sizeof(imp->imp_remote_handle));
        spin_unlock(&imp->imp_lock);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_disconnect_import);
 
index d771cb9f129fda2e793b3de72d39579230c42158..379e59477ea2df00b7476e5be03dee06d6e6f34d 100644 (file)
@@ -167,7 +167,7 @@ static int llog_client_destroy(const struct lu_env *env,
        ptlrpc_req_finished(req);
 err_exit:
        LLOG_CLIENT_EXIT(loghandle->lgh_ctxt, imp);
-       RETURN(rc);
+       return rc;
 }
 
 
index 963223d3ed1f34f24400c32e8580c4a568bf1cef..17c06a32df629136e3c55529cff3d3a741041b81 100644 (file)
@@ -69,6 +69,6 @@ int llog_initiator_connect(struct llog_ctxt *ctxt)
                ctxt->loc_imp = class_import_get(new_imp);
        }
        mutex_unlock(&ctxt->loc_mutex);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(llog_initiator_connect);
index 711cbd1ecc2905dc0238c497b337d4b029cc7254..af9d2ac391eff084d2febea51ebcb5ab7b17b71d 100644 (file)
@@ -73,7 +73,7 @@ int llog_origin_handle_open(struct ptlrpc_request *req)
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY);
        if (body == NULL)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        if (ostid_id(&body->lgd_logid.lgl_oi) > 0)
                logid = &body->lgd_logid;
@@ -81,7 +81,7 @@ int llog_origin_handle_open(struct ptlrpc_request *req)
        if (req_capsule_field_present(&req->rq_pill, &RMF_NAME, RCL_CLIENT)) {
                name = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
                if (name == NULL)
-                       RETURN(-EFAULT);
+                       return -EFAULT;
                CDEBUG(D_INFO, "%s: opening log %s\n", obd->obd_name, name);
        }
 
@@ -89,7 +89,7 @@ int llog_origin_handle_open(struct ptlrpc_request *req)
        if (ctxt == NULL) {
                CDEBUG(D_WARNING, "%s: no ctxt. group=%p idx=%d name=%s\n",
                       obd->obd_name, &obd->obd_olg, body->lgd_ctxt_idx, name);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
        disk_obd = ctxt->loc_exp->exp_obd;
        push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
@@ -126,7 +126,7 @@ int llog_origin_handle_destroy(struct ptlrpc_request *req)
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY);
        if (body == NULL)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        if (ostid_id(&body->lgd_logid.lgl_oi) > 0)
                logid = &body->lgd_logid;
@@ -137,7 +137,7 @@ int llog_origin_handle_destroy(struct ptlrpc_request *req)
 
        ctxt = llog_get_context(req->rq_export->exp_obd, body->lgd_ctxt_idx);
        if (ctxt == NULL)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        disk_obd = ctxt->loc_exp->exp_obd;
        push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
@@ -148,7 +148,7 @@ int llog_origin_handle_destroy(struct ptlrpc_request *req)
                rc = llog_erase(req->rq_svc_thread->t_env, ctxt, logid, NULL);
        pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
        llog_ctxt_put(ctxt);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(llog_origin_handle_destroy);
 
@@ -166,11 +166,11 @@ int llog_origin_handle_next_block(struct ptlrpc_request *req)
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY);
        if (body == NULL)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        ctxt = llog_get_context(req->rq_export->exp_obd, body->lgd_ctxt_idx);
        if (ctxt == NULL)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        disk_obd = ctxt->loc_exp->exp_obd;
        push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
@@ -224,11 +224,11 @@ int llog_origin_handle_prev_block(struct ptlrpc_request *req)
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY);
        if (body == NULL)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        ctxt = llog_get_context(req->rq_export->exp_obd, body->lgd_ctxt_idx);
        if (ctxt == NULL)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        disk_obd = ctxt->loc_exp->exp_obd;
        push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
@@ -281,11 +281,11 @@ int llog_origin_handle_read_header(struct ptlrpc_request *req)
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY);
        if (body == NULL)
-               RETURN(-EFAULT);
+               return -EFAULT;
 
        ctxt = llog_get_context(req->rq_export->exp_obd, body->lgd_ctxt_idx);
        if (ctxt == NULL)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        disk_obd = ctxt->loc_exp->exp_obd;
        push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
@@ -323,7 +323,7 @@ EXPORT_SYMBOL(llog_origin_handle_read_header);
 int llog_origin_handle_close(struct ptlrpc_request *req)
 {
        /* Nothing to do */
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(llog_origin_handle_close);
 
@@ -343,13 +343,13 @@ int llog_origin_handle_cancel(struct ptlrpc_request *req)
                                           RCL_CLIENT) / sizeof(*logcookies);
        if (logcookies == NULL || num_cookies == 0) {
                DEBUG_REQ(D_HA, req, "No llog cookies sent");
-               RETURN(-EFAULT);
+               return -EFAULT;
        }
 
        ctxt = llog_get_context(req->rq_export->exp_obd,
                                logcookies->lgc_subsys);
        if (ctxt == NULL)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
        disk_obd = ctxt->loc_exp->exp_obd;
        push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
index 602ce679508b4b6b5e99ff0de340333cf253c75c..bea44a3d4a2f387d171ab153515b05c52c0e02c4 100644 (file)
@@ -612,7 +612,7 @@ out:
 
        mutex_unlock(&nrs_core.nrs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -696,7 +696,7 @@ out:
        if (cmd_copy)
                OBD_FREE(cmd_copy, LPROCFS_NRS_WR_MAX_CMD);
 
-       RETURN(rc < 0 ? rc : count);
+       return rc < 0 ? rc : count;
 }
 LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs);
 
@@ -1220,7 +1220,7 @@ int lprocfs_wr_ping(struct file *file, const char *buffer,
        req = ptlrpc_prep_ping(obd->u.cli.cl_import);
        LPROCFS_CLIMP_EXIT(obd);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req->rq_send_state = LUSTRE_IMP_FULL;
 
@@ -1228,8 +1228,8 @@ int lprocfs_wr_ping(struct file *file, const char *buffer,
 
        ptlrpc_req_finished(req);
        if (rc >= 0)
-               RETURN(count);
-       RETURN(rc);
+               return count;
+       return rc;
 }
 EXPORT_SYMBOL(lprocfs_wr_ping);
 
index b5b5b486edbfe24a1bd894bf9f99faf68de89731..a0e009717a5ad825b9d9627977ad49deb864f7bd 100644 (file)
@@ -75,7 +75,7 @@ static int ptl_send_buf (lnet_handle_md_t *mdh, void *base, int len,
        if (unlikely(rc != 0)) {
                CERROR ("LNetMDBind failed: %d\n", rc);
                LASSERT (rc == -ENOMEM);
-               RETURN (-ENOMEM);
+               return -ENOMEM;
        }
 
        CDEBUG(D_NET, "Sending %d bytes to portal %d, xid "LPD64", offset %u\n",
@@ -94,7 +94,7 @@ static int ptl_send_buf (lnet_handle_md_t *mdh, void *base, int len,
                LASSERTF(rc2 == 0, "rc2 = %d\n", rc2);
        }
 
-       RETURN (0);
+       return 0;
 }
 
 static void mdunlink_iterate_helper(lnet_handle_md_t *bd_mds, int count)
@@ -123,7 +123,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)
        lnet_md_t        md;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_BULK_GET_NET))
-               RETURN(0);
+               return 0;
 
        /* NB no locking required until desc is on the network */
        LASSERT(desc->bd_nob > 0);
@@ -205,7 +205,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)
                LASSERT(desc->bd_md_count >= 0);
                mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw);
                req->rq_status = -ENOMEM;
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        /* Set rq_xid to matchbits of the final bulk so that server can
@@ -229,7 +229,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)
               desc->bd_iov_count, desc->bd_nob,
               desc->bd_last_xid, req->rq_xid, desc->bd_portal);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_register_bulk);
 
@@ -254,7 +254,7 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
                req->rq_bulk_deadline = cfs_time_current_sec() + LONG_UNLINK;
 
        if (ptlrpc_client_bulk_active(req) == 0)        /* completed or */
-               RETURN(1);                              /* never registered */
+               return 1;                               /* never registered */
 
        LASSERT(desc->bd_req == req);  /* bd_req NULL until registered */
 
@@ -265,14 +265,14 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
        mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw);
 
        if (ptlrpc_client_bulk_active(req) == 0)        /* completed or */
-               RETURN(1);                              /* never registered */
+               return 1;                               /* never registered */
 
        /* Move to "Unregistering" phase as bulk was not unlinked yet. */
        ptlrpc_rqphase_move(req, RQ_PHASE_UNREGISTERING);
 
        /* Do not wait for unlink to finish. */
        if (async)
-               RETURN(0);
+               return 0;
 
        if (req->rq_set != NULL)
                wq = &req->rq_set->set_waitq;
@@ -287,14 +287,14 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
                rc = l_wait_event(*wq, !ptlrpc_client_bulk_active(req), &lwi);
                if (rc == 0) {
                        ptlrpc_rqphase_move(req, req->rq_next_phase);
-                       RETURN(1);
+                       return 1;
                }
 
                LASSERT(rc == -ETIMEDOUT);
                DEBUG_REQ(D_WARNING, req, "Unexpectedly long timeout: desc %p",
                          desc);
        }
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_unregister_bulk);
 
@@ -455,12 +455,12 @@ int ptlrpc_send_error(struct ptlrpc_request *req, int may_be_difficult)
        int rc;
 
        if (req->rq_no_reply)
-               RETURN(0);
+               return 0;
 
        if (!req->rq_repmsg) {
                rc = lustre_pack_reply(req, 1, NULL, NULL);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
        if (req->rq_status != -ENOSPC && req->rq_status != -EACCES &&
@@ -469,7 +469,7 @@ int ptlrpc_send_error(struct ptlrpc_request *req, int may_be_difficult)
                req->rq_type = PTL_RPC_MSG_ERR;
 
        rc = ptlrpc_send_reply(req, may_be_difficult);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_send_error);
 
@@ -496,7 +496,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
        struct obd_device *obd = request->rq_import->imp_obd;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_DROP_RPC))
-               RETURN(0);
+               return 0;
 
        LASSERT(request->rq_type == PTL_RPC_MSG_REQUEST);
        LASSERT(request->rq_wait_ctx == 0);
@@ -512,7 +512,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
                /* this prevents us from waiting in ptlrpc_queue_wait */
                request->rq_err = 1;
                request->rq_status = -ENODEV;
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        connection = request->rq_import->imp_connection;
index 226c9c0880640739b387d031b06edc4c6eabd0da..0abcd6d822737da12e12aeb4204c16e672961382 100644 (file)
@@ -81,11 +81,11 @@ static int nrs_policy_ctl_locked(struct ptlrpc_nrs_policy *policy,
         * policy->pol_private will be NULL in such a case.
         */
        if (policy->pol_state == NRS_POL_STATE_STOPPED)
-               RETURN(-ENODEV);
+               return -ENODEV;
 
-       RETURN(policy->pol_desc->pd_ops->op_policy_ctl != NULL ?
+       return policy->pol_desc->pd_ops->op_policy_ctl != NULL ?
               policy->pol_desc->pd_ops->op_policy_ctl(policy, opc, arg) :
-              -ENOSYS);
+              -ENOSYS;
 }
 
 static void nrs_policy_stop0(struct ptlrpc_nrs_policy *policy)
@@ -117,14 +117,14 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
        struct ptlrpc_nrs *nrs = policy->pol_nrs;
 
        if (nrs->nrs_policy_fallback == policy && !nrs->nrs_stopping)
-               RETURN(-EPERM);
+               return -EPERM;
 
        if (policy->pol_state == NRS_POL_STATE_STARTING)
-               RETURN(-EAGAIN);
+               return -EAGAIN;
 
        /* In progress or already stopped */
        if (policy->pol_state != NRS_POL_STATE_STARTED)
-               RETURN(0);
+               return 0;
 
        policy->pol_state = NRS_POL_STATE_STOPPING;
 
@@ -141,7 +141,7 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
        if (policy->pol_ref == 1)
                nrs_policy_stop0(policy);
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -197,12 +197,12 @@ static int nrs_policy_start_locked(struct ptlrpc_nrs_policy *policy)
         * benefit.
         */
        if (nrs->nrs_policy_starting)
-               RETURN(-EAGAIN);
+               return -EAGAIN;
 
        LASSERT(policy->pol_state != NRS_POL_STATE_STARTING);
 
        if (policy->pol_state == NRS_POL_STATE_STOPPING)
-               RETURN(-EAGAIN);
+               return -EAGAIN;
 
        if (policy->pol_flags & PTLRPC_NRS_FL_FALLBACK) {
                /**
@@ -213,7 +213,7 @@ static int nrs_policy_start_locked(struct ptlrpc_nrs_policy *policy)
                 */
                if (policy == nrs->nrs_policy_fallback) {
                        nrs_policy_stop_primary(nrs);
-                       RETURN(0);
+                       return 0;
                }
 
                /**
@@ -228,10 +228,10 @@ static int nrs_policy_start_locked(struct ptlrpc_nrs_policy *policy)
                 * Shouldn't start primary policy if w/o fallback policy.
                 */
                if (nrs->nrs_policy_fallback == NULL)
-                       RETURN(-EPERM);
+                       return -EPERM;
 
                if (policy->pol_state == NRS_POL_STATE_STARTED)
-                       RETURN(0);
+                       return 0;
        }
 
        /**
@@ -243,7 +243,7 @@ static int nrs_policy_start_locked(struct ptlrpc_nrs_policy *policy)
                atomic_dec(&policy->pol_desc->pd_refs);
                CERROR("NRS: cannot get module for policy %s; is it alive?\n",
                       policy->pol_desc->pd_name);
-               RETURN(-ENODEV);
+               return -ENODEV;
        }
 
        /**
@@ -290,7 +290,7 @@ static int nrs_policy_start_locked(struct ptlrpc_nrs_policy *policy)
 out:
        nrs->nrs_policy_starting = 0;
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -660,7 +660,7 @@ out:
 
        spin_unlock(&nrs->nrs_lock);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -684,7 +684,7 @@ static int nrs_policy_unregister(struct ptlrpc_nrs *nrs, char *name)
                spin_unlock(&nrs->nrs_lock);
 
                CERROR("Can't find NRS policy %s\n", name);
-               RETURN(-ENOENT);
+               return -ENOENT;
        }
 
        if (policy->pol_ref > 1) {
@@ -693,7 +693,7 @@ static int nrs_policy_unregister(struct ptlrpc_nrs *nrs, char *name)
                nrs_policy_put_locked(policy);
 
                spin_unlock(&nrs->nrs_lock);
-               RETURN(-EBUSY);
+               return -EBUSY;
        }
 
        LASSERT(policy->pol_req_queued == 0);
@@ -716,7 +716,7 @@ static int nrs_policy_unregister(struct ptlrpc_nrs *nrs, char *name)
        LASSERT(policy->pol_private == NULL);
        OBD_FREE_PTR(policy);
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -748,7 +748,7 @@ static int nrs_policy_register(struct ptlrpc_nrs *nrs,
        OBD_CPT_ALLOC_GFP(policy, svcpt->scp_service->srv_cptable,
                          svcpt->scp_cpt, sizeof(*policy), __GFP_IO);
        if (policy == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        policy->pol_nrs     = nrs;
        policy->pol_desc    = desc;
@@ -761,7 +761,7 @@ static int nrs_policy_register(struct ptlrpc_nrs *nrs,
        rc = nrs_policy_init(policy);
        if (rc != 0) {
                OBD_FREE_PTR(policy);
-               RETURN(rc);
+               return rc;
        }
 
        spin_lock(&nrs->nrs_lock);
@@ -777,7 +777,7 @@ static int nrs_policy_register(struct ptlrpc_nrs *nrs,
                nrs_policy_fini(policy);
                OBD_FREE_PTR(policy);
 
-               RETURN(-EEXIST);
+               return -EEXIST;
        }
 
        list_add_tail(&policy->pol_list, &nrs->nrs_policy_list);
@@ -791,7 +791,7 @@ static int nrs_policy_register(struct ptlrpc_nrs *nrs,
        if (rc != 0)
                (void) nrs_policy_unregister(nrs, policy->pol_desc->pd_name);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -893,7 +893,7 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs)
                }
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -931,7 +931,7 @@ static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs,
 
        rc = nrs_register_policies_locked(nrs);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -974,7 +974,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
        rc = nrs_svcpt_setup_locked0(nrs, svcpt);
 
 out:
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1031,9 +1031,9 @@ static struct ptlrpc_nrs_pol_desc *nrs_policy_find_desc_locked(const char *name)
 
        list_for_each_entry(tmp, &nrs_core.nrs_policies, pd_list) {
                if (strncmp(tmp->pd_name, name, NRS_POL_NAME_MAX) == 0)
-                       RETURN(tmp);
+                       return tmp;
        }
-       RETURN(NULL);
+       return NULL;
 }
 
 /**
@@ -1082,7 +1082,7 @@ again:
                                       "partition %d of service %s: %d\n",
                                       desc->pd_name, svcpt->scp_cpt,
                                       svcpt->scp_service->srv_name, rc);
-                               RETURN(rc);
+                               return rc;
                        }
 
                        if (!hp && nrs_svc_has_hp(svc)) {
@@ -1095,7 +1095,7 @@ again:
                        desc->pd_ops->op_lprocfs_fini(svc);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1145,7 +1145,7 @@ int ptlrpc_nrs_policy_register(struct ptlrpc_nrs_pol_conf *conf)
                       "policy flags; external policies cannot act as fallback "
                       "policies, or be started immediately upon registration "
                       "without interaction with lprocfs\n", conf->nc_name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        mutex_lock(&nrs_core.nrs_mutex);
@@ -1248,7 +1248,7 @@ internal:
 fail:
        mutex_unlock(&nrs_core.nrs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_nrs_policy_register);
 
@@ -1276,7 +1276,7 @@ int ptlrpc_nrs_policy_unregister(struct ptlrpc_nrs_pol_conf *conf)
        if (conf->nc_flags & PTLRPC_NRS_FL_FALLBACK) {
                CERROR("Unable to unregister a fallback policy, unless the "
                       "PTLRPC service is stopping.\n");
-               RETURN(-EPERM);
+               return -EPERM;
        }
 
        conf->nc_name[NRS_POL_NAME_MAX - 1] = '\0';
@@ -1314,7 +1314,7 @@ fail:
 not_exist:
        mutex_unlock(&nrs_core.nrs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_nrs_policy_unregister);
 
@@ -1369,7 +1369,7 @@ failed:
 
        mutex_unlock(&nrs_core.nrs_mutex);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1698,7 +1698,7 @@ int ptlrpc_nrs_policy_control(const struct ptlrpc_service *svc,
                }
        }
 out:
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1724,7 +1724,7 @@ int ptlrpc_nrs_init(void)
                GOTO(fail, rc);
 
 
-       RETURN(rc);
+       return rc;
 fail:
        /**
         * Since no PTLRPC services have been started at this point, all we need
@@ -1732,7 +1732,7 @@ fail:
         */
        ptlrpc_nrs_fini();
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
index d722c6451cea37f577d86f58fa53d136bd066620..cd2611a3b53d1823b6249c417e771a584fb6ec3e 100644 (file)
@@ -341,7 +341,7 @@ int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
        msg_len = lustre_msg_size_v2(count, lens);
        rc = sptlrpc_svc_alloc_rs(req, msg_len);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rs = req->rq_reply_state;
        atomic_set(&rs->rs_refcount, 1);    /* 1 ref for rq_reply_state */
@@ -362,7 +362,7 @@ int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
 
        PTLRPC_RS_DEBUG_LRU_ADD(rs);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(lustre_pack_reply_v2);
 
@@ -586,12 +586,12 @@ int __lustre_unpack_msg(struct lustre_msg *m, int len)
                /* can't even look inside the message */
                CERROR("message length %d too small for magic/version check\n",
                       len);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = lustre_unpack_msg_v2(m, len);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(__lustre_unpack_msg);
 
@@ -1617,7 +1617,7 @@ int do_set_info_async(struct obd_import *imp,
 
        req = ptlrpc_request_alloc(imp, &RQF_OBD_SET_INFO);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_KEY,
                             RCL_CLIENT, keylen);
@@ -1626,7 +1626,7 @@ int do_set_info_async(struct obd_import *imp,
        rc = ptlrpc_request_pack(req, version, opcode);
        if (rc) {
                ptlrpc_request_free(req);
-               RETURN(rc);
+               return rc;
        }
 
        tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
@@ -1644,7 +1644,7 @@ int do_set_info_async(struct obd_import *imp,
                ptlrpc_req_finished(req);
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(do_set_info_async);
 
index 481963df2023e340295d7a9fa9007bafccf2b38e..a9206e955cd3522cda52fd549b50bcb8afd0a012 100644 (file)
@@ -78,7 +78,7 @@ int ptlrpc_obd_ping(struct obd_device *obd)
 
        req = ptlrpc_prep_ping(obd->u.cli.cl_import);
        if (req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req->rq_send_state = LUSTRE_IMP_FULL;
 
@@ -86,7 +86,7 @@ int ptlrpc_obd_ping(struct obd_device *obd)
 
        ptlrpc_req_finished(req);
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_obd_ping);
 
@@ -99,14 +99,14 @@ int ptlrpc_ping(struct obd_import *imp)
                CERROR("OOM trying to ping %s->%s\n",
                       imp->imp_obd->obd_uuid.uuid,
                       obd2cli_tgt(imp->imp_obd));
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        DEBUG_REQ(D_INFO, req, "pinging %s->%s",
                  imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
        ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1);
 
-       RETURN(0);
+       return 0;
 }
 
 void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
@@ -374,7 +374,7 @@ int ptlrpc_start_pinger(void)
 
        if (!thread_is_init(&pinger_thread) &&
            !thread_is_stopped(&pinger_thread))
-               RETURN(-EALREADY);
+               return -EALREADY;
 
        init_waitqueue_head(&pinger_thread.t_ctl_waitq);
        init_waitqueue_head(&suspend_timeouts_waitq);
@@ -387,7 +387,7 @@ int ptlrpc_start_pinger(void)
                                 &pinger_thread, pinger_thread.t_name));
        if (IS_ERR_VALUE(rc)) {
                CERROR("cannot start thread: %d\n", rc);
-               RETURN(rc);
+               return rc;
        }
        l_wait_event(pinger_thread.t_ctl_waitq,
                     thread_is_running(&pinger_thread), &lwi);
@@ -399,7 +399,7 @@ int ptlrpc_start_pinger(void)
                      "(Search for the \"suppress_pings\" kernel module "
                      "parameter.)\n");
 
-       RETURN(0);
+       return 0;
 }
 
 int ptlrpc_pinger_remove_timeouts(void);
@@ -411,7 +411,7 @@ int ptlrpc_stop_pinger(void)
 
        if (!thread_is_init(&pinger_thread) &&
            !thread_is_stopped(&pinger_thread))
-               RETURN(-EALREADY);
+               return -EALREADY;
 
        ptlrpc_pinger_remove_timeouts();
        thread_set_flags(&pinger_thread, SVC_STOPPING);
@@ -420,7 +420,7 @@ int ptlrpc_stop_pinger(void)
        l_wait_event(pinger_thread.t_ctl_waitq,
                     thread_is_stopped(&pinger_thread), &lwi);
 
-       RETURN(rc);
+       return rc;
 }
 
 void ptlrpc_pinger_sending_on_import(struct obd_import *imp)
@@ -447,7 +447,7 @@ void ptlrpc_pinger_commit_expected(struct obd_import *imp)
 int ptlrpc_pinger_add_import(struct obd_import *imp)
 {
        if (!list_empty(&imp->imp_pinger_chain))
-               RETURN(-EALREADY);
+               return -EALREADY;
 
        mutex_lock(&pinger_mutex);
        CDEBUG(D_HA, "adding pingable import %s->%s\n",
@@ -462,14 +462,14 @@ int ptlrpc_pinger_add_import(struct obd_import *imp)
        ptlrpc_pinger_wake_up();
        mutex_unlock(&pinger_mutex);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_pinger_add_import);
 
 int ptlrpc_pinger_del_import(struct obd_import *imp)
 {
        if (list_empty(&imp->imp_pinger_chain))
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        mutex_lock(&pinger_mutex);
        list_del_init(&imp->imp_pinger_chain);
@@ -479,7 +479,7 @@ int ptlrpc_pinger_del_import(struct obd_import *imp)
        imp->imp_obd->obd_no_recov = 1;
        class_import_put(imp);
        mutex_unlock(&pinger_mutex);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_pinger_del_import);
 
@@ -715,7 +715,7 @@ static int ping_evictor_main(void *arg)
        }
        CDEBUG(D_HA, "Exiting Ping Evictor\n");
 
-       RETURN(0);
+       return 0;
 }
 
 void ping_evictor_start(void)
index e8163805e685aa4eb7e40c9e47237a9727ff9f08..d26fce802b66d8f1da28a113448f222e31455d59 100644 (file)
@@ -66,11 +66,11 @@ __init int ptlrpc_init(void)
 
        rc = req_layout_init();
        if (rc)
-               RETURN(rc);
+               return rc;
 
        rc = ptlrpc_hr_init();
        if (rc)
-               RETURN(rc);
+               return rc;
 
        cleanup_phase = 1;
 
@@ -109,7 +109,7 @@ __init int ptlrpc_init(void)
        rc = tgt_mod_init();
        if (rc)
                GOTO(cleanup, rc);
-       RETURN(0);
+       return 0;
 
 cleanup:
        switch(cleanup_phase) {
index 8b654abd8f7361537cb2f71c1a8e86886957cd9c..59c4f83af4468b6f66702aaed9559f44a04fcedc 100644 (file)
@@ -301,7 +301,7 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)
                 * new modules are loaded, i.e., early during boot up.
                 */
                CERROR("Failure to refill session: %d\n", rc2);
-               RETURN(rc);
+               return rc;
        }
 
        if (atomic_read(&set->set_remaining))
@@ -367,7 +367,7 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)
                }
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -408,7 +408,7 @@ static int ptlrpcd(void *arg)
        complete(&pc->pc_starting);
 
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        /*
         * This mainloop strongly resembles ptlrpc_set_wait() except that our
@@ -593,7 +593,7 @@ static int ptlrpcd_bind(int index, int max)
                }
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -608,7 +608,7 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
        if (test_and_set_bit(LIOD_START, &pc->pc_flags)) {
                CWARN("Starting second thread (%s) for same pc %p\n",
                      name, pc);
-               RETURN(0);
+               return 0;
        }
 
        pc->pc_index = index;
@@ -659,7 +659,7 @@ out:
                clear_bit(LIOD_BIND, &pc->pc_flags);
                clear_bit(LIOD_START, &pc->pc_flags);
        }
-       RETURN(rc);
+       return rc;
 }
 
 void ptlrpcd_stop(struct ptlrpcd_ctl *pc, int force)
@@ -785,7 +785,7 @@ out:
                ptlrpcds = NULL;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 int ptlrpcd_addref(void)
@@ -796,7 +796,7 @@ int ptlrpcd_addref(void)
        if (++ptlrpcd_users == 1)
                rc = ptlrpcd_init();
        mutex_unlock(&ptlrpcd_mutex);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpcd_addref);
 
index 682d97143c343bc12106db4ba55b9a929761fc0d..84c39e083ea4bef97acfdabb2d2424cd76540b58 100644 (file)
@@ -132,11 +132,11 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
                if (rc) {
                        CERROR("recovery replay error %d for req "
                               LPU64"\n", rc, req->rq_xid);
-                       RETURN(rc);
+                       return rc;
                }
                *inflight = 1;
        }
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -156,7 +156,7 @@ int ptlrpc_resend(struct obd_import *imp)
        spin_lock(&imp->imp_lock);
        if (imp->imp_state != LUSTRE_IMP_RECOVER) {
                spin_unlock(&imp->imp_lock);
-               RETURN(-1);
+               return -1;
        }
 
        list_for_each_entry_safe(req, next, &imp->imp_sending_list,
@@ -169,7 +169,7 @@ int ptlrpc_resend(struct obd_import *imp)
        }
        spin_unlock(&imp->imp_lock);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_resend);
 
@@ -268,7 +268,7 @@ int ptlrpc_set_import_active(struct obd_import *imp, int active)
                rc = ptlrpc_recover_import(imp, NULL, 0);
        }
 
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_set_import_active);
 
index 82b1c3ac05a435627f1782768be789f22871b8df..962b31d163dea527281264f55b426af2c2ed54b6 100644 (file)
@@ -402,7 +402,7 @@ int sptlrpc_req_get_ctx(struct ptlrpc_request *req)
 
        rc = import_sec_validate_get(imp, &sec);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        req->rq_cli_ctx = get_my_ctx(sec);
 
@@ -410,10 +410,10 @@ int sptlrpc_req_get_ctx(struct ptlrpc_request *req)
 
        if (!req->rq_cli_ctx) {
                CERROR("req %p: fail to get context\n", req);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -528,7 +528,7 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req)
 
                /* restore old ctx */
                req->rq_cli_ctx = oldctx;
-               RETURN(rc);
+               return rc;
        }
 
        newctx = req->rq_cli_ctx;
@@ -555,14 +555,14 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req)
                        /* restore old ctx */
                        sptlrpc_req_put_ctx(req, 0);
                        req->rq_cli_ctx = oldctx;
-                       RETURN(rc);
+                       return rc;
                }
 
                LASSERT(req->rq_cli_ctx == newctx);
        }
 
        sptlrpc_cli_ctx_put(oldctx, 1);
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(sptlrpc_req_replace_dead_ctx);
 
@@ -638,7 +638,7 @@ int sptlrpc_req_refresh_ctx(struct ptlrpc_request *req, long timeout)
        LASSERT(ctx);
 
        if (req->rq_ctx_init || req->rq_ctx_fini)
-               RETURN(0);
+               return 0;
 
        /*
         * during the process a request's context might change type even
@@ -648,7 +648,7 @@ int sptlrpc_req_refresh_ctx(struct ptlrpc_request *req, long timeout)
 again:
        rc = import_sec_validate_get(req->rq_import, &sec);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        if (sec->ps_flvr.sf_rpc != req->rq_flvr.sf_rpc) {
                CDEBUG(D_SEC, "req %p: flavor has changed %x -> %x\n",
@@ -660,7 +660,7 @@ again:
        sptlrpc_sec_put(sec);
 
        if (cli_ctx_is_eternal(ctx))
-               RETURN(0);
+               return 0;
 
        if (unlikely(test_bit(PTLRPC_CTX_NEW_BIT, &ctx->cc_flags))) {
                LASSERT(ctx->cc_ops->refresh);
@@ -671,7 +671,7 @@ again:
        LASSERT(ctx->cc_ops->validate);
        if (ctx->cc_ops->validate(ctx) == 0) {
                req_off_ctx_list(req, ctx);
-               RETURN(0);
+               return 0;
        }
 
        if (unlikely(test_bit(PTLRPC_CTX_ERROR_BIT, &ctx->cc_flags))) {
@@ -679,7 +679,7 @@ again:
                req->rq_err = 1;
                spin_unlock(&req->rq_lock);
                req_off_ctx_list(req, ctx);
-               RETURN(-EPERM);
+               return -EPERM;
        }
 
        /*
@@ -713,7 +713,7 @@ again:
            unlikely(req->rq_reqmsg) &&
            lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) {
                req_off_ctx_list(req, ctx);
-               RETURN(0);
+               return 0;
        }
 
        if (unlikely(test_bit(PTLRPC_CTX_DEAD_BIT, &ctx->cc_flags))) {
@@ -725,7 +725,7 @@ again:
                        spin_lock(&req->rq_lock);
                        req->rq_err = 1;
                        spin_unlock(&req->rq_lock);
-                       RETURN(-EINTR);
+                       return -EINTR;
                }
 
                rc = sptlrpc_req_replace_dead_ctx(req);
@@ -736,7 +736,7 @@ again:
                        spin_lock(&req->rq_lock);
                        req->rq_err = 1;
                        spin_unlock(&req->rq_lock);
-                       RETURN(rc);
+                       return rc;
                }
 
                ctx = req->rq_cli_ctx;
@@ -753,7 +753,7 @@ again:
        spin_unlock(&ctx->cc_lock);
 
        if (timeout < 0)
-               RETURN(-EWOULDBLOCK);
+               return -EWOULDBLOCK;
 
        /* Clear any flags that may be present from previous sends */
        LASSERT(req->rq_receiving_reply == 0);
@@ -783,7 +783,7 @@ again:
                req_off_ctx_list(req, ctx);
 
                LASSERT(rc != 0);
-               RETURN(rc);
+               return rc;
        }
 
        goto again;
@@ -891,22 +891,22 @@ int sptlrpc_import_check_ctx(struct obd_import *imp)
        sptlrpc_sec_put(sec);
 
        if (!ctx)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        if (cli_ctx_is_eternal(ctx) ||
            ctx->cc_ops->validate(ctx) == 0) {
                sptlrpc_cli_ctx_put(ctx, 1);
-               RETURN(0);
+               return 0;
        }
 
        if (cli_ctx_is_error(ctx)) {
                sptlrpc_cli_ctx_put(ctx, 1);
-               RETURN(-EACCES);
+               return -EACCES;
        }
 
        OBD_ALLOC_PTR(req);
        if (!req)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        spin_lock_init(&req->rq_lock);
        atomic_set(&req->rq_refcount, 10000);
@@ -922,7 +922,7 @@ int sptlrpc_import_check_ctx(struct obd_import *imp)
        sptlrpc_cli_ctx_put(req->rq_cli_ctx, 1);
        OBD_FREE_PTR(req);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -945,7 +945,7 @@ int sptlrpc_cli_wrap_request(struct ptlrpc_request *req)
        if (req->rq_bulk) {
                rc = sptlrpc_cli_wrap_bulk(req, req->rq_bulk);
                if (rc)
-                       RETURN(rc);
+                       return rc;
        }
 
        switch (SPTLRPC_FLVR_SVC(req->rq_flvr.sf_rpc)) {
@@ -969,7 +969,7 @@ int sptlrpc_cli_wrap_request(struct ptlrpc_request *req)
                LASSERT(req->rq_reqdata_len <= req->rq_reqbuf_len);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int do_cli_unwrap_reply(struct ptlrpc_request *req)
@@ -993,13 +993,13 @@ static int do_cli_unwrap_reply(struct ptlrpc_request *req)
                break;
        default:
                CERROR("failed unpack reply: x"LPU64"\n", req->rq_xid);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (req->rq_repdata_len < sizeof(struct lustre_msg)) {
                CERROR("replied data length %d too small\n",
                       req->rq_repdata_len);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (SPTLRPC_FLVR_POLICY(req->rq_repdata->lm_secflvr) !=
@@ -1007,7 +1007,7 @@ static int do_cli_unwrap_reply(struct ptlrpc_request *req)
                CERROR("reply policy %u doesn't match request policy %u\n",
                       SPTLRPC_FLVR_POLICY(req->rq_repdata->lm_secflvr),
                       SPTLRPC_FLVR_POLICY(req->rq_flvr.sf_rpc));
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        switch (SPTLRPC_FLVR_SVC(req->rq_flvr.sf_rpc)) {
@@ -1029,7 +1029,7 @@ static int do_cli_unwrap_reply(struct ptlrpc_request *req)
        if (SPTLRPC_FLVR_POLICY(req->rq_flvr.sf_rpc) != SPTLRPC_POLICY_NULL &&
            !req->rq_ctx_init)
                req->rq_rep_swab_mask = 0;
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1090,7 +1090,7 @@ int sptlrpc_cli_unwrap_early_reply(struct ptlrpc_request *req,
 
        OBD_ALLOC_PTR(early_req);
        if (early_req == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        early_size = req->rq_nob_received;
        early_bufsz = size_roundup_power2(early_size);
@@ -1153,7 +1153,7 @@ int sptlrpc_cli_unwrap_early_reply(struct ptlrpc_request *req,
 
        LASSERT(early_req->rq_repmsg);
        *req_ret = early_req;
-       RETURN(0);
+       return 0;
 
 err_ctx:
        sptlrpc_cli_ctx_put(early_req->rq_cli_ctx, 1);
@@ -1161,7 +1161,7 @@ err_buf:
        OBD_FREE_LARGE(early_buf, early_bufsz);
 err_req:
        OBD_FREE_PTR(early_req);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -1297,7 +1297,7 @@ struct ptlrpc_sec * sptlrpc_sec_create(struct obd_import *imp,
                policy = sptlrpc_wireflavor2policy(sf->sf_rpc);
                if (!policy) {
                        CERROR("invalid flavor 0x%x\n", sf->sf_rpc);
-                       RETURN(NULL);
+                       return NULL;
                }
        }
 
@@ -1313,7 +1313,7 @@ struct ptlrpc_sec * sptlrpc_sec_create(struct obd_import *imp,
                sptlrpc_policy_put(policy);
        }
 
-       RETURN(sec);
+       return sec;
 }
 
 struct ptlrpc_sec *sptlrpc_import_sec_ref(struct obd_import *imp)
@@ -1399,7 +1399,7 @@ int sptlrpc_import_sec_adapt(struct obd_import *imp,
        might_sleep();
 
        if (imp == NULL)
-               RETURN(0);
+               return 0;
 
        conn = imp->imp_connection;
 
@@ -1473,7 +1473,7 @@ int sptlrpc_import_sec_adapt(struct obd_import *imp,
        mutex_unlock(&imp->imp_sec_mutex);
 out:
        sptlrpc_sec_put(sec);
-       RETURN(rc);
+       return rc;
 }
 
 void sptlrpc_import_sec_put(struct obd_import *imp)
@@ -1663,10 +1663,10 @@ int sptlrpc_cli_alloc_repbuf(struct ptlrpc_request *req, int msgsize)
        LASSERT(ctx->cc_sec->ps_policy);
 
        if (req->rq_repbuf)
-               RETURN(0);
+               return 0;
 
        policy = ctx->cc_sec->ps_policy;
-       RETURN(policy->sp_cops->alloc_repbuf(ctx->cc_sec, req, msgsize));
+       return policy->sp_cops->alloc_repbuf(ctx->cc_sec, req, msgsize);
 }
 
 /**
@@ -2035,7 +2035,7 @@ int sptlrpc_svc_unwrap_request(struct ptlrpc_request *req)
        default:
                CERROR("error unpacking request from %s x"LPU64"\n",
                       libcfs_id2str(req->rq_peer), req->rq_xid);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        req->rq_flvr.sf_rpc = WIRE_FLVR(msg->lm_secflvr);
@@ -2046,7 +2046,7 @@ int sptlrpc_svc_unwrap_request(struct ptlrpc_request *req)
        policy = sptlrpc_wireflavor2policy(req->rq_flvr.sf_rpc);
        if (!policy) {
                CERROR("unsupported rpc flavor %x\n", req->rq_flvr.sf_rpc);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        LASSERT(policy->sp_sops->accept);
@@ -2064,7 +2064,7 @@ int sptlrpc_svc_unwrap_request(struct ptlrpc_request *req)
 
        /* sanity check for the request source */
        rc = sptlrpc_svc_check_from(req, rc);
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2089,7 +2089,7 @@ int sptlrpc_svc_alloc_rs(struct ptlrpc_request *req, int msglen)
                /* failed alloc, try emergency pool */
                rs = lustre_get_emerg_rs(req->rq_rqbd->rqbd_svcpt);
                if (rs == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                req->rq_reply_state = rs;
                rc = policy->sp_sops->alloc_rs(req, msglen);
@@ -2102,7 +2102,7 @@ int sptlrpc_svc_alloc_rs(struct ptlrpc_request *req, int msglen)
        LASSERT(rc != 0 ||
                (req->rq_reply_state && req->rq_reply_state->rs_msg));
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
@@ -2125,7 +2125,7 @@ int sptlrpc_svc_wrap_reply(struct ptlrpc_request *req)
        rc = policy->sp_sops->authorize(req);
        LASSERT(rc || req->rq_reply_state->rs_repdata_len);
 
-       RETURN(rc);
+       return rc;
 }
 
 /**
index 665cf1b2171d114c9d8d3e4021b76e678db23bcc..6cc3f23c27ccff4b44ba013cabeeec4b53391db1 100644 (file)
@@ -195,7 +195,7 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
        flavor = strchr(param, '=');
        if (flavor == NULL) {
                CERROR("invalid param, no '='\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        *flavor++ = '\0';
 
@@ -208,7 +208,7 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
                rule->sr_netid = libcfs_str2net(param);
                if (rule->sr_netid == LNET_NIDNET(LNET_NID_ANY)) {
                        CERROR("invalid network name: %s\n", param);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
@@ -228,16 +228,16 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
                        rule->sr_to = LUSTRE_SP_MDT;
                } else {
                        CERROR("invalid rule dir segment: %s\n", dir);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
        /* 2.1 flavor */
        rc = sptlrpc_parse_flavor(flavor, &rule->sr_flvr);
        if (rc)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(sptlrpc_parse_rule);
 
@@ -665,13 +665,13 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
        target = lustre_cfg_string(lcfg, 1);
        if (target == NULL) {
                CERROR("missing target name\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        param = lustre_cfg_string(lcfg, 2);
        if (param == NULL) {
                CERROR("missing parameter\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        CDEBUG(D_SEC, "processing rule: %s.%s\n", target, param);
@@ -679,13 +679,13 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
        /* parse rule to make sure the format is correct */
        if (strncmp(param, PARAM_SRPC_FLVR, sizeof(PARAM_SRPC_FLVR) - 1) != 0) {
                CERROR("Invalid sptlrpc parameter: %s\n", param);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        param += sizeof(PARAM_SRPC_FLVR) - 1;
 
        rc = sptlrpc_parse_rule(param, &rule);
        if (rc)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (conf == NULL) {
                target2fsname(target, fsname, sizeof(fsname));
@@ -707,7 +707,7 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
        if (rc == 0)
                conf->sc_modified++;
 
-       RETURN(rc);
+       return rc;
 }
 
 int sptlrpc_process_config(struct lustre_cfg *lcfg)
@@ -1011,7 +1011,7 @@ int sptlrpc_target_local_copy_conf(struct obd_device *obd,
 
        ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
        if (ctxt == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
@@ -1054,7 +1054,7 @@ out_ctx:
        llog_ctxt_put(ctxt);
        CDEBUG(D_SEC, "target %s: write local sptlrpc conf: rc = %d\n",
               obd->obd_name, rc);
-       RETURN(rc);
+       return rc;
 }
 
 static int local_read_handler(const struct lu_env *env,
@@ -1067,7 +1067,7 @@ static int local_read_handler(const struct lu_env *env,
 
        if (rec->lrh_type != OBD_CFG_REC) {
                CERROR("unhandled lrh_type: %#x\n", rec->lrh_type);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        cfg_len = rec->lrh_len - sizeof(struct llog_rec_hdr) -
@@ -1076,15 +1076,15 @@ static int local_read_handler(const struct lu_env *env,
        rc = lustre_cfg_sanity_check(lcfg, cfg_len);
        if (rc) {
                CERROR("Insane cfg\n");
-               RETURN(rc);
+               return rc;
        }
 
        if (lcfg->lcfg_command != LCFG_SPTLRPC_CONF) {
                CERROR("invalid command (%x)\n", lcfg->lcfg_command);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
-       RETURN(__sptlrpc_process_config(lcfg, conf));
+       return __sptlrpc_process_config(lcfg, conf);
 }
 
 static
@@ -1101,7 +1101,7 @@ int sptlrpc_target_local_read_conf(struct obd_device *obd,
        ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
        if (ctxt == NULL) {
                CERROR("missing llog context\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
@@ -1137,7 +1137,7 @@ out_pop:
        llog_ctxt_put(ctxt);
        CDEBUG(D_SEC, "target %s: read local sptlrpc conf: rc = %d\n",
               obd->obd_name, rc);
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1161,7 +1161,7 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
                sp_dst = LUSTRE_SP_OST;
        } else {
                CERROR("unexpected obd type %s\n", obd->obd_type->typ_name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        CDEBUG(D_SEC, "get rules for target %s\n", obd->obd_uuid.uuid);
 
@@ -1203,7 +1203,7 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
                                      LUSTRE_SP_ANY, sp_dst, rset);
 out:
        mutex_unlock(&sptlrpc_conf_lock);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(sptlrpc_conf_target_get_rules);
 
index ed33a7fecb46716aff23247d298edc1b307386e8..416401be6d4f71821aa9c5133943aeea867c076a 100644 (file)
@@ -208,7 +208,7 @@ int plain_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 
        req->rq_reqdata_len = lustre_msg_size_v2(msg->lm_bufcount,
                                                 msg->lm_buflens);
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -221,7 +221,7 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 
        if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) {
                CERROR("unexpected reply buf count %u\n", msg->lm_bufcount);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        swabbed = ptlrpc_rep_need_swab(req);
@@ -229,24 +229,24 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
        phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, sizeof(*phdr));
        if (phdr == NULL) {
                CERROR("missing plain header\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (phdr->ph_ver != 0) {
                CERROR("Invalid header version\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        /* expect no user desc in reply */
        if (phdr->ph_flags & PLAIN_FL_USER) {
                CERROR("Unexpected udesc flag in reply\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (phdr->ph_bulk_hash_alg != req->rq_flvr.u_bulk.hash.hash_alg) {
                CERROR("reply bulk flavor %u != %u\n", phdr->ph_bulk_hash_alg,
                       req->rq_flvr.u_bulk.hash.hash_alg);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (unlikely(req->rq_early)) {
@@ -260,7 +260,7 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
                        CDEBUG(D_SEC,
                               "early reply checksum mismatch: %08x != %08x\n",
                               cpu_to_le32(cksum), msg->lm_cksum);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        } else {
                /* whether we sent with bulk or not, we expect the same
@@ -270,18 +270,18 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
                          phdr->ph_flags & PLAIN_FL_BULK)) {
                        CERROR("%s bulk checksum in reply\n",
                               req->rq_pack_bulk ? "Missing" : "Unexpected");
-                       RETURN(-EPROTO);
+                       return -EPROTO;
                }
 
                if (phdr->ph_flags & PLAIN_FL_BULK) {
                        if (plain_unpack_bsd(msg, swabbed))
-                               RETURN(-EPROTO);
+                               return -EPROTO;
                }
        }
 
        req->rq_repmsg = lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0);
        req->rq_replen = lustre_msg_buflen(msg, PLAIN_PACK_MSG_OFF);
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -305,10 +305,10 @@ int plain_cli_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
        bsd->bsd_svc = SPTLRPC_FLVR_BULK_SVC(req->rq_flvr.sf_rpc);
 
        if (bsd->bsd_svc == SPTLRPC_BULK_SVC_NULL)
-               RETURN(0);
+               return 0;
 
        if (req->rq_bulk_read)
-               RETURN(0);
+               return 0;
 
        rc = plain_generate_bulk_csum(desc, req->rq_flvr.u_bulk.hash.hash_alg,
                                      token);
@@ -446,7 +446,7 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp,
 
        OBD_ALLOC_PTR(plsec);
        if (plsec == NULL)
-               RETURN(NULL);
+               return NULL;
 
        /*
         * initialize plain_sec
@@ -471,12 +471,12 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp,
                ctx = plain_sec_install_ctx(plsec);
                if (ctx == NULL) {
                        plain_destroy_sec(sec);
-                       RETURN(NULL);
+                       return NULL;
                }
                sptlrpc_cli_ctx_put(ctx, 1);
        }
 
-       RETURN(sec);
+       return sec;
 }
 
 static
@@ -496,7 +496,7 @@ struct ptlrpc_cli_ctx *plain_lookup_ctx(struct ptlrpc_sec *sec,
        if (unlikely(ctx == NULL))
                ctx = plain_sec_install_ctx(plsec);
 
-       RETURN(ctx);
+       return ctx;
 }
 
 static
@@ -523,7 +523,7 @@ int plain_flush_ctx_cache(struct ptlrpc_sec *sec,
 
        /* do nothing unless caller want to flush for 'all' */
        if (uid != -1)
-               RETURN(0);
+               return 0;
 
        write_lock(&plsec->pls_lock);
        ctx = plsec->pls_ctx;
@@ -532,7 +532,7 @@ int plain_flush_ctx_cache(struct ptlrpc_sec *sec,
 
        if (ctx)
                sptlrpc_cli_ctx_put(ctx, 1);
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -562,7 +562,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
                alloc_len = size_roundup_power2(alloc_len);
                OBD_ALLOC_LARGE(req->rq_reqbuf, alloc_len);
                if (!req->rq_reqbuf)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                req->rq_reqbuf_len = alloc_len;
        } else {
@@ -577,7 +577,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
        if (req->rq_pack_udesc)
                sptlrpc_pack_user_desc(req->rq_reqbuf, PLAIN_PACK_USER_OFF);
 
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -616,10 +616,10 @@ int plain_alloc_repbuf(struct ptlrpc_sec *sec,
 
        OBD_ALLOC_LARGE(req->rq_repbuf, alloc_len);
        if (!req->rq_repbuf)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        req->rq_repbuf_len = alloc_len;
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -667,7 +667,7 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec,
 
                OBD_ALLOC_LARGE(newbuf, newbuf_size);
                if (newbuf == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                memcpy(newbuf, req->rq_reqbuf, req->rq_reqbuf_len);
 
@@ -683,7 +683,7 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec,
        _sptlrpc_enlarge_msg_inplace(req->rq_reqmsg, segment, newsize);
 
        req->rq_reqlen = newmsg_size;
-       RETURN(0);
+       return 0;
 }
 
 /****************************************
@@ -710,12 +710,12 @@ int plain_accept(struct ptlrpc_request *req)
            SPTLRPC_FLVR_BULK_TYPE(req->rq_flvr.sf_rpc) !=
            SPTLRPC_FLVR_BULK_TYPE(SPTLRPC_FLVR_PLAIN)) {
                CERROR("Invalid rpc flavor %x\n", req->rq_flvr.sf_rpc);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        if (msg->lm_bufcount < PLAIN_PACK_SEGMENTS) {
                CERROR("unexpected request buf count %u\n", msg->lm_bufcount);
-               RETURN(SECSVC_DROP);
+               return SECSVC_DROP;
        }
 
        swabbed = ptlrpc_req_need_swab(req);
@@ -723,17 +723,17 @@ int plain_accept(struct ptlrpc_request *req)
        phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, sizeof(*phdr));
        if (phdr == NULL) {
                CERROR("missing plain header\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (phdr->ph_ver != 0) {
                CERROR("Invalid header version\n");
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        if (phdr->ph_bulk_hash_alg >= BULK_HASH_ALG_MAX) {
                CERROR("invalid hash algorithm: %u\n", phdr->ph_bulk_hash_alg);
-               RETURN(-EPROTO);
+               return -EPROTO;
        }
 
        req->rq_sp_from = phdr->ph_sp;
@@ -743,7 +743,7 @@ int plain_accept(struct ptlrpc_request *req)
                if (sptlrpc_unpack_user_desc(msg, PLAIN_PACK_USER_OFF,
                                             swabbed)) {
                        CERROR("Mal-formed user descriptor\n");
-                       RETURN(SECSVC_DROP);
+                       return SECSVC_DROP;
                }
 
                req->rq_pack_udesc = 1;
@@ -752,7 +752,7 @@ int plain_accept(struct ptlrpc_request *req)
 
        if (phdr->ph_flags & PLAIN_FL_BULK) {
                if (plain_unpack_bsd(msg, swabbed))
-                       RETURN(SECSVC_DROP);
+                       return SECSVC_DROP;
 
                req->rq_pack_bulk = 1;
        }
@@ -763,7 +763,7 @@ int plain_accept(struct ptlrpc_request *req)
        req->rq_svc_ctx = &plain_svc_ctx;
        atomic_inc(&req->rq_svc_ctx->sc_refcount);
 
-       RETURN(SECSVC_OK);
+       return SECSVC_OK;
 }
 
 static
@@ -791,7 +791,7 @@ int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
        } else {
                OBD_ALLOC_LARGE(rs, rs_size);
                if (rs == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
 
                rs->rs_size = rs_size;
        }
@@ -805,7 +805,7 @@ int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
        rs->rs_msg = lustre_msg_buf_v2(rs->rs_repbuf, PLAIN_PACK_MSG_OFF, 0);
 
        req->rq_reply_state = rs;
-       RETURN(0);
+       return 0;
 }
 
 static
@@ -862,7 +862,7 @@ int plain_authorize(struct ptlrpc_request *req)
                        req->rq_reply_off = 0;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static
index 190c83f170df0cb41f0d8155802ef2683b927b4c..d5628e0fedf7aea89830f287469771d6a99f6397 100644 (file)
@@ -717,7 +717,7 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
                        if (rc != 0) {
                                CERROR("%s: invalid CPT pattern string: %s",
                                       conf->psc_name, cconf->cc_pattern);
-                               RETURN(ERR_PTR(-EINVAL));
+                               return ERR_PTR(-EINVAL);
                        }
 
                        rc = cfs_expr_list_values(el, ncpts, &cpts);
@@ -727,7 +727,7 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
                                       conf->psc_name, cconf->cc_pattern, rc);
                                if (cpts != NULL)
                                        OBD_FREE(cpts, sizeof(*cpts) * ncpts);
-                               RETURN(ERR_PTR(rc < 0 ? rc : -EINVAL));
+                               return ERR_PTR(rc < 0 ? rc : -EINVAL);
                        }
                        ncpts = rc;
                }
@@ -737,7 +737,7 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
        if (service == NULL) {
                if (cpts != NULL)
                        OBD_FREE(cpts, sizeof(*cpts) * ncpts);
-               RETURN(ERR_PTR(-ENOMEM));
+               return ERR_PTR(-ENOMEM);
        }
 
        service->srv_cptable            = cptable;
@@ -816,10 +816,10 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
                GOTO(failed, rc);
        }
 
-       RETURN(service);
+       return service;
 failed:
        ptlrpc_unregister_service(service);
-       RETURN(ERR_PTR(rc));
+       return ERR_PTR(rc);
 }
 EXPORT_SYMBOL(ptlrpc_register_service);
 
@@ -1257,7 +1257,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
                  at_get(&svcpt->scp_at_estimate), at_extra);
 
        if (AT_OFF)
-               RETURN(0);
+               return 0;
 
        if (olddl < 0) {
                DEBUG_REQ(D_WARNING, req, "Already past deadline (%+lds), "
@@ -1265,13 +1265,13 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
                          "at_early_margin (%d)?", olddl, at_early_margin);
 
                /* Return an error so we're not re-added to the timed list. */
-               RETURN(-ETIMEDOUT);
+               return -ETIMEDOUT;
        }
 
        if ((lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) == 0){
                DEBUG_REQ(D_INFO, req, "Wanted to ask client for more time, "
                          "but no AT support");
-               RETURN(-ENOSYS);
+               return -ENOSYS;
        }
 
        if (req->rq_export &&
@@ -1301,18 +1301,18 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
                                  olddl, req->rq_arrival_time.tv_sec +
                                  at_get(&svcpt->scp_at_estimate) -
                                  cfs_time_current_sec());
-                       RETURN(-ETIMEDOUT);
+                       return -ETIMEDOUT;
                }
        }
        newdl = cfs_time_current_sec() + at_get(&svcpt->scp_at_estimate);
 
        OBD_ALLOC(reqcopy, sizeof *reqcopy);
        if (reqcopy == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        OBD_ALLOC_LARGE(reqmsg, req->rq_reqlen);
        if (!reqmsg) {
                OBD_FREE(reqcopy, sizeof *reqcopy);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        *reqcopy = *req;
@@ -1371,7 +1371,7 @@ out:
        sptlrpc_svc_ctx_decref(reqcopy);
        OBD_FREE_LARGE(reqmsg, req->rq_reqlen);
        OBD_FREE(reqcopy, sizeof *reqcopy);
-       RETURN(rc);
+       return rc;
 }
 
 /* Send early replies to everybody expiring within at_early_margin
@@ -1390,14 +1390,14 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
        spin_lock(&svcpt->scp_at_lock);
        if (svcpt->scp_at_check == 0) {
                spin_unlock(&svcpt->scp_at_lock);
-               RETURN(0);
+               return 0;
        }
        delay = cfs_time_sub(cfs_time_current(), svcpt->scp_at_checktime);
        svcpt->scp_at_check = 0;
 
        if (array->paa_count == 0) {
                spin_unlock(&svcpt->scp_at_lock);
-               RETURN(0);
+               return 0;
        }
 
        /* The timer went off, but maybe the nearest rpc already completed. */
@@ -1406,7 +1406,7 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
                /* We've still got plenty of time.  Reset the timer. */
                ptlrpc_at_set_timer(svcpt);
                spin_unlock(&svcpt->scp_at_lock);
-               RETURN(0);
+               return 0;
        }
 
        /* We're close to a timeout, and we don't know how much longer the
@@ -1476,7 +1476,7 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
                ptlrpc_server_drop_request(rq);
        }
 
-       RETURN(1); /* return "did_something" for liblustre */
+       return 1; /* return "did_something" for liblustre */
 }
 
 /**
@@ -1491,7 +1491,7 @@ static int ptlrpc_server_hpreq_init(struct ptlrpc_service_part *svcpt,
        if (svcpt->scp_service->srv_ops.so_hpreq_handler) {
                rc = svcpt->scp_service->srv_ops.so_hpreq_handler(req);
                if (rc < 0)
-                       RETURN(rc);
+                       return rc;
                LASSERT(rc == 0);
        }
        if (req->rq_export && req->rq_ops) {
@@ -1512,7 +1512,7 @@ static int ptlrpc_server_hpreq_init(struct ptlrpc_service_part *svcpt,
                         * ost_brw_write().
                         */
                        if (rc < 0)
-                               RETURN(rc);
+                               return rc;
                        LASSERT(rc == 0 || rc == 1);
                }
 
@@ -1524,7 +1524,7 @@ static int ptlrpc_server_hpreq_init(struct ptlrpc_service_part *svcpt,
 
        ptlrpc_nrs_req_initialize(svcpt, req, rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 /** Remove the request from the export list. */
@@ -1573,11 +1573,11 @@ static int ptlrpc_server_request_add(struct ptlrpc_service_part *svcpt,
 
        rc = ptlrpc_server_hpreq_init(svcpt, req);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        ptlrpc_nrs_req_add(svcpt, req, !!rc);
 
-       RETURN(0);
+       return 0;
 }
 
 /**
@@ -1703,7 +1703,7 @@ ptlrpc_server_request_get(struct ptlrpc_service_part *svcpt, bool force)
        }
 
        spin_unlock(&svcpt->scp_req_lock);
-       RETURN(NULL);
+       return NULL;
 
 got_request:
        svcpt->scp_nreqs_active++;
@@ -1715,7 +1715,7 @@ got_request:
        if (likely(req->rq_export))
                class_export_rpc_inc(req->rq_export);
 
-       RETURN(req);
+       return req;
 }
 
 /**
@@ -1736,7 +1736,7 @@ ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt,
        spin_lock(&svcpt->scp_lock);
        if (list_empty(&svcpt->scp_req_incoming)) {
                spin_unlock(&svcpt->scp_lock);
-               RETURN(0);
+               return 0;
        }
 
        req = list_entry(svcpt->scp_req_incoming.next,
@@ -1855,12 +1855,12 @@ ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt,
                GOTO(err_req, rc);
 
        wake_up(&svcpt->scp_waitq);
-       RETURN(1);
+       return 1;
 
 err_req:
        ptlrpc_server_finish_request(svcpt, req);
 
-       RETURN(1);
+       return 1;
 }
 
 /**
@@ -1881,7 +1881,7 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt,
 
        request = ptlrpc_server_request_get(svcpt, false);
        if (request == NULL)
-               RETURN(0);
+               return 0;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT))
                fail_opc = OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT;
@@ -2020,7 +2020,7 @@ put_conn:
 out_req:
        ptlrpc_server_finish_active_request(svcpt, request);
 
-       RETURN(1);
+       return 1;
 }
 
 /**
@@ -2119,12 +2119,12 @@ ptlrpc_handle_rs(struct ptlrpc_reply_state *rs)
                if (atomic_dec_and_test(&svcpt->scp_nreps_difficult) &&
                    svc->srv_is_stopping)
                        wake_up_all(&svcpt->scp_waitq);
-               RETURN(1);
+               return 1;
        }
 
        /* still on the net; callback will schedule */
        spin_unlock(&rs->rs_lock);
-       RETURN(1);
+       return 1;
 }
 
 
@@ -2557,9 +2557,9 @@ static int ptlrpc_start_hr_threads(void)
                CERROR("Reply handling thread %d:%d Failed on starting: "
                       "rc = %d\n", i, j, rc);
                ptlrpc_stop_hr_threads();
-               RETURN(rc);
+               return rc;
        }
-       RETURN(0);
+       return 0;
 }
 
 static void ptlrpc_svcpt_stop_threads(struct ptlrpc_service_part *svcpt)
@@ -2646,12 +2646,12 @@ int ptlrpc_start_threads(struct ptlrpc_service *svc)
                }
        }
 
-       RETURN(0);
+       return 0;
  failed:
        CERROR("cannot start %s thread #%d_%d: rc %d\n",
               svc->srv_thread_name, i, j, rc);
        ptlrpc_stop_all_threads(svc);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(ptlrpc_start_threads);
 
@@ -2672,23 +2672,23 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait)
 
  again:
        if (unlikely(svc->srv_is_stopping))
-               RETURN(-ESRCH);
+               return -ESRCH;
 
        if (!ptlrpc_threads_increasable(svcpt) ||
            (OBD_FAIL_CHECK(OBD_FAIL_TGT_TOOMANY_THREADS) &&
             svcpt->scp_nthrs_running == svc->srv_nthrs_cpt_init - 1))
-               RETURN(-EMFILE);
+               return -EMFILE;
 
        OBD_CPT_ALLOC_PTR(thread, svc->srv_cptable, svcpt->scp_cpt);
        if (thread == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        init_waitqueue_head(&thread->t_ctl_waitq);
 
        spin_lock(&svcpt->scp_lock);
        if (!ptlrpc_threads_increasable(svcpt)) {
                spin_unlock(&svcpt->scp_lock);
                OBD_FREE_PTR(thread);
-               RETURN(-EMFILE);
+               return -EMFILE;
        }
 
        if (svcpt->scp_nthrs_starting != 0) {
@@ -2706,7 +2706,7 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait)
 
                CDEBUG(D_INFO, "Creating thread %s #%d race, retry later\n",
                       svc->srv_thread_name, svcpt->scp_thr_nextid);
-               RETURN(-EAGAIN);
+               return -EAGAIN;
        }
 
        svcpt->scp_nthrs_starting++;
@@ -2744,18 +2744,18 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait)
                        spin_unlock(&svcpt->scp_lock);
                        OBD_FREE_PTR(thread);
                }
-               RETURN(rc);
+               return rc;
        }
 
        if (!wait)
-               RETURN(0);
+               return 0;
 
        l_wait_event(thread->t_ctl_waitq,
                     thread_is_running(thread) || thread_is_stopped(thread),
                     &lwi);
 
        rc = thread_is_stopped(thread) ? thread->t_id : 0;
-       RETURN(rc);
+       return rc;
 }
 
 int ptlrpc_hr_init(void)
@@ -2774,7 +2774,7 @@ int ptlrpc_hr_init(void)
        ptlrpc_hr.hr_partitions = cfs_percpt_alloc(ptlrpc_hr.hr_cpt_table,
                                                   sizeof(*hrp));
        if (ptlrpc_hr.hr_partitions == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        init_waitqueue_head(&ptlrpc_hr.hr_waitq);
 
@@ -2811,7 +2811,7 @@ int ptlrpc_hr_init(void)
 out:
        if (rc != 0)
                ptlrpc_hr_fini();
-       RETURN(rc);
+       return rc;
 }
 
 void ptlrpc_hr_fini(void)
@@ -3052,7 +3052,7 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service)
 
        ptlrpc_service_free(service);
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(ptlrpc_unregister_service);