提交 0a3bdb00 编写于 作者: G Greg Kroah-Hartman

staging: lustre: remove RETURN macro

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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 23f14e79
...@@ -52,11 +52,11 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size) ...@@ -52,11 +52,11 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size)); OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size));
if (ptr == NULL) if (ptr == NULL)
RETURN(ptr); return ptr;
ptr->size = size; ptr->size = size;
RETURN (ptr); return ptr;
} }
#define CFS_FREE_BITMAP(ptr) OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size)) #define CFS_FREE_BITMAP(ptr) OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
......
...@@ -80,20 +80,8 @@ static inline int __is_po2(unsigned long long val) ...@@ -80,20 +80,8 @@ static inline int __is_po2(unsigned long long val)
#define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \ #define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \
((hexnum) >> 8 & 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 #define LUSTRE_SRV_LNET_PID LUSTRE_LNET_PID
#include <linux/list.h> #include <linux/list.h>
#ifndef cfs_for_each_possible_cpu #ifndef cfs_for_each_possible_cpu
......
...@@ -262,53 +262,6 @@ do { \ ...@@ -262,53 +262,6 @@ do { \
} while (0) } 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, extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format1, ...) const char *format1, ...)
__attribute__ ((format (printf, 2, 3))); __attribute__ ((format (printf, 2, 3)));
......
...@@ -380,7 +380,7 @@ ksocknal_receive (ksock_conn_t *conn) ...@@ -380,7 +380,7 @@ ksocknal_receive (ksock_conn_t *conn)
} }
ksocknal_connsock_decref(conn); ksocknal_connsock_decref(conn);
RETURN (rc); return rc;
} }
void void
......
...@@ -247,7 +247,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev) ...@@ -247,7 +247,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
/* must called with lnet_eq_wait_lock hold */ /* must called with lnet_eq_wait_lock hold */
if (LNET_SEQ_GT(eq->eq_deq_seq, new_event->sequence)) if (LNET_SEQ_GT(eq->eq_deq_seq, new_event->sequence))
RETURN(0); return 0;
/* We've got a new event... */ /* We've got a new event... */
*ev = *new_event; *ev = *new_event;
...@@ -267,7 +267,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev) ...@@ -267,7 +267,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
} }
eq->eq_deq_seq = new_event->sequence + 1; 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, ...@@ -404,7 +404,7 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
LASSERT (the_lnet.ln_refcount > 0); LASSERT (the_lnet.ln_refcount > 0);
if (neq < 1) if (neq < 1)
RETURN(-ENOENT); return -ENOENT;
lnet_eq_wait_lock(); lnet_eq_wait_lock();
...@@ -414,14 +414,14 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms, ...@@ -414,14 +414,14 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
if (eq == NULL) { if (eq == NULL) {
lnet_eq_wait_unlock(); lnet_eq_wait_unlock();
RETURN(-ENOENT); return -ENOENT;
} }
rc = lnet_eq_dequeue_event(eq, event); rc = lnet_eq_dequeue_event(eq, event);
if (rc != 0) { if (rc != 0) {
lnet_eq_wait_unlock(); lnet_eq_wait_unlock();
*which = i; *which = i;
RETURN(rc); return rc;
} }
} }
...@@ -441,5 +441,5 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms, ...@@ -441,5 +441,5 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
} }
lnet_eq_wait_unlock(); lnet_eq_wait_unlock();
RETURN(0); return 0;
} }
...@@ -120,7 +120,7 @@ init_lnet(void) ...@@ -120,7 +120,7 @@ init_lnet(void)
rc = LNetInit(); rc = LNetInit();
if (rc != 0) { if (rc != 0) {
CERROR("LNetInit: error %d\n", rc); CERROR("LNetInit: error %d\n", rc);
RETURN(rc); return rc;
} }
rc = libcfs_register_ioctl(&lnet_ioctl_handler); rc = libcfs_register_ioctl(&lnet_ioctl_handler);
...@@ -132,7 +132,7 @@ init_lnet(void) ...@@ -132,7 +132,7 @@ init_lnet(void)
(void) kthread_run(lnet_configure, NULL, "lnet_initd"); (void) kthread_run(lnet_configure, NULL, "lnet_initd");
} }
RETURN(0); return 0;
} }
void void
......
...@@ -67,7 +67,7 @@ static int seq_client_rpc(struct lu_client_seq *seq, ...@@ -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, req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_SEQ_QUERY,
LUSTRE_MDS_VERSION, SEQ_QUERY); LUSTRE_MDS_VERSION, SEQ_QUERY);
if (req == NULL) if (req == NULL)
RETURN(-ENOMEM); return -ENOMEM;
/* Init operation code */ /* Init operation code */
op = req_capsule_client_get(&req->rq_pill, &RMF_SEQ_OPC); 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, ...@@ -153,14 +153,14 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
* setup (lcs_exp != NULL) */ * setup (lcs_exp != NULL) */
if (seq->lcs_exp == NULL) { if (seq->lcs_exp == NULL) {
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(-EINPROGRESS); return -EINPROGRESS;
} }
rc = seq_client_rpc(seq, &seq->lcs_space, rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_SUPER, "super"); SEQ_ALLOC_SUPER, "super");
} }
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(rc); return rc;
} }
/* Request sequence-controller node to allocate new meta-sequence. */ /* Request sequence-controller node to allocate new meta-sequence. */
...@@ -182,7 +182,7 @@ static int seq_client_alloc_meta(const struct lu_env *env, ...@@ -182,7 +182,7 @@ static int seq_client_alloc_meta(const struct lu_env *env,
} while (rc == -EINPROGRESS || rc == -EAGAIN); } while (rc == -EINPROGRESS || rc == -EAGAIN);
} }
RETURN(rc); return rc;
} }
/* Allocate new sequence for client. */ /* Allocate new sequence for client. */
...@@ -198,7 +198,7 @@ static int seq_client_alloc_seq(const struct lu_env *env, ...@@ -198,7 +198,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
if (rc) { if (rc) {
CERROR("%s: Can't allocate new meta-sequence," CERROR("%s: Can't allocate new meta-sequence,"
"rc %d\n", seq->lcs_name, rc); "rc %d\n", seq->lcs_name, rc);
RETURN(rc); return rc;
} else { } else {
CDEBUG(D_INFO, "%s: New range - "DRANGE"\n", CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
seq->lcs_name, PRANGE(&seq->lcs_space)); seq->lcs_name, PRANGE(&seq->lcs_space));
...@@ -214,7 +214,7 @@ static int seq_client_alloc_seq(const struct lu_env *env, ...@@ -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, CDEBUG(D_INFO, "%s: Allocated sequence ["LPX64"]\n", seq->lcs_name,
*seqnr); *seqnr);
RETURN(rc); return rc;
} }
static int seq_fid_alloc_prep(struct lu_client_seq *seq, 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, ...@@ -333,7 +333,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
"rc %d\n", seq->lcs_name, rc); "rc %d\n", seq->lcs_name, rc);
seq_fid_alloc_fini(seq); seq_fid_alloc_fini(seq);
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(rc); return rc;
} }
CDEBUG(D_INFO, "%s: Switch to sequence " CDEBUG(D_INFO, "%s: Switch to sequence "
...@@ -357,7 +357,7 @@ int seq_client_alloc_fid(const struct lu_env *env, ...@@ -357,7 +357,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
CDEBUG(D_INFO, "%s: Allocated FID "DFID"\n", seq->lcs_name, PFID(fid)); CDEBUG(D_INFO, "%s: Allocated FID "DFID"\n", seq->lcs_name, PFID(fid));
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(seq_client_alloc_fid); EXPORT_SYMBOL(seq_client_alloc_fid);
...@@ -422,7 +422,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq) ...@@ -422,7 +422,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
CERROR("%s: LProcFS failed in seq-init\n", CERROR("%s: LProcFS failed in seq-init\n",
seq->lcs_name); seq->lcs_name);
rc = PTR_ERR(seq->lcs_proc_dir); rc = PTR_ERR(seq->lcs_proc_dir);
RETURN(rc); return rc;
} }
rc = lprocfs_add_vars(seq->lcs_proc_dir, rc = lprocfs_add_vars(seq->lcs_proc_dir,
...@@ -433,7 +433,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq) ...@@ -433,7 +433,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
GOTO(out_cleanup, rc); GOTO(out_cleanup, rc);
} }
RETURN(0); return 0;
out_cleanup: out_cleanup:
seq_client_proc_fini(seq); seq_client_proc_fini(seq);
...@@ -479,7 +479,7 @@ int seq_client_init(struct lu_client_seq *seq, ...@@ -479,7 +479,7 @@ int seq_client_init(struct lu_client_seq *seq,
rc = seq_client_proc_init(seq); rc = seq_client_proc_init(seq);
if (rc) if (rc)
seq_client_fini(seq); seq_client_fini(seq);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(seq_client_init); EXPORT_SYMBOL(seq_client_init);
...@@ -505,7 +505,7 @@ int client_fid_init(struct obd_device *obd, ...@@ -505,7 +505,7 @@ int client_fid_init(struct obd_device *obd,
OBD_ALLOC_PTR(cli->cl_seq); OBD_ALLOC_PTR(cli->cl_seq);
if (cli->cl_seq == NULL) if (cli->cl_seq == NULL)
RETURN(-ENOMEM); return -ENOMEM;
OBD_ALLOC(prefix, MAX_OBD_NAME + 5); OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
if (prefix == NULL) if (prefix == NULL)
...@@ -519,7 +519,7 @@ int client_fid_init(struct obd_device *obd, ...@@ -519,7 +519,7 @@ int client_fid_init(struct obd_device *obd,
if (rc) if (rc)
GOTO(out_free_seq, rc); GOTO(out_free_seq, rc);
RETURN(rc); return rc;
out_free_seq: out_free_seq:
OBD_FREE_PTR(cli->cl_seq); OBD_FREE_PTR(cli->cl_seq);
cli->cl_seq = NULL; cli->cl_seq = NULL;
...@@ -537,7 +537,7 @@ int client_fid_fini(struct obd_device *obd) ...@@ -537,7 +537,7 @@ int client_fid_fini(struct obd_device *obd)
cli->cl_seq = NULL; cli->cl_seq = NULL;
} }
RETURN(0); return 0;
} }
EXPORT_SYMBOL(client_fid_fini); EXPORT_SYMBOL(client_fid_fini);
......
...@@ -72,9 +72,9 @@ lprocfs_fid_write_common(const char *buffer, unsigned long count, ...@@ -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_start,
(long long unsigned *)&tmp.lsr_end); (long long unsigned *)&tmp.lsr_end);
if (rc != 2 || !range_is_sane(&tmp) || range_is_zero(&tmp)) if (rc != 2 || !range_is_sane(&tmp) || range_is_zero(&tmp))
RETURN(-EINVAL); return -EINVAL;
*range = tmp; *range = tmp;
RETURN(0); return 0;
} }
/* Client side procfs stuff */ /* Client side procfs stuff */
...@@ -97,7 +97,7 @@ lprocfs_fid_space_seq_write(struct file *file, const char *buffer, ...@@ -97,7 +97,7 @@ lprocfs_fid_space_seq_write(struct file *file, const char *buffer,
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(count); return count;
} }
static int static int
...@@ -112,7 +112,7 @@ lprocfs_fid_space_seq_show(struct seq_file *m, void *unused) ...@@ -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)); rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n", PRANGE(&seq->lcs_space));
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(rc); return rc;
} }
static ssize_t static ssize_t
...@@ -127,7 +127,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer, ...@@ -127,7 +127,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer,
rc = lprocfs_write_helper(buffer, count, &val); rc = lprocfs_write_helper(buffer, count, &val);
if (rc) if (rc)
RETURN(rc); return rc;
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
if (seq->lcs_type == LUSTRE_SEQ_DATA) if (seq->lcs_type == LUSTRE_SEQ_DATA)
...@@ -146,7 +146,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer, ...@@ -146,7 +146,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer,
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(count); return count;
} }
static int static int
...@@ -161,7 +161,7 @@ lprocfs_fid_width_seq_show(struct seq_file *m, void *unused) ...@@ -161,7 +161,7 @@ lprocfs_fid_width_seq_show(struct seq_file *m, void *unused)
rc = seq_printf(m, LPU64"\n", seq->lcs_width); rc = seq_printf(m, LPU64"\n", seq->lcs_width);
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(rc); return rc;
} }
static int static int
...@@ -176,7 +176,7 @@ lprocfs_fid_fid_seq_show(struct seq_file *m, void *unused) ...@@ -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)); rc = seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
RETURN(rc); return rc;
} }
static int static int
...@@ -194,7 +194,7 @@ lprocfs_fid_server_seq_show(struct seq_file *m, void *unused) ...@@ -194,7 +194,7 @@ lprocfs_fid_server_seq_show(struct seq_file *m, void *unused)
} else { } else {
rc = seq_printf(m, "%s\n", seq->lcs_srv->lss_name); rc = seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
} }
RETURN(rc); return rc;
} }
LPROC_SEQ_FOPS(lprocfs_fid_space); LPROC_SEQ_FOPS(lprocfs_fid_space);
......
...@@ -72,7 +72,7 @@ struct fld_cache *fld_cache_init(const char *name, ...@@ -72,7 +72,7 @@ struct fld_cache *fld_cache_init(const char *name,
OBD_ALLOC_PTR(cache); OBD_ALLOC_PTR(cache);
if (cache == NULL) if (cache == NULL)
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&cache->fci_entries_head); INIT_LIST_HEAD(&cache->fci_entries_head);
INIT_LIST_HEAD(&cache->fci_lru); INIT_LIST_HEAD(&cache->fci_lru);
...@@ -92,7 +92,7 @@ struct fld_cache *fld_cache_init(const char *name, ...@@ -92,7 +92,7 @@ struct fld_cache *fld_cache_init(const char *name,
CDEBUG(D_INFO, "%s: FLD cache - Size: %d, Threshold: %d\n", CDEBUG(D_INFO, "%s: FLD cache - Size: %d, Threshold: %d\n",
cache->fci_name, cache_size, cache_threshold); cache->fci_name, cache_size, cache_threshold);
RETURN(cache); return cache;
} }
/** /**
...@@ -223,7 +223,7 @@ static int fld_cache_shrink(struct fld_cache *cache) ...@@ -223,7 +223,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
LASSERT(cache != NULL); LASSERT(cache != NULL);
if (cache->fci_cache_count < cache->fci_cache_size) if (cache->fci_cache_count < cache->fci_cache_size)
RETURN(0); return 0;
curr = cache->fci_lru.prev; curr = cache->fci_lru.prev;
...@@ -239,7 +239,7 @@ static int fld_cache_shrink(struct fld_cache *cache) ...@@ -239,7 +239,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
CDEBUG(D_INFO, "%s: FLD cache - Shrunk by " CDEBUG(D_INFO, "%s: FLD cache - Shrunk by "
"%d entries\n", cache->fci_name, num); "%d entries\n", cache->fci_name, num);
RETURN(0); return 0;
} }
/** /**
...@@ -367,10 +367,10 @@ struct fld_cache_entry ...@@ -367,10 +367,10 @@ struct fld_cache_entry
OBD_ALLOC_PTR(f_new); OBD_ALLOC_PTR(f_new);
if (!f_new) if (!f_new)
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
f_new->fce_range = *range; f_new->fce_range = *range;
RETURN(f_new); return f_new;
} }
/** /**
...@@ -424,7 +424,7 @@ int fld_cache_insert_nolock(struct fld_cache *cache, ...@@ -424,7 +424,7 @@ int fld_cache_insert_nolock(struct fld_cache *cache,
/* Add new entry to cache and lru list. */ /* Add new entry to cache and lru list. */
fld_cache_entry_add(cache, f_new, prev); fld_cache_entry_add(cache, f_new, prev);
out: out:
RETURN(0); return 0;
} }
int fld_cache_insert(struct fld_cache *cache, int fld_cache_insert(struct fld_cache *cache,
...@@ -435,7 +435,7 @@ 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); flde = fld_cache_entry_create(range);
if (IS_ERR(flde)) if (IS_ERR(flde))
RETURN(PTR_ERR(flde)); return PTR_ERR(flde);
write_lock(&cache->fci_lock); write_lock(&cache->fci_lock);
rc = fld_cache_insert_nolock(cache, flde); rc = fld_cache_insert_nolock(cache, flde);
...@@ -443,7 +443,7 @@ int fld_cache_insert(struct fld_cache *cache, ...@@ -443,7 +443,7 @@ int fld_cache_insert(struct fld_cache *cache,
if (rc) if (rc)
OBD_FREE_PTR(flde); OBD_FREE_PTR(flde);
RETURN(rc); return rc;
} }
void fld_cache_delete_nolock(struct fld_cache *cache, void fld_cache_delete_nolock(struct fld_cache *cache,
...@@ -495,7 +495,7 @@ struct fld_cache_entry ...@@ -495,7 +495,7 @@ struct fld_cache_entry
} }
} }
RETURN(got); return got;
} }
/** /**
...@@ -509,7 +509,7 @@ struct fld_cache_entry ...@@ -509,7 +509,7 @@ struct fld_cache_entry
read_lock(&cache->fci_lock); read_lock(&cache->fci_lock);
got = fld_cache_entry_lookup_nolock(cache, range); got = fld_cache_entry_lookup_nolock(cache, range);
read_unlock(&cache->fci_lock); read_unlock(&cache->fci_lock);
RETURN(got); return got;
} }
/** /**
...@@ -539,9 +539,9 @@ int fld_cache_lookup(struct fld_cache *cache, ...@@ -539,9 +539,9 @@ int fld_cache_lookup(struct fld_cache *cache,
cache->fci_stat.fst_cache++; cache->fci_stat.fst_cache++;
read_unlock(&cache->fci_lock); read_unlock(&cache->fci_lock);
RETURN(0); return 0;
} }
} }
read_unlock(&cache->fci_lock); read_unlock(&cache->fci_lock);
RETURN(-ENOENT); return -ENOENT;
} }
...@@ -70,7 +70,7 @@ static int fld_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw) ...@@ -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); client_obd_list_lock(&cli->cl_loi_list_lock);
rc = list_empty(&mcw->mcw_entry); rc = list_empty(&mcw->mcw_entry);
client_obd_list_unlock(&cli->cl_loi_list_lock); client_obd_list_unlock(&cli->cl_loi_list_lock);
RETURN(rc); return rc;
}; };
static void fld_enter_request(struct client_obd *cli) static void fld_enter_request(struct client_obd *cli)
...@@ -137,7 +137,7 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq) ...@@ -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) { list_for_each_entry(target, &fld->lcf_targets, ft_chain) {
if (target->ft_idx == hash) if (target->ft_idx == hash)
RETURN(target); return target;
} }
CERROR("%s: Can't find target by hash %d (seq "LPX64"). " 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) ...@@ -161,7 +161,7 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq)
* LBUG() to catch this situation. * LBUG() to catch this situation.
*/ */
LBUG(); LBUG();
RETURN(NULL); return NULL;
} }
struct lu_fld_hash fld_hash[] = { struct lu_fld_hash fld_hash[] = {
...@@ -192,7 +192,7 @@ fld_client_get_target(struct lu_client_fld *fld, seqno_t seq) ...@@ -192,7 +192,7 @@ fld_client_get_target(struct lu_client_fld *fld, seqno_t seq)
target->ft_idx, seq); target->ft_idx, seq);
} }
RETURN(target); return target;
} }
/* /*
...@@ -214,7 +214,7 @@ int fld_client_add_target(struct lu_client_fld *fld, ...@@ -214,7 +214,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
CERROR("%s: Attempt to add target %s (idx "LPU64") " CERROR("%s: Attempt to add target %s (idx "LPU64") "
"on fly - skip it\n", fld->lcf_name, name, "on fly - skip it\n", fld->lcf_name, name,
tar->ft_idx); tar->ft_idx);
RETURN(0); return 0;
} else { } else {
CDEBUG(D_INFO, "%s: Adding target %s (idx " CDEBUG(D_INFO, "%s: Adding target %s (idx "
LPU64")\n", fld->lcf_name, name, tar->ft_idx); LPU64")\n", fld->lcf_name, name, tar->ft_idx);
...@@ -222,7 +222,7 @@ int fld_client_add_target(struct lu_client_fld *fld, ...@@ -222,7 +222,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
OBD_ALLOC_PTR(target); OBD_ALLOC_PTR(target);
if (target == NULL) if (target == NULL)
RETURN(-ENOMEM); return -ENOMEM;
spin_lock(&fld->lcf_lock); spin_lock(&fld->lcf_lock);
list_for_each_entry(tmp, &fld->lcf_targets, ft_chain) { list_for_each_entry(tmp, &fld->lcf_targets, ft_chain) {
...@@ -231,7 +231,7 @@ int fld_client_add_target(struct lu_client_fld *fld, ...@@ -231,7 +231,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
OBD_FREE_PTR(target); OBD_FREE_PTR(target);
CERROR("Target %s exists in FLD and known as %s:#"LPU64"\n", CERROR("Target %s exists in FLD and known as %s:#"LPU64"\n",
name, fld_target_name(tmp), tmp->ft_idx); 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, ...@@ -247,7 +247,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
fld->lcf_count++; fld->lcf_count++;
spin_unlock(&fld->lcf_lock); spin_unlock(&fld->lcf_lock);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(fld_client_add_target); EXPORT_SYMBOL(fld_client_add_target);
...@@ -268,11 +268,11 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx) ...@@ -268,11 +268,11 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)
class_export_put(target->ft_exp); class_export_put(target->ft_exp);
OBD_FREE_PTR(target); OBD_FREE_PTR(target);
RETURN(0); return 0;
} }
} }
spin_unlock(&fld->lcf_lock); spin_unlock(&fld->lcf_lock);
RETURN(-ENOENT); return -ENOENT;
} }
EXPORT_SYMBOL(fld_client_del_target); EXPORT_SYMBOL(fld_client_del_target);
...@@ -291,7 +291,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld) ...@@ -291,7 +291,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
CERROR("%s: LProcFS failed in fld-init\n", CERROR("%s: LProcFS failed in fld-init\n",
fld->lcf_name); fld->lcf_name);
rc = PTR_ERR(fld->lcf_proc_dir); rc = PTR_ERR(fld->lcf_proc_dir);
RETURN(rc); return rc;
} }
rc = lprocfs_add_vars(fld->lcf_proc_dir, rc = lprocfs_add_vars(fld->lcf_proc_dir,
...@@ -302,7 +302,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld) ...@@ -302,7 +302,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
GOTO(out_cleanup, rc); GOTO(out_cleanup, rc);
} }
RETURN(0); return 0;
out_cleanup: out_cleanup:
fld_client_proc_fini(fld); fld_client_proc_fini(fld);
...@@ -350,7 +350,7 @@ int fld_client_init(struct lu_client_fld *fld, ...@@ -350,7 +350,7 @@ int fld_client_init(struct lu_client_fld *fld,
if (!hash_is_sane(hash)) { if (!hash_is_sane(hash)) {
CERROR("%s: Wrong hash function %#x\n", CERROR("%s: Wrong hash function %#x\n",
fld->lcf_name, hash); fld->lcf_name, hash);
RETURN(-EINVAL); return -EINVAL;
} }
fld->lcf_count = 0; fld->lcf_count = 0;
...@@ -424,7 +424,7 @@ int fld_client_rpc(struct obd_export *exp, ...@@ -424,7 +424,7 @@ int fld_client_rpc(struct obd_export *exp,
req = ptlrpc_request_alloc_pack(imp, &RQF_FLD_QUERY, LUSTRE_MDS_VERSION, req = ptlrpc_request_alloc_pack(imp, &RQF_FLD_QUERY, LUSTRE_MDS_VERSION,
FLD_QUERY); FLD_QUERY);
if (req == NULL) if (req == NULL)
RETURN(-ENOMEM); return -ENOMEM;
op = req_capsule_client_get(&req->rq_pill, &RMF_FLD_OPC); op = req_capsule_client_get(&req->rq_pill, &RMF_FLD_OPC);
*op = fld_op; *op = fld_op;
...@@ -471,7 +471,7 @@ int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds, ...@@ -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); rc = fld_cache_lookup(fld->lcf_cache, seq, &res);
if (rc == 0) { if (rc == 0) {
*mds = res.lsr_index; *mds = res.lsr_index;
RETURN(0); return 0;
} }
/* Can not find it in the cache */ /* 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, ...@@ -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); fld_cache_insert(fld->lcf_cache, &res);
} }
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(fld_client_lookup); EXPORT_SYMBOL(fld_client_lookup);
......
...@@ -71,7 +71,7 @@ fld_proc_targets_seq_show(struct seq_file *m, void *unused) ...@@ -71,7 +71,7 @@ fld_proc_targets_seq_show(struct seq_file *m, void *unused)
seq_printf(m, "%s\n", fld_target_name(target)); seq_printf(m, "%s\n", fld_target_name(target));
spin_unlock(&fld->lcf_lock); spin_unlock(&fld->lcf_lock);
RETURN(0); return 0;
} }
static int static int
...@@ -85,7 +85,7 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused) ...@@ -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); seq_printf(m, "%s\n", fld->lcf_hash->fh_name);
spin_unlock(&fld->lcf_lock); spin_unlock(&fld->lcf_lock);
RETURN(0); return 0;
} }
static ssize_t static ssize_t
...@@ -117,7 +117,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer, ...@@ -117,7 +117,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer,
fld->lcf_name, hash->fh_name); fld->lcf_name, hash->fh_name);
} }
RETURN(count); return count;
} }
static ssize_t static ssize_t
...@@ -132,7 +132,7 @@ fld_proc_cache_flush_write(struct file *file, const char __user *buffer, ...@@ -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); 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) static int fld_proc_cache_flush_open(struct inode *inode, struct file *file)
......
...@@ -216,7 +216,7 @@ static inline int lustre_cfg_len(__u32 bufcount, __u32 *buflens) ...@@ -216,7 +216,7 @@ static inline int lustre_cfg_len(__u32 bufcount, __u32 *buflens)
for (i = 0; i < bufcount; i++) for (i = 0; i < bufcount; i++)
len += cfs_size_round(buflens[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, ...@@ -232,7 +232,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount, OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount,
bufs->lcfg_buflen)); bufs->lcfg_buflen));
if (!lcfg) if (!lcfg)
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
lcfg->lcfg_version = LUSTRE_CFG_VERSION; lcfg->lcfg_version = LUSTRE_CFG_VERSION;
lcfg->lcfg_command = cmd; lcfg->lcfg_command = cmd;
...@@ -243,7 +243,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd, ...@@ -243,7 +243,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i]; lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i];
LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr); 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) 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) ...@@ -261,27 +261,27 @@ static inline int lustre_cfg_sanity_check(void *buf, int len)
struct lustre_cfg *lcfg = (struct lustre_cfg *)buf; struct lustre_cfg *lcfg = (struct lustre_cfg *)buf;
if (!lcfg) if (!lcfg)
RETURN(-EINVAL); return -EINVAL;
/* check that the first bits of the struct are valid */ /* check that the first bits of the struct are valid */
if (len < LCFG_HDR_SIZE(0)) if (len < LCFG_HDR_SIZE(0))
RETURN(-EINVAL); return -EINVAL;
if (lcfg->lcfg_version != LUSTRE_CFG_VERSION) if (lcfg->lcfg_version != LUSTRE_CFG_VERSION)
RETURN(-EINVAL); return -EINVAL;
if (lcfg->lcfg_bufcount >= LUSTRE_CFG_MAX_BUFCOUNT) if (lcfg->lcfg_bufcount >= LUSTRE_CFG_MAX_BUFCOUNT)
RETURN(-EINVAL); return -EINVAL;
/* check that the buflens are valid */ /* check that the buflens are valid */
if (len < LCFG_HDR_SIZE(lcfg->lcfg_bufcount)) if (len < LCFG_HDR_SIZE(lcfg->lcfg_bufcount))
RETURN(-EINVAL); return -EINVAL;
/* make sure all the pointers point inside the data */ /* make sure all the pointers point inside the data */
if (len < lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens)) if (len < lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens))
RETURN(-EINVAL); return -EINVAL;
RETURN(0); return 0;
} }
#include <lustre/lustre_user.h> #include <lustre/lustre_user.h>
......
...@@ -677,14 +677,14 @@ static inline __u64 fid_flatten(const struct lu_fid *fid) ...@@ -677,14 +677,14 @@ static inline __u64 fid_flatten(const struct lu_fid *fid)
if (fid_is_igif(fid)) { if (fid_is_igif(fid)) {
ino = lu_igif_ino(fid); ino = lu_igif_ino(fid);
RETURN(ino); return ino;
} }
seq = fid_seq(fid); seq = fid_seq(fid);
ino = (seq << 24) + ((seq >> 24) & 0xffffff0000ULL) + fid_oid(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) 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) ...@@ -703,7 +703,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid)
if (fid_is_igif(fid)) { if (fid_is_igif(fid)) {
ino = lu_igif_ino(fid); ino = lu_igif_ino(fid);
RETURN(ino); return ino;
} }
seq = fid_seq(fid) - FID_SEQ_START; seq = fid_seq(fid) - FID_SEQ_START;
...@@ -717,7 +717,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid) ...@@ -717,7 +717,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid)
(seq >> (64 - (40-8)) & 0xffffff00) + (seq >> (64 - (40-8)) & 0xffffff00) +
(fid_oid(fid) & 0xff000fff) + ((fid_oid(fid) & 0x00fff000) << 8); (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) static inline int lu_fid_diff(struct lu_fid *fid1, struct lu_fid *fid2)
......
...@@ -471,12 +471,12 @@ static inline int llog_destroy(const struct lu_env *env, ...@@ -471,12 +471,12 @@ static inline int llog_destroy(const struct lu_env *env,
rc = llog_handle2ops(handle, &lop); rc = llog_handle2ops(handle, &lop);
if (rc) if (rc)
RETURN(rc); return rc;
if (lop->lop_destroy == NULL) if (lop->lop_destroy == NULL)
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
rc = lop->lop_destroy(env, handle); rc = lop->lop_destroy(env, handle);
RETURN(rc); return rc;
} }
static inline int llog_next_block(const struct lu_env *env, 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, ...@@ -489,13 +489,13 @@ static inline int llog_next_block(const struct lu_env *env,
rc = llog_handle2ops(loghandle, &lop); rc = llog_handle2ops(loghandle, &lop);
if (rc) if (rc)
RETURN(rc); return rc;
if (lop->lop_next_block == NULL) if (lop->lop_next_block == NULL)
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
rc = lop->lop_next_block(env, loghandle, cur_idx, next_idx, rc = lop->lop_next_block(env, loghandle, cur_idx, next_idx,
cur_offset, buf, len); cur_offset, buf, len);
RETURN(rc); return rc;
} }
static inline int llog_prev_block(const struct lu_env *env, 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, ...@@ -507,12 +507,12 @@ static inline int llog_prev_block(const struct lu_env *env,
rc = llog_handle2ops(loghandle, &lop); rc = llog_handle2ops(loghandle, &lop);
if (rc) if (rc)
RETURN(rc); return rc;
if (lop->lop_prev_block == NULL) if (lop->lop_prev_block == NULL)
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
rc = lop->lop_prev_block(env, loghandle, prev_idx, buf, len); rc = lop->lop_prev_block(env, loghandle, prev_idx, buf, len);
RETURN(rc); return rc;
} }
static inline int llog_connect(struct llog_ctxt *ctxt, static inline int llog_connect(struct llog_ctxt *ctxt,
...@@ -524,12 +524,12 @@ 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); rc = llog_obd2ops(ctxt, &lop);
if (rc) if (rc)
RETURN(rc); return rc;
if (lop->lop_connect == NULL) if (lop->lop_connect == NULL)
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
rc = lop->lop_connect(ctxt, logid, gen, uuid); rc = lop->lop_connect(ctxt, logid, gen, uuid);
RETURN(rc); return rc;
} }
/* llog.c */ /* llog.c */
......
...@@ -130,10 +130,10 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io, ...@@ -130,10 +130,10 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
cio->cui_glimpse = 0; cio->cui_glimpse = 0;
if (lock == NULL) if (lock == NULL)
RETURN(0); return 0;
if (IS_ERR(lock)) if (IS_ERR(lock))
RETURN(PTR_ERR(lock)); return PTR_ERR(lock);
LASSERT(agl == 0); LASSERT(agl == 0);
result = cl_wait(env, lock); result = cl_wait(env, lock);
...@@ -158,7 +158,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io, ...@@ -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, 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) ...@@ -223,7 +223,7 @@ int cl_glimpse_size0(struct inode *inode, int agl)
goto again; goto again;
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
} }
RETURN(result); return result;
} }
int cl_local_size(struct inode *inode) int cl_local_size(struct inode *inode)
...@@ -238,11 +238,11 @@ int cl_local_size(struct inode *inode) ...@@ -238,11 +238,11 @@ int cl_local_size(struct inode *inode)
int refcheck; int refcheck;
if (!cl_i2info(inode)->lli_has_smd) if (!cl_i2info(inode)->lli_has_smd)
RETURN(0); return 0;
result = cl_io_get(inode, &env, &io, &refcheck); result = cl_io_get(inode, &env, &io, &refcheck);
if (result <= 0) if (result <= 0)
RETURN(result); return result;
clob = io->ci_obj; clob = io->ci_obj;
result = cl_io_init(env, io, CIT_MISC, clob); result = cl_io_init(env, io, CIT_MISC, clob);
...@@ -265,5 +265,5 @@ int cl_local_size(struct inode *inode) ...@@ -265,5 +265,5 @@ int cl_local_size(struct inode *inode)
} }
cl_io_fini(env, io); cl_io_fini(env, io);
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
RETURN(result); return result;
} }
...@@ -181,7 +181,7 @@ int ccc_device_init(const struct lu_env *env, struct lu_device *d, ...@@ -181,7 +181,7 @@ int ccc_device_init(const struct lu_env *env, struct lu_device *d,
lu_device_get(next); lu_device_get(next);
lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init); 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, 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, ...@@ -203,7 +203,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
OBD_ALLOC_PTR(vdv); OBD_ALLOC_PTR(vdv);
if (vdv == NULL) if (vdv == NULL)
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
lud = &vdv->cdv_cl.cd_lu_dev; lud = &vdv->cdv_cl.cd_lu_dev;
cl_device_init(&vdv->cdv_cl, t); cl_device_init(&vdv->cdv_cl, t);
...@@ -226,7 +226,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env, ...@@ -226,7 +226,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
ccc_device_free(env, lud); ccc_device_free(env, lud);
lud = ERR_PTR(rc); lud = ERR_PTR(rc);
} }
RETURN(lud); return lud;
} }
struct lu_device *ccc_device_free(const struct lu_env *env, struct lu_device *ccc_device_free(const struct lu_env *env,
...@@ -426,7 +426,7 @@ int ccc_object_glimpse(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) if (lvb->lvb_size > 0 && lvb->lvb_blocks == 0)
lvb->lvb_blocks = dirty_cnt(inode); 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, ...@@ -490,7 +490,7 @@ int ccc_page_is_under_lock(const struct lu_env *env,
} }
} else } else
result = 0; result = 0;
RETURN(result); return result;
} }
int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice) 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, ...@@ -555,7 +555,7 @@ int ccc_transient_page_prep(const struct lu_env *env,
struct cl_io *unused) struct cl_io *unused)
{ {
/* transient page should always be sent. */ /* transient page should always be sent. */
RETURN(0); return 0;
} }
/***************************************************************************** /*****************************************************************************
...@@ -635,7 +635,7 @@ int ccc_lock_fits_into(const struct lu_env *env, ...@@ -635,7 +635,7 @@ int ccc_lock_fits_into(const struct lu_env *env,
result = lock->cll_state >= CLS_ENQUEUED; result = lock->cll_state >= CLS_ENQUEUED;
else else
result = 1; 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, ...@@ -715,7 +715,7 @@ int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
descr->cld_enq_flags = enqflags; descr->cld_enq_flags = enqflags;
cl_io_lock_add(env, io, &cio->cui_link); cl_io_lock_add(env, io, &cio->cui_link);
RETURN(0); return 0;
} }
void ccc_io_update_iov(const struct lu_env *env, 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, ...@@ -978,7 +978,7 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
env = cl_env_get(&refcheck); env = cl_env_get(&refcheck);
if (IS_ERR(env)) if (IS_ERR(env))
RETURN(PTR_ERR(env)); return PTR_ERR(env);
io = ccc_env_thread_io(env); io = ccc_env_thread_io(env);
io->ci_obj = cl_i2info(inode)->lli_clob; io->ci_obj = cl_i2info(inode)->lli_clob;
...@@ -1007,7 +1007,7 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr, ...@@ -1007,7 +1007,7 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
if (unlikely(io->ci_need_restart)) if (unlikely(io->ci_need_restart))
goto again; goto again;
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
RETURN(result); return result;
} }
/***************************************************************************** /*****************************************************************************
...@@ -1272,9 +1272,9 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent) ...@@ -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) __u64 cl_fid_build_ino(const struct lu_fid *fid, int api32)
{ {
if (BITS_PER_LONG == 32 || api32) if (BITS_PER_LONG == 32 || api32)
RETURN(fid_flatten32(fid)); return fid_flatten32(fid);
else else
RETURN(fid_flatten(fid)); return fid_flatten(fid);
} }
/** /**
...@@ -1286,11 +1286,11 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid) ...@@ -1286,11 +1286,11 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
if (fid_is_igif(fid)) { if (fid_is_igif(fid)) {
gen = lu_igif_gen(fid); gen = lu_igif_gen(fid);
RETURN(gen); return gen;
} }
gen = (fid_flatten(fid) >> 32); gen = (fid_flatten(fid) >> 32);
RETURN(gen); return gen;
} }
/* lsm is unreliable after hsm implementation as layout can be changed at /* lsm is unreliable after hsm implementation as layout can be changed at
......
...@@ -61,7 +61,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp) ...@@ -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, rc = obd_get_info(NULL, dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
&valsize, &desc, NULL); &valsize, &desc, NULL);
if (rc) if (rc)
RETURN(rc); return rc;
stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT); stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
lsm.lsm_stripe_count = stripes; lsm.lsm_stripe_count = stripes;
...@@ -76,7 +76,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp) ...@@ -76,7 +76,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
easize, cookiesize); easize, cookiesize);
rc = md_init_ea_size(md_exp, easize, def_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, ...@@ -114,7 +114,7 @@ int cl_ocd_update(struct obd_device *host,
watched->obd_name); watched->obd_name);
result = -EINVAL; result = -EINVAL;
} }
RETURN(result); return result;
} }
#define GROUPLOCK_SCOPE "grouplock" #define GROUPLOCK_SCOPE "grouplock"
......
...@@ -134,44 +134,44 @@ for (node = interval_last(root); node != NULL; \ ...@@ -134,44 +134,44 @@ for (node = interval_last(root); node != NULL; \
static struct interval_node *interval_first(struct interval_node *node) static struct interval_node *interval_first(struct interval_node *node)
{ {
if (!node) if (!node)
RETURN(NULL); return NULL;
while (node->in_left) while (node->in_left)
node = node->in_left; node = node->in_left;
RETURN(node); return node;
} }
static struct interval_node *interval_last(struct interval_node *node) static struct interval_node *interval_last(struct interval_node *node)
{ {
if (!node) if (!node)
RETURN(NULL); return NULL;
while (node->in_right) while (node->in_right)
node = node->in_right; node = node->in_right;
RETURN(node); return node;
} }
static struct interval_node *interval_next(struct interval_node *node) static struct interval_node *interval_next(struct interval_node *node)
{ {
if (!node) if (!node)
RETURN(NULL); return NULL;
if (node->in_right) 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)) while (node->in_parent && node_is_right_child(node))
node = node->in_parent; node = node->in_parent;
RETURN(node->in_parent); return node->in_parent;
} }
static struct interval_node *interval_prev(struct interval_node *node) static struct interval_node *interval_prev(struct interval_node *node)
{ {
if (!node) if (!node)
RETURN(NULL); return NULL;
if (node->in_left) 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)) while (node->in_parent && node_is_left_child(node))
node = node->in_parent; node = node->in_parent;
RETURN(node->in_parent); return node->in_parent;
} }
enum interval_iter interval_iterate(struct interval_node *root, enum interval_iter interval_iterate(struct interval_node *root,
...@@ -187,7 +187,7 @@ enum interval_iter interval_iterate(struct interval_node *root, ...@@ -187,7 +187,7 @@ enum interval_iter interval_iterate(struct interval_node *root,
break; break;
} }
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(interval_iterate); EXPORT_SYMBOL(interval_iterate);
...@@ -204,7 +204,7 @@ enum interval_iter interval_iterate_reverse(struct interval_node *root, ...@@ -204,7 +204,7 @@ enum interval_iter interval_iterate_reverse(struct interval_node *root,
break; break;
} }
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(interval_iterate_reverse); EXPORT_SYMBOL(interval_iterate_reverse);
...@@ -226,7 +226,7 @@ struct interval_node *interval_find(struct interval_node *root, ...@@ -226,7 +226,7 @@ struct interval_node *interval_find(struct interval_node *root,
walk = walk->in_right; walk = walk->in_right;
} }
RETURN(walk); return walk;
} }
EXPORT_SYMBOL(interval_find); EXPORT_SYMBOL(interval_find);
...@@ -374,7 +374,7 @@ struct interval_node *interval_insert(struct interval_node *node, ...@@ -374,7 +374,7 @@ struct interval_node *interval_insert(struct interval_node *node,
while (*p) { while (*p) {
parent = *p; parent = *p;
if (node_equal(parent, node)) if (node_equal(parent, node))
RETURN(parent); return parent;
/* max_high field must be updated after each iteration */ /* max_high field must be updated after each iteration */
if (parent->in_max_high < interval_high(node)) if (parent->in_max_high < interval_high(node))
...@@ -395,7 +395,7 @@ struct interval_node *interval_insert(struct interval_node *node, ...@@ -395,7 +395,7 @@ struct interval_node *interval_insert(struct interval_node *node,
interval_insert_color(node, root); interval_insert_color(node, root);
node->in_intree = 1; node->in_intree = 1;
RETURN(NULL); return NULL;
} }
EXPORT_SYMBOL(interval_insert); EXPORT_SYMBOL(interval_insert);
......
...@@ -85,7 +85,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms) ...@@ -85,7 +85,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
continue; continue;
if (lck->l_policy_data.l_extent.end >= old_kms) 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) /* This extent _has_ to be smaller than old_kms (checked above)
* so kms can only ever be smaller or the same as old_kms. */ * 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) ...@@ -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); LASSERTF(kms <= old_kms, "kms "LPU64" old_kms "LPU64"\n", kms, old_kms);
RETURN(kms); return kms;
} }
EXPORT_SYMBOL(ldlm_extent_shift_kms); EXPORT_SYMBOL(ldlm_extent_shift_kms);
...@@ -106,11 +106,11 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock) ...@@ -106,11 +106,11 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock)
LASSERT(lock->l_resource->lr_type == LDLM_EXTENT); LASSERT(lock->l_resource->lr_type == LDLM_EXTENT);
OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO); OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO);
if (node == NULL) if (node == NULL)
RETURN(NULL); return NULL;
INIT_LIST_HEAD(&node->li_group); INIT_LIST_HEAD(&node->li_group);
ldlm_interval_attach(node, lock); ldlm_interval_attach(node, lock);
RETURN(node); return node;
} }
void ldlm_interval_free(struct ldlm_interval *node) void ldlm_interval_free(struct ldlm_interval *node)
......
...@@ -305,12 +305,12 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -305,12 +305,12 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
continue; continue;
if (!first_enq) if (!first_enq)
RETURN(LDLM_ITER_CONTINUE); return LDLM_ITER_CONTINUE;
if (*flags & LDLM_FL_BLOCK_NOWAIT) { if (*flags & LDLM_FL_BLOCK_NOWAIT) {
ldlm_flock_destroy(req, mode, *flags); ldlm_flock_destroy(req, mode, *flags);
*err = -EAGAIN; *err = -EAGAIN;
RETURN(LDLM_ITER_STOP); return LDLM_ITER_STOP;
} }
if (*flags & LDLM_FL_TEST_LOCK) { if (*flags & LDLM_FL_TEST_LOCK) {
...@@ -323,7 +323,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -323,7 +323,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
req->l_policy_data.l_flock.end = req->l_policy_data.l_flock.end =
lock->l_policy_data.l_flock.end; lock->l_policy_data.l_flock.end;
*flags |= LDLM_FL_LOCK_CHANGED; *flags |= LDLM_FL_LOCK_CHANGED;
RETURN(LDLM_ITER_STOP); return LDLM_ITER_STOP;
} }
/* add lock to blocking list before deadlock /* add lock to blocking list before deadlock
...@@ -332,18 +332,18 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -332,18 +332,18 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
if (rc) { if (rc) {
ldlm_flock_destroy(req, mode, *flags); ldlm_flock_destroy(req, mode, *flags);
*err = rc; *err = rc;
RETURN(LDLM_ITER_STOP); return LDLM_ITER_STOP;
} }
if (ldlm_flock_deadlock(req, lock)) { if (ldlm_flock_deadlock(req, lock)) {
ldlm_flock_blocking_unlink(req); ldlm_flock_blocking_unlink(req);
ldlm_flock_destroy(req, mode, *flags); ldlm_flock_destroy(req, mode, *flags);
*err = -EDEADLK; *err = -EDEADLK;
RETURN(LDLM_ITER_STOP); return LDLM_ITER_STOP;
} }
ldlm_resource_add_lock(res, &res->lr_waiting, req); ldlm_resource_add_lock(res, &res->lr_waiting, req);
*flags |= LDLM_FL_BLOCK_GRANTED; *flags |= LDLM_FL_BLOCK_GRANTED;
RETURN(LDLM_ITER_STOP); return LDLM_ITER_STOP;
} }
} }
...@@ -351,7 +351,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -351,7 +351,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
ldlm_flock_destroy(req, mode, *flags); ldlm_flock_destroy(req, mode, *flags);
req->l_req_mode = LCK_NL; req->l_req_mode = LCK_NL;
*flags |= LDLM_FL_LOCK_CHANGED; *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 /* In case we had slept on this lock request take it off of the
...@@ -463,7 +463,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -463,7 +463,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
ldlm_flock_destroy(req, lock->l_granted_mode, ldlm_flock_destroy(req, lock->l_granted_mode,
*flags); *flags);
*err = -ENOLCK; *err = -ENOLCK;
RETURN(LDLM_ITER_STOP); return LDLM_ITER_STOP;
} }
goto reprocess; goto reprocess;
} }
...@@ -530,7 +530,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq, ...@@ -530,7 +530,7 @@ ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags, int first_enq,
ldlm_flock_destroy(req, mode, *flags); ldlm_flock_destroy(req, mode, *flags);
ldlm_resource_dump(D_INFO, res); ldlm_resource_dump(D_INFO, res);
RETURN(LDLM_ITER_CONTINUE); return LDLM_ITER_CONTINUE;
} }
struct ldlm_flock_wait_data { struct ldlm_flock_wait_data {
...@@ -591,7 +591,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *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 */ /* Need to wake up the waiter if we were evicted */
wake_up(&lock->l_waitq); wake_up(&lock->l_waitq);
RETURN(0); return 0;
} }
LASSERT(flags != LDLM_FL_WAIT_NOREPROC); LASSERT(flags != LDLM_FL_WAIT_NOREPROC);
...@@ -603,7 +603,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -603,7 +603,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
goto granted; goto granted;
/* CP AST RPC: lock get granted, wake it up */ /* CP AST RPC: lock get granted, wake it up */
wake_up(&lock->l_waitq); wake_up(&lock->l_waitq);
RETURN(0); return 0;
} }
LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, " 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) ...@@ -629,7 +629,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
if (rc) { if (rc) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)", LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
rc); rc);
RETURN(rc); return rc;
} }
granted: granted:
...@@ -637,18 +637,18 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -637,18 +637,18 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
if (lock->l_flags & LDLM_FL_DESTROYED) { if (lock->l_flags & LDLM_FL_DESTROYED) {
LDLM_DEBUG(lock, "client-side enqueue waking up: destroyed"); LDLM_DEBUG(lock, "client-side enqueue waking up: destroyed");
RETURN(0); return 0;
} }
if (lock->l_flags & LDLM_FL_FAILED) { if (lock->l_flags & LDLM_FL_FAILED) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed"); LDLM_DEBUG(lock, "client-side enqueue waking up: failed");
RETURN(-EIO); return -EIO;
} }
if (rc) { if (rc) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)", LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
rc); rc);
RETURN(rc); return rc;
} }
LDLM_DEBUG(lock, "client-side enqueue granted"); LDLM_DEBUG(lock, "client-side enqueue granted");
...@@ -690,7 +690,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -690,7 +690,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
ldlm_process_flock_lock(lock, &noreproc, 1, &err, NULL); ldlm_process_flock_lock(lock, &noreproc, 1, &err, NULL);
} }
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_flock_completion_ast); EXPORT_SYMBOL(ldlm_flock_completion_ast);
...@@ -704,7 +704,7 @@ int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, ...@@ -704,7 +704,7 @@ int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
lock_res_and_lock(lock); lock_res_and_lock(lock);
ldlm_flock_blocking_unlink(lock); ldlm_flock_blocking_unlink(lock);
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
RETURN(0); return 0;
} }
void ldlm_flock_policy_wire18_to_local(const ldlm_wire_policy_data_t *wpolicy, 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) ...@@ -825,9 +825,9 @@ int ldlm_init_flock_export(struct obd_export *exp)
&ldlm_export_flock_ops, &ldlm_export_flock_ops,
CFS_HASH_DEFAULT | CFS_HASH_NBLK_CHANGE); CFS_HASH_DEFAULT | CFS_HASH_NBLK_CHANGE);
if (!exp->exp_flock_hash) if (!exp->exp_flock_hash)
RETURN(-ENOMEM); return -ENOMEM;
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_init_flock_export); EXPORT_SYMBOL(ldlm_init_flock_export);
......
...@@ -63,13 +63,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid, ...@@ -63,13 +63,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
if (!create && !priority) { if (!create && !priority) {
CDEBUG(D_HA, "Nothing to do\n"); CDEBUG(D_HA, "Nothing to do\n");
RETURN(-EINVAL); return -EINVAL;
} }
ptlrpc_conn = ptlrpc_uuid_to_connection(uuid); ptlrpc_conn = ptlrpc_uuid_to_connection(uuid);
if (!ptlrpc_conn) { if (!ptlrpc_conn) {
CDEBUG(D_HA, "can't find connection %s\n", uuid->uuid); CDEBUG(D_HA, "can't find connection %s\n", uuid->uuid);
RETURN (-ENOENT); return -ENOENT;
} }
if (create) { if (create) {
...@@ -114,13 +114,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid, ...@@ -114,13 +114,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
} }
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
RETURN(0); return 0;
out_free: out_free:
if (imp_conn) if (imp_conn)
OBD_FREE(imp_conn, sizeof(*imp_conn)); OBD_FREE(imp_conn, sizeof(*imp_conn));
out_put: out_put:
ptlrpc_connection_put(ptlrpc_conn); ptlrpc_connection_put(ptlrpc_conn);
RETURN(rc); return rc;
} }
int import_set_conn_priority(struct obd_import *imp, struct obd_uuid *uuid) int import_set_conn_priority(struct obd_import *imp, struct obd_uuid *uuid)
...@@ -185,7 +185,7 @@ int client_import_del_conn(struct obd_import *imp, struct obd_uuid *uuid) ...@@ -185,7 +185,7 @@ int client_import_del_conn(struct obd_import *imp, struct obd_uuid *uuid)
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
if (rc == -ENOENT) if (rc == -ENOENT)
CERROR("connection %s not found\n", uuid->uuid); CERROR("connection %s not found\n", uuid->uuid);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(client_import_del_conn); EXPORT_SYMBOL(client_import_del_conn);
...@@ -209,7 +209,7 @@ int client_import_find_conn(struct obd_import *imp, lnet_nid_t peer, ...@@ -209,7 +209,7 @@ int client_import_find_conn(struct obd_import *imp, lnet_nid_t peer,
} }
} }
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(client_import_find_conn); EXPORT_SYMBOL(client_import_find_conn);
...@@ -301,27 +301,27 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) ...@@ -301,27 +301,27 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
} else { } else {
CERROR("unknown client OBD type \"%s\", can't setup\n", CERROR("unknown client OBD type \"%s\", can't setup\n",
name); name);
RETURN(-EINVAL); return -EINVAL;
} }
if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) { if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
CERROR("requires a TARGET UUID\n"); CERROR("requires a TARGET UUID\n");
RETURN(-EINVAL); return -EINVAL;
} }
if (LUSTRE_CFG_BUFLEN(lcfg, 1) > 37) { if (LUSTRE_CFG_BUFLEN(lcfg, 1) > 37) {
CERROR("client UUID must be less than 38 characters\n"); CERROR("client UUID must be less than 38 characters\n");
RETURN(-EINVAL); return -EINVAL;
} }
if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1) { if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1) {
CERROR("setup requires a SERVER UUID\n"); CERROR("setup requires a SERVER UUID\n");
RETURN(-EINVAL); return -EINVAL;
} }
if (LUSTRE_CFG_BUFLEN(lcfg, 2) > 37) { if (LUSTRE_CFG_BUFLEN(lcfg, 2) > 37) {
CERROR("target UUID must be less than 38 characters\n"); CERROR("target UUID must be less than 38 characters\n");
RETURN(-EINVAL); return -EINVAL;
} }
init_rwsem(&cli->cl_sem); init_rwsem(&cli->cl_sem);
...@@ -448,14 +448,14 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) ...@@ -448,14 +448,14 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
cli->cl_qchk_stat = CL_NOT_QUOTACHECKED; cli->cl_qchk_stat = CL_NOT_QUOTACHECKED;
RETURN(rc); return rc;
err_import: err_import:
class_destroy_import(imp); class_destroy_import(imp);
err_ldlm: err_ldlm:
ldlm_put_ref(); ldlm_put_ref();
err: err:
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(client_obd_setup); EXPORT_SYMBOL(client_obd_setup);
...@@ -468,7 +468,7 @@ int client_obd_cleanup(struct obd_device *obddev) ...@@ -468,7 +468,7 @@ int client_obd_cleanup(struct obd_device *obddev)
LASSERT(obddev->u.cli.cl_import == NULL); LASSERT(obddev->u.cli.cl_import == NULL);
ldlm_put_ref(); ldlm_put_ref();
RETURN(0); return 0;
} }
EXPORT_SYMBOL(client_obd_cleanup); EXPORT_SYMBOL(client_obd_cleanup);
...@@ -548,7 +548,7 @@ int client_disconnect_export(struct obd_export *exp) ...@@ -548,7 +548,7 @@ int client_disconnect_export(struct obd_export *exp)
if (!obd) { if (!obd) {
CERROR("invalid export for disconnect: exp %p cookie "LPX64"\n", CERROR("invalid export for disconnect: exp %p cookie "LPX64"\n",
exp, exp ? exp->exp_handle.h_cookie : -1); exp, exp ? exp->exp_handle.h_cookie : -1);
RETURN(-EINVAL); return -EINVAL;
} }
cli = &obd->u.cli; cli = &obd->u.cli;
...@@ -604,7 +604,7 @@ int client_disconnect_export(struct obd_export *exp) ...@@ -604,7 +604,7 @@ int client_disconnect_export(struct obd_export *exp)
up_write(&cli->cl_sem); up_write(&cli->cl_sem);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(client_disconnect_export); EXPORT_SYMBOL(client_disconnect_export);
...@@ -622,7 +622,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req) ...@@ -622,7 +622,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
!exp_connect_lru_resize(req->rq_export))) { !exp_connect_lru_resize(req->rq_export))) {
lustre_msg_set_slv(req->rq_repmsg, 0); lustre_msg_set_slv(req->rq_repmsg, 0);
lustre_msg_set_limit(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. */ /* 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) ...@@ -633,7 +633,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
lustre_msg_set_limit(req->rq_repmsg, obd->obd_pool_limit); lustre_msg_set_limit(req->rq_repmsg, obd->obd_pool_limit);
read_unlock(&obd->obd_pool_lock); read_unlock(&obd->obd_pool_lock);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(target_pack_pool_reply); EXPORT_SYMBOL(target_pack_pool_reply);
......
...@@ -251,7 +251,7 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock) ...@@ -251,7 +251,7 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock)
if (lock->l_flags & LDLM_FL_NS_SRV) { if (lock->l_flags & LDLM_FL_NS_SRV) {
LASSERT(list_empty(&lock->l_lru)); LASSERT(list_empty(&lock->l_lru));
RETURN(0); return 0;
} }
spin_lock(&ns->ns_lock); spin_lock(&ns->ns_lock);
...@@ -439,7 +439,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource) ...@@ -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); OBD_SLAB_ALLOC_PTR_GFP(lock, ldlm_lock_slab, __GFP_IO);
if (lock == NULL) if (lock == NULL)
RETURN(NULL); return NULL;
spin_lock_init(&lock->l_lock); spin_lock_init(&lock->l_lock);
lock->l_resource = resource; lock->l_resource = resource;
...@@ -475,7 +475,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource) ...@@ -475,7 +475,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
#endif #endif
INIT_LIST_HEAD(&lock->l_exp_list); 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, ...@@ -497,7 +497,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
sizeof(lock->l_resource->lr_name)) == 0) { sizeof(lock->l_resource->lr_name)) == 0) {
/* Nothing to do */ /* Nothing to do */
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
RETURN(0); return 0;
} }
LASSERT(new_resid->name[0] != 0); LASSERT(new_resid->name[0] != 0);
...@@ -510,7 +510,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock, ...@@ -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); newres = ldlm_resource_get(ns, NULL, new_resid, type, 1);
if (newres == NULL) if (newres == NULL)
RETURN(-ENOMEM); return -ENOMEM;
lu_ref_add(&newres->lr_reference, "lock", lock); 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, ...@@ -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); lu_ref_del(&oldres->lr_reference, "lock", lock);
ldlm_resource_putref(oldres); ldlm_resource_putref(oldres);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_lock_change_resource); EXPORT_SYMBOL(ldlm_lock_change_resource);
...@@ -572,13 +572,13 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle, ...@@ -572,13 +572,13 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
lock = class_handle2object(handle->cookie); lock = class_handle2object(handle->cookie);
if (lock == NULL) if (lock == NULL)
RETURN(NULL); return NULL;
/* It's unlikely but possible that someone marked the lock as /* It's unlikely but possible that someone marked the lock as
* destroyed after we did handle2object on it */ * destroyed after we did handle2object on it */
if (flags == 0 && ((lock->l_flags & LDLM_FL_DESTROYED)== 0)) { if (flags == 0 && ((lock->l_flags & LDLM_FL_DESTROYED)== 0)) {
lu_ref_add(&lock->l_reference, "handle", current); lu_ref_add(&lock->l_reference, "handle", current);
RETURN(lock); return lock;
} }
lock_res_and_lock(lock); lock_res_and_lock(lock);
...@@ -590,20 +590,20 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle, ...@@ -590,20 +590,20 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
CDEBUG(D_INFO, "lock already destroyed: lock %p\n", lock); CDEBUG(D_INFO, "lock already destroyed: lock %p\n", lock);
LDLM_LOCK_PUT(lock); LDLM_LOCK_PUT(lock);
RETURN(NULL); return NULL;
} }
if (flags && (lock->l_flags & flags)) { if (flags && (lock->l_flags & flags)) {
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
LDLM_LOCK_PUT(lock); LDLM_LOCK_PUT(lock);
RETURN(NULL); return NULL;
} }
if (flags) if (flags)
lock->l_flags |= flags; lock->l_flags |= flags;
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
RETURN(lock); return lock;
} }
EXPORT_SYMBOL(__ldlm_handle2lock); EXPORT_SYMBOL(__ldlm_handle2lock);
/** @} ldlm_handles */ /** @} ldlm_handles */
...@@ -1280,7 +1280,7 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags, ...@@ -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); res = ldlm_resource_get(ns, NULL, res_id, type, 0);
if (res == NULL) { if (res == NULL) {
LASSERT(old_lock == NULL); LASSERT(old_lock == NULL);
RETURN(0); return 0;
} }
LDLM_RESOURCE_ADDREF(res); LDLM_RESOURCE_ADDREF(res);
...@@ -1433,7 +1433,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, ...@@ -1433,7 +1433,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lustre_swab_ost_lvb); lustre_swab_ost_lvb);
if (unlikely(lvb == NULL)) { if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB"); LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO); return -EPROTO;
} }
memcpy(data, lvb, size); memcpy(data, lvb, size);
...@@ -1450,7 +1450,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, ...@@ -1450,7 +1450,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lustre_swab_ost_lvb_v1); lustre_swab_ost_lvb_v1);
if (unlikely(lvb == NULL)) { if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB"); LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO); return -EPROTO;
} }
memcpy(data, lvb, size); memcpy(data, lvb, size);
...@@ -1460,7 +1460,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, ...@@ -1460,7 +1460,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
} else { } else {
LDLM_ERROR(lock, "Replied unexpected ost LVB size %d", LDLM_ERROR(lock, "Replied unexpected ost LVB size %d",
size); size);
RETURN(-EINVAL); return -EINVAL;
} }
break; break;
case LVB_T_LQUOTA: case LVB_T_LQUOTA:
...@@ -1475,14 +1475,14 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, ...@@ -1475,14 +1475,14 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lustre_swab_lquota_lvb); lustre_swab_lquota_lvb);
if (unlikely(lvb == NULL)) { if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB"); LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO); return -EPROTO;
} }
memcpy(data, lvb, size); memcpy(data, lvb, size);
} else { } else {
LDLM_ERROR(lock, "Replied unexpected lquota LVB size %d", LDLM_ERROR(lock, "Replied unexpected lquota LVB size %d",
size); size);
RETURN(-EINVAL); return -EINVAL;
} }
break; break;
case LVB_T_LAYOUT: case LVB_T_LAYOUT:
...@@ -1495,7 +1495,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, ...@@ -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); lvb = req_capsule_server_get(pill, &RMF_DLM_LVB);
if (unlikely(lvb == NULL)) { if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB"); LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO); return -EPROTO;
} }
memcpy(data, lvb, size); memcpy(data, lvb, size);
...@@ -1503,10 +1503,10 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, ...@@ -1503,10 +1503,10 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
default: default:
LDLM_ERROR(lock, "Unknown LVB type: %d\n", lock->l_lvb_type); LDLM_ERROR(lock, "Unknown LVB type: %d\n", lock->l_lvb_type);
dump_stack(); dump_stack();
RETURN(-EINVAL); return -EINVAL;
} }
RETURN(0); return 0;
} }
/** /**
...@@ -1526,12 +1526,12 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns, ...@@ -1526,12 +1526,12 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
res = ldlm_resource_get(ns, NULL, res_id, type, 1); res = ldlm_resource_get(ns, NULL, res_id, type, 1);
if (res == NULL) if (res == NULL)
RETURN(NULL); return NULL;
lock = ldlm_lock_new(res); lock = ldlm_lock_new(res);
if (lock == NULL) if (lock == NULL)
RETURN(NULL); return NULL;
lock->l_req_mode = mode; lock->l_req_mode = mode;
lock->l_ast_data = data; lock->l_ast_data = data;
...@@ -1562,7 +1562,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns, ...@@ -1562,7 +1562,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_NEW_LOCK)) if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_NEW_LOCK))
GOTO(out, 0); GOTO(out, 0);
RETURN(lock); return lock;
out: out:
ldlm_lock_destroy(lock); ldlm_lock_destroy(lock);
...@@ -1606,11 +1606,11 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns, ...@@ -1606,11 +1606,11 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
LDLM_LOCK_RELEASE(lock); LDLM_LOCK_RELEASE(lock);
} }
*flags |= LDLM_FL_LOCK_CHANGED; *flags |= LDLM_FL_LOCK_CHANGED;
RETURN(0); return 0;
} else if (rc != ELDLM_OK || } else if (rc != ELDLM_OK ||
(rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) { (rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) {
ldlm_lock_destroy(lock); ldlm_lock_destroy(lock);
RETURN(rc); return rc;
} }
} }
...@@ -1692,7 +1692,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq) ...@@ -1692,7 +1692,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
struct ldlm_lock *lock; struct ldlm_lock *lock;
if (list_empty(arg->list)) if (list_empty(arg->list))
RETURN(-ENOENT); return -ENOENT;
lock = list_entry(arg->list->next, struct ldlm_lock, l_bl_ast); 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) ...@@ -1713,7 +1713,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
lock->l_blocking_lock = NULL; lock->l_blocking_lock = NULL;
LDLM_LOCK_RELEASE(lock); LDLM_LOCK_RELEASE(lock);
RETURN(rc); return rc;
} }
/** /**
...@@ -1728,7 +1728,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq) ...@@ -1728,7 +1728,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
ldlm_completion_callback completion_callback; ldlm_completion_callback completion_callback;
if (list_empty(arg->list)) if (list_empty(arg->list))
RETURN(-ENOENT); return -ENOENT;
lock = list_entry(arg->list->next, struct ldlm_lock, l_cp_ast); 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) ...@@ -1757,7 +1757,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
rc = completion_callback(lock, 0, (void *)arg); rc = completion_callback(lock, 0, (void *)arg);
LDLM_LOCK_RELEASE(lock); LDLM_LOCK_RELEASE(lock);
RETURN(rc); return rc;
} }
/** /**
...@@ -1772,7 +1772,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq) ...@@ -1772,7 +1772,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
struct ldlm_lock *lock; struct ldlm_lock *lock;
if (list_empty(arg->list)) if (list_empty(arg->list))
RETURN(-ENOENT); return -ENOENT;
lock = list_entry(arg->list->next, struct ldlm_lock, l_rk_ast); lock = list_entry(arg->list->next, struct ldlm_lock, l_rk_ast);
list_del_init(&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) ...@@ -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); rc = lock->l_blocking_ast(lock, &desc, (void*)arg, LDLM_CB_BLOCKING);
LDLM_LOCK_RELEASE(lock); 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) ...@@ -1799,7 +1799,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
int rc = 0; int rc = 0;
if (list_empty(arg->list)) if (list_empty(arg->list))
RETURN(-ENOENT); return -ENOENT;
gl_work = list_entry(arg->list->next, struct ldlm_glimpse_work, gl_work = list_entry(arg->list->next, struct ldlm_glimpse_work,
gl_list); gl_list);
...@@ -1819,7 +1819,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq) ...@@ -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) if ((gl_work->gl_flags & LDLM_GL_WORK_NOFREE) == 0)
OBD_FREE_PTR(gl_work); 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, ...@@ -1836,11 +1836,11 @@ int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,
int rc; int rc;
if (list_empty(rpc_list)) if (list_empty(rpc_list))
RETURN(0); return 0;
OBD_ALLOC_PTR(arg); OBD_ALLOC_PTR(arg);
if (arg == NULL) if (arg == NULL)
RETURN(-ENOMEM); return -ENOMEM;
atomic_set(&arg->restart, 0); atomic_set(&arg->restart, 0);
arg->list = rpc_list; arg->list = rpc_list;
...@@ -2027,7 +2027,7 @@ int ldlm_lock_set_data(struct lustre_handle *lockh, void *data) ...@@ -2027,7 +2027,7 @@ int ldlm_lock_set_data(struct lustre_handle *lockh, void *data)
rc = 0; rc = 0;
LDLM_LOCK_PUT(lock); LDLM_LOCK_PUT(lock);
} }
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_lock_set_data); EXPORT_SYMBOL(ldlm_lock_set_data);
...@@ -2136,7 +2136,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, ...@@ -2136,7 +2136,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
/* Just return if mode is unchanged. */ /* Just return if mode is unchanged. */
if (new_mode == lock->l_granted_mode) { if (new_mode == lock->l_granted_mode) {
*flags |= LDLM_FL_BLOCK_GRANTED; *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 /* 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, ...@@ -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); OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO);
if (node == NULL) if (node == NULL)
/* Actually, this causes EDEADLOCK to be returned */ /* Actually, this causes EDEADLOCK to be returned */
RETURN(NULL); return NULL;
LASSERTF((new_mode == LCK_PW && lock->l_granted_mode == LCK_PR), LASSERTF((new_mode == LCK_PW && lock->l_granted_mode == LCK_PR),
"new_mode %u, granted %u\n", new_mode, lock->l_granted_mode); "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, ...@@ -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); ldlm_run_ast_work(ns, &rpc_list, LDLM_WORK_CP_AST);
if (node) if (node)
OBD_SLAB_FREE(node, ldlm_interval_slab, sizeof(*node)); OBD_SLAB_FREE(node, ldlm_interval_slab, sizeof(*node));
RETURN(res); return res;
} }
EXPORT_SYMBOL(ldlm_lock_convert); EXPORT_SYMBOL(ldlm_lock_convert);
......
...@@ -127,12 +127,12 @@ struct ldlm_bl_work_item { ...@@ -127,12 +127,12 @@ struct ldlm_bl_work_item {
int ldlm_del_waiting_lock(struct ldlm_lock *lock) int ldlm_del_waiting_lock(struct ldlm_lock *lock)
{ {
RETURN(0); return 0;
} }
int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout) 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, ...@@ -395,7 +395,7 @@ static int __ldlm_bl_to_thread(struct ldlm_bl_work_item *blwi,
if (!(cancel_flags & LCF_ASYNC)) if (!(cancel_flags & LCF_ASYNC))
wait_for_completion(&blwi->blwi_comp); wait_for_completion(&blwi->blwi_comp);
RETURN(0); return 0;
} }
static inline void init_blwi(struct ldlm_bl_work_item *blwi, 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, ...@@ -440,17 +440,17 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
ldlm_cancel_flags_t cancel_flags) ldlm_cancel_flags_t cancel_flags)
{ {
if (cancels && count == 0) if (cancels && count == 0)
RETURN(0); return 0;
if (cancel_flags & LCF_ASYNC) { if (cancel_flags & LCF_ASYNC) {
struct ldlm_bl_work_item *blwi; struct ldlm_bl_work_item *blwi;
OBD_ALLOC(blwi, sizeof(*blwi)); OBD_ALLOC(blwi, sizeof(*blwi));
if (blwi == NULL) if (blwi == NULL)
RETURN(-ENOMEM); return -ENOMEM;
init_blwi(blwi, ns, ld, cancels, count, lock, cancel_flags); 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 { } else {
/* if it is synchronous call do minimum mem alloc, as it could /* if it is synchronous call do minimum mem alloc, as it could
* be triggered from kernel shrinker * be triggered from kernel shrinker
...@@ -459,7 +459,7 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns, ...@@ -459,7 +459,7 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
memset(&blwi, 0, sizeof(blwi)); memset(&blwi, 0, sizeof(blwi));
init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags); 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) ...@@ -493,14 +493,14 @@ static int ldlm_handle_setinfo(struct ptlrpc_request *req)
key = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY); key = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
if (key == NULL) { if (key == NULL) {
DEBUG_REQ(D_IOCTL, req, "no set_info key"); DEBUG_REQ(D_IOCTL, req, "no set_info key");
RETURN(-EFAULT); return -EFAULT;
} }
keylen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_KEY, keylen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_KEY,
RCL_CLIENT); RCL_CLIENT);
val = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL); val = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL);
if (val == NULL) { if (val == NULL) {
DEBUG_REQ(D_IOCTL, req, "no set_info val"); DEBUG_REQ(D_IOCTL, req, "no set_info val");
RETURN(-EFAULT); return -EFAULT;
} }
vallen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_VAL, vallen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_VAL,
RCL_CLIENT); RCL_CLIENT);
...@@ -542,7 +542,7 @@ static int ldlm_handle_qc_callback(struct ptlrpc_request *req) ...@@ -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); oqctl = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
if (oqctl == NULL) { if (oqctl == NULL) {
CERROR("Can't unpack obd_quotactl\n"); CERROR("Can't unpack obd_quotactl\n");
RETURN(-EPROTO); return -EPROTO;
} }
oqctl->qc_stat = ptlrpc_status_ntoh(oqctl->qc_stat); oqctl->qc_stat = ptlrpc_status_ntoh(oqctl->qc_stat);
...@@ -566,7 +566,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) ...@@ -566,7 +566,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
/* do nothing for sec context finalize */ /* do nothing for sec context finalize */
if (lustre_msg_get_opc(req->rq_reqmsg) == SEC_CTX_FINI) if (lustre_msg_get_opc(req->rq_reqmsg) == SEC_CTX_FINI)
RETURN(0); return 0;
req_capsule_init(&req->rq_pill, req, RCL_SERVER); req_capsule_init(&req->rq_pill, req, RCL_SERVER);
...@@ -574,7 +574,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) ...@@ -574,7 +574,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -ENOTCONN); rc = ldlm_callback_reply(req, -ENOTCONN);
ldlm_callback_errmsg(req, "Operate on unconnected server", ldlm_callback_errmsg(req, "Operate on unconnected server",
rc, NULL); rc, NULL);
RETURN(0); return 0;
} }
LASSERT(req->rq_export != NULL); LASSERT(req->rq_export != NULL);
...@@ -583,71 +583,71 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) ...@@ -583,71 +583,71 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
switch (lustre_msg_get_opc(req->rq_reqmsg)) { switch (lustre_msg_get_opc(req->rq_reqmsg)) {
case LDLM_BL_CALLBACK: case LDLM_BL_CALLBACK:
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_BL_CALLBACK_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_BL_CALLBACK_NET))
RETURN(0); return 0;
break; break;
case LDLM_CP_CALLBACK: case LDLM_CP_CALLBACK:
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CP_CALLBACK_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CP_CALLBACK_NET))
RETURN(0); return 0;
break; break;
case LDLM_GL_CALLBACK: case LDLM_GL_CALLBACK:
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_GL_CALLBACK_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_GL_CALLBACK_NET))
RETURN(0); return 0;
break; break;
case LDLM_SET_INFO: case LDLM_SET_INFO:
rc = ldlm_handle_setinfo(req); rc = ldlm_handle_setinfo(req);
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
case OBD_LOG_CANCEL: /* remove this eventually - for 1.4.0 compat */ case OBD_LOG_CANCEL: /* remove this eventually - for 1.4.0 compat */
CERROR("shouldn't be handling OBD_LOG_CANCEL on DLM thread\n"); CERROR("shouldn't be handling OBD_LOG_CANCEL on DLM thread\n");
req_capsule_set(&req->rq_pill, &RQF_LOG_CANCEL); req_capsule_set(&req->rq_pill, &RQF_LOG_CANCEL);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_NET))
RETURN(0); return 0;
rc = llog_origin_handle_cancel(req); rc = llog_origin_handle_cancel(req);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_REP)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_REP))
RETURN(0); return 0;
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
case LLOG_ORIGIN_HANDLE_CREATE: case LLOG_ORIGIN_HANDLE_CREATE:
req_capsule_set(&req->rq_pill, &RQF_LLOG_ORIGIN_HANDLE_CREATE); req_capsule_set(&req->rq_pill, &RQF_LLOG_ORIGIN_HANDLE_CREATE);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0); return 0;
rc = llog_origin_handle_open(req); rc = llog_origin_handle_open(req);
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
case LLOG_ORIGIN_HANDLE_NEXT_BLOCK: case LLOG_ORIGIN_HANDLE_NEXT_BLOCK:
req_capsule_set(&req->rq_pill, req_capsule_set(&req->rq_pill,
&RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK); &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0); return 0;
rc = llog_origin_handle_next_block(req); rc = llog_origin_handle_next_block(req);
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
case LLOG_ORIGIN_HANDLE_READ_HEADER: case LLOG_ORIGIN_HANDLE_READ_HEADER:
req_capsule_set(&req->rq_pill, req_capsule_set(&req->rq_pill,
&RQF_LLOG_ORIGIN_HANDLE_READ_HEADER); &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0); return 0;
rc = llog_origin_handle_read_header(req); rc = llog_origin_handle_read_header(req);
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
case LLOG_ORIGIN_HANDLE_CLOSE: case LLOG_ORIGIN_HANDLE_CLOSE:
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0); return 0;
rc = llog_origin_handle_close(req); rc = llog_origin_handle_close(req);
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
case OBD_QC_CALLBACK: case OBD_QC_CALLBACK:
req_capsule_set(&req->rq_pill, &RQF_QC_CALLBACK); req_capsule_set(&req->rq_pill, &RQF_QC_CALLBACK);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_QC_CALLBACK_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_OBD_QC_CALLBACK_NET))
RETURN(0); return 0;
rc = ldlm_handle_qc_callback(req); rc = ldlm_handle_qc_callback(req);
ldlm_callback_reply(req, rc); ldlm_callback_reply(req, rc);
RETURN(0); return 0;
default: default:
CERROR("unknown opcode %u\n", CERROR("unknown opcode %u\n",
lustre_msg_get_opc(req->rq_reqmsg)); lustre_msg_get_opc(req->rq_reqmsg));
ldlm_callback_reply(req, -EPROTO); ldlm_callback_reply(req, -EPROTO);
RETURN(0); return 0;
} }
ns = req->rq_export->exp_obd->obd_namespace; ns = req->rq_export->exp_obd->obd_namespace;
...@@ -660,7 +660,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) ...@@ -660,7 +660,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -EPROTO); rc = ldlm_callback_reply(req, -EPROTO);
ldlm_callback_errmsg(req, "Operate without parameter", rc, ldlm_callback_errmsg(req, "Operate without parameter", rc,
NULL); NULL);
RETURN(0); return 0;
} }
/* Force a known safe race, send a cancel to the server for a lock /* 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) ...@@ -679,7 +679,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -EINVAL); rc = ldlm_callback_reply(req, -EINVAL);
ldlm_callback_errmsg(req, "Operate with invalid parameter", rc, ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
&dlm_req->lock_handle[0]); &dlm_req->lock_handle[0]);
RETURN(0); return 0;
} }
if ((lock->l_flags & LDLM_FL_FAIL_LOC) && if ((lock->l_flags & LDLM_FL_FAIL_LOC) &&
...@@ -706,7 +706,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) ...@@ -706,7 +706,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -EINVAL); rc = ldlm_callback_reply(req, -EINVAL);
ldlm_callback_errmsg(req, "Operate on stale lock", rc, ldlm_callback_errmsg(req, "Operate on stale lock", rc,
&dlm_req->lock_handle[0]); &dlm_req->lock_handle[0]);
RETURN(0); return 0;
} }
/* BL_AST locks are not needed in LRU. /* BL_AST locks are not needed in LRU.
* Let ldlm_cancel_lru() be fast. */ * Let ldlm_cancel_lru() be fast. */
...@@ -752,7 +752,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) ...@@ -752,7 +752,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
LBUG(); /* checked above */ LBUG(); /* checked above */
} }
RETURN(0); return 0;
} }
...@@ -894,7 +894,7 @@ static int ldlm_bl_thread_main(void *arg) ...@@ -894,7 +894,7 @@ static int ldlm_bl_thread_main(void *arg)
atomic_dec(&blp->blp_busy_threads); atomic_dec(&blp->blp_busy_threads);
atomic_dec(&blp->blp_num_threads); atomic_dec(&blp->blp_num_threads);
complete(&blp->blp_comp); complete(&blp->blp_comp);
RETURN(0); return 0;
} }
...@@ -913,7 +913,7 @@ int ldlm_get_ref(void) ...@@ -913,7 +913,7 @@ int ldlm_get_ref(void)
} }
mutex_unlock(&ldlm_ref_mutex); mutex_unlock(&ldlm_ref_mutex);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_get_ref); EXPORT_SYMBOL(ldlm_get_ref);
...@@ -1014,9 +1014,9 @@ int ldlm_init_export(struct obd_export *exp) ...@@ -1014,9 +1014,9 @@ int ldlm_init_export(struct obd_export *exp)
CFS_HASH_NBLK_CHANGE); CFS_HASH_NBLK_CHANGE);
if (!exp->exp_lock_hash) if (!exp->exp_lock_hash)
RETURN(-ENOMEM); return -ENOMEM;
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_init_export); EXPORT_SYMBOL(ldlm_init_export);
...@@ -1037,11 +1037,11 @@ static int ldlm_setup(void) ...@@ -1037,11 +1037,11 @@ static int ldlm_setup(void)
int i; int i;
if (ldlm_state != NULL) if (ldlm_state != NULL)
RETURN(-EALREADY); return -EALREADY;
OBD_ALLOC(ldlm_state, sizeof(*ldlm_state)); OBD_ALLOC(ldlm_state, sizeof(*ldlm_state));
if (ldlm_state == NULL) if (ldlm_state == NULL)
RETURN(-ENOMEM); return -ENOMEM;
#ifdef LPROCFS #ifdef LPROCFS
rc = ldlm_proc_setup(); rc = ldlm_proc_setup();
...@@ -1121,11 +1121,11 @@ static int ldlm_setup(void) ...@@ -1121,11 +1121,11 @@ static int ldlm_setup(void)
CERROR("Failed to initialize LDLM pools: %d\n", rc); CERROR("Failed to initialize LDLM pools: %d\n", rc);
GOTO(out, rc); GOTO(out, rc);
} }
RETURN(0); return 0;
out: out:
ldlm_cleanup(); ldlm_cleanup();
RETURN(rc); return rc;
} }
static int ldlm_cleanup(void) static int ldlm_cleanup(void)
...@@ -1135,7 +1135,7 @@ static int ldlm_cleanup(void) ...@@ -1135,7 +1135,7 @@ static int ldlm_cleanup(void)
CERROR("ldlm still has namespaces; clean these up first.\n"); 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_SERVER, D_DLMTRACE);
ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE); ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
RETURN(-EBUSY); return -EBUSY;
} }
ldlm_pools_fini(); ldlm_pools_fini();
...@@ -1168,7 +1168,7 @@ static int ldlm_cleanup(void) ...@@ -1168,7 +1168,7 @@ static int ldlm_cleanup(void)
OBD_FREE(ldlm_state, sizeof(*ldlm_state)); OBD_FREE(ldlm_state, sizeof(*ldlm_state));
ldlm_state = NULL; ldlm_state = NULL;
RETURN(0); return 0;
} }
int ldlm_init(void) int ldlm_init(void)
......
...@@ -338,13 +338,13 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl) ...@@ -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; recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) if (recalc_interval_sec < pl->pl_recalc_period)
RETURN(0); return 0;
spin_lock(&pl->pl_lock); spin_lock(&pl->pl_lock);
recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time; recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) { if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock); spin_unlock(&pl->pl_lock);
RETURN(0); return 0;
} }
/* /*
* Recalc SLV after last period. This should be done * Recalc SLV after last period. This should be done
...@@ -366,7 +366,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl) ...@@ -366,7 +366,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT, lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
recalc_interval_sec); recalc_interval_sec);
spin_unlock(&pl->pl_lock); spin_unlock(&pl->pl_lock);
RETURN(0); return 0;
} }
/** /**
...@@ -393,7 +393,7 @@ static int ldlm_srv_pool_shrink(struct ldlm_pool *pl, ...@@ -393,7 +393,7 @@ static int ldlm_srv_pool_shrink(struct ldlm_pool *pl,
* and can't cancel anything. Let's catch this race. * and can't cancel anything. Let's catch this race.
*/ */
if (atomic_read(&pl->pl_granted) == 0) if (atomic_read(&pl->pl_granted) == 0)
RETURN(0); return 0;
spin_lock(&pl->pl_lock); spin_lock(&pl->pl_lock);
...@@ -475,7 +475,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) ...@@ -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; recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) if (recalc_interval_sec < pl->pl_recalc_period)
RETURN(0); return 0;
spin_lock(&pl->pl_lock); spin_lock(&pl->pl_lock);
/* /*
...@@ -484,7 +484,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) ...@@ -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; recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) { if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock); spin_unlock(&pl->pl_lock);
RETURN(0); return 0;
} }
/* /*
...@@ -501,7 +501,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) ...@@ -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. * Do not cancel locks in case lru resize is disabled for this ns.
*/ */
if (!ns_connect_lru_resize(ldlm_pl2ns(pl))) 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 * 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) ...@@ -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 * It may be called when SLV has changed much, this is why we do not
* take into account pl->pl_recalc_time here. * take into account pl->pl_recalc_time here.
*/ */
RETURN(ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC, return ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC, LDLM_CANCEL_LRUR);
LDLM_CANCEL_LRUR));
} }
/** /**
...@@ -530,7 +529,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl, ...@@ -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. * Do not cancel locks in case lru resize is disabled for this ns.
*/ */
if (!ns_connect_lru_resize(ns)) if (!ns_connect_lru_resize(ns))
RETURN(0); return 0;
/* /*
* Make sure that pool knows last SLV and Limit from obd. * 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) ...@@ -734,7 +733,7 @@ static int ldlm_pool_proc_init(struct ldlm_pool *pl)
OBD_ALLOC(var_name, MAX_STRING_SIZE + 1); OBD_ALLOC(var_name, MAX_STRING_SIZE + 1);
if (!var_name) if (!var_name)
RETURN(-ENOMEM); return -ENOMEM;
parent_ns_proc = ns->ns_proc_dir_entry; parent_ns_proc = ns->ns_proc_dir_entry;
if (parent_ns_proc == NULL) { if (parent_ns_proc == NULL) {
...@@ -858,11 +857,11 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, ...@@ -858,11 +857,11 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
pl->pl_client_lock_volume = 0; pl->pl_client_lock_volume = 0;
rc = ldlm_pool_proc_init(pl); rc = ldlm_pool_proc_init(pl);
if (rc) if (rc)
RETURN(rc); return rc;
CDEBUG(D_DLMTRACE, "Lock pool %s is initialized\n", pl->pl_name); CDEBUG(D_DLMTRACE, "Lock pool %s is initialized\n", pl->pl_name);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_pool_init); EXPORT_SYMBOL(ldlm_pool_init);
...@@ -1343,11 +1342,11 @@ static int ldlm_pools_thread_start(void) ...@@ -1343,11 +1342,11 @@ static int ldlm_pools_thread_start(void)
task_t *task; task_t *task;
if (ldlm_pools_thread != NULL) if (ldlm_pools_thread != NULL)
RETURN(-EALREADY); return -EALREADY;
OBD_ALLOC_PTR(ldlm_pools_thread); OBD_ALLOC_PTR(ldlm_pools_thread);
if (ldlm_pools_thread == NULL) if (ldlm_pools_thread == NULL)
RETURN(-ENOMEM); return -ENOMEM;
init_completion(&ldlm_pools_comp); init_completion(&ldlm_pools_comp);
init_waitqueue_head(&ldlm_pools_thread->t_ctl_waitq); init_waitqueue_head(&ldlm_pools_thread->t_ctl_waitq);
...@@ -1358,11 +1357,11 @@ static int ldlm_pools_thread_start(void) ...@@ -1358,11 +1357,11 @@ static int ldlm_pools_thread_start(void)
CERROR("Can't start pool thread, error %ld\n", PTR_ERR(task)); CERROR("Can't start pool thread, error %ld\n", PTR_ERR(task));
OBD_FREE(ldlm_pools_thread, sizeof(*ldlm_pools_thread)); OBD_FREE(ldlm_pools_thread, sizeof(*ldlm_pools_thread));
ldlm_pools_thread = NULL; ldlm_pools_thread = NULL;
RETURN(PTR_ERR(task)); return PTR_ERR(task);
} }
l_wait_event(ldlm_pools_thread->t_ctl_waitq, l_wait_event(ldlm_pools_thread->t_ctl_waitq,
thread_is_running(ldlm_pools_thread), &lwi); thread_is_running(ldlm_pools_thread), &lwi);
RETURN(0); return 0;
} }
static void ldlm_pools_thread_stop(void) static void ldlm_pools_thread_stop(void)
...@@ -1397,7 +1396,7 @@ int ldlm_pools_init(void) ...@@ -1397,7 +1396,7 @@ int ldlm_pools_init(void)
set_shrinker(DEFAULT_SEEKS, set_shrinker(DEFAULT_SEEKS,
ldlm_pools_cli_shrink); ldlm_pools_cli_shrink);
} }
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_pools_init); EXPORT_SYMBOL(ldlm_pools_init);
......
...@@ -98,7 +98,7 @@ int ldlm_expired_completion_wait(void *data) ...@@ -98,7 +98,7 @@ int ldlm_expired_completion_wait(void *data)
static cfs_time_t next_dump = 0, last_dump = 0; static cfs_time_t next_dump = 0, last_dump = 0;
if (ptlrpc_check_suspend()) if (ptlrpc_check_suspend())
RETURN(0); return 0;
LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", " LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", "
CFS_DURATION_T"s ago)\n", CFS_DURATION_T"s ago)\n",
...@@ -119,7 +119,7 @@ int ldlm_expired_completion_wait(void *data) ...@@ -119,7 +119,7 @@ int ldlm_expired_completion_wait(void *data)
if (last_dump == 0) if (last_dump == 0)
libcfs_debug_dumplog(); libcfs_debug_dumplog();
} }
RETURN(0); return 0;
} }
obd = lock->l_conn_export->exp_obd; obd = lock->l_conn_export->exp_obd;
...@@ -131,7 +131,7 @@ int ldlm_expired_completion_wait(void *data) ...@@ -131,7 +131,7 @@ int ldlm_expired_completion_wait(void *data)
cfs_time_sub(cfs_time_current_sec(), lock->l_last_activity), cfs_time_sub(cfs_time_current_sec(), lock->l_last_activity),
obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid); obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_expired_completion_wait); EXPORT_SYMBOL(ldlm_expired_completion_wait);
...@@ -185,19 +185,19 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -185,19 +185,19 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data)
{ {
if (flags == LDLM_FL_WAIT_NOREPROC) { if (flags == LDLM_FL_WAIT_NOREPROC) {
LDLM_DEBUG(lock, "client-side enqueue waiting on pending lock"); LDLM_DEBUG(lock, "client-side enqueue waiting on pending lock");
RETURN(0); return 0;
} }
if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED | if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
LDLM_FL_BLOCK_CONV))) { LDLM_FL_BLOCK_CONV))) {
wake_up(&lock->l_waitq); 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, " LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
"going forward"); "going forward");
ldlm_reprocess_all(lock->l_resource); ldlm_reprocess_all(lock->l_resource);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_completion_ast_async); EXPORT_SYMBOL(ldlm_completion_ast_async);
...@@ -240,7 +240,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -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 | if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
LDLM_FL_BLOCK_CONV))) { LDLM_FL_BLOCK_CONV))) {
wake_up(&lock->l_waitq); wake_up(&lock->l_waitq);
RETURN(0); return 0;
} }
LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, " LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
...@@ -291,10 +291,10 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -291,10 +291,10 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
if (rc) { if (rc) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)", LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
rc); rc);
RETURN(rc); return rc;
} }
RETURN(ldlm_completion_tail(lock)); return ldlm_completion_tail(lock);
} }
EXPORT_SYMBOL(ldlm_completion_ast); EXPORT_SYMBOL(ldlm_completion_ast);
...@@ -330,7 +330,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock) ...@@ -330,7 +330,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock)
LDLM_DEBUG(lock, "Lock still has references, will be " LDLM_DEBUG(lock, "Lock still has references, will be "
"cancelled later"); "cancelled later");
} }
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_blocking_ast_nocheck); EXPORT_SYMBOL(ldlm_blocking_ast_nocheck);
...@@ -352,7 +352,7 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, ...@@ -352,7 +352,7 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
{ {
if (flag == LDLM_CB_CANCELING) { if (flag == LDLM_CB_CANCELING) {
/* Don't need to do anything here. */ /* Don't need to do anything here. */
RETURN(0); return 0;
} }
lock_res_and_lock(lock); lock_res_and_lock(lock);
...@@ -363,9 +363,9 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, ...@@ -363,9 +363,9 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
* early, if so. */ * early, if so. */
if (lock->l_blocking_ast != ldlm_blocking_ast) { if (lock->l_blocking_ast != ldlm_blocking_ast) {
unlock_res_and_lock(lock); 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); EXPORT_SYMBOL(ldlm_blocking_ast);
...@@ -526,7 +526,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ...@@ -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. */ /* ldlm_cli_enqueue is holding a reference on this lock. */
if (!lock) { if (!lock) {
LASSERT(type == LDLM_FLOCK); LASSERT(type == LDLM_FLOCK);
RETURN(-ENOLCK); return -ENOLCK;
} }
LASSERTF(ergo(lvb_len != 0, lvb_len == lock->l_lvb_len), 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, ...@@ -782,7 +782,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
rc = ptlrpc_request_pack(req, version, opc); rc = ptlrpc_request_pack(req, version, opc);
if (rc) { if (rc) {
ldlm_lock_list_put(cancels, l_bl_ast, count); ldlm_lock_list_put(cancels, l_bl_ast, count);
RETURN(rc); return rc;
} }
if (ns_connect_cancelset(ns)) { if (ns_connect_cancelset(ns)) {
...@@ -802,7 +802,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req, ...@@ -802,7 +802,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
} else { } else {
ldlm_lock_list_put(cancels, l_bl_ast, count); ldlm_lock_list_put(cancels, l_bl_ast, count);
} }
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_prep_elc_req); EXPORT_SYMBOL(ldlm_prep_elc_req);
...@@ -821,17 +821,17 @@ struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp, int lvb_len) ...@@ -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); req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
if (req == NULL) if (req == NULL)
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
rc = ldlm_prep_enqueue_req(exp, req, NULL, 0); rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
if (rc) { if (rc) {
ptlrpc_request_free(req); 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); req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
ptlrpc_request_set_replen(req); ptlrpc_request_set_replen(req);
RETURN(req); return req;
} }
EXPORT_SYMBOL(ldlm_enqueue_pack); EXPORT_SYMBOL(ldlm_enqueue_pack);
...@@ -881,7 +881,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, ...@@ -881,7 +881,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
einfo->ei_mode, &cbs, einfo->ei_cbdata, einfo->ei_mode, &cbs, einfo->ei_cbdata,
lvb_len, lvb_type); lvb_len, lvb_type);
if (lock == NULL) if (lock == NULL)
RETURN(-ENOMEM); return -ENOMEM;
/* for the local lock, add the reference */ /* for the local lock, add the reference */
ldlm_lock_addref_internal(lock, einfo->ei_mode); ldlm_lock_addref_internal(lock, einfo->ei_mode);
ldlm_lock2handle(lock, lockh); ldlm_lock2handle(lock, lockh);
...@@ -922,7 +922,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, ...@@ -922,7 +922,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
if (req == NULL) { if (req == NULL) {
failed_lock_cleanup(ns, lock, einfo->ei_mode); failed_lock_cleanup(ns, lock, einfo->ei_mode);
LDLM_LOCK_RELEASE(lock); LDLM_LOCK_RELEASE(lock);
RETURN(-ENOMEM); return -ENOMEM;
} }
req_passed_in = 0; req_passed_in = 0;
if (reqp) if (reqp)
...@@ -963,7 +963,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, ...@@ -963,7 +963,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
if (async) { if (async) {
LASSERT(reqp != NULL); LASSERT(reqp != NULL);
RETURN(0); return 0;
} }
LDLM_DEBUG(lock, "sending request"); LDLM_DEBUG(lock, "sending request");
...@@ -987,7 +987,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp, ...@@ -987,7 +987,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
*reqp = NULL; *reqp = NULL;
} }
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_cli_enqueue); EXPORT_SYMBOL(ldlm_cli_enqueue);
...@@ -1012,7 +1012,7 @@ static int ldlm_cli_convert_local(struct ldlm_lock *lock, int new_mode, ...@@ -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_DEBUG(lock, "client-side local convert handler END");
LDLM_LOCK_PUT(lock); LDLM_LOCK_PUT(lock);
RETURN(rc); return rc;
} }
/* FIXME: one of ldlm_cli_convert or the server side should reject attempted /* 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) ...@@ -1031,12 +1031,12 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags)
lock = ldlm_handle2lock(lockh); lock = ldlm_handle2lock(lockh);
if (!lock) { if (!lock) {
LBUG(); LBUG();
RETURN(-EINVAL); return -EINVAL;
} }
*flags = 0; *flags = 0;
if (lock->l_conn_export == NULL) 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"); LDLM_DEBUG(lock, "client-side convert");
...@@ -1045,7 +1045,7 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags) ...@@ -1045,7 +1045,7 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags)
LDLM_CONVERT); LDLM_CONVERT);
if (req == NULL) { if (req == NULL) {
LDLM_LOCK_PUT(lock); LDLM_LOCK_PUT(lock);
RETURN(-ENOMEM); return -ENOMEM;
} }
body = req_capsule_client_get(&req->rq_pill, &RMF_DLM_REQ); 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) ...@@ -1129,7 +1129,7 @@ static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock)
ldlm_reprocess_all(lock->l_resource); 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, ...@@ -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); CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_PAUSE_CANCEL, cfs_fail_val);
if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_RACE)) if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_RACE))
RETURN(count); return count;
free = ldlm_format_handles_avail(class_exp2cliimp(exp), free = ldlm_format_handles_avail(class_exp2cliimp(exp),
&RQF_LDLM_CANCEL, RCL_CLIENT, 0); &RQF_LDLM_CANCEL, RCL_CLIENT, 0);
...@@ -1196,7 +1196,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels, ...@@ -1196,7 +1196,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels,
if (imp == NULL || imp->imp_invalid) { if (imp == NULL || imp->imp_invalid) {
CDEBUG(D_DLMTRACE, CDEBUG(D_DLMTRACE,
"skipping cancel on invalid import %p\n", imp); "skipping cancel on invalid import %p\n", imp);
RETURN(count); return count;
} }
req = ptlrpc_request_alloc(imp, &RQF_LDLM_CANCEL); req = ptlrpc_request_alloc(imp, &RQF_LDLM_CANCEL);
...@@ -1275,7 +1275,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req) ...@@ -1275,7 +1275,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
/* /*
* Do nothing for corner cases. * Do nothing for corner cases.
*/ */
RETURN(0); return 0;
} }
/* In some cases RPC may contain SLV and limit zeroed out. This /* 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) ...@@ -1289,7 +1289,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
"(SLV: "LPU64", Limit: %u)", "(SLV: "LPU64", Limit: %u)",
lustre_msg_get_slv(req->rq_repmsg), lustre_msg_get_slv(req->rq_repmsg),
lustre_msg_get_limit(req->rq_repmsg)); lustre_msg_get_limit(req->rq_repmsg));
RETURN(0); return 0;
} }
new_limit = lustre_msg_get_limit(req->rq_repmsg); new_limit = lustre_msg_get_limit(req->rq_repmsg);
...@@ -1306,7 +1306,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req) ...@@ -1306,7 +1306,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
obd->obd_pool_limit = new_limit; obd->obd_pool_limit = new_limit;
write_unlock(&obd->obd_pool_lock); write_unlock(&obd->obd_pool_lock);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_cli_update_pool); EXPORT_SYMBOL(ldlm_cli_update_pool);
...@@ -1329,13 +1329,13 @@ int ldlm_cli_cancel(struct lustre_handle *lockh, ...@@ -1329,13 +1329,13 @@ int ldlm_cli_cancel(struct lustre_handle *lockh,
lock = ldlm_handle2lock_long(lockh, LDLM_FL_CANCELING); lock = ldlm_handle2lock_long(lockh, LDLM_FL_CANCELING);
if (lock == NULL) { if (lock == NULL) {
LDLM_DEBUG_NOLOCK("lock is already being destroyed\n"); LDLM_DEBUG_NOLOCK("lock is already being destroyed\n");
RETURN(0); return 0;
} }
rc = ldlm_cli_cancel_local(lock); rc = ldlm_cli_cancel_local(lock);
if (rc == LDLM_FL_LOCAL_ONLY) { if (rc == LDLM_FL_LOCAL_ONLY) {
LDLM_LOCK_RELEASE(lock); LDLM_LOCK_RELEASE(lock);
RETURN(0); return 0;
} }
/* Even if the lock is marked as LDLM_FL_BL_AST, this is a LDLM_CANCEL /* 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 * 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, ...@@ -1357,7 +1357,7 @@ int ldlm_cli_cancel(struct lustre_handle *lockh,
LCF_BL_AST, flags); LCF_BL_AST, flags);
} }
ldlm_cli_cancel_list(&cancels, count, NULL, cancel_flags); ldlm_cli_cancel_list(&cancels, count, NULL, cancel_flags);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_cli_cancel); EXPORT_SYMBOL(ldlm_cli_cancel);
...@@ -1407,7 +1407,7 @@ int ldlm_cli_cancel_list_local(struct list_head *cancels, int count, ...@@ -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); ldlm_cli_cancel_list(&head, bl_ast, NULL, 0);
} }
RETURN(count); return count;
} }
EXPORT_SYMBOL(ldlm_cli_cancel_list_local); 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, ...@@ -1439,7 +1439,7 @@ static ldlm_policy_res_t ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns,
} }
unlock_res_and_lock(lock); 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 ...@@ -1730,7 +1730,7 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, struct list_head *ca
unused--; unused--;
} }
spin_unlock(&ns->ns_lock); spin_unlock(&ns->ns_lock);
RETURN(added); return added;
} }
int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels, 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, ...@@ -1764,9 +1764,9 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
count = ldlm_prepare_lru_list(ns, &cancels, nr, 0, flags); count = ldlm_prepare_lru_list(ns, &cancels, nr, 0, flags);
rc = ldlm_bl_to_thread_list(ns, NULL, &cancels, count, cancel_flags); rc = ldlm_bl_to_thread_list(ns, NULL, &cancels, count, cancel_flags);
if (rc == 0) if (rc == 0)
RETURN(count); return count;
RETURN(0); return 0;
} }
/** /**
...@@ -1822,7 +1822,7 @@ int ldlm_cancel_resource_local(struct ldlm_resource *res, ...@@ -1822,7 +1822,7 @@ int ldlm_cancel_resource_local(struct ldlm_resource *res,
} }
unlock_res(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); EXPORT_SYMBOL(ldlm_cancel_resource_local);
...@@ -1843,7 +1843,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count, ...@@ -1843,7 +1843,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
int res = 0; int res = 0;
if (list_empty(cancels) || count == 0) if (list_empty(cancels) || count == 0)
RETURN(0); return 0;
/* XXX: requests (both batched and not) could be sent in parallel. /* 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 * 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, ...@@ -1879,7 +1879,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
ldlm_lock_list_put(cancels, l_bl_ast, res); ldlm_lock_list_put(cancels, l_bl_ast, res);
} }
LASSERT(count == 0); LASSERT(count == 0);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_cli_cancel_list); EXPORT_SYMBOL(ldlm_cli_cancel_list);
...@@ -1904,7 +1904,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns, ...@@ -1904,7 +1904,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
if (res == NULL) { if (res == NULL) {
/* This is not a problem. */ /* This is not a problem. */
CDEBUG(D_INFO, "No resource "LPU64"\n", res_id->name[0]); CDEBUG(D_INFO, "No resource "LPU64"\n", res_id->name[0]);
RETURN(0); return 0;
} }
LDLM_RESOURCE_ADDREF(res); LDLM_RESOURCE_ADDREF(res);
...@@ -1916,7 +1916,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns, ...@@ -1916,7 +1916,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
LDLM_RESOURCE_DELREF(res); LDLM_RESOURCE_DELREF(res);
ldlm_resource_putref(res); ldlm_resource_putref(res);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(ldlm_cli_cancel_unused_resource); EXPORT_SYMBOL(ldlm_cli_cancel_unused_resource);
...@@ -1959,16 +1959,16 @@ int ldlm_cli_cancel_unused(struct ldlm_namespace *ns, ...@@ -1959,16 +1959,16 @@ int ldlm_cli_cancel_unused(struct ldlm_namespace *ns,
}; };
if (ns == NULL) if (ns == NULL)
RETURN(ELDLM_OK); return ELDLM_OK;
if (res_id != NULL) { 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, LCK_MINMODE, flags,
opaque)); opaque);
} else { } else {
cfs_hash_for_each_nolock(ns->ns_rs_hash, cfs_hash_for_each_nolock(ns->ns_rs_hash,
ldlm_cli_hash_cancel_unused, &arg); ldlm_cli_hash_cancel_unused, &arg);
RETURN(ELDLM_OK); return ELDLM_OK;
} }
} }
EXPORT_SYMBOL(ldlm_cli_cancel_unused); EXPORT_SYMBOL(ldlm_cli_cancel_unused);
...@@ -1983,7 +1983,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter, ...@@ -1983,7 +1983,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
int rc = LDLM_ITER_CONTINUE; int rc = LDLM_ITER_CONTINUE;
if (!res) if (!res)
RETURN(LDLM_ITER_CONTINUE); return LDLM_ITER_CONTINUE;
lock_res(res); lock_res(res);
list_for_each_safe(tmp, next, &res->lr_granted) { 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, ...@@ -2008,7 +2008,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
} }
out: out:
unlock_res(res); unlock_res(res);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_resource_foreach); EXPORT_SYMBOL(ldlm_resource_foreach);
...@@ -2067,13 +2067,13 @@ int ldlm_resource_iterate(struct ldlm_namespace *ns, ...@@ -2067,13 +2067,13 @@ int ldlm_resource_iterate(struct ldlm_namespace *ns,
res = ldlm_resource_get(ns, NULL, res_id, 0, 0); res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
if (res == NULL) if (res == NULL)
RETURN(0); return 0;
LDLM_RESOURCE_ADDREF(res); LDLM_RESOURCE_ADDREF(res);
rc = ldlm_resource_foreach(res, iter, data); rc = ldlm_resource_foreach(res, iter, data);
LDLM_RESOURCE_DELREF(res); LDLM_RESOURCE_DELREF(res);
ldlm_resource_putref(res); ldlm_resource_putref(res);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_resource_iterate); EXPORT_SYMBOL(ldlm_resource_iterate);
...@@ -2147,7 +2147,7 @@ static int replay_lock_interpret(const struct lu_env *env, ...@@ -2147,7 +2147,7 @@ static int replay_lock_interpret(const struct lu_env *env,
if (rc != ELDLM_OK) if (rc != ELDLM_OK)
ptlrpc_connect_import(req->rq_import); ptlrpc_connect_import(req->rq_import);
RETURN(rc); return rc;
} }
static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock) 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) ...@@ -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 */ /* Bug 11974: Do not replay a lock which is actively being canceled */
if (lock->l_flags & LDLM_FL_CANCELING) { if (lock->l_flags & LDLM_FL_CANCELING) {
LDLM_DEBUG(lock, "Not replaying canceled lock:"); LDLM_DEBUG(lock, "Not replaying canceled lock:");
RETURN(0); return 0;
} }
/* If this is reply-less callback lock, we cannot replay it, since /* 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) ...@@ -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) { if (lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK) {
LDLM_DEBUG(lock, "Not replaying reply-less lock:"); LDLM_DEBUG(lock, "Not replaying reply-less lock:");
ldlm_lock_cancel(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) ...@@ -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, req = ptlrpc_request_alloc_pack(imp, &RQF_LDLM_ENQUEUE,
LUSTRE_DLM_VERSION, LDLM_ENQUEUE); LUSTRE_DLM_VERSION, LDLM_ENQUEUE);
if (req == NULL) if (req == NULL)
RETURN(-ENOMEM); return -ENOMEM;
/* We're part of recovery, so don't wait for it. */ /* We're part of recovery, so don't wait for it. */
req->rq_send_state = LUSTRE_IMP_REPLAY_LOCKS; 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) ...@@ -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; req->rq_interpret_reply = (ptlrpc_interpterer_t)replay_lock_interpret;
ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1); ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
RETURN(0); return 0;
} }
/** /**
...@@ -2271,7 +2271,7 @@ int ldlm_replay_locks(struct obd_import *imp) ...@@ -2271,7 +2271,7 @@ int ldlm_replay_locks(struct obd_import *imp)
/* don't replay locks if import failed recovery */ /* don't replay locks if import failed recovery */
if (imp->imp_vbr_failed) if (imp->imp_vbr_failed)
RETURN(0); return 0;
/* ensure this doesn't fall to 0 before all have been queued */ /* ensure this doesn't fall to 0 before all have been queued */
atomic_inc(&imp->imp_replay_inflight); atomic_inc(&imp->imp_replay_inflight);
...@@ -2293,6 +2293,6 @@ int ldlm_replay_locks(struct obd_import *imp) ...@@ -2293,6 +2293,6 @@ int ldlm_replay_locks(struct obd_import *imp)
atomic_dec(&imp->imp_replay_inflight); atomic_dec(&imp->imp_replay_inflight);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(ldlm_replay_locks); EXPORT_SYMBOL(ldlm_replay_locks);
...@@ -78,7 +78,7 @@ static ssize_t lprocfs_wr_dump_ns(struct file *file, const char *buffer, ...@@ -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_SERVER, D_DLMTRACE);
ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE); ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
RETURN(count); return count;
} }
LPROC_SEQ_FOPS_WR_ONLY(ldlm, dump_ns); LPROC_SEQ_FOPS_WR_ONLY(ldlm, dump_ns);
...@@ -126,7 +126,7 @@ int ldlm_proc_setup(void) ...@@ -126,7 +126,7 @@ int ldlm_proc_setup(void)
rc = lprocfs_add_vars(ldlm_type_proc_dir, list, NULL); rc = lprocfs_add_vars(ldlm_type_proc_dir, list, NULL);
RETURN(0); return 0;
err_ns: err_ns:
lprocfs_remove(&ldlm_ns_proc_dir); lprocfs_remove(&ldlm_ns_proc_dir);
...@@ -136,7 +136,7 @@ int ldlm_proc_setup(void) ...@@ -136,7 +136,7 @@ int ldlm_proc_setup(void)
ldlm_svc_proc_dir = NULL; ldlm_svc_proc_dir = NULL;
ldlm_type_proc_dir = NULL; ldlm_type_proc_dir = NULL;
ldlm_ns_proc_dir = NULL; ldlm_ns_proc_dir = NULL;
RETURN(rc); return rc;
} }
void ldlm_proc_cleanup(void) void ldlm_proc_cleanup(void)
...@@ -573,7 +573,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, ...@@ -573,7 +573,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
rc = ldlm_get_ref(); rc = ldlm_get_ref();
if (rc) { if (rc) {
CERROR("ldlm_get_ref failed: %d\n", rc); CERROR("ldlm_get_ref failed: %d\n", rc);
RETURN(NULL); return NULL;
} }
for (idx = 0;;idx++) { for (idx = 0;;idx++) {
...@@ -647,7 +647,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, ...@@ -647,7 +647,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
} }
ldlm_namespace_register(ns, client); ldlm_namespace_register(ns, client);
RETURN(ns); return ns;
out_proc: out_proc:
ldlm_namespace_proc_unregister(ns); ldlm_namespace_proc_unregister(ns);
ldlm_namespace_cleanup(ns, 0); ldlm_namespace_cleanup(ns, 0);
...@@ -657,7 +657,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, ...@@ -657,7 +657,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
OBD_FREE_PTR(ns); OBD_FREE_PTR(ns);
out_ref: out_ref:
ldlm_put_ref(); ldlm_put_ref();
RETURN(NULL); return NULL;
} }
EXPORT_SYMBOL(ldlm_namespace_new); EXPORT_SYMBOL(ldlm_namespace_new);
...@@ -837,13 +837,13 @@ static int __ldlm_namespace_free(struct ldlm_namespace *ns, int force) ...@@ -837,13 +837,13 @@ static int __ldlm_namespace_free(struct ldlm_namespace *ns, int force)
"with %d resources in use, (rc=%d)\n", "with %d resources in use, (rc=%d)\n",
ldlm_ns_name(ns), ldlm_ns_name(ns),
atomic_read(&ns->ns_bref), rc); atomic_read(&ns->ns_bref), rc);
RETURN(ELDLM_NAMESPACE_EXISTS); return ELDLM_NAMESPACE_EXISTS;
} }
CDEBUG(D_DLMTRACE, "dlm namespace %s free done waiting\n", CDEBUG(D_DLMTRACE, "dlm namespace %s free done waiting\n",
ldlm_ns_name(ns)); ldlm_ns_name(ns));
} }
RETURN(ELDLM_OK); return ELDLM_OK;
} }
/** /**
......
...@@ -458,14 +458,6 @@ void libcfs_debug_set_level(unsigned int debug_level) ...@@ -458,14 +458,6 @@ void libcfs_debug_set_level(unsigned int debug_level)
EXPORT_SYMBOL(libcfs_debug_set_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, void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, const char *label,
long_ptr_t rc) long_ptr_t rc)
{ {
......
...@@ -1053,7 +1053,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, ...@@ -1053,7 +1053,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
CFS_HASH_NAME_LEN : CFS_HASH_BIGNAME_LEN; CFS_HASH_NAME_LEN : CFS_HASH_BIGNAME_LEN;
LIBCFS_ALLOC(hs, offsetof(cfs_hash_t, hs_name[len])); LIBCFS_ALLOC(hs, offsetof(cfs_hash_t, hs_name[len]));
if (hs == NULL) if (hs == NULL)
RETURN(NULL); return NULL;
strncpy(hs->hs_name, name, len); strncpy(hs->hs_name, name, len);
hs->hs_name[len - 1] = '\0'; hs->hs_name[len - 1] = '\0';
...@@ -1085,7 +1085,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, ...@@ -1085,7 +1085,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
return hs; return hs;
LIBCFS_FREE(hs, offsetof(cfs_hash_t, hs_name[len])); LIBCFS_FREE(hs, offsetof(cfs_hash_t, hs_name[len]));
RETURN(NULL); return NULL;
} }
EXPORT_SYMBOL(cfs_hash_create); 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, ...@@ -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_unlock(hs, 0);
cfs_hash_for_each_exit(hs); cfs_hash_for_each_exit(hs);
RETURN(count); return count;
} }
typedef struct { typedef struct {
...@@ -1645,18 +1645,18 @@ cfs_hash_for_each_nolock(cfs_hash_t *hs, ...@@ -1645,18 +1645,18 @@ cfs_hash_for_each_nolock(cfs_hash_t *hs,
if (cfs_hash_with_no_lock(hs) || if (cfs_hash_with_no_lock(hs) ||
cfs_hash_with_rehash_key(hs) || cfs_hash_with_rehash_key(hs) ||
!cfs_hash_with_no_itemref(hs)) !cfs_hash_with_no_itemref(hs))
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
if (CFS_HOP(hs, get) == NULL || if (CFS_HOP(hs, get) == NULL ||
(CFS_HOP(hs, put) == NULL && (CFS_HOP(hs, put) == NULL &&
CFS_HOP(hs, put_locked) == NULL)) CFS_HOP(hs, put_locked) == NULL))
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
cfs_hash_for_each_enter(hs); cfs_hash_for_each_enter(hs);
cfs_hash_for_each_relax(hs, func, data); cfs_hash_for_each_relax(hs, func, data);
cfs_hash_for_each_exit(hs); cfs_hash_for_each_exit(hs);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(cfs_hash_for_each_nolock); EXPORT_SYMBOL(cfs_hash_for_each_nolock);
...@@ -1691,7 +1691,7 @@ cfs_hash_for_each_empty(cfs_hash_t *hs, ...@@ -1691,7 +1691,7 @@ cfs_hash_for_each_empty(cfs_hash_t *hs,
hs->hs_name, i++); hs->hs_name, i++);
} }
cfs_hash_for_each_exit(hs); cfs_hash_for_each_exit(hs);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(cfs_hash_for_each_empty); EXPORT_SYMBOL(cfs_hash_for_each_empty);
......
...@@ -248,7 +248,7 @@ int libcfs_kkuc_group_rem(int uid, int group) ...@@ -248,7 +248,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
struct kkuc_reg *reg, *next; struct kkuc_reg *reg, *next;
if (kkuc_groups[group].next == NULL) if (kkuc_groups[group].next == NULL)
RETURN(0); return 0;
if (uid == 0) { if (uid == 0) {
/* Broadcast a shutdown message */ /* Broadcast a shutdown message */
...@@ -274,7 +274,7 @@ int libcfs_kkuc_group_rem(int uid, int group) ...@@ -274,7 +274,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
} }
up_write(&kg_sem); up_write(&kg_sem);
RETURN(0); return 0;
} }
EXPORT_SYMBOL(libcfs_kkuc_group_rem); EXPORT_SYMBOL(libcfs_kkuc_group_rem);
...@@ -303,7 +303,7 @@ int libcfs_kkuc_group_put(int group, void *payload) ...@@ -303,7 +303,7 @@ int libcfs_kkuc_group_put(int group, void *payload)
if (one_success) if (one_success)
rc = 0; rc = 0;
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(libcfs_kkuc_group_put); EXPORT_SYMBOL(libcfs_kkuc_group_put);
...@@ -321,12 +321,12 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, ...@@ -321,12 +321,12 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
if (group > KUC_GRP_MAX) { if (group > KUC_GRP_MAX) {
CDEBUG(D_WARNING, "Kernelcomm: bad group %d\n", group); CDEBUG(D_WARNING, "Kernelcomm: bad group %d\n", group);
RETURN(-EINVAL); return -EINVAL;
} }
/* no link for this group */ /* no link for this group */
if (kkuc_groups[group].next == NULL) if (kkuc_groups[group].next == NULL)
RETURN(0); return 0;
down_read(&kg_sem); down_read(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) { 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, ...@@ -336,7 +336,7 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
} }
up_read(&kg_sem); up_read(&kg_sem);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(libcfs_kkuc_group_foreach); EXPORT_SYMBOL(libcfs_kkuc_group_foreach);
......
...@@ -215,12 +215,12 @@ int cfs_get_environ(const char *key, char *value, int *val_len) ...@@ -215,12 +215,12 @@ int cfs_get_environ(const char *key, char *value, int *val_len)
buffer = kmalloc(buf_len, GFP_USER); buffer = kmalloc(buf_len, GFP_USER);
if (!buffer) if (!buffer)
RETURN(-ENOMEM); return -ENOMEM;
mm = get_task_mm(current); mm = get_task_mm(current);
if (!mm) { if (!mm) {
kfree(buffer); kfree(buffer);
RETURN(-EINVAL); return -EINVAL;
} }
/* Avoid deadlocks on mmap_sem if called from sys_mmap_pgoff(), /* Avoid deadlocks on mmap_sem if called from sys_mmap_pgoff(),
......
...@@ -51,31 +51,31 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg) ...@@ -51,31 +51,31 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
err = copy_from_user(buf, (void *)arg, sizeof(*hdr)); err = copy_from_user(buf, (void *)arg, sizeof(*hdr));
if (err) if (err)
RETURN(err); return err;
if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) { if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) {
CERROR("PORTALS: version mismatch kernel vs application\n"); CERROR("PORTALS: version mismatch kernel vs application\n");
RETURN(-EINVAL); return -EINVAL;
} }
if (hdr->ioc_len + buf >= end) { if (hdr->ioc_len + buf >= end) {
CERROR("PORTALS: user buffer exceeds kernel buffer\n"); CERROR("PORTALS: user buffer exceeds kernel buffer\n");
RETURN(-EINVAL); return -EINVAL;
} }
if (hdr->ioc_len < sizeof(struct libcfs_ioctl_data)) { if (hdr->ioc_len < sizeof(struct libcfs_ioctl_data)) {
CERROR("PORTALS: user buffer too small for ioctl\n"); CERROR("PORTALS: user buffer too small for ioctl\n");
RETURN(-EINVAL); return -EINVAL;
} }
err = copy_from_user(buf, (void *)arg, hdr->ioc_len); err = copy_from_user(buf, (void *)arg, hdr->ioc_len);
if (err) if (err)
RETURN(err); return err;
if (libcfs_ioctl_is_invalid(data)) { if (libcfs_ioctl_is_invalid(data)) {
CERROR("PORTALS: ioctl not correctly formatted\n"); CERROR("PORTALS: ioctl not correctly formatted\n");
RETURN(-EINVAL); return -EINVAL;
} }
if (data->ioc_inllen1) if (data->ioc_inllen1)
...@@ -85,7 +85,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg) ...@@ -85,7 +85,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
data->ioc_inlbuf2 = &data->ioc_bulk[0] + data->ioc_inlbuf2 = &data->ioc_bulk[0] +
cfs_size_round(data->ioc_inllen1); cfs_size_round(data->ioc_inllen1);
RETURN(0); return 0;
} }
int libcfs_ioctl_popdata(void *arg, void *data, int size) int libcfs_ioctl_popdata(void *arg, void *data, int size)
......
...@@ -165,7 +165,7 @@ static int libcfs_psdev_open(unsigned long flags, void *args) ...@@ -165,7 +165,7 @@ static int libcfs_psdev_open(unsigned long flags, void *args)
} }
*(struct libcfs_device_userstate **)args = ldu; *(struct libcfs_device_userstate **)args = ldu;
RETURN(0); return 0;
} }
/* called when closing /dev/device */ /* called when closing /dev/device */
...@@ -180,7 +180,7 @@ static int libcfs_psdev_release(unsigned long flags, void *args) ...@@ -180,7 +180,7 @@ static int libcfs_psdev_release(unsigned long flags, void *args)
} }
module_put(THIS_MODULE); module_put(THIS_MODULE);
RETURN(0); return 0;
} }
static struct rw_semaphore ioctl_list_sem; static struct rw_semaphore ioctl_list_sem;
...@@ -224,7 +224,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd, ...@@ -224,7 +224,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
switch (cmd) { switch (cmd) {
case IOC_LIBCFS_CLEAR_DEBUG: case IOC_LIBCFS_CLEAR_DEBUG:
libcfs_debug_clear_buffer(); libcfs_debug_clear_buffer();
RETURN(0); return 0;
/* /*
* case IOC_LIBCFS_PANIC: * case IOC_LIBCFS_PANIC:
* Handled in arch/cfs_module.c * Handled in arch/cfs_module.c
...@@ -232,9 +232,9 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd, ...@@ -232,9 +232,9 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
case IOC_LIBCFS_MARK_DEBUG: case IOC_LIBCFS_MARK_DEBUG:
if (data->ioc_inlbuf1 == NULL || if (data->ioc_inlbuf1 == NULL ||
data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0') data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
RETURN(-EINVAL); return -EINVAL;
libcfs_debug_mark_buffer(data->ioc_inlbuf1); libcfs_debug_mark_buffer(data->ioc_inlbuf1);
RETURN(0); return 0;
#if LWT_SUPPORT #if LWT_SUPPORT
case IOC_LIBCFS_LWT_CONTROL: case IOC_LIBCFS_LWT_CONTROL:
err = lwt_control ((data->ioc_flags & 1) != 0, 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, ...@@ -298,7 +298,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
ping(data); ping(data);
symbol_put(kping_client); symbol_put(kping_client);
} }
RETURN(0); return 0;
} }
default: { default: {
...@@ -319,7 +319,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd, ...@@ -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) 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 ...@@ -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); LIBCFS_ALLOC_GFP(buf, 1024, GFP_IOFS);
if (buf == NULL) if (buf == NULL)
RETURN(-ENOMEM); return -ENOMEM;
/* 'cmd' and permissions get checked in our arch-specific caller */ /* 'cmd' and permissions get checked in our arch-specific caller */
if (libcfs_ioctl_getdata(buf, buf + 800, (void *)arg)) { 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 ...@@ -343,7 +343,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a
out: out:
LIBCFS_FREE(buf, 1024); LIBCFS_FREE(buf, 1024);
RETURN(err); return err;
} }
......
...@@ -793,15 +793,15 @@ cfs_parse_nidlist(char *str, int len, struct list_head *nidlist) ...@@ -793,15 +793,15 @@ cfs_parse_nidlist(char *str, int len, struct list_head *nidlist)
rc = cfs_gettok(&src, ' ', &res); rc = cfs_gettok(&src, ' ', &res);
if (rc == 0) { if (rc == 0) {
cfs_free_nidlist(nidlist); cfs_free_nidlist(nidlist);
RETURN(0); return 0;
} }
rc = parse_nidrange(&res, nidlist); rc = parse_nidrange(&res, nidlist);
if (rc == 0) { if (rc == 0) {
cfs_free_nidlist(nidlist); 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) ...@@ -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))) if (nr->nr_netnum != LNET_NETNUM(LNET_NIDNET(nid)))
continue; continue;
if (nr->nr_all) if (nr->nr_all)
RETURN(1); return 1;
list_for_each_entry(ar, &nr->nr_addrranges, ar_link) list_for_each_entry(ar, &nr->nr_addrranges, ar_link)
if (nr->nr_netstrfns->nf_match_addr(LNET_NIDADDR(nid), if (nr->nr_netstrfns->nf_match_addr(LNET_NIDADDR(nid),
&ar->ar_numaddr_ranges)) &ar->ar_numaddr_ranges))
RETURN(1); return 1;
} }
RETURN(0); return 0;
} }
......
...@@ -175,7 +175,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache, ...@@ -175,7 +175,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache,
new = alloc_entry(cache, key, args); new = alloc_entry(cache, key, args);
if (!new) { if (!new) {
CERROR("fail to alloc entry\n"); CERROR("fail to alloc entry\n");
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
} }
goto find_again; goto find_again;
} else { } else {
...@@ -265,7 +265,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache, ...@@ -265,7 +265,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache,
/* Now we know it's good */ /* Now we know it's good */
out: out:
spin_unlock(&cache->uc_lock); spin_unlock(&cache->uc_lock);
RETURN(entry); return entry;
} }
EXPORT_SYMBOL(upcall_cache_get_entry); EXPORT_SYMBOL(upcall_cache_get_entry);
...@@ -308,7 +308,7 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key, ...@@ -308,7 +308,7 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
cache->uc_name, key); cache->uc_name, key);
/* haven't found, it's possible */ /* haven't found, it's possible */
spin_unlock(&cache->uc_lock); spin_unlock(&cache->uc_lock);
RETURN(-EINVAL); return -EINVAL;
} }
if (err) { if (err) {
...@@ -350,7 +350,7 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key, ...@@ -350,7 +350,7 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
wake_up_all(&entry->ue_waitq); wake_up_all(&entry->ue_waitq);
put_entry(cache, entry); put_entry(cache, entry);
RETURN(rc); return rc;
} }
EXPORT_SYMBOL(upcall_cache_downcall); EXPORT_SYMBOL(upcall_cache_downcall);
...@@ -425,7 +425,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall, ...@@ -425,7 +425,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
LIBCFS_ALLOC(cache, sizeof(*cache)); LIBCFS_ALLOC(cache, sizeof(*cache));
if (!cache) if (!cache)
RETURN(ERR_PTR(-ENOMEM)); return ERR_PTR(-ENOMEM);
spin_lock_init(&cache->uc_lock); spin_lock_init(&cache->uc_lock);
rwlock_init(&cache->uc_upcall_rwlock); rwlock_init(&cache->uc_upcall_rwlock);
...@@ -438,7 +438,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall, ...@@ -438,7 +438,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
cache->uc_acquire_expire = 30; cache->uc_acquire_expire = 30;
cache->uc_ops = ops; cache->uc_ops = ops;
RETURN(cache); return cache;
} }
EXPORT_SYMBOL(upcall_cache_init); EXPORT_SYMBOL(upcall_cache_init);
......
...@@ -86,10 +86,10 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry, ...@@ -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) unsigned int len, const char *str, const struct qstr *name)
{ {
if (len != name->len) if (len != name->len)
RETURN(1); return 1;
if (memcmp(str, name->name, len)) if (memcmp(str, name->name, len))
RETURN(1); return 1;
CDEBUG(D_DENTRY, "found name %.*s(%p) flags %#x refc %d\n", CDEBUG(D_DENTRY, "found name %.*s(%p) flags %#x refc %d\n",
name->len, name->name, dentry, dentry->d_flags, name->len, name->name, dentry, dentry->d_flags,
...@@ -97,12 +97,12 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry, ...@@ -97,12 +97,12 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
/* mountpoint is always valid */ /* mountpoint is always valid */
if (d_mountpoint((struct dentry *)dentry)) if (d_mountpoint((struct dentry *)dentry))
RETURN(0); return 0;
if (d_lustre_invalid(dentry)) 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) static inline int return_if_equal(struct ldlm_lock *lock, void *data)
...@@ -128,16 +128,16 @@ static int find_cbdata(struct inode *inode) ...@@ -128,16 +128,16 @@ static int find_cbdata(struct inode *inode)
rc = md_find_cbdata(sbi->ll_md_exp, ll_inode2fid(inode), rc = md_find_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
return_if_equal, NULL); return_if_equal, NULL);
if (rc != 0) if (rc != 0)
RETURN(rc); return rc;
lsm = ccc_inode_lsm_get(inode); lsm = ccc_inode_lsm_get(inode);
if (lsm == NULL) if (lsm == NULL)
RETURN(rc); return rc;
rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL); rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
ccc_inode_lsm_put(inode, lsm); ccc_inode_lsm_put(inode, lsm);
RETURN(rc); return rc;
} }
/** /**
...@@ -172,8 +172,8 @@ static int ll_ddelete(const struct dentry *de) ...@@ -172,8 +172,8 @@ static int ll_ddelete(const struct dentry *de)
#endif #endif
if (d_lustre_invalid((struct dentry *)de)) if (d_lustre_invalid((struct dentry *)de))
RETURN(1); return 1;
RETURN(0); return 0;
} }
static int ll_set_dd(struct dentry *de) static int ll_set_dd(struct dentry *de)
...@@ -196,11 +196,11 @@ static int ll_set_dd(struct dentry *de) ...@@ -196,11 +196,11 @@ static int ll_set_dd(struct dentry *de)
OBD_FREE_PTR(lld); OBD_FREE_PTR(lld);
spin_unlock(&de->d_lock); spin_unlock(&de->d_lock);
} else { } else {
RETURN(-ENOMEM); return -ENOMEM;
} }
} }
RETURN(0); return 0;
} }
int ll_dops_init(struct dentry *de, int block, int init_sa) 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, ...@@ -304,14 +304,14 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
int rc = 0; int rc = 0;
if (!request) if (!request)
RETURN(0); return 0;
if (it_disposition(it, DISP_LOOKUP_NEG)) if (it_disposition(it, DISP_LOOKUP_NEG))
RETURN(-ENOENT); return -ENOENT;
rc = ll_prep_inode(&de->d_inode, request, NULL, it); 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) 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, ...@@ -368,10 +368,10 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
away this negative dentry and actually do the request to away this negative dentry and actually do the request to
kernel to create whatever needs to be created (if possible)*/ kernel to create whatever needs to be created (if possible)*/
if (it && (it->it_op & IT_CREAT)) if (it && (it->it_op & IT_CREAT))
RETURN(0); return 0;
if (d_lustre_invalid(de)) if (d_lustre_invalid(de))
RETURN(0); return 0;
ibits = MDS_INODELOCK_UPDATE; ibits = MDS_INODELOCK_UPDATE;
rc = ll_have_md_lock(parent, &ibits, LCK_MINMODE); rc = ll_have_md_lock(parent, &ibits, LCK_MINMODE);
...@@ -398,7 +398,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, ...@@ -398,7 +398,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
LASSERT(it); LASSERT(it);
if (it->it_op == IT_LOOKUP && !d_lustre_invalid(de)) if (it->it_op == IT_LOOKUP && !d_lustre_invalid(de))
RETURN(1); return 1;
if (it->it_op == IT_OPEN) { if (it->it_op == IT_OPEN) {
struct inode *inode = de->d_inode; struct inode *inode = de->d_inode;
...@@ -445,7 +445,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, ...@@ -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 if it would be, we'll reopen the open request to
MDS later during file open path */ MDS later during file open path */
mutex_unlock(&lli->lli_och_mutex); mutex_unlock(&lli->lli_och_mutex);
RETURN(1); return 1;
} else { } else {
mutex_unlock(&lli->lli_och_mutex); mutex_unlock(&lli->lli_och_mutex);
} }
...@@ -464,7 +464,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, ...@@ -464,7 +464,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
de->d_name.name, de->d_name.len, de->d_name.name, de->d_name.len,
0, LUSTRE_OPC_ANY, NULL); 0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data)) if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data)); return PTR_ERR(op_data);
if (!IS_POSIXACL(parent) || !exp_connect_umask(exp)) if (!IS_POSIXACL(parent) || !exp_connect_umask(exp))
it->it_create_mode &= ~current_umask(); it->it_create_mode &= ~current_umask();
...@@ -551,7 +551,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, ...@@ -551,7 +551,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
mark: mark:
if (it != NULL && it->it_op == IT_GETATTR && rc > 0) if (it != NULL && it->it_op == IT_GETATTR && rc > 0)
ll_statahead_mark(parent, de); ll_statahead_mark(parent, de);
RETURN(rc); return rc;
/* /*
* This part is here to combat evil-evil race in real_lookup on 2.6 * This part is here to combat evil-evil race in real_lookup on 2.6
...@@ -583,7 +583,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, ...@@ -583,7 +583,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
LUSTRE_OPC_CREATE : LUSTRE_OPC_CREATE :
LUSTRE_OPC_ANY), NULL); LUSTRE_OPC_ANY), NULL);
if (IS_ERR(op_data)) 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, rc = md_intent_lock(exp, op_data, NULL, 0, it, 0, &req,
ll_md_blocking_ast, 0); ll_md_blocking_ast, 0);
...@@ -630,7 +630,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags) ...@@ -630,7 +630,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
if (!(flags & (LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE)) && if (!(flags & (LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE)) &&
ll_need_statahead(parent, dentry) > 0) { ll_need_statahead(parent, dentry) > 0) {
if (flags & LOOKUP_RCU) if (flags & LOOKUP_RCU)
RETURN(-ECHILD); return -ECHILD;
if (dentry->d_inode == NULL) if (dentry->d_inode == NULL)
unplug = 1; unplug = 1;
...@@ -638,7 +638,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags) ...@@ -638,7 +638,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
ll_statahead_mark(parent, dentry); ll_statahead_mark(parent, dentry);
} }
RETURN(1); return 1;
} }
......
...@@ -589,7 +589,7 @@ int ll_dir_read(struct inode *inode, struct dir_context *ctx) ...@@ -589,7 +589,7 @@ int ll_dir_read(struct inode *inode, struct dir_context *ctx)
ctx->pos = pos; ctx->pos = pos;
ll_dir_chain_fini(&chain); ll_dir_chain_fini(&chain);
RETURN(rc); return rc;
} }
static int ll_readdir(struct file *filp, struct dir_context *ctx) static int ll_readdir(struct file *filp, struct dir_context *ctx)
...@@ -629,7 +629,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx) ...@@ -629,7 +629,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
if (!rc) if (!rc)
ll_stats_ops_tally(sbi, LPROC_LL_READDIR, 1); ll_stats_ops_tally(sbi, LPROC_LL_READDIR, 1);
RETURN(rc); return rc;
} }
int ll_send_mgc_param(struct obd_export *mgc, char *string) 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, ...@@ -716,7 +716,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
" %#08x != %#08x nor %#08x\n", " %#08x != %#08x nor %#08x\n",
lump->lmm_magic, LOV_USER_MAGIC_V1, lump->lmm_magic, LOV_USER_MAGIC_V1,
LOV_USER_MAGIC_V3); LOV_USER_MAGIC_V3);
RETURN(-EINVAL); return -EINVAL;
} }
} }
} else { } else {
...@@ -726,7 +726,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump, ...@@ -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, op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL); LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data)) 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)) if (lump != NULL && lump->lmm_magic == cpu_to_le32(LMV_USER_MAGIC))
op_data->op_cli_flags |= CLI_SET_MEA; op_data->op_cli_flags |= CLI_SET_MEA;
...@@ -782,7 +782,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump, ...@@ -782,7 +782,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
if (param != NULL) if (param != NULL)
OBD_FREE(param, MGS_PARAM_MAXLEN); OBD_FREE(param, MGS_PARAM_MAXLEN);
} }
RETURN(rc); return rc;
} }
int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp, 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, ...@@ -797,13 +797,13 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
rc = ll_get_max_mdsize(sbi, &lmmsize); rc = ll_get_max_mdsize(sbi, &lmmsize);
if (rc) if (rc)
RETURN(rc); return rc;
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL,
0, lmmsize, LUSTRE_OPC_ANY, 0, lmmsize, LUSTRE_OPC_ANY,
NULL); NULL);
if (IS_ERR(op_data)) 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; op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr(sbi->ll_md_exp, op_data, &req); rc = md_getattr(sbi->ll_md_exp, op_data, &req);
...@@ -867,7 +867,7 @@ int ll_get_mdt_idx(struct inode *inode) ...@@ -867,7 +867,7 @@ int ll_get_mdt_idx(struct inode *inode)
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0,
0, LUSTRE_OPC_ANY, NULL); 0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data)) if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data)); return PTR_ERR(op_data);
op_data->op_flags |= MF_GET_MDT_IDX; op_data->op_flags |= MF_GET_MDT_IDX;
rc = md_getattr(sbi->ll_md_exp, op_data, NULL); rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
...@@ -875,7 +875,7 @@ int ll_get_mdt_idx(struct inode *inode) ...@@ -875,7 +875,7 @@ int ll_get_mdt_idx(struct inode *inode)
ll_finish_md_op_data(op_data); ll_finish_md_op_data(op_data);
if (rc < 0) { if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc); CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
RETURN(rc); return rc;
} }
return mdtidx; return mdtidx;
} }
...@@ -945,7 +945,7 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy) ...@@ -945,7 +945,7 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk), rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
&hpk, NULL); &hpk, NULL);
RETURN(rc); return rc;
} }
/** /**
...@@ -1044,7 +1044,7 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy) ...@@ -1044,7 +1044,7 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk), rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
&hpk, NULL); &hpk, NULL);
RETURN(rc); return rc;
} }
...@@ -1082,7 +1082,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -1082,7 +1082,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
case Q_SETINFO: case Q_SETINFO:
if (!cfs_capable(CFS_CAP_SYS_ADMIN) || if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT) sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EPERM); return -EPERM;
break; break;
case Q_GETQUOTA: case Q_GETQUOTA:
if (((type == USRQUOTA && if (((type == USRQUOTA &&
...@@ -1091,25 +1091,25 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -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)))) && !in_egroup_p(make_kgid(&init_user_ns, id)))) &&
(!cfs_capable(CFS_CAP_SYS_ADMIN) || (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT)) sbi->ll_flags & LL_SBI_RMT_CLIENT))
RETURN(-EPERM); return -EPERM;
break; break;
case Q_GETINFO: case Q_GETINFO:
break; break;
default: default:
CERROR("unsupported quotactl op: %#x\n", cmd); CERROR("unsupported quotactl op: %#x\n", cmd);
RETURN(-ENOTTY); return -ENOTTY;
} }
if (valid != QC_GENERAL) { if (valid != QC_GENERAL) {
if (sbi->ll_flags & LL_SBI_RMT_CLIENT) if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
if (cmd == Q_GETINFO) if (cmd == Q_GETINFO)
qctl->qc_cmd = Q_GETOINFO; qctl->qc_cmd = Q_GETOINFO;
else if (cmd == Q_GETQUOTA) else if (cmd == Q_GETQUOTA)
qctl->qc_cmd = Q_GETOQUOTA; qctl->qc_cmd = Q_GETOQUOTA;
else else
RETURN(-EINVAL); return -EINVAL;
switch (valid) { switch (valid) {
case QC_MDTIDX: case QC_MDTIDX:
...@@ -1134,7 +1134,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -1134,7 +1134,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
} }
if (rc) if (rc)
RETURN(rc); return rc;
qctl->qc_cmd = cmd; qctl->qc_cmd = cmd;
} else { } else {
...@@ -1142,7 +1142,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -1142,7 +1142,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
OBD_ALLOC_PTR(oqctl); OBD_ALLOC_PTR(oqctl);
if (oqctl == NULL) if (oqctl == NULL)
RETURN(-ENOMEM); return -ENOMEM;
QCTL_COPY(oqctl, qctl); QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(sbi->ll_md_exp, oqctl); 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) ...@@ -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_quotactl(sbi->ll_md_exp, oqctl);
} }
OBD_FREE_PTR(oqctl); OBD_FREE_PTR(oqctl);
RETURN(rc); return rc;
} }
/* If QIF_SPACE is not set, client should collect the /* If QIF_SPACE is not set, client should collect the
* space usage from OSSs by itself */ * space usage from OSSs by itself */
...@@ -1199,7 +1199,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -1199,7 +1199,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
OBD_FREE_PTR(oqctl); OBD_FREE_PTR(oqctl);
} }
RETURN(rc); return rc;
} }
static char * static char *
...@@ -1244,10 +1244,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1244,10 +1244,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
switch(cmd) { switch(cmd) {
case FSFILT_IOC_GETFLAGS: case FSFILT_IOC_GETFLAGS:
case FSFILT_IOC_SETFLAGS: 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_OLD:
case FSFILT_IOC_GETVERSION: 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, /* We need to special case any other ioctls we want to handle,
* to send them to the MDS/OST as appropriate and to properly * to send them to the MDS/OST as appropriate and to properly
* network encode the arg field. * network encode the arg field.
...@@ -1259,10 +1259,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1259,10 +1259,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
mdtidx = ll_get_mdt_idx(inode); mdtidx = ll_get_mdt_idx(inode);
if (mdtidx < 0) if (mdtidx < 0)
RETURN(mdtidx); return mdtidx;
if (put_user((int)mdtidx, (int*)arg)) if (put_user((int)mdtidx, (int*)arg))
RETURN(-EFAULT); return -EFAULT;
return 0; return 0;
} }
...@@ -1275,7 +1275,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -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); rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
if (rc) if (rc)
RETURN(rc); return rc;
data = (void *)buf; data = (void *)buf;
filename = data->ioc_inlbuf1; filename = data->ioc_inlbuf1;
...@@ -1314,7 +1314,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1314,7 +1314,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = obd_ioctl_getdata(&buf, &len, (void *)arg); rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
if (rc) if (rc)
RETURN(rc); return rc;
data = (void *)buf; data = (void *)buf;
if (data->ioc_inlbuf1 == NULL || data->ioc_inlbuf2 == NULL || if (data->ioc_inlbuf1 == NULL || data->ioc_inlbuf2 == NULL ||
...@@ -1345,7 +1345,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1345,7 +1345,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = ll_dir_setdirstripe(inode, lum, filename); rc = ll_dir_setdirstripe(inode, lum, filename);
lmv_out_free: lmv_out_free:
obd_ioctl_freedata(buf, len); obd_ioctl_freedata(buf, len);
RETURN(rc); return rc;
} }
case LL_IOC_LOV_SETSTRIPE: { case LL_IOC_LOV_SETSTRIPE: {
...@@ -1361,11 +1361,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1361,11 +1361,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
sizeof(lumv3p->lmm_objects[0])); sizeof(lumv3p->lmm_objects[0]));
/* first try with v1 which is smaller than v3 */ /* first try with v1 which is smaller than v3 */
if (copy_from_user(lumv1, lumv1p, sizeof(*lumv1))) if (copy_from_user(lumv1, lumv1p, sizeof(*lumv1)))
RETURN(-EFAULT); return -EFAULT;
if ((lumv1->lmm_magic == LOV_USER_MAGIC_V3) ) { if ((lumv1->lmm_magic == LOV_USER_MAGIC_V3) ) {
if (copy_from_user(&lumv3, lumv3p, sizeof(lumv3))) if (copy_from_user(&lumv3, lumv3p, sizeof(lumv3)))
RETURN(-EFAULT); return -EFAULT;
} }
if (inode->i_sb->s_root == file->f_dentry) if (inode->i_sb->s_root == file->f_dentry)
...@@ -1374,7 +1374,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1374,7 +1374,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* in v1 and v3 cases lumv1 points to data */ /* in v1 and v3 cases lumv1 points to data */
rc = ll_dir_setstripe(inode, lumv1, set_default); rc = ll_dir_setstripe(inode, lumv1, set_default);
RETURN(rc); return rc;
} }
case LL_IOC_LMV_GETSTRIPE: { case LL_IOC_LMV_GETSTRIPE: {
struct lmv_user_md *lump = (struct lmv_user_md *)arg; struct lmv_user_md *lump = (struct lmv_user_md *)arg;
...@@ -1385,10 +1385,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1385,10 +1385,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
int mdtindex; int mdtindex;
if (copy_from_user(&lum, lump, sizeof(struct lmv_user_md))) if (copy_from_user(&lum, lump, sizeof(struct lmv_user_md)))
RETURN(-EFAULT); return -EFAULT;
if (lum.lum_magic != LMV_MAGIC_V1) if (lum.lum_magic != LMV_MAGIC_V1)
RETURN(-EINVAL); return -EINVAL;
lum_size = lmv_user_md_size(1, LMV_MAGIC_V1); lum_size = lmv_user_md_size(1, LMV_MAGIC_V1);
OBD_ALLOC(tmp, lum_size); OBD_ALLOC(tmp, lum_size);
...@@ -1411,7 +1411,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1411,7 +1411,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
free_lmv: free_lmv:
if (tmp) if (tmp)
OBD_FREE(tmp, lum_size); OBD_FREE(tmp, lum_size);
RETURN(rc); return rc;
} }
case LL_IOC_REMOVE_ENTRY: { case LL_IOC_REMOVE_ENTRY: {
char *filename = NULL; char *filename = NULL;
...@@ -1428,7 +1428,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1428,7 +1428,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
filename = ll_getname((const char *)arg); filename = ll_getname((const char *)arg);
if (IS_ERR(filename)) if (IS_ERR(filename))
RETURN(PTR_ERR(filename)); return PTR_ERR(filename);
namelen = strlen(filename); namelen = strlen(filename);
if (namelen < 1) if (namelen < 1)
...@@ -1438,12 +1438,12 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1438,12 +1438,12 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
out_rmdir: out_rmdir:
if (filename) if (filename)
ll_putname(filename); ll_putname(filename);
RETURN(rc); return rc;
} }
case LL_IOC_LOV_SWAP_LAYOUTS: case LL_IOC_LOV_SWAP_LAYOUTS:
RETURN(-EPERM); return -EPERM;
case LL_IOC_OBD_STATFS: 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_LOV_GETSTRIPE:
case LL_IOC_MDC_GETINFO: case LL_IOC_MDC_GETINFO:
case IOC_MDC_GETFILEINFO: case IOC_MDC_GETFILEINFO:
...@@ -1459,7 +1459,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1459,7 +1459,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
cmd == IOC_MDC_GETFILESTRIPE) { cmd == IOC_MDC_GETFILESTRIPE) {
filename = ll_getname((const char *)arg); filename = ll_getname((const char *)arg);
if (IS_ERR(filename)) if (IS_ERR(filename))
RETURN(PTR_ERR(filename)); return PTR_ERR(filename);
rc = ll_lov_getstripe_ea_info(inode, filename, &lmm, rc = ll_lov_getstripe_ea_info(inode, filename, &lmm,
&lmmsize, &request); &lmmsize, &request);
...@@ -1539,11 +1539,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1539,11 +1539,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = ll_get_max_mdsize(sbi, &lmmsize); rc = ll_get_max_mdsize(sbi, &lmmsize);
if (rc) if (rc)
RETURN(rc); return rc;
OBD_ALLOC_LARGE(lmm, lmmsize); OBD_ALLOC_LARGE(lmm, lmmsize);
if (lmm == NULL) if (lmm == NULL)
RETURN(-ENOMEM); return -ENOMEM;
if (copy_from_user(lmm, lum, lmmsize)) if (copy_from_user(lmm, lum, lmmsize))
GOTO(free_lmm, rc = -EFAULT); GOTO(free_lmm, rc = -EFAULT);
...@@ -1591,7 +1591,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1591,7 +1591,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return rc; return rc;
} }
case OBD_IOC_LLOG_CATINFO: { case OBD_IOC_LLOG_CATINFO: {
RETURN(-EOPNOTSUPP); return -EOPNOTSUPP;
} }
case OBD_IOC_QUOTACHECK: { case OBD_IOC_QUOTACHECK: {
struct obd_quotactl *oqctl; struct obd_quotactl *oqctl;
...@@ -1599,11 +1599,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1599,11 +1599,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (!cfs_capable(CFS_CAP_SYS_ADMIN) || if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT) sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EPERM); return -EPERM;
OBD_ALLOC_PTR(oqctl); OBD_ALLOC_PTR(oqctl);
if (!oqctl) if (!oqctl)
RETURN(-ENOMEM); return -ENOMEM;
oqctl->qc_type = arg; oqctl->qc_type = arg;
rc = obd_quotacheck(sbi->ll_md_exp, oqctl); rc = obd_quotacheck(sbi->ll_md_exp, oqctl);
if (rc < 0) { if (rc < 0) {
...@@ -1623,11 +1623,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1623,11 +1623,11 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (!cfs_capable(CFS_CAP_SYS_ADMIN) || if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT) sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EPERM); return -EPERM;
OBD_ALLOC_PTR(check); OBD_ALLOC_PTR(check);
if (!check) if (!check)
RETURN(-ENOMEM); return -ENOMEM;
rc = obd_iocontrol(cmd, sbi->ll_md_exp, 0, (void *)check, rc = obd_iocontrol(cmd, sbi->ll_md_exp, 0, (void *)check,
NULL); NULL);
...@@ -1650,7 +1650,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1650,7 +1650,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} }
out_poll: out_poll:
OBD_FREE_PTR(check); OBD_FREE_PTR(check);
RETURN(rc); return rc;
} }
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0)
case LL_IOC_QUOTACTL_18: { case LL_IOC_QUOTACTL_18: {
...@@ -1661,7 +1661,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1661,7 +1661,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_ALLOC_PTR(qctl_18); OBD_ALLOC_PTR(qctl_18);
if (!qctl_18) if (!qctl_18)
RETURN(-ENOMEM); return -ENOMEM;
OBD_ALLOC_PTR(qctl_20); OBD_ALLOC_PTR(qctl_20);
if (!qctl_20) if (!qctl_20)
...@@ -1701,7 +1701,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1701,7 +1701,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_FREE_PTR(qctl_20); OBD_FREE_PTR(qctl_20);
out_quotactl_18: out_quotactl_18:
OBD_FREE_PTR(qctl_18); OBD_FREE_PTR(qctl_18);
RETURN(rc); return rc;
} }
#else #else
#warning "remove old LL_IOC_QUOTACTL_18 compatibility code" #warning "remove old LL_IOC_QUOTACTL_18 compatibility code"
...@@ -1711,7 +1711,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1711,7 +1711,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_ALLOC_PTR(qctl); OBD_ALLOC_PTR(qctl);
if (!qctl) if (!qctl)
RETURN(-ENOMEM); return -ENOMEM;
if (copy_from_user(qctl, (void *)arg, sizeof(*qctl))) if (copy_from_user(qctl, (void *)arg, sizeof(*qctl)))
GOTO(out_quotactl, rc = -EFAULT); GOTO(out_quotactl, rc = -EFAULT);
...@@ -1723,13 +1723,13 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1723,13 +1723,13 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
out_quotactl: out_quotactl:
OBD_FREE_PTR(qctl); OBD_FREE_PTR(qctl);
RETURN(rc); return rc;
} }
case OBD_IOC_GETDTNAME: case OBD_IOC_GETDTNAME:
case OBD_IOC_GETMDNAME: case OBD_IOC_GETMDNAME:
RETURN(ll_get_obd_name(inode, cmd, arg)); return ll_get_obd_name(inode, cmd, arg);
case LL_IOC_FLUSHCTX: case LL_IOC_FLUSHCTX:
RETURN(ll_flush_ctx(inode)); return ll_flush_ctx(inode);
#ifdef CONFIG_FS_POSIX_ACL #ifdef CONFIG_FS_POSIX_ACL
case LL_IOC_RMTACL: { case LL_IOC_RMTACL: {
if (sbi->ll_flags & LL_SBI_RMT_CLIENT && if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
...@@ -1740,9 +1740,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1740,9 +1740,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = rct_add(&sbi->ll_rct, current_pid(), arg); rc = rct_add(&sbi->ll_rct, current_pid(), arg);
if (!rc) if (!rc)
fd->fd_flags |= LL_FILE_RMTACL; fd->fd_flags |= LL_FILE_RMTACL;
RETURN(rc); return rc;
} else } else
RETURN(0); return 0;
} }
#endif #endif
case LL_IOC_GETOBDCOUNT: { case LL_IOC_GETOBDCOUNT: {
...@@ -1750,7 +1750,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1750,7 +1750,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct obd_export *exp; struct obd_export *exp;
if (copy_from_user(&count, (int *)arg, sizeof(int))) if (copy_from_user(&count, (int *)arg, sizeof(int)))
RETURN(-EFAULT); return -EFAULT;
/* get ost count when count is zero, get mdt count otherwise */ /* get ost count when count is zero, get mdt count otherwise */
exp = count ? sbi->ll_md_exp : sbi->ll_dt_exp; exp = count ? sbi->ll_md_exp : sbi->ll_dt_exp;
...@@ -1759,41 +1759,41 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1759,41 +1759,41 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
KEY_TGT_COUNT, &vallen, &count, NULL); KEY_TGT_COUNT, &vallen, &count, NULL);
if (rc) { if (rc) {
CERROR("get target count failed: %d\n", rc); CERROR("get target count failed: %d\n", rc);
RETURN(rc); return rc;
} }
if (copy_to_user((int *)arg, &count, sizeof(int))) if (copy_to_user((int *)arg, &count, sizeof(int)))
RETURN(-EFAULT); return -EFAULT;
RETURN(0); return 0;
} }
case LL_IOC_PATH2FID: case LL_IOC_PATH2FID:
if (copy_to_user((void *)arg, ll_inode2fid(inode), if (copy_to_user((void *)arg, ll_inode2fid(inode),
sizeof(struct lu_fid))) sizeof(struct lu_fid)))
RETURN(-EFAULT); return -EFAULT;
RETURN(0); return 0;
case LL_IOC_GET_CONNECT_FLAGS: { 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_SEND:
case OBD_IOC_CHANGELOG_CLEAR: case OBD_IOC_CHANGELOG_CLEAR:
rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg, rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
sizeof(struct ioc_changelog)); sizeof(struct ioc_changelog));
RETURN(rc); return rc;
case OBD_IOC_FID2PATH: case OBD_IOC_FID2PATH:
RETURN(ll_fid2path(inode, (void *)arg)); return ll_fid2path(inode, (void *)arg);
case LL_IOC_HSM_REQUEST: { case LL_IOC_HSM_REQUEST: {
struct hsm_user_request *hur; struct hsm_user_request *hur;
int totalsize; int totalsize;
OBD_ALLOC_PTR(hur); OBD_ALLOC_PTR(hur);
if (hur == NULL) if (hur == NULL)
RETURN(-ENOMEM); return -ENOMEM;
/* We don't know the true size yet; copy the fixed-size part */ /* We don't know the true size yet; copy the fixed-size part */
if (copy_from_user(hur, (void *)arg, sizeof(*hur))) { if (copy_from_user(hur, (void *)arg, sizeof(*hur))) {
OBD_FREE_PTR(hur); OBD_FREE_PTR(hur);
RETURN(-EFAULT); return -EFAULT;
} }
/* Compute the whole struct size */ /* Compute the whole struct size */
...@@ -1801,12 +1801,12 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1801,12 +1801,12 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_FREE_PTR(hur); OBD_FREE_PTR(hur);
OBD_ALLOC_LARGE(hur, totalsize); OBD_ALLOC_LARGE(hur, totalsize);
if (hur == NULL) if (hur == NULL)
RETURN(-ENOMEM); return -ENOMEM;
/* Copy the whole struct */ /* Copy the whole struct */
if (copy_from_user(hur, (void *)arg, totalsize)) { if (copy_from_user(hur, (void *)arg, totalsize)) {
OBD_FREE_LARGE(hur, totalsize); OBD_FREE_LARGE(hur, totalsize);
RETURN(-EFAULT); return -EFAULT;
} }
rc = obd_iocontrol(cmd, ll_i2mdexp(inode), totalsize, rc = obd_iocontrol(cmd, ll_i2mdexp(inode), totalsize,
...@@ -1814,14 +1814,14 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1814,14 +1814,14 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_FREE_LARGE(hur, totalsize); OBD_FREE_LARGE(hur, totalsize);
RETURN(rc); return rc;
} }
case LL_IOC_HSM_PROGRESS: { case LL_IOC_HSM_PROGRESS: {
struct hsm_progress_kernel hpk; struct hsm_progress_kernel hpk;
struct hsm_progress hp; struct hsm_progress hp;
if (copy_from_user(&hp, (void *)arg, sizeof(hp))) if (copy_from_user(&hp, (void *)arg, sizeof(hp)))
RETURN(-EFAULT); return -EFAULT;
hpk.hpk_fid = hp.hp_fid; hpk.hpk_fid = hp.hp_fid;
hpk.hpk_cookie = hp.hp_cookie; hpk.hpk_cookie = hp.hp_cookie;
...@@ -1834,12 +1834,12 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1834,12 +1834,12 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
* reported to Lustre root */ * reported to Lustre root */
rc = obd_iocontrol(cmd, sbi->ll_md_exp, sizeof(hpk), &hpk, rc = obd_iocontrol(cmd, sbi->ll_md_exp, sizeof(hpk), &hpk,
NULL); NULL);
RETURN(rc); return rc;
} }
case LL_IOC_HSM_CT_START: case LL_IOC_HSM_CT_START:
rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg, rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
sizeof(struct lustre_kernelcomm)); sizeof(struct lustre_kernelcomm));
RETURN(rc); return rc;
case LL_IOC_HSM_COPY_START: { case LL_IOC_HSM_COPY_START: {
struct hsm_copy *copy; struct hsm_copy *copy;
...@@ -1847,10 +1847,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1847,10 +1847,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_ALLOC_PTR(copy); OBD_ALLOC_PTR(copy);
if (copy == NULL) if (copy == NULL)
RETURN(-ENOMEM); return -ENOMEM;
if (copy_from_user(copy, (char *)arg, sizeof(*copy))) { if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
OBD_FREE_PTR(copy); OBD_FREE_PTR(copy);
RETURN(-EFAULT); return -EFAULT;
} }
rc = ll_ioc_copy_start(inode->i_sb, copy); rc = ll_ioc_copy_start(inode->i_sb, copy);
...@@ -1858,7 +1858,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1858,7 +1858,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EFAULT; rc = -EFAULT;
OBD_FREE_PTR(copy); OBD_FREE_PTR(copy);
RETURN(rc); return rc;
} }
case LL_IOC_HSM_COPY_END: { case LL_IOC_HSM_COPY_END: {
struct hsm_copy *copy; struct hsm_copy *copy;
...@@ -1866,10 +1866,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1866,10 +1866,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
OBD_ALLOC_PTR(copy); OBD_ALLOC_PTR(copy);
if (copy == NULL) if (copy == NULL)
RETURN(-ENOMEM); return -ENOMEM;
if (copy_from_user(copy, (char *)arg, sizeof(*copy))) { if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
OBD_FREE_PTR(copy); OBD_FREE_PTR(copy);
RETURN(-EFAULT); return -EFAULT;
} }
rc = ll_ioc_copy_end(inode->i_sb, copy); rc = ll_ioc_copy_end(inode->i_sb, copy);
...@@ -1877,11 +1877,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1877,11 +1877,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EFAULT; rc = -EFAULT;
OBD_FREE_PTR(copy); OBD_FREE_PTR(copy);
RETURN(rc); return rc;
} }
default: default:
RETURN(obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL, return obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL, (void *)arg);
(void *)arg));
} }
} }
...@@ -1937,12 +1936,12 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin) ...@@ -1937,12 +1936,12 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
int ll_dir_open(struct inode *inode, struct file *file) 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) 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 = { struct file_operations ll_dir_operations = {
......
...@@ -279,7 +279,7 @@ static int capa_thread_main(void *unused) ...@@ -279,7 +279,7 @@ static int capa_thread_main(void *unused)
thread_set_flags(&ll_capa_thread, SVC_STOPPED); thread_set_flags(&ll_capa_thread, SVC_STOPPED);
wake_up(&ll_capa_thread.t_ctl_waitq); wake_up(&ll_capa_thread.t_ctl_waitq);
RETURN(0); return 0;
} }
void ll_capa_timer_callback(unsigned long unused) void ll_capa_timer_callback(unsigned long unused)
...@@ -297,12 +297,12 @@ int ll_capa_thread_start(void) ...@@ -297,12 +297,12 @@ int ll_capa_thread_start(void)
if (IS_ERR(task)) { if (IS_ERR(task)) {
CERROR("cannot start expired capa thread: rc %ld\n", CERROR("cannot start expired capa thread: rc %ld\n",
PTR_ERR(task)); PTR_ERR(task));
RETURN(PTR_ERR(task)); return PTR_ERR(task);
} }
wait_event(ll_capa_thread.t_ctl_waitq, wait_event(ll_capa_thread.t_ctl_waitq,
thread_is_running(&ll_capa_thread)); thread_is_running(&ll_capa_thread));
RETURN(0); return 0;
} }
void ll_capa_thread_stop(void) void ll_capa_thread_stop(void)
...@@ -320,7 +320,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc) ...@@ -320,7 +320,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
int found = 0; int found = 0;
if ((ll_i2sbi(inode)->ll_flags & LL_SBI_OSS_CAPA) == 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 || LASSERT(opc == CAPA_OPC_OSS_WRITE || opc == CAPA_OPC_OSS_RW ||
opc == CAPA_OPC_OSS_TRUNC); opc == CAPA_OPC_OSS_TRUNC);
...@@ -364,7 +364,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc) ...@@ -364,7 +364,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
} }
spin_unlock(&capa_lock); spin_unlock(&capa_lock);
RETURN(ocapa); return ocapa;
} }
EXPORT_SYMBOL(ll_osscapa_get); EXPORT_SYMBOL(ll_osscapa_get);
...@@ -376,7 +376,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode) ...@@ -376,7 +376,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
LASSERT(inode != NULL); LASSERT(inode != NULL);
if ((ll_i2sbi(inode)->ll_flags & LL_SBI_MDS_CAPA) == 0) if ((ll_i2sbi(inode)->ll_flags & LL_SBI_MDS_CAPA) == 0)
RETURN(NULL); return NULL;
spin_lock(&capa_lock); spin_lock(&capa_lock);
ocapa = capa_get(lli->lli_mds_capa); ocapa = capa_get(lli->lli_mds_capa);
...@@ -386,7 +386,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode) ...@@ -386,7 +386,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
atomic_set(&ll_capa_debug, 0); atomic_set(&ll_capa_debug, 0);
} }
RETURN(ocapa); return ocapa;
} }
static struct obd_capa *do_add_mds_capa(struct inode *inode, 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) ...@@ -554,7 +554,7 @@ int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa)
capa_put(ocapa); capa_put(ocapa);
iput(inode); iput(inode);
RETURN(rc); return rc;
} }
spin_lock(&ocapa->c_lock); spin_lock(&ocapa->c_lock);
......
...@@ -225,7 +225,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data) ...@@ -225,7 +225,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
OBDO_ALLOC(oa); OBDO_ALLOC(oa);
if (!oa) { if (!oa) {
CERROR("can't allocate memory for Size-on-MDS update.\n"); CERROR("can't allocate memory for Size-on-MDS update.\n");
RETURN(-ENOMEM); return -ENOMEM;
} }
old_flags = op_data->op_flags; old_flags = op_data->op_flags;
...@@ -255,7 +255,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data) ...@@ -255,7 +255,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
ptlrpc_req_finished(request); ptlrpc_req_finished(request);
OBDO_FREE(oa); OBDO_FREE(oa);
RETURN(rc); return rc;
} }
/** /**
...@@ -356,7 +356,7 @@ static int ll_close_thread(void *arg) ...@@ -356,7 +356,7 @@ static int ll_close_thread(void *arg)
CDEBUG(D_INFO, "ll_close exiting\n"); CDEBUG(D_INFO, "ll_close exiting\n");
complete(&lcq->lcq_comp); complete(&lcq->lcq_comp);
RETURN(0); return 0;
} }
int ll_close_thread_start(struct ll_close_queue **lcq_ret) int ll_close_thread_start(struct ll_close_queue **lcq_ret)
......
...@@ -81,7 +81,7 @@ static struct ll_sb_info *ll_init_sbi(void) ...@@ -81,7 +81,7 @@ static struct ll_sb_info *ll_init_sbi(void)
OBD_ALLOC(sbi, sizeof(*sbi)); OBD_ALLOC(sbi, sizeof(*sbi));
if (!sbi) if (!sbi)
RETURN(NULL); return NULL;
spin_lock_init(&sbi->ll_lock); spin_lock_init(&sbi->ll_lock);
mutex_init(&sbi->ll_lco.lco_lock); mutex_init(&sbi->ll_lco.lco_lock);
...@@ -139,7 +139,7 @@ static struct ll_sb_info *ll_init_sbi(void) ...@@ -139,7 +139,7 @@ static struct ll_sb_info *ll_init_sbi(void)
atomic_set(&sbi->ll_agl_total, 0); atomic_set(&sbi->ll_agl_total, 0);
sbi->ll_flags |= LL_SBI_AGL_ENABLED; sbi->ll_flags |= LL_SBI_AGL_ENABLED;
RETURN(sbi); return sbi;
} }
void ll_free_sbi(struct super_block *sb) 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, ...@@ -178,17 +178,17 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
obd = class_name2obd(md); obd = class_name2obd(md);
if (!obd) { if (!obd) {
CERROR("MD %s: not setup or attached\n", md); CERROR("MD %s: not setup or attached\n", md);
RETURN(-EINVAL); return -EINVAL;
} }
OBD_ALLOC_PTR(data); OBD_ALLOC_PTR(data);
if (data == NULL) if (data == NULL)
RETURN(-ENOMEM); return -ENOMEM;
OBD_ALLOC_PTR(osfs); OBD_ALLOC_PTR(osfs);
if (osfs == NULL) { if (osfs == NULL) {
OBD_FREE_PTR(data); OBD_FREE_PTR(data);
RETURN(-ENOMEM); return -ENOMEM;
} }
if (proc_lustre_fs_root) { if (proc_lustre_fs_root) {
...@@ -588,7 +588,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, ...@@ -588,7 +588,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
if (osfs != NULL) if (osfs != NULL)
OBD_FREE_PTR(osfs); OBD_FREE_PTR(osfs);
RETURN(err); return err;
out_root: out_root:
if (root) if (root)
iput(root); iput(root);
...@@ -624,7 +624,7 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize) ...@@ -624,7 +624,7 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
if (rc) if (rc)
CERROR("Get max mdsize error rc %d \n", rc); CERROR("Get max mdsize error rc %d \n", rc);
RETURN(rc); return rc;
} }
void ll_dump_inode(struct inode *inode) void ll_dump_inode(struct inode *inode)
...@@ -726,20 +726,20 @@ char *ll_read_opt(const char *opt, char *data) ...@@ -726,20 +726,20 @@ char *ll_read_opt(const char *opt, char *data)
CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data); CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
if (strncmp(opt, data, strlen(opt))) if (strncmp(opt, data, strlen(opt)))
RETURN(NULL); return NULL;
if ((value = strchr(data, '=')) == NULL) if ((value = strchr(data, '=')) == NULL)
RETURN(NULL); return NULL;
value++; value++;
OBD_ALLOC(retval, strlen(value) + 1); OBD_ALLOC(retval, strlen(value) + 1);
if (!retval) { if (!retval) {
CERROR("out of memory!\n"); CERROR("out of memory!\n");
RETURN(NULL); return NULL;
} }
memcpy(retval, value, strlen(value)+1); memcpy(retval, value, strlen(value)+1);
CDEBUG(D_SUPER, "Assigned option: %s, value %s\n", opt, retval); 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) 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) ...@@ -757,7 +757,7 @@ static int ll_options(char *options, int *flags)
char *s1 = options, *s2; char *s1 = options, *s2;
if (!options) if (!options)
RETURN(0); return 0;
CDEBUG(D_CONFIG, "Parsing opts %s\n", options); CDEBUG(D_CONFIG, "Parsing opts %s\n", options);
...@@ -880,7 +880,7 @@ static int ll_options(char *options, int *flags) ...@@ -880,7 +880,7 @@ static int ll_options(char *options, int *flags)
} }
LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n", LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n",
s1); s1);
RETURN(-EINVAL); return -EINVAL;
next: next:
/* Find next opt */ /* Find next opt */
...@@ -889,7 +889,7 @@ static int ll_options(char *options, int *flags) ...@@ -889,7 +889,7 @@ static int ll_options(char *options, int *flags)
break; break;
s1 = s2 + 1; s1 = s2 + 1;
} }
RETURN(0); return 0;
} }
void ll_lli_init(struct ll_inode_info *lli) void ll_lli_init(struct ll_inode_info *lli)
...@@ -971,7 +971,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) ...@@ -971,7 +971,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
OBD_ALLOC_PTR(cfg); OBD_ALLOC_PTR(cfg);
if (cfg == NULL) if (cfg == NULL)
RETURN(-ENOMEM); return -ENOMEM;
try_module_get(THIS_MODULE); try_module_get(THIS_MODULE);
...@@ -980,7 +980,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) ...@@ -980,7 +980,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
if (!sbi) { if (!sbi) {
module_put(THIS_MODULE); module_put(THIS_MODULE);
OBD_FREE_PTR(cfg); OBD_FREE_PTR(cfg);
RETURN(-ENOMEM); return -ENOMEM;
} }
err = ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags); err = ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags);
...@@ -1046,7 +1046,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) ...@@ -1046,7 +1046,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
LCONSOLE_WARN("Mounted %s\n", profilenm); LCONSOLE_WARN("Mounted %s\n", profilenm);
OBD_FREE_PTR(cfg); OBD_FREE_PTR(cfg);
RETURN(err); return err;
} /* ll_fill_super */ } /* ll_fill_super */
void ll_put_super(struct super_block *sb) 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, ...@@ -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, op_data = ll_prep_md_op_data(op_data, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL); LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data)) 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, rc = md_setattr(sbi->ll_md_exp, op_data, NULL, 0, NULL, 0,
&request, mod); &request, mod);
...@@ -1255,14 +1255,14 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data, ...@@ -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) { } else if (rc != -EPERM && rc != -EACCES && rc != -ETXTBSY) {
CERROR("md_setattr fails: rc = %d\n", rc); 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, rc = md_get_lustre_md(sbi->ll_md_exp, request, sbi->ll_dt_exp,
sbi->ll_md_exp, &md); sbi->ll_md_exp, &md);
if (rc) { if (rc) {
ptlrpc_req_finished(request); ptlrpc_req_finished(request);
RETURN(rc); return rc;
} }
ia_valid = op_data->op_attr.ia_valid; 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, ...@@ -1279,7 +1279,7 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
ll_update_inode(inode, &md); ll_update_inode(inode, &md);
ptlrpc_req_finished(request); ptlrpc_req_finished(request);
RETURN(rc); return rc;
} }
/* Close IO epoch and send Size-on-MDS attribute update. */ /* Close IO epoch and send Size-on-MDS attribute update. */
...@@ -1292,7 +1292,7 @@ static int ll_setattr_done_writing(struct inode *inode, ...@@ -1292,7 +1292,7 @@ static int ll_setattr_done_writing(struct inode *inode,
LASSERT(op_data != NULL); LASSERT(op_data != NULL);
if (!S_ISREG(inode->i_mode)) if (!S_ISREG(inode->i_mode))
RETURN(0); return 0;
CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n", CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n",
op_data->op_ioepoch, PFID(&lli->lli_fid)); op_data->op_ioepoch, PFID(&lli->lli_fid));
...@@ -1310,7 +1310,7 @@ static int ll_setattr_done_writing(struct inode *inode, ...@@ -1310,7 +1310,7 @@ static int ll_setattr_done_writing(struct inode *inode,
CERROR("inode %lu mdc truncate failed: rc = %d\n", CERROR("inode %lu mdc truncate failed: rc = %d\n",
inode->i_ino, rc); inode->i_ino, rc);
} }
RETURN(rc); return rc;
} }
static int ll_setattr_ost(struct inode *inode, struct iattr *attr) 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) ...@@ -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 */ /* Check new size against VFS/VM file size limit and rlimit */
rc = inode_newsize_ok(inode, attr->ia_size); rc = inode_newsize_ok(inode, attr->ia_size);
if (rc) if (rc)
RETURN(rc); return rc;
/* The maximum Lustre file size is variable, based on the /* The maximum Lustre file size is variable, based on the
* OST maximum object size and number of stripes. This * OST maximum object size and number of stripes. This
...@@ -1373,7 +1373,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr) ...@@ -1373,7 +1373,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
CDEBUG(D_INODE,"file "DFID" too large %llu > "LPU64"\n", CDEBUG(D_INODE,"file "DFID" too large %llu > "LPU64"\n",
PFID(&lli->lli_fid), attr->ia_size, PFID(&lli->lli_fid), attr->ia_size,
ll_file_maxbytes(inode)); ll_file_maxbytes(inode));
RETURN(-EFBIG); return -EFBIG;
} }
attr->ia_valid |= ATTR_MTIME | ATTR_CTIME; attr->ia_valid |= ATTR_MTIME | ATTR_CTIME;
...@@ -1383,7 +1383,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr) ...@@ -1383,7 +1383,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
if (attr->ia_valid & TIMES_SET_FLAGS) { if (attr->ia_valid & TIMES_SET_FLAGS) {
if ((!uid_eq(current_fsuid(), inode->i_uid)) && if ((!uid_eq(current_fsuid(), inode->i_uid)) &&
!cfs_capable(CFS_CAP_FOWNER)) !cfs_capable(CFS_CAP_FOWNER))
RETURN(-EPERM); return -EPERM;
} }
/* We mark all of the fields "set" so MDS/OST does not re-set them */ /* 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) ...@@ -1420,7 +1420,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
OBD_ALLOC_PTR(op_data); OBD_ALLOC_PTR(op_data);
if (op_data == NULL) if (op_data == NULL)
RETURN(-ENOMEM); return -ENOMEM;
if (!S_ISDIR(inode->i_mode)) { if (!S_ISDIR(inode->i_mode)) {
if (attr->ia_valid & ATTR_SIZE) if (attr->ia_valid & ATTR_SIZE)
...@@ -1521,7 +1521,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs, ...@@ -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); rc = obd_statfs(NULL, sbi->ll_md_exp, osfs, max_age, flags);
if (rc) { if (rc) {
CERROR("md_statfs fails: rc = %d\n", rc); CERROR("md_statfs fails: rc = %d\n", rc);
RETURN(rc); return rc;
} }
osfs->os_type = sb->s_magic; osfs->os_type = sb->s_magic;
...@@ -1535,7 +1535,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs, ...@@ -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); rc = obd_statfs_rqset(sbi->ll_dt_exp, &obd_osfs, max_age, flags);
if (rc) { if (rc) {
CERROR("obd_statfs fails: rc = %d\n", rc); CERROR("obd_statfs fails: rc = %d\n", rc);
RETURN(rc); return rc;
} }
CDEBUG(D_SUPER, "OSC blocks "LPU64"/"LPU64" objects "LPU64"/"LPU64"\n", 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, ...@@ -1557,7 +1557,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
osfs->os_ffree = obd_osfs.os_ffree; osfs->os_ffree = obd_osfs.os_ffree;
} }
RETURN(rc); return rc;
} }
int ll_statfs(struct dentry *de, struct kstatfs *sfs) int ll_statfs(struct dentry *de, struct kstatfs *sfs)
{ {
...@@ -1851,14 +1851,14 @@ int ll_iocontrol(struct inode *inode, struct file *file, ...@@ -1851,14 +1851,14 @@ int ll_iocontrol(struct inode *inode, struct file *file,
0, 0, LUSTRE_OPC_ANY, 0, 0, LUSTRE_OPC_ANY,
NULL); NULL);
if (IS_ERR(op_data)) if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data)); return PTR_ERR(op_data);
op_data->op_valid = OBD_MD_FLFLAGS; op_data->op_valid = OBD_MD_FLFLAGS;
rc = md_getattr(sbi->ll_md_exp, op_data, &req); rc = md_getattr(sbi->ll_md_exp, op_data, &req);
ll_finish_md_op_data(op_data); ll_finish_md_op_data(op_data);
if (rc) { if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino); 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); body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
...@@ -1867,7 +1867,7 @@ int ll_iocontrol(struct inode *inode, struct file *file, ...@@ -1867,7 +1867,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
ptlrpc_req_finished(req); ptlrpc_req_finished(req);
RETURN(put_user(flags, (int *)arg)); return put_user(flags, (int *)arg);
} }
case FSFILT_IOC_SETFLAGS: { case FSFILT_IOC_SETFLAGS: {
struct lov_stripe_md *lsm; struct lov_stripe_md *lsm;
...@@ -1875,12 +1875,12 @@ int ll_iocontrol(struct inode *inode, struct file *file, ...@@ -1875,12 +1875,12 @@ int ll_iocontrol(struct inode *inode, struct file *file,
struct md_op_data *op_data; struct md_op_data *op_data;
if (get_user(flags, (int *)arg)) if (get_user(flags, (int *)arg))
RETURN(-EFAULT); return -EFAULT;
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0, op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL); LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data)) 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; ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags = flags;
op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG; op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
...@@ -1889,20 +1889,20 @@ int ll_iocontrol(struct inode *inode, struct file *file, ...@@ -1889,20 +1889,20 @@ int ll_iocontrol(struct inode *inode, struct file *file,
ll_finish_md_op_data(op_data); ll_finish_md_op_data(op_data);
ptlrpc_req_finished(req); ptlrpc_req_finished(req);
if (rc) if (rc)
RETURN(rc); return rc;
inode->i_flags = ll_ext_to_inode_flags(flags); inode->i_flags = ll_ext_to_inode_flags(flags);
lsm = ccc_inode_lsm_get(inode); lsm = ccc_inode_lsm_get(inode);
if (!lsm_has_objects(lsm)) { if (!lsm_has_objects(lsm)) {
ccc_inode_lsm_put(inode, lsm); ccc_inode_lsm_put(inode, lsm);
RETURN(0); return 0;
} }
OBDO_ALLOC(oinfo.oi_oa); OBDO_ALLOC(oinfo.oi_oa);
if (!oinfo.oi_oa) { if (!oinfo.oi_oa) {
ccc_inode_lsm_put(inode, lsm); ccc_inode_lsm_put(inode, lsm);
RETURN(-ENOMEM); return -ENOMEM;
} }
oinfo.oi_md = lsm; oinfo.oi_md = lsm;
oinfo.oi_oa->o_oi = lsm->lsm_oi; oinfo.oi_oa->o_oi = lsm->lsm_oi;
...@@ -1919,13 +1919,13 @@ int ll_iocontrol(struct inode *inode, struct file *file, ...@@ -1919,13 +1919,13 @@ int ll_iocontrol(struct inode *inode, struct file *file,
if (rc && rc != -EPERM && rc != -EACCES) if (rc && rc != -EPERM && rc != -EACCES)
CERROR("osc_setattr_async fails: rc = %d\n", rc); CERROR("osc_setattr_async fails: rc = %d\n", rc);
RETURN(rc); return rc;
} }
default: default:
RETURN(-ENOSYS); return -ENOSYS;
} }
RETURN(0); return 0;
} }
int ll_flush_ctx(struct inode *inode) int ll_flush_ctx(struct inode *inode)
...@@ -2032,7 +2032,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, ...@@ -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, rc = md_get_lustre_md(sbi->ll_md_exp, req, sbi->ll_dt_exp,
sbi->ll_md_exp, &md); sbi->ll_md_exp, &md);
if (rc) if (rc)
RETURN(rc); return rc;
if (*inode) { if (*inode) {
ll_update_inode(*inode, &md); ll_update_inode(*inode, &md);
...@@ -2094,7 +2094,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, ...@@ -2094,7 +2094,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
if (md.lsm != NULL) if (md.lsm != NULL)
obd_free_memmd(sbi->ll_dt_exp, &md.lsm); obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
md_free_lustre_md(sbi->ll_md_exp, &md); md_free_lustre_md(sbi->ll_md_exp, &md);
RETURN(rc); return rc;
} }
int ll_obd_statfs(struct inode *inode, void *arg) int ll_obd_statfs(struct inode *inode, void *arg)
...@@ -2270,7 +2270,7 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry) ...@@ -2270,7 +2270,7 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry)
if (sbi->ll_flags & LL_SBI_USER_FID2PATH) if (sbi->ll_flags & LL_SBI_USER_FID2PATH)
seq_puts(seq, ",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) ...@@ -2286,16 +2286,16 @@ int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg)
else if (cmd == OBD_IOC_GETMDNAME) else if (cmd == OBD_IOC_GETMDNAME)
obd = class_exp2obd(sbi->ll_md_exp); obd = class_exp2obd(sbi->ll_md_exp);
else else
RETURN(-EINVAL); return -EINVAL;
if (!obd) if (!obd)
RETURN(-ENOENT); return -ENOENT;
if (copy_to_user((void *)arg, obd->obd_name, if (copy_to_user((void *)arg, obd->obd_name,
strlen(obd->obd_name) + 1)) strlen(obd->obd_name) + 1))
RETURN(-EFAULT); return -EFAULT;
RETURN(0); return 0;
} }
/** /**
......
...@@ -384,17 +384,17 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, const char *buffer, ...@@ -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); buffer = lprocfs_find_named_value(buffer, "max_cached_mb:", &count);
rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult); rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
if (rc) if (rc)
RETURN(rc); return rc;
if (pages_number < 0 || pages_number > totalram_pages) { if (pages_number < 0 || pages_number > totalram_pages) {
CERROR("%s: can't set max cache more than %lu MB\n", CERROR("%s: can't set max cache more than %lu MB\n",
ll_get_fsname(sb, NULL, 0), ll_get_fsname(sb, NULL, 0),
totalram_pages >> (20 - PAGE_CACHE_SHIFT)); totalram_pages >> (20 - PAGE_CACHE_SHIFT));
RETURN(-ERANGE); return -ERANGE;
} }
if (sbi->ll_dt_exp == NULL) if (sbi->ll_dt_exp == NULL)
RETURN(-ENODEV); return -ENODEV;
spin_lock(&sbi->ll_lock); spin_lock(&sbi->ll_lock);
diff = pages_number - cache->ccc_lru_max; diff = pages_number - cache->ccc_lru_max;
...@@ -878,7 +878,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, ...@@ -878,7 +878,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
if (IS_ERR(sbi->ll_proc_root)) { if (IS_ERR(sbi->ll_proc_root)) {
err = PTR_ERR(sbi->ll_proc_root); err = PTR_ERR(sbi->ll_proc_root);
sbi->ll_proc_root = NULL; sbi->ll_proc_root = NULL;
RETURN(err); return err;
} }
rc = lprocfs_seq_create(sbi->ll_proc_root, "dump_page_cache", 0444, rc = lprocfs_seq_create(sbi->ll_proc_root, "dump_page_cache", 0444,
...@@ -992,7 +992,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent, ...@@ -992,7 +992,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
lprocfs_free_stats(&sbi->ll_ra_stats); lprocfs_free_stats(&sbi->ll_ra_stats);
lprocfs_free_stats(&sbi->ll_stats); lprocfs_free_stats(&sbi->ll_stats);
} }
RETURN(err); return err;
} }
void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi)
......
...@@ -213,7 +213,7 @@ int cl_sb_init(struct super_block *sb) ...@@ -213,7 +213,7 @@ int cl_sb_init(struct super_block *sb)
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
} else } else
rc = PTR_ERR(env); rc = PTR_ERR(env);
RETURN(rc); return rc;
} }
int cl_sb_fini(struct super_block *sb) int cl_sb_fini(struct super_block *sb)
...@@ -246,7 +246,7 @@ 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). * automatically when last device is destroyed).
*/ */
lu_types_stop(); lu_types_stop();
RETURN(result); return result;
} }
/**************************************************************************** /****************************************************************************
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册