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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2013-08-03 10:35:28 +08:00
parent 23f14e79ac
commit 0a3bdb0071
144 changed files with 3136 additions and 3207 deletions

View File

@ -52,11 +52,11 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size));
if (ptr == NULL)
RETURN(ptr);
return ptr;
ptr->size = size;
RETURN (ptr);
return ptr;
}
#define CFS_FREE_BITMAP(ptr) OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))

View File

@ -80,20 +80,8 @@ static inline int __is_po2(unsigned long long val)
#define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \
((hexnum) >> 8 & 0xf))
/*
* Some (nomina odiosa sunt) platforms define NULL as naked 0. This confuses
* Lustre RETURN(NULL) macro.
*/
#if defined(NULL)
#undef NULL
#endif
#define NULL ((void *)0)
#define LUSTRE_SRV_LNET_PID LUSTRE_LNET_PID
#include <linux/list.h>
#ifndef cfs_for_each_possible_cpu

View File

@ -262,53 +262,6 @@ do { \
} while (0)
/*
* if rc == NULL, we need to code as RETURN((void *)NULL), otherwise
* there will be a warning in osx.
*/
#if defined(__GNUC__)
long libcfs_log_return(struct libcfs_debug_msg_data *, long rc);
#if BITS_PER_LONG > 32
#define RETURN(rc) \
do { \
if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL); \
return (typeof(rc))libcfs_log_return(&msgdata, \
(long)(rc)); \
} \
\
return (rc); \
} while (0)
#else /* BITS_PER_LONG == 32 */
/* We need an on-stack variable, because we cannot case a 32-bit pointer
* directly to (long long) without generating a complier warning/error, yet
* casting directly to (long) will truncate 64-bit return values. The log
* values will print as 32-bit values, but they always have been. LU-1436
*/
#define RETURN(rc) \
do { \
if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) { \
typeof(rc) __rc = (rc); \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL); \
libcfs_log_return(&msgdata, (long_ptr_t)__rc); \
return __rc; \
} \
\
return (rc); \
} while (0)
#endif /* BITS_PER_LONG > 32 */
#elif defined(_MSC_VER)
#define RETURN(rc) \
do { \
CDEBUG(D_TRACE, "Process leaving.\n"); \
return (rc); \
} while (0)
#else
# error "Unkown compiler"
#endif /* __GNUC__ */
extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format1, ...)
__attribute__ ((format (printf, 2, 3)));

View File

@ -380,7 +380,7 @@ ksocknal_receive (ksock_conn_t *conn)
}
ksocknal_connsock_decref(conn);
RETURN (rc);
return rc;
}
void

View File

@ -247,7 +247,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
/* must called with lnet_eq_wait_lock hold */
if (LNET_SEQ_GT(eq->eq_deq_seq, new_event->sequence))
RETURN(0);
return 0;
/* We've got a new event... */
*ev = *new_event;
@ -267,7 +267,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
}
eq->eq_deq_seq = new_event->sequence + 1;
RETURN(rc);
return rc;
}
/**
@ -404,7 +404,7 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
LASSERT (the_lnet.ln_refcount > 0);
if (neq < 1)
RETURN(-ENOENT);
return -ENOENT;
lnet_eq_wait_lock();
@ -414,14 +414,14 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
if (eq == NULL) {
lnet_eq_wait_unlock();
RETURN(-ENOENT);
return -ENOENT;
}
rc = lnet_eq_dequeue_event(eq, event);
if (rc != 0) {
lnet_eq_wait_unlock();
*which = i;
RETURN(rc);
return rc;
}
}
@ -441,5 +441,5 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
}
lnet_eq_wait_unlock();
RETURN(0);
return 0;
}

View File

@ -120,7 +120,7 @@ init_lnet(void)
rc = LNetInit();
if (rc != 0) {
CERROR("LNetInit: error %d\n", rc);
RETURN(rc);
return rc;
}
rc = libcfs_register_ioctl(&lnet_ioctl_handler);
@ -132,7 +132,7 @@ init_lnet(void)
(void) kthread_run(lnet_configure, NULL, "lnet_initd");
}
RETURN(0);
return 0;
}
void

View File

@ -67,7 +67,7 @@ static int seq_client_rpc(struct lu_client_seq *seq,
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_SEQ_QUERY,
LUSTRE_MDS_VERSION, SEQ_QUERY);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* Init operation code */
op = req_capsule_client_get(&req->rq_pill, &RMF_SEQ_OPC);
@ -153,14 +153,14 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
* setup (lcs_exp != NULL) */
if (seq->lcs_exp == NULL) {
mutex_unlock(&seq->lcs_mutex);
RETURN(-EINPROGRESS);
return -EINPROGRESS;
}
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_SUPER, "super");
}
mutex_unlock(&seq->lcs_mutex);
RETURN(rc);
return rc;
}
/* Request sequence-controller node to allocate new meta-sequence. */
@ -182,7 +182,7 @@ static int seq_client_alloc_meta(const struct lu_env *env,
} while (rc == -EINPROGRESS || rc == -EAGAIN);
}
RETURN(rc);
return rc;
}
/* Allocate new sequence for client. */
@ -198,7 +198,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
if (rc) {
CERROR("%s: Can't allocate new meta-sequence,"
"rc %d\n", seq->lcs_name, rc);
RETURN(rc);
return rc;
} else {
CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
seq->lcs_name, PRANGE(&seq->lcs_space));
@ -214,7 +214,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
CDEBUG(D_INFO, "%s: Allocated sequence ["LPX64"]\n", seq->lcs_name,
*seqnr);
RETURN(rc);
return rc;
}
static int seq_fid_alloc_prep(struct lu_client_seq *seq,
@ -333,7 +333,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
"rc %d\n", seq->lcs_name, rc);
seq_fid_alloc_fini(seq);
mutex_unlock(&seq->lcs_mutex);
RETURN(rc);
return rc;
}
CDEBUG(D_INFO, "%s: Switch to sequence "
@ -357,7 +357,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
mutex_unlock(&seq->lcs_mutex);
CDEBUG(D_INFO, "%s: Allocated FID "DFID"\n", seq->lcs_name, PFID(fid));
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(seq_client_alloc_fid);
@ -422,7 +422,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
CERROR("%s: LProcFS failed in seq-init\n",
seq->lcs_name);
rc = PTR_ERR(seq->lcs_proc_dir);
RETURN(rc);
return rc;
}
rc = lprocfs_add_vars(seq->lcs_proc_dir,
@ -433,7 +433,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
GOTO(out_cleanup, rc);
}
RETURN(0);
return 0;
out_cleanup:
seq_client_proc_fini(seq);
@ -479,7 +479,7 @@ int seq_client_init(struct lu_client_seq *seq,
rc = seq_client_proc_init(seq);
if (rc)
seq_client_fini(seq);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(seq_client_init);
@ -505,7 +505,7 @@ int client_fid_init(struct obd_device *obd,
OBD_ALLOC_PTR(cli->cl_seq);
if (cli->cl_seq == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
if (prefix == NULL)
@ -519,7 +519,7 @@ int client_fid_init(struct obd_device *obd,
if (rc)
GOTO(out_free_seq, rc);
RETURN(rc);
return rc;
out_free_seq:
OBD_FREE_PTR(cli->cl_seq);
cli->cl_seq = NULL;
@ -537,7 +537,7 @@ int client_fid_fini(struct obd_device *obd)
cli->cl_seq = NULL;
}
RETURN(0);
return 0;
}
EXPORT_SYMBOL(client_fid_fini);

View File

@ -72,9 +72,9 @@ lprocfs_fid_write_common(const char *buffer, unsigned long count,
(long long unsigned *)&tmp.lsr_start,
(long long unsigned *)&tmp.lsr_end);
if (rc != 2 || !range_is_sane(&tmp) || range_is_zero(&tmp))
RETURN(-EINVAL);
return -EINVAL;
*range = tmp;
RETURN(0);
return 0;
}
/* Client side procfs stuff */
@ -97,7 +97,7 @@ lprocfs_fid_space_seq_write(struct file *file, const char *buffer,
mutex_unlock(&seq->lcs_mutex);
RETURN(count);
return count;
}
static int
@ -112,7 +112,7 @@ lprocfs_fid_space_seq_show(struct seq_file *m, void *unused)
rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n", PRANGE(&seq->lcs_space));
mutex_unlock(&seq->lcs_mutex);
RETURN(rc);
return rc;
}
static ssize_t
@ -127,7 +127,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer,
rc = lprocfs_write_helper(buffer, count, &val);
if (rc)
RETURN(rc);
return rc;
mutex_lock(&seq->lcs_mutex);
if (seq->lcs_type == LUSTRE_SEQ_DATA)
@ -146,7 +146,7 @@ lprocfs_fid_width_seq_write(struct file *file, const char *buffer,
mutex_unlock(&seq->lcs_mutex);
RETURN(count);
return count;
}
static int
@ -161,7 +161,7 @@ lprocfs_fid_width_seq_show(struct seq_file *m, void *unused)
rc = seq_printf(m, LPU64"\n", seq->lcs_width);
mutex_unlock(&seq->lcs_mutex);
RETURN(rc);
return rc;
}
static int
@ -176,7 +176,7 @@ lprocfs_fid_fid_seq_show(struct seq_file *m, void *unused)
rc = seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
mutex_unlock(&seq->lcs_mutex);
RETURN(rc);
return rc;
}
static int
@ -194,7 +194,7 @@ lprocfs_fid_server_seq_show(struct seq_file *m, void *unused)
} else {
rc = seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
}
RETURN(rc);
return rc;
}
LPROC_SEQ_FOPS(lprocfs_fid_space);

View File

@ -72,7 +72,7 @@ struct fld_cache *fld_cache_init(const char *name,
OBD_ALLOC_PTR(cache);
if (cache == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
INIT_LIST_HEAD(&cache->fci_entries_head);
INIT_LIST_HEAD(&cache->fci_lru);
@ -92,7 +92,7 @@ struct fld_cache *fld_cache_init(const char *name,
CDEBUG(D_INFO, "%s: FLD cache - Size: %d, Threshold: %d\n",
cache->fci_name, cache_size, cache_threshold);
RETURN(cache);
return cache;
}
/**
@ -223,7 +223,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
LASSERT(cache != NULL);
if (cache->fci_cache_count < cache->fci_cache_size)
RETURN(0);
return 0;
curr = cache->fci_lru.prev;
@ -239,7 +239,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
CDEBUG(D_INFO, "%s: FLD cache - Shrunk by "
"%d entries\n", cache->fci_name, num);
RETURN(0);
return 0;
}
/**
@ -367,10 +367,10 @@ struct fld_cache_entry
OBD_ALLOC_PTR(f_new);
if (!f_new)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
f_new->fce_range = *range;
RETURN(f_new);
return f_new;
}
/**
@ -424,7 +424,7 @@ int fld_cache_insert_nolock(struct fld_cache *cache,
/* Add new entry to cache and lru list. */
fld_cache_entry_add(cache, f_new, prev);
out:
RETURN(0);
return 0;
}
int fld_cache_insert(struct fld_cache *cache,
@ -435,7 +435,7 @@ int fld_cache_insert(struct fld_cache *cache,
flde = fld_cache_entry_create(range);
if (IS_ERR(flde))
RETURN(PTR_ERR(flde));
return PTR_ERR(flde);
write_lock(&cache->fci_lock);
rc = fld_cache_insert_nolock(cache, flde);
@ -443,7 +443,7 @@ int fld_cache_insert(struct fld_cache *cache,
if (rc)
OBD_FREE_PTR(flde);
RETURN(rc);
return rc;
}
void fld_cache_delete_nolock(struct fld_cache *cache,
@ -495,7 +495,7 @@ struct fld_cache_entry
}
}
RETURN(got);
return got;
}
/**
@ -509,7 +509,7 @@ struct fld_cache_entry
read_lock(&cache->fci_lock);
got = fld_cache_entry_lookup_nolock(cache, range);
read_unlock(&cache->fci_lock);
RETURN(got);
return got;
}
/**
@ -539,9 +539,9 @@ int fld_cache_lookup(struct fld_cache *cache,
cache->fci_stat.fst_cache++;
read_unlock(&cache->fci_lock);
RETURN(0);
return 0;
}
}
read_unlock(&cache->fci_lock);
RETURN(-ENOENT);
return -ENOENT;
}

View File

@ -70,7 +70,7 @@ static int fld_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
client_obd_list_lock(&cli->cl_loi_list_lock);
rc = list_empty(&mcw->mcw_entry);
client_obd_list_unlock(&cli->cl_loi_list_lock);
RETURN(rc);
return rc;
};
static void fld_enter_request(struct client_obd *cli)
@ -137,7 +137,7 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq)
list_for_each_entry(target, &fld->lcf_targets, ft_chain) {
if (target->ft_idx == hash)
RETURN(target);
return target;
}
CERROR("%s: Can't find target by hash %d (seq "LPX64"). "
@ -161,7 +161,7 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq)
* LBUG() to catch this situation.
*/
LBUG();
RETURN(NULL);
return NULL;
}
struct lu_fld_hash fld_hash[] = {
@ -192,7 +192,7 @@ fld_client_get_target(struct lu_client_fld *fld, seqno_t seq)
target->ft_idx, seq);
}
RETURN(target);
return target;
}
/*
@ -214,7 +214,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
CERROR("%s: Attempt to add target %s (idx "LPU64") "
"on fly - skip it\n", fld->lcf_name, name,
tar->ft_idx);
RETURN(0);
return 0;
} else {
CDEBUG(D_INFO, "%s: Adding target %s (idx "
LPU64")\n", fld->lcf_name, name, tar->ft_idx);
@ -222,7 +222,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
OBD_ALLOC_PTR(target);
if (target == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
spin_lock(&fld->lcf_lock);
list_for_each_entry(tmp, &fld->lcf_targets, ft_chain) {
@ -231,7 +231,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
OBD_FREE_PTR(target);
CERROR("Target %s exists in FLD and known as %s:#"LPU64"\n",
name, fld_target_name(tmp), tmp->ft_idx);
RETURN(-EEXIST);
return -EEXIST;
}
}
@ -247,7 +247,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
fld->lcf_count++;
spin_unlock(&fld->lcf_lock);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(fld_client_add_target);
@ -268,11 +268,11 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)
class_export_put(target->ft_exp);
OBD_FREE_PTR(target);
RETURN(0);
return 0;
}
}
spin_unlock(&fld->lcf_lock);
RETURN(-ENOENT);
return -ENOENT;
}
EXPORT_SYMBOL(fld_client_del_target);
@ -291,7 +291,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
CERROR("%s: LProcFS failed in fld-init\n",
fld->lcf_name);
rc = PTR_ERR(fld->lcf_proc_dir);
RETURN(rc);
return rc;
}
rc = lprocfs_add_vars(fld->lcf_proc_dir,
@ -302,7 +302,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
GOTO(out_cleanup, rc);
}
RETURN(0);
return 0;
out_cleanup:
fld_client_proc_fini(fld);
@ -350,7 +350,7 @@ int fld_client_init(struct lu_client_fld *fld,
if (!hash_is_sane(hash)) {
CERROR("%s: Wrong hash function %#x\n",
fld->lcf_name, hash);
RETURN(-EINVAL);
return -EINVAL;
}
fld->lcf_count = 0;
@ -424,7 +424,7 @@ int fld_client_rpc(struct obd_export *exp,
req = ptlrpc_request_alloc_pack(imp, &RQF_FLD_QUERY, LUSTRE_MDS_VERSION,
FLD_QUERY);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
op = req_capsule_client_get(&req->rq_pill, &RMF_FLD_OPC);
*op = fld_op;
@ -471,7 +471,7 @@ int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds,
rc = fld_cache_lookup(fld->lcf_cache, seq, &res);
if (rc == 0) {
*mds = res.lsr_index;
RETURN(0);
return 0;
}
/* Can not find it in the cache */
@ -491,7 +491,7 @@ int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds,
fld_cache_insert(fld->lcf_cache, &res);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(fld_client_lookup);

View File

@ -71,7 +71,7 @@ fld_proc_targets_seq_show(struct seq_file *m, void *unused)
seq_printf(m, "%s\n", fld_target_name(target));
spin_unlock(&fld->lcf_lock);
RETURN(0);
return 0;
}
static int
@ -85,7 +85,7 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused)
seq_printf(m, "%s\n", fld->lcf_hash->fh_name);
spin_unlock(&fld->lcf_lock);
RETURN(0);
return 0;
}
static ssize_t
@ -117,7 +117,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer,
fld->lcf_name, hash->fh_name);
}
RETURN(count);
return count;
}
static ssize_t
@ -132,7 +132,7 @@ fld_proc_cache_flush_write(struct file *file, const char __user *buffer,
CDEBUG(D_INFO, "%s: Lookup cache is flushed\n", fld->lcf_name);
RETURN(count);
return count;
}
static int fld_proc_cache_flush_open(struct inode *inode, struct file *file)

View File

@ -216,7 +216,7 @@ static inline int lustre_cfg_len(__u32 bufcount, __u32 *buflens)
for (i = 0; i < bufcount; i++)
len += cfs_size_round(buflens[i]);
RETURN(cfs_size_round(len));
return cfs_size_round(len);
}
@ -232,7 +232,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount,
bufs->lcfg_buflen));
if (!lcfg)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
lcfg->lcfg_version = LUSTRE_CFG_VERSION;
lcfg->lcfg_command = cmd;
@ -243,7 +243,7 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i];
LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr);
}
RETURN(lcfg);
return lcfg;
}
static inline void lustre_cfg_free(struct lustre_cfg *lcfg)
@ -261,27 +261,27 @@ static inline int lustre_cfg_sanity_check(void *buf, int len)
struct lustre_cfg *lcfg = (struct lustre_cfg *)buf;
if (!lcfg)
RETURN(-EINVAL);
return -EINVAL;
/* check that the first bits of the struct are valid */
if (len < LCFG_HDR_SIZE(0))
RETURN(-EINVAL);
return -EINVAL;
if (lcfg->lcfg_version != LUSTRE_CFG_VERSION)
RETURN(-EINVAL);
return -EINVAL;
if (lcfg->lcfg_bufcount >= LUSTRE_CFG_MAX_BUFCOUNT)
RETURN(-EINVAL);
return -EINVAL;
/* check that the buflens are valid */
if (len < LCFG_HDR_SIZE(lcfg->lcfg_bufcount))
RETURN(-EINVAL);
return -EINVAL;
/* make sure all the pointers point inside the data */
if (len < lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens))
RETURN(-EINVAL);
return -EINVAL;
RETURN(0);
return 0;
}
#include <lustre/lustre_user.h>

View File

@ -677,14 +677,14 @@ static inline __u64 fid_flatten(const struct lu_fid *fid)
if (fid_is_igif(fid)) {
ino = lu_igif_ino(fid);
RETURN(ino);
return ino;
}
seq = fid_seq(fid);
ino = (seq << 24) + ((seq >> 24) & 0xffffff0000ULL) + fid_oid(fid);
RETURN(ino ? ino : fid_oid(fid));
return ino ? ino : fid_oid(fid);
}
static inline __u32 fid_hash(const struct lu_fid *f, int bits)
@ -703,7 +703,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid)
if (fid_is_igif(fid)) {
ino = lu_igif_ino(fid);
RETURN(ino);
return ino;
}
seq = fid_seq(fid) - FID_SEQ_START;
@ -717,7 +717,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid)
(seq >> (64 - (40-8)) & 0xffffff00) +
(fid_oid(fid) & 0xff000fff) + ((fid_oid(fid) & 0x00fff000) << 8);
RETURN(ino ? ino : fid_oid(fid));
return ino ? ino : fid_oid(fid);
}
static inline int lu_fid_diff(struct lu_fid *fid1, struct lu_fid *fid2)

View File

@ -471,12 +471,12 @@ static inline int llog_destroy(const struct lu_env *env,
rc = llog_handle2ops(handle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_destroy == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = lop->lop_destroy(env, handle);
RETURN(rc);
return rc;
}
static inline int llog_next_block(const struct lu_env *env,
@ -489,13 +489,13 @@ static inline int llog_next_block(const struct lu_env *env,
rc = llog_handle2ops(loghandle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_next_block == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = lop->lop_next_block(env, loghandle, cur_idx, next_idx,
cur_offset, buf, len);
RETURN(rc);
return rc;
}
static inline int llog_prev_block(const struct lu_env *env,
@ -507,12 +507,12 @@ static inline int llog_prev_block(const struct lu_env *env,
rc = llog_handle2ops(loghandle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_prev_block == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = lop->lop_prev_block(env, loghandle, prev_idx, buf, len);
RETURN(rc);
return rc;
}
static inline int llog_connect(struct llog_ctxt *ctxt,
@ -524,12 +524,12 @@ static inline int llog_connect(struct llog_ctxt *ctxt,
rc = llog_obd2ops(ctxt, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_connect == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = lop->lop_connect(ctxt, logid, gen, uuid);
RETURN(rc);
return rc;
}
/* llog.c */

View File

@ -326,7 +326,7 @@ void obdo_le_to_cpu(struct obdo *dobdo, struct obdo *sobdo);
do { \
if (!(obd)) { \
CERROR("NULL device\n"); \
RETURN(-ENODEV); \
return -ENODEV; \
} \
} while (0)
@ -337,7 +337,7 @@ do { \
if (!(obd)->obd_set_up || (obd)->obd_stopping) { \
CERROR("Device %d not setup\n", \
(obd)->obd_minor); \
RETURN(-ENODEV); \
return -ENODEV; \
} \
} while (0)
@ -424,7 +424,7 @@ do { \
if (err) \
CERROR("md_" #op ": dev %s/%d no operation\n", \
obd->obd_name, obd->obd_minor); \
RETURN(err); \
return err; \
} \
} while (0)
@ -432,17 +432,17 @@ do { \
do { \
if ((exp) == NULL) { \
CERROR("obd_" #op ": NULL export\n"); \
RETURN(-ENODEV); \
return -ENODEV; \
} \
if ((exp)->exp_obd == NULL || !OBT((exp)->exp_obd)) { \
CERROR("obd_" #op ": cleaned up obd\n"); \
RETURN(-EOPNOTSUPP); \
return -EOPNOTSUPP; \
} \
if (!OBT((exp)->exp_obd) || !MDP((exp)->exp_obd, op)) { \
CERROR("obd_" #op ": dev %s/%d no operation\n", \
(exp)->exp_obd->obd_name, \
(exp)->exp_obd->obd_minor); \
RETURN(-EOPNOTSUPP); \
return -EOPNOTSUPP; \
} \
} while (0)
@ -453,7 +453,7 @@ do { \
if (err) \
CERROR("obd_" #op ": dev %d no operation\n", \
obd->obd_minor); \
RETURN(err); \
return err; \
} \
} while (0)
@ -461,16 +461,16 @@ do { \
do { \
if ((exp) == NULL) { \
CERROR("obd_" #op ": NULL export\n"); \
RETURN(-ENODEV); \
return -ENODEV; \
} \
if ((exp)->exp_obd == NULL || !OBT((exp)->exp_obd)) { \
CERROR("obd_" #op ": cleaned up obd\n"); \
RETURN(-EOPNOTSUPP); \
return -EOPNOTSUPP; \
} \
if (!OBT((exp)->exp_obd) || !OBP((exp)->exp_obd, op)) { \
CERROR("obd_" #op ": dev %d no operation\n", \
(exp)->exp_obd->obd_minor); \
RETURN(-EOPNOTSUPP); \
return -EOPNOTSUPP; \
} \
} while (0)
@ -480,7 +480,7 @@ do { \
if (err) \
CERROR("lop_" #op ": dev %d no operation\n", \
ctxt->loc_obd->obd_minor); \
RETURN(err); \
return err; \
} \
} while (0)
@ -501,7 +501,7 @@ static inline int obd_get_info(const struct lu_env *env,
rc = OBP(exp->exp_obd, get_info)(env, exp, keylen, key, vallen, val,
lsm);
RETURN(rc);
return rc;
}
static inline int obd_set_info_async(const struct lu_env *env,
@ -516,7 +516,7 @@ static inline int obd_set_info_async(const struct lu_env *env,
rc = OBP(exp->exp_obd, set_info_async)(env, exp, keylen, key, vallen,
val, set);
RETURN(rc);
return rc;
}
/*
@ -574,7 +574,7 @@ static inline int obd_setup(struct obd_device *obd, struct lustre_cfg *cfg)
OBD_COUNTER_INCREMENT(obd, setup);
rc = OBP(obd, setup)(obd, cfg);
}
RETURN(rc);
return rc;
}
static inline int obd_precleanup(struct obd_device *obd,
@ -601,7 +601,7 @@ static inline int obd_precleanup(struct obd_device *obd,
OBD_COUNTER_INCREMENT(obd, precleanup);
rc = OBP(obd, precleanup)(obd, cleanup_stage);
RETURN(rc);
return rc;
}
static inline int obd_cleanup(struct obd_device *obd)
@ -627,7 +627,7 @@ static inline int obd_cleanup(struct obd_device *obd)
OBD_COUNTER_INCREMENT(obd, cleanup);
rc = OBP(obd, cleanup)(obd);
RETURN(rc);
return rc;
}
static inline void obd_cleanup_client_import(struct obd_device *obd)
@ -677,7 +677,7 @@ obd_process_config(struct obd_device *obd, int datalen, void *data)
OBD_COUNTER_INCREMENT(obd, process_config);
obd->obd_process_conf = 0;
RETURN(rc);
return rc;
}
/* Pack an in-memory MD struct for storage on disk.
@ -697,7 +697,7 @@ static inline int obd_packmd(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, packmd);
rc = OBP(exp->exp_obd, packmd)(exp, disk_tgt, mem_src);
RETURN(rc);
return rc;
}
static inline int obd_size_diskmd(struct obd_export *exp,
@ -751,7 +751,7 @@ static inline int obd_unpackmd(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, unpackmd);
rc = OBP(exp->exp_obd, unpackmd)(exp, mem_tgt, disk_src, disk_len);
RETURN(rc);
return rc;
}
/* helper functions */
@ -783,7 +783,7 @@ static inline int obd_precreate(struct obd_export *exp)
OBD_COUNTER_INCREMENT(exp->exp_obd, precreate);
rc = OBP(exp->exp_obd, precreate)(exp);
RETURN(rc);
return rc;
}
static inline int obd_create_async(struct obd_export *exp,
@ -797,7 +797,7 @@ static inline int obd_create_async(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, create_async);
rc = OBP(exp->exp_obd, create_async)(exp, oinfo, ea, oti);
RETURN(rc);
return rc;
}
static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
@ -810,7 +810,7 @@ static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, create);
rc = OBP(exp->exp_obd, create)(env, exp, obdo, ea, oti);
RETURN(rc);
return rc;
}
static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
@ -824,7 +824,7 @@ static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, destroy);
rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, ea, oti, md_exp, capa);
RETURN(rc);
return rc;
}
static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
@ -836,7 +836,7 @@ static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, getattr);
rc = OBP(exp->exp_obd, getattr)(env, exp, oinfo);
RETURN(rc);
return rc;
}
static inline int obd_getattr_async(struct obd_export *exp,
@ -849,7 +849,7 @@ static inline int obd_getattr_async(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, getattr_async);
rc = OBP(exp->exp_obd, getattr_async)(exp, oinfo, set);
RETURN(rc);
return rc;
}
static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
@ -862,7 +862,7 @@ static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, setattr);
rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo, oti);
RETURN(rc);
return rc;
}
/* This performs all the requests set init/wait/destroy actions. */
@ -878,13 +878,13 @@ static inline int obd_setattr_rqset(struct obd_export *exp,
set = ptlrpc_prep_set();
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
rc = OBP(exp->exp_obd, setattr_async)(exp, oinfo, oti, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
return rc;
}
/* This adds all the requests into @set if @set != NULL, otherwise
@ -900,7 +900,7 @@ static inline int obd_setattr_async(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, setattr_async);
rc = OBP(exp->exp_obd, setattr_async)(exp, oinfo, oti, set);
RETURN(rc);
return rc;
}
static inline int obd_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
@ -914,7 +914,7 @@ static inline int obd_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
OBD_COUNTER_INCREMENT(obd, add_conn);
rc = OBP(obd, add_conn)(imp, uuid, priority);
RETURN(rc);
return rc;
}
static inline int obd_del_conn(struct obd_import *imp, struct obd_uuid *uuid)
@ -927,7 +927,7 @@ static inline int obd_del_conn(struct obd_import *imp, struct obd_uuid *uuid)
OBD_COUNTER_INCREMENT(obd, del_conn);
rc = OBP(obd, del_conn)(imp, uuid);
RETURN(rc);
return rc;
}
static inline struct obd_uuid *obd_get_uuid(struct obd_export *exp)
@ -938,7 +938,7 @@ static inline struct obd_uuid *obd_get_uuid(struct obd_export *exp)
EXP_COUNTER_INCREMENT(exp, get_uuid);
uuid = OBP(exp->exp_obd, get_uuid)(exp);
RETURN(uuid);
return uuid;
}
/** Create a new /a exp on device /a obd for the uuid /a cluuid
@ -964,7 +964,7 @@ static inline int obd_connect(const struct lu_env *env,
/* check that only subset is granted */
LASSERT(ergo(data != NULL, (data->ocd_connect_flags & ocf) ==
data->ocd_connect_flags));
RETURN(rc);
return rc;
}
static inline int obd_reconnect(const struct lu_env *env,
@ -986,7 +986,7 @@ static inline int obd_reconnect(const struct lu_env *env,
/* check that only subset is granted */
LASSERT(ergo(d != NULL,
(d->ocd_connect_flags & ocf) == d->ocd_connect_flags));
RETURN(rc);
return rc;
}
static inline int obd_disconnect(struct obd_export *exp)
@ -997,7 +997,7 @@ static inline int obd_disconnect(struct obd_export *exp)
EXP_COUNTER_INCREMENT(exp, disconnect);
rc = OBP(exp->exp_obd, disconnect)(exp);
RETURN(rc);
return rc;
}
static inline int obd_fid_init(struct obd_device *obd, struct obd_export *exp,
@ -1009,7 +1009,7 @@ static inline int obd_fid_init(struct obd_device *obd, struct obd_export *exp,
OBD_COUNTER_INCREMENT(obd, fid_init);
rc = OBP(obd, fid_init)(obd, exp, type);
RETURN(rc);
return rc;
}
static inline int obd_fid_fini(struct obd_device *obd)
@ -1020,7 +1020,7 @@ static inline int obd_fid_fini(struct obd_device *obd)
OBD_COUNTER_INCREMENT(obd, fid_fini);
rc = OBP(obd, fid_fini)(obd);
RETURN(rc);
return rc;
}
static inline int obd_fid_alloc(struct obd_export *exp,
@ -1033,7 +1033,7 @@ static inline int obd_fid_alloc(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, fid_alloc);
rc = OBP(exp->exp_obd, fid_alloc)(exp, fid, op_data);
RETURN(rc);
return rc;
}
static inline int obd_ping(const struct lu_env *env, struct obd_export *exp)
@ -1044,7 +1044,7 @@ static inline int obd_ping(const struct lu_env *env, struct obd_export *exp)
EXP_COUNTER_INCREMENT(exp, ping);
rc = OBP(exp->exp_obd, ping)(env, exp);
RETURN(rc);
return rc;
}
static inline int obd_pool_new(struct obd_device *obd, char *poolname)
@ -1055,7 +1055,7 @@ static inline int obd_pool_new(struct obd_device *obd, char *poolname)
OBD_COUNTER_INCREMENT(obd, pool_new);
rc = OBP(obd, pool_new)(obd, poolname);
RETURN(rc);
return rc;
}
static inline int obd_pool_del(struct obd_device *obd, char *poolname)
@ -1066,7 +1066,7 @@ static inline int obd_pool_del(struct obd_device *obd, char *poolname)
OBD_COUNTER_INCREMENT(obd, pool_del);
rc = OBP(obd, pool_del)(obd, poolname);
RETURN(rc);
return rc;
}
static inline int obd_pool_add(struct obd_device *obd, char *poolname, char *ostname)
@ -1077,7 +1077,7 @@ static inline int obd_pool_add(struct obd_device *obd, char *poolname, char *ost
OBD_COUNTER_INCREMENT(obd, pool_add);
rc = OBP(obd, pool_add)(obd, poolname, ostname);
RETURN(rc);
return rc;
}
static inline int obd_pool_rem(struct obd_device *obd, char *poolname, char *ostname)
@ -1088,7 +1088,7 @@ static inline int obd_pool_rem(struct obd_device *obd, char *poolname, char *ost
OBD_COUNTER_INCREMENT(obd, pool_rem);
rc = OBP(obd, pool_rem)(obd, poolname, ostname);
RETURN(rc);
return rc;
}
static inline void obd_getref(struct obd_device *obd)
@ -1114,7 +1114,7 @@ static inline int obd_init_export(struct obd_export *exp)
if ((exp)->exp_obd != NULL && OBT((exp)->exp_obd) &&
OBP((exp)->exp_obd, init_export))
rc = OBP(exp->exp_obd, init_export)(exp);
RETURN(rc);
return rc;
}
static inline int obd_destroy_export(struct obd_export *exp)
@ -1122,7 +1122,7 @@ static inline int obd_destroy_export(struct obd_export *exp)
if ((exp)->exp_obd != NULL && OBT((exp)->exp_obd) &&
OBP((exp)->exp_obd, destroy_export))
OBP(exp->exp_obd, destroy_export)(exp);
RETURN(0);
return 0;
}
static inline int obd_extent_calc(struct obd_export *exp,
@ -1133,7 +1133,7 @@ static inline int obd_extent_calc(struct obd_export *exp,
EXP_CHECK_DT_OP(exp, extent_calc);
rc = OBP(exp->exp_obd, extent_calc)(exp, md, cmd, offset);
RETURN(rc);
return rc;
}
static inline struct dentry *
@ -1158,7 +1158,7 @@ static inline int obd_statfs_async(struct obd_export *exp,
struct obd_device *obd;
if (exp == NULL || exp->exp_obd == NULL)
RETURN(-EINVAL);
return -EINVAL;
obd = exp->exp_obd;
OBD_CHECK_DT_OP(obd, statfs, -EOPNOTSUPP);
@ -1181,7 +1181,7 @@ static inline int obd_statfs_async(struct obd_export *exp,
if (oinfo->oi_cb_up)
oinfo->oi_cb_up(oinfo, 0);
}
RETURN(rc);
return rc;
}
static inline int obd_statfs_rqset(struct obd_export *exp,
@ -1194,7 +1194,7 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
set = ptlrpc_prep_set();
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
oinfo.oi_osfs = osfs;
oinfo.oi_flags = flags;
@ -1202,7 +1202,7 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
return rc;
}
/* @max_age is the oldest time in jiffies that we accept using a cached data.
@ -1216,7 +1216,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
struct obd_device *obd = exp->exp_obd;
if (obd == NULL)
RETURN(-EINVAL);
return -EINVAL;
OBD_CHECK_DT_OP(obd, statfs, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(obd, statfs);
@ -1241,7 +1241,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
memcpy(osfs, &obd->obd_osfs, sizeof(*osfs));
spin_unlock(&obd->obd_osfs_lock);
}
RETURN(rc);
return rc;
}
static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo,
@ -1255,13 +1255,13 @@ static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo,
set = ptlrpc_prep_set();
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
rc = OBP(exp->exp_obd, sync)(NULL, exp, oinfo, start, end, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
return rc;
}
static inline int obd_sync(const struct lu_env *env, struct obd_export *exp,
@ -1274,7 +1274,7 @@ static inline int obd_sync(const struct lu_env *env, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, sync);
rc = OBP(exp->exp_obd, sync)(env, exp, oinfo, start, end, set);
RETURN(rc);
return rc;
}
static inline int obd_punch_rqset(struct obd_export *exp,
@ -1289,13 +1289,13 @@ static inline int obd_punch_rqset(struct obd_export *exp,
set = ptlrpc_prep_set();
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
rc = OBP(exp->exp_obd, punch)(NULL, exp, oinfo, oti, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
return rc;
}
static inline int obd_punch(const struct lu_env *env, struct obd_export *exp,
@ -1308,7 +1308,7 @@ static inline int obd_punch(const struct lu_env *env, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, punch);
rc = OBP(exp->exp_obd, punch)(env, exp, oinfo, oti, rqset);
RETURN(rc);
return rc;
}
static inline int obd_brw(int cmd, struct obd_export *exp,
@ -1327,7 +1327,7 @@ static inline int obd_brw(int cmd, struct obd_export *exp,
}
rc = OBP(exp->exp_obd, brw)(cmd, exp, oinfo, oa_bufs, pg, oti);
RETURN(rc);
return rc;
}
static inline int obd_preprw(const struct lu_env *env, int cmd,
@ -1345,7 +1345,7 @@ static inline int obd_preprw(const struct lu_env *env, int cmd,
rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
pages, local, oti, capa);
RETURN(rc);
return rc;
}
static inline int obd_commitrw(const struct lu_env *env, int cmd,
@ -1360,7 +1360,7 @@ static inline int obd_commitrw(const struct lu_env *env, int cmd,
rc = OBP(exp->exp_obd, commitrw)(env, cmd, exp, oa, objcount, obj,
rnb, pages, local, oti, rc);
RETURN(rc);
return rc;
}
static inline int obd_merge_lvb(struct obd_export *exp,
@ -1373,7 +1373,7 @@ static inline int obd_merge_lvb(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, merge_lvb);
rc = OBP(exp->exp_obd, merge_lvb)(exp, lsm, lvb, kms_only);
RETURN(rc);
return rc;
}
static inline int obd_adjust_kms(struct obd_export *exp,
@ -1386,7 +1386,7 @@ static inline int obd_adjust_kms(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, adjust_kms);
rc = OBP(exp->exp_obd, adjust_kms)(exp, lsm, size, shrink);
RETURN(rc);
return rc;
}
static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp,
@ -1398,7 +1398,7 @@ static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, iocontrol);
rc = OBP(exp->exp_obd, iocontrol)(cmd, exp, len, karg, uarg);
RETURN(rc);
return rc;
}
static inline int obd_enqueue_rqset(struct obd_export *exp,
@ -1413,13 +1413,13 @@ static inline int obd_enqueue_rqset(struct obd_export *exp,
set = ptlrpc_prep_set();
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
return rc;
}
static inline int obd_enqueue(struct obd_export *exp,
@ -1433,7 +1433,7 @@ static inline int obd_enqueue(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, enqueue);
rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set);
RETURN(rc);
return rc;
}
static inline int obd_change_cbdata(struct obd_export *exp,
@ -1446,7 +1446,7 @@ static inline int obd_change_cbdata(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, change_cbdata);
rc = OBP(exp->exp_obd, change_cbdata)(exp, lsm, it, data);
RETURN(rc);
return rc;
}
static inline int obd_find_cbdata(struct obd_export *exp,
@ -1459,7 +1459,7 @@ static inline int obd_find_cbdata(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, find_cbdata);
rc = OBP(exp->exp_obd, find_cbdata)(exp, lsm, it, data);
RETURN(rc);
return rc;
}
static inline int obd_cancel(struct obd_export *exp,
@ -1472,7 +1472,7 @@ static inline int obd_cancel(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, cancel);
rc = OBP(exp->exp_obd, cancel)(exp, ea, mode, lockh);
RETURN(rc);
return rc;
}
static inline int obd_cancel_unused(struct obd_export *exp,
@ -1486,7 +1486,7 @@ static inline int obd_cancel_unused(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, cancel_unused);
rc = OBP(exp->exp_obd, cancel_unused)(exp, ea, flags, opaque);
RETURN(rc);
return rc;
}
static inline int obd_pin(struct obd_export *exp, const struct lu_fid *fid,
@ -1499,7 +1499,7 @@ static inline int obd_pin(struct obd_export *exp, const struct lu_fid *fid,
EXP_COUNTER_INCREMENT(exp, pin);
rc = OBP(exp->exp_obd, pin)(exp, fid, oc, handle, flag);
RETURN(rc);
return rc;
}
static inline int obd_unpin(struct obd_export *exp,
@ -1511,7 +1511,7 @@ static inline int obd_unpin(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, unpin);
rc = OBP(exp->exp_obd, unpin)(exp, handle, flag);
RETURN(rc);
return rc;
}
@ -1538,7 +1538,7 @@ static inline int obd_llog_connect(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, llog_connect);
rc = OBP(exp->exp_obd, llog_connect)(exp, body);
RETURN(rc);
return rc;
}
@ -1557,17 +1557,17 @@ static inline int obd_notify(struct obd_device *obd,
by this point, and it needs to get them to execute mds_postrecov. */
if (!obd->obd_set_up && !obd->obd_async_recov) {
CDEBUG(D_HA, "obd %s not set up\n", obd->obd_name);
RETURN(-EINVAL);
return -EINVAL;
}
if (!OBP(obd, notify)) {
CDEBUG(D_HA, "obd %s has no notify handler\n", obd->obd_name);
RETURN(-ENOSYS);
return -ENOSYS;
}
OBD_COUNTER_INCREMENT(obd, notify);
rc = OBP(obd, notify)(obd, watched, ev, data);
RETURN(rc);
return rc;
}
static inline int obd_notify_observer(struct obd_device *observer,
@ -1606,7 +1606,7 @@ static inline int obd_quotacheck(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, quotacheck);
rc = OBP(exp->exp_obd, quotacheck)(exp->exp_obd, exp, oqctl);
RETURN(rc);
return rc;
}
static inline int obd_quotactl(struct obd_export *exp,
@ -1618,7 +1618,7 @@ static inline int obd_quotactl(struct obd_export *exp,
EXP_COUNTER_INCREMENT(exp, quotactl);
rc = OBP(exp->exp_obd, quotactl)(exp->exp_obd, exp, oqctl);
RETURN(rc);
return rc;
}
static inline int obd_health_check(const struct lu_env *env,
@ -1636,15 +1636,15 @@ static inline int obd_health_check(const struct lu_env *env,
/* don't use EXP_CHECK_DT_OP, because NULL method is normal here */
if (obd == NULL || !OBT(obd)) {
CERROR("cleaned up obd\n");
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
}
if (!obd->obd_set_up || obd->obd_stopping)
RETURN(0);
return 0;
if (!OBP(obd, health_check))
RETURN(0);
return 0;
rc = OBP(obd, health_check)(env, obd);
RETURN(rc);
return rc;
}
static inline int obd_register_observer(struct obd_device *obd,
@ -1654,11 +1654,11 @@ static inline int obd_register_observer(struct obd_device *obd,
down_write(&obd->obd_observer_link_sem);
if (obd->obd_observer && observer) {
up_write(&obd->obd_observer_link_sem);
RETURN(-EALREADY);
return -EALREADY;
}
obd->obd_observer = observer;
up_write(&obd->obd_observer_link_sem);
RETURN(0);
return 0;
}
static inline int obd_pin_observer(struct obd_device *obd,
@ -1668,16 +1668,16 @@ static inline int obd_pin_observer(struct obd_device *obd,
if (!obd->obd_observer) {
*observer = NULL;
up_read(&obd->obd_observer_link_sem);
RETURN(-ENOENT);
return -ENOENT;
}
*observer = obd->obd_observer;
RETURN(0);
return 0;
}
static inline int obd_unpin_observer(struct obd_device *obd)
{
up_read(&obd->obd_observer_link_sem);
RETURN(0);
return 0;
}
#if 0
@ -1691,7 +1691,7 @@ static inline int obd_register_page_removal_cb(struct obd_export *exp,
OBD_COUNTER_INCREMENT(exp->exp_obd, register_page_removal_cb);
rc = OBP(exp->exp_obd, register_page_removal_cb)(exp, cb, pin_cb);
RETURN(rc);
return rc;
}
static inline int obd_unregister_page_removal_cb(struct obd_export *exp,
@ -1703,7 +1703,7 @@ static inline int obd_unregister_page_removal_cb(struct obd_export *exp,
OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_page_removal_cb);
rc = OBP(exp->exp_obd, unregister_page_removal_cb)(exp, cb);
RETURN(rc);
return rc;
}
static inline int obd_register_lock_cancel_cb(struct obd_export *exp,
@ -1715,7 +1715,7 @@ static inline int obd_register_lock_cancel_cb(struct obd_export *exp,
OBD_COUNTER_INCREMENT(exp->exp_obd, register_lock_cancel_cb);
rc = OBP(exp->exp_obd, register_lock_cancel_cb)(exp, cb);
RETURN(rc);
return rc;
}
static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp,
@ -1727,7 +1727,7 @@ static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp,
OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_lock_cancel_cb);
rc = OBP(exp->exp_obd, unregister_lock_cancel_cb)(exp, cb);
RETURN(rc);
return rc;
}
#endif
@ -1740,7 +1740,7 @@ static inline int md_getstatus(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, getstatus);
EXP_MD_COUNTER_INCREMENT(exp, getstatus);
rc = MDP(exp->exp_obd, getstatus)(exp, fid, pc);
RETURN(rc);
return rc;
}
static inline int md_getattr(struct obd_export *exp, struct md_op_data *op_data,
@ -1751,7 +1751,7 @@ static inline int md_getattr(struct obd_export *exp, struct md_op_data *op_data,
EXP_CHECK_MD_OP(exp, getattr);
EXP_MD_COUNTER_INCREMENT(exp, getattr);
rc = MDP(exp->exp_obd, getattr)(exp, op_data, request);
RETURN(rc);
return rc;
}
static inline int md_null_inode(struct obd_export *exp,
@ -1762,7 +1762,7 @@ static inline int md_null_inode(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, null_inode);
EXP_MD_COUNTER_INCREMENT(exp, null_inode);
rc = MDP(exp->exp_obd, null_inode)(exp, fid);
RETURN(rc);
return rc;
}
static inline int md_find_cbdata(struct obd_export *exp,
@ -1774,7 +1774,7 @@ static inline int md_find_cbdata(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, find_cbdata);
EXP_MD_COUNTER_INCREMENT(exp, find_cbdata);
rc = MDP(exp->exp_obd, find_cbdata)(exp, fid, it, data);
RETURN(rc);
return rc;
}
static inline int md_close(struct obd_export *exp, struct md_op_data *op_data,
@ -1786,7 +1786,7 @@ static inline int md_close(struct obd_export *exp, struct md_op_data *op_data,
EXP_CHECK_MD_OP(exp, close);
EXP_MD_COUNTER_INCREMENT(exp, close);
rc = MDP(exp->exp_obd, close)(exp, op_data, mod, request);
RETURN(rc);
return rc;
}
static inline int md_create(struct obd_export *exp, struct md_op_data *op_data,
@ -1800,7 +1800,7 @@ static inline int md_create(struct obd_export *exp, struct md_op_data *op_data,
EXP_MD_COUNTER_INCREMENT(exp, create);
rc = MDP(exp->exp_obd, create)(exp, op_data, data, datalen, mode,
uid, gid, cap_effective, rdev, request);
RETURN(rc);
return rc;
}
static inline int md_done_writing(struct obd_export *exp,
@ -1812,7 +1812,7 @@ static inline int md_done_writing(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, done_writing);
EXP_MD_COUNTER_INCREMENT(exp, done_writing);
rc = MDP(exp->exp_obd, done_writing)(exp, op_data, mod);
RETURN(rc);
return rc;
}
static inline int md_enqueue(struct obd_export *exp,
@ -1830,7 +1830,7 @@ static inline int md_enqueue(struct obd_export *exp,
EXP_MD_COUNTER_INCREMENT(exp, enqueue);
rc = MDP(exp->exp_obd, enqueue)(exp, einfo, it, op_data, lockh,
lmm, lmmsize, req, extra_lock_flags);
RETURN(rc);
return rc;
}
static inline int md_getattr_name(struct obd_export *exp,
@ -1842,7 +1842,7 @@ static inline int md_getattr_name(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, getattr_name);
EXP_MD_COUNTER_INCREMENT(exp, getattr_name);
rc = MDP(exp->exp_obd, getattr_name)(exp, op_data, request);
RETURN(rc);
return rc;
}
static inline int md_intent_lock(struct obd_export *exp,
@ -1859,7 +1859,7 @@ static inline int md_intent_lock(struct obd_export *exp,
rc = MDP(exp->exp_obd, intent_lock)(exp, op_data, lmm, lmmsize,
it, lookup_flags, reqp, cb_blocking,
extra_lock_flags);
RETURN(rc);
return rc;
}
static inline int md_link(struct obd_export *exp, struct md_op_data *op_data,
@ -1870,7 +1870,7 @@ static inline int md_link(struct obd_export *exp, struct md_op_data *op_data,
EXP_CHECK_MD_OP(exp, link);
EXP_MD_COUNTER_INCREMENT(exp, link);
rc = MDP(exp->exp_obd, link)(exp, op_data, request);
RETURN(rc);
return rc;
}
static inline int md_rename(struct obd_export *exp, struct md_op_data *op_data,
@ -1883,7 +1883,7 @@ static inline int md_rename(struct obd_export *exp, struct md_op_data *op_data,
EXP_MD_COUNTER_INCREMENT(exp, rename);
rc = MDP(exp->exp_obd, rename)(exp, op_data, old, oldlen, new,
newlen, request);
RETURN(rc);
return rc;
}
static inline int md_is_subdir(struct obd_export *exp,
@ -1896,7 +1896,7 @@ static inline int md_is_subdir(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, is_subdir);
EXP_MD_COUNTER_INCREMENT(exp, is_subdir);
rc = MDP(exp->exp_obd, is_subdir)(exp, pfid, cfid, request);
RETURN(rc);
return rc;
}
static inline int md_setattr(struct obd_export *exp, struct md_op_data *op_data,
@ -1910,7 +1910,7 @@ static inline int md_setattr(struct obd_export *exp, struct md_op_data *op_data,
EXP_MD_COUNTER_INCREMENT(exp, setattr);
rc = MDP(exp->exp_obd, setattr)(exp, op_data, ea, ealen,
ea2, ea2len, request, mod);
RETURN(rc);
return rc;
}
static inline int md_sync(struct obd_export *exp, const struct lu_fid *fid,
@ -1921,7 +1921,7 @@ static inline int md_sync(struct obd_export *exp, const struct lu_fid *fid,
EXP_CHECK_MD_OP(exp, sync);
EXP_MD_COUNTER_INCREMENT(exp, sync);
rc = MDP(exp->exp_obd, sync)(exp, fid, oc, request);
RETURN(rc);
return rc;
}
static inline int md_readpage(struct obd_export *exp, struct md_op_data *opdata,
@ -1933,7 +1933,7 @@ static inline int md_readpage(struct obd_export *exp, struct md_op_data *opdata,
EXP_CHECK_MD_OP(exp, readpage);
EXP_MD_COUNTER_INCREMENT(exp, readpage);
rc = MDP(exp->exp_obd, readpage)(exp, opdata, pages, request);
RETURN(rc);
return rc;
}
static inline int md_unlink(struct obd_export *exp, struct md_op_data *op_data,
@ -1944,7 +1944,7 @@ static inline int md_unlink(struct obd_export *exp, struct md_op_data *op_data,
EXP_CHECK_MD_OP(exp, unlink);
EXP_MD_COUNTER_INCREMENT(exp, unlink);
rc = MDP(exp->exp_obd, unlink)(exp, op_data, request);
RETURN(rc);
return rc;
}
static inline int md_get_lustre_md(struct obd_export *exp,
@ -1955,7 +1955,7 @@ static inline int md_get_lustre_md(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, get_lustre_md);
EXP_MD_COUNTER_INCREMENT(exp, get_lustre_md);
RETURN(MDP(exp->exp_obd, get_lustre_md)(exp, req, dt_exp, md_exp, md));
return MDP(exp->exp_obd, get_lustre_md)(exp, req, dt_exp, md_exp, md);
}
static inline int md_free_lustre_md(struct obd_export *exp,
@ -1963,7 +1963,7 @@ static inline int md_free_lustre_md(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, free_lustre_md);
EXP_MD_COUNTER_INCREMENT(exp, free_lustre_md);
RETURN(MDP(exp->exp_obd, free_lustre_md)(exp, md));
return MDP(exp->exp_obd, free_lustre_md)(exp, md);
}
static inline int md_setxattr(struct obd_export *exp,
@ -1975,9 +1975,9 @@ static inline int md_setxattr(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, setxattr);
EXP_MD_COUNTER_INCREMENT(exp, setxattr);
RETURN(MDP(exp->exp_obd, setxattr)(exp, fid, oc, valid, name, input,
return MDP(exp->exp_obd, setxattr)(exp, fid, oc, valid, name, input,
input_size, output_size, flags,
suppgid, request));
suppgid, request);
}
static inline int md_getxattr(struct obd_export *exp,
@ -1989,9 +1989,9 @@ static inline int md_getxattr(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, getxattr);
EXP_MD_COUNTER_INCREMENT(exp, getxattr);
RETURN(MDP(exp->exp_obd, getxattr)(exp, fid, oc, valid, name, input,
return MDP(exp->exp_obd, getxattr)(exp, fid, oc, valid, name, input,
input_size, output_size, flags,
request));
request);
}
static inline int md_set_open_replay_data(struct obd_export *exp,
@ -2000,7 +2000,7 @@ static inline int md_set_open_replay_data(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, set_open_replay_data);
EXP_MD_COUNTER_INCREMENT(exp, set_open_replay_data);
RETURN(MDP(exp->exp_obd, set_open_replay_data)(exp, och, open_req));
return MDP(exp->exp_obd, set_open_replay_data)(exp, och, open_req);
}
static inline int md_clear_open_replay_data(struct obd_export *exp,
@ -2008,7 +2008,7 @@ static inline int md_clear_open_replay_data(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, clear_open_replay_data);
EXP_MD_COUNTER_INCREMENT(exp, clear_open_replay_data);
RETURN(MDP(exp->exp_obd, clear_open_replay_data)(exp, och));
return MDP(exp->exp_obd, clear_open_replay_data)(exp, och);
}
static inline int md_set_lock_data(struct obd_export *exp,
@ -2016,7 +2016,7 @@ static inline int md_set_lock_data(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, set_lock_data);
EXP_MD_COUNTER_INCREMENT(exp, set_lock_data);
RETURN(MDP(exp->exp_obd, set_lock_data)(exp, lockh, data, bits));
return MDP(exp->exp_obd, set_lock_data)(exp, lockh, data, bits);
}
static inline int md_cancel_unused(struct obd_export *exp,
@ -2033,7 +2033,7 @@ static inline int md_cancel_unused(struct obd_export *exp,
rc = MDP(exp->exp_obd, cancel_unused)(exp, fid, policy, mode,
flags, opaque);
RETURN(rc);
return rc;
}
static inline ldlm_mode_t md_lock_match(struct obd_export *exp, __u64 flags,
@ -2045,8 +2045,8 @@ static inline ldlm_mode_t md_lock_match(struct obd_export *exp, __u64 flags,
{
EXP_CHECK_MD_OP(exp, lock_match);
EXP_MD_COUNTER_INCREMENT(exp, lock_match);
RETURN(MDP(exp->exp_obd, lock_match)(exp, flags, fid, type,
policy, mode, lockh));
return MDP(exp->exp_obd, lock_match)(exp, flags, fid, type,
policy, mode, lockh);
}
static inline int md_init_ea_size(struct obd_export *exp, int easize,
@ -2054,8 +2054,8 @@ static inline int md_init_ea_size(struct obd_export *exp, int easize,
{
EXP_CHECK_MD_OP(exp, init_ea_size);
EXP_MD_COUNTER_INCREMENT(exp, init_ea_size);
RETURN(MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
cookiesize));
return MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
cookiesize);
}
static inline int md_get_remote_perm(struct obd_export *exp,
@ -2065,8 +2065,8 @@ static inline int md_get_remote_perm(struct obd_export *exp,
{
EXP_CHECK_MD_OP(exp, get_remote_perm);
EXP_MD_COUNTER_INCREMENT(exp, get_remote_perm);
RETURN(MDP(exp->exp_obd, get_remote_perm)(exp, fid, oc, suppgid,
request));
return MDP(exp->exp_obd, get_remote_perm)(exp, fid, oc, suppgid,
request);
}
static inline int md_renew_capa(struct obd_export *exp, struct obd_capa *ocapa,
@ -2077,7 +2077,7 @@ static inline int md_renew_capa(struct obd_export *exp, struct obd_capa *ocapa,
EXP_CHECK_MD_OP(exp, renew_capa);
EXP_MD_COUNTER_INCREMENT(exp, renew_capa);
rc = MDP(exp->exp_obd, renew_capa)(exp, ocapa, cb);
RETURN(rc);
return rc;
}
static inline int md_unpack_capa(struct obd_export *exp,
@ -2090,7 +2090,7 @@ static inline int md_unpack_capa(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, unpack_capa);
EXP_MD_COUNTER_INCREMENT(exp, unpack_capa);
rc = MDP(exp->exp_obd, unpack_capa)(exp, req, field, oc);
RETURN(rc);
return rc;
}
static inline int md_intent_getattr_async(struct obd_export *exp,
@ -2102,7 +2102,7 @@ static inline int md_intent_getattr_async(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, intent_getattr_async);
EXP_MD_COUNTER_INCREMENT(exp, intent_getattr_async);
rc = MDP(exp->exp_obd, intent_getattr_async)(exp, minfo, einfo);
RETURN(rc);
return rc;
}
static inline int md_revalidate_lock(struct obd_export *exp,
@ -2114,7 +2114,7 @@ static inline int md_revalidate_lock(struct obd_export *exp,
EXP_CHECK_MD_OP(exp, revalidate_lock);
EXP_MD_COUNTER_INCREMENT(exp, revalidate_lock);
rc = MDP(exp->exp_obd, revalidate_lock)(exp, it, fid, bits);
RETURN(rc);
return rc;
}

View File

@ -130,10 +130,10 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
cio->cui_glimpse = 0;
if (lock == NULL)
RETURN(0);
return 0;
if (IS_ERR(lock))
RETURN(PTR_ERR(lock));
return PTR_ERR(lock);
LASSERT(agl == 0);
result = cl_wait(env, lock);
@ -158,7 +158,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
}
}
RETURN(result);
return result;
}
static int cl_io_get(struct inode *inode, struct lu_env **envout,
@ -223,7 +223,7 @@ int cl_glimpse_size0(struct inode *inode, int agl)
goto again;
cl_env_put(env, &refcheck);
}
RETURN(result);
return result;
}
int cl_local_size(struct inode *inode)
@ -238,11 +238,11 @@ int cl_local_size(struct inode *inode)
int refcheck;
if (!cl_i2info(inode)->lli_has_smd)
RETURN(0);
return 0;
result = cl_io_get(inode, &env, &io, &refcheck);
if (result <= 0)
RETURN(result);
return result;
clob = io->ci_obj;
result = cl_io_init(env, io, CIT_MISC, clob);
@ -265,5 +265,5 @@ int cl_local_size(struct inode *inode)
}
cl_io_fini(env, io);
cl_env_put(env, &refcheck);
RETURN(result);
return result;
}

View File

@ -181,7 +181,7 @@ int ccc_device_init(const struct lu_env *env, struct lu_device *d,
lu_device_get(next);
lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init);
}
RETURN(rc);
return rc;
}
struct lu_device *ccc_device_fini(const struct lu_env *env,
@ -203,7 +203,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
OBD_ALLOC_PTR(vdv);
if (vdv == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
lud = &vdv->cdv_cl.cd_lu_dev;
cl_device_init(&vdv->cdv_cl, t);
@ -226,7 +226,7 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
ccc_device_free(env, lud);
lud = ERR_PTR(rc);
}
RETURN(lud);
return lud;
}
struct lu_device *ccc_device_free(const struct lu_env *env,
@ -426,7 +426,7 @@ int ccc_object_glimpse(const struct lu_env *env,
*/
if (lvb->lvb_size > 0 && lvb->lvb_blocks == 0)
lvb->lvb_blocks = dirty_cnt(inode);
RETURN(0);
return 0;
}
@ -490,7 +490,7 @@ int ccc_page_is_under_lock(const struct lu_env *env,
}
} else
result = 0;
RETURN(result);
return result;
}
int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice)
@ -555,7 +555,7 @@ int ccc_transient_page_prep(const struct lu_env *env,
struct cl_io *unused)
{
/* transient page should always be sent. */
RETURN(0);
return 0;
}
/*****************************************************************************
@ -635,7 +635,7 @@ int ccc_lock_fits_into(const struct lu_env *env,
result = lock->cll_state >= CLS_ENQUEUED;
else
result = 1;
RETURN(result);
return result;
}
/**
@ -715,7 +715,7 @@ int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
descr->cld_enq_flags = enqflags;
cl_io_lock_add(env, io, &cio->cui_link);
RETURN(0);
return 0;
}
void ccc_io_update_iov(const struct lu_env *env,
@ -978,7 +978,7 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
env = cl_env_get(&refcheck);
if (IS_ERR(env))
RETURN(PTR_ERR(env));
return PTR_ERR(env);
io = ccc_env_thread_io(env);
io->ci_obj = cl_i2info(inode)->lli_clob;
@ -1007,7 +1007,7 @@ again:
if (unlikely(io->ci_need_restart))
goto again;
cl_env_put(env, &refcheck);
RETURN(result);
return result;
}
/*****************************************************************************
@ -1272,9 +1272,9 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
__u64 cl_fid_build_ino(const struct lu_fid *fid, int api32)
{
if (BITS_PER_LONG == 32 || api32)
RETURN(fid_flatten32(fid));
return fid_flatten32(fid);
else
RETURN(fid_flatten(fid));
return fid_flatten(fid);
}
/**
@ -1286,11 +1286,11 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
if (fid_is_igif(fid)) {
gen = lu_igif_gen(fid);
RETURN(gen);
return gen;
}
gen = (fid_flatten(fid) >> 32);
RETURN(gen);
return gen;
}
/* lsm is unreliable after hsm implementation as layout can be changed at

View File

@ -61,7 +61,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
rc = obd_get_info(NULL, dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
&valsize, &desc, NULL);
if (rc)
RETURN(rc);
return rc;
stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
lsm.lsm_stripe_count = stripes;
@ -76,7 +76,7 @@ int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
easize, cookiesize);
rc = md_init_ea_size(md_exp, easize, def_easize, cookiesize);
RETURN(rc);
return rc;
}
/**
@ -114,7 +114,7 @@ int cl_ocd_update(struct obd_device *host,
watched->obd_name);
result = -EINVAL;
}
RETURN(result);
return result;
}
#define GROUPLOCK_SCOPE "grouplock"

View File

@ -134,44 +134,44 @@ for (node = interval_last(root); node != NULL; \
static struct interval_node *interval_first(struct interval_node *node)
{
if (!node)
RETURN(NULL);
return NULL;
while (node->in_left)
node = node->in_left;
RETURN(node);
return node;
}
static struct interval_node *interval_last(struct interval_node *node)
{
if (!node)
RETURN(NULL);
return NULL;
while (node->in_right)
node = node->in_right;
RETURN(node);
return node;
}
static struct interval_node *interval_next(struct interval_node *node)
{
if (!node)
RETURN(NULL);
return NULL;
if (node->in_right)
RETURN(interval_first(node->in_right));
return interval_first(node->in_right);
while (node->in_parent && node_is_right_child(node))
node = node->in_parent;
RETURN(node->in_parent);
return node->in_parent;
}
static struct interval_node *interval_prev(struct interval_node *node)
{
if (!node)
RETURN(NULL);
return NULL;
if (node->in_left)
RETURN(interval_last(node->in_left));
return interval_last(node->in_left);
while (node->in_parent && node_is_left_child(node))
node = node->in_parent;
RETURN(node->in_parent);
return node->in_parent;
}
enum interval_iter interval_iterate(struct interval_node *root,
@ -187,7 +187,7 @@ enum interval_iter interval_iterate(struct interval_node *root,
break;
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(interval_iterate);
@ -204,7 +204,7 @@ enum interval_iter interval_iterate_reverse(struct interval_node *root,
break;
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(interval_iterate_reverse);
@ -226,7 +226,7 @@ struct interval_node *interval_find(struct interval_node *root,
walk = walk->in_right;
}
RETURN(walk);
return walk;
}
EXPORT_SYMBOL(interval_find);
@ -374,7 +374,7 @@ struct interval_node *interval_insert(struct interval_node *node,
while (*p) {
parent = *p;
if (node_equal(parent, node))
RETURN(parent);
return parent;
/* max_high field must be updated after each iteration */
if (parent->in_max_high < interval_high(node))
@ -395,7 +395,7 @@ struct interval_node *interval_insert(struct interval_node *node,
interval_insert_color(node, root);
node->in_intree = 1;
RETURN(NULL);
return NULL;
}
EXPORT_SYMBOL(interval_insert);

View File

@ -85,7 +85,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
continue;
if (lck->l_policy_data.l_extent.end >= old_kms)
RETURN(old_kms);
return old_kms;
/* This extent _has_ to be smaller than old_kms (checked above)
* so kms can only ever be smaller or the same as old_kms. */
@ -94,7 +94,7 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
}
LASSERTF(kms <= old_kms, "kms "LPU64" old_kms "LPU64"\n", kms, old_kms);
RETURN(kms);
return kms;
}
EXPORT_SYMBOL(ldlm_extent_shift_kms);
@ -106,11 +106,11 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock)
LASSERT(lock->l_resource->lr_type == LDLM_EXTENT);
OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO);
if (node == NULL)
RETURN(NULL);
return NULL;
INIT_LIST_HEAD(&node->li_group);
ldlm_interval_attach(node, lock);
RETURN(node);
return node;
}
void ldlm_interval_free(struct ldlm_interval *node)

View File

@ -305,12 +305,12 @@ reprocess:
continue;
if (!first_enq)
RETURN(LDLM_ITER_CONTINUE);
return LDLM_ITER_CONTINUE;
if (*flags & LDLM_FL_BLOCK_NOWAIT) {
ldlm_flock_destroy(req, mode, *flags);
*err = -EAGAIN;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
if (*flags & LDLM_FL_TEST_LOCK) {
@ -323,7 +323,7 @@ reprocess:
req->l_policy_data.l_flock.end =
lock->l_policy_data.l_flock.end;
*flags |= LDLM_FL_LOCK_CHANGED;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
/* add lock to blocking list before deadlock
@ -332,18 +332,18 @@ reprocess:
if (rc) {
ldlm_flock_destroy(req, mode, *flags);
*err = rc;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
if (ldlm_flock_deadlock(req, lock)) {
ldlm_flock_blocking_unlink(req);
ldlm_flock_destroy(req, mode, *flags);
*err = -EDEADLK;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
ldlm_resource_add_lock(res, &res->lr_waiting, req);
*flags |= LDLM_FL_BLOCK_GRANTED;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
}
@ -351,7 +351,7 @@ reprocess:
ldlm_flock_destroy(req, mode, *flags);
req->l_req_mode = LCK_NL;
*flags |= LDLM_FL_LOCK_CHANGED;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
/* In case we had slept on this lock request take it off of the
@ -463,7 +463,7 @@ reprocess:
ldlm_flock_destroy(req, lock->l_granted_mode,
*flags);
*err = -ENOLCK;
RETURN(LDLM_ITER_STOP);
return LDLM_ITER_STOP;
}
goto reprocess;
}
@ -530,7 +530,7 @@ reprocess:
ldlm_flock_destroy(req, mode, *flags);
ldlm_resource_dump(D_INFO, res);
RETURN(LDLM_ITER_CONTINUE);
return LDLM_ITER_CONTINUE;
}
struct ldlm_flock_wait_data {
@ -591,7 +591,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
/* Need to wake up the waiter if we were evicted */
wake_up(&lock->l_waitq);
RETURN(0);
return 0;
}
LASSERT(flags != LDLM_FL_WAIT_NOREPROC);
@ -603,7 +603,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
goto granted;
/* CP AST RPC: lock get granted, wake it up */
wake_up(&lock->l_waitq);
RETURN(0);
return 0;
}
LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
@ -629,7 +629,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
if (rc) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
rc);
RETURN(rc);
return rc;
}
granted:
@ -637,18 +637,18 @@ granted:
if (lock->l_flags & LDLM_FL_DESTROYED) {
LDLM_DEBUG(lock, "client-side enqueue waking up: destroyed");
RETURN(0);
return 0;
}
if (lock->l_flags & LDLM_FL_FAILED) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed");
RETURN(-EIO);
return -EIO;
}
if (rc) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
rc);
RETURN(rc);
return rc;
}
LDLM_DEBUG(lock, "client-side enqueue granted");
@ -690,7 +690,7 @@ granted:
ldlm_process_flock_lock(lock, &noreproc, 1, &err, NULL);
}
unlock_res_and_lock(lock);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_flock_completion_ast);
@ -704,7 +704,7 @@ int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
lock_res_and_lock(lock);
ldlm_flock_blocking_unlink(lock);
unlock_res_and_lock(lock);
RETURN(0);
return 0;
}
void ldlm_flock_policy_wire18_to_local(const ldlm_wire_policy_data_t *wpolicy,
@ -825,9 +825,9 @@ int ldlm_init_flock_export(struct obd_export *exp)
&ldlm_export_flock_ops,
CFS_HASH_DEFAULT | CFS_HASH_NBLK_CHANGE);
if (!exp->exp_flock_hash)
RETURN(-ENOMEM);
return -ENOMEM;
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_init_flock_export);

View File

@ -63,13 +63,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
if (!create && !priority) {
CDEBUG(D_HA, "Nothing to do\n");
RETURN(-EINVAL);
return -EINVAL;
}
ptlrpc_conn = ptlrpc_uuid_to_connection(uuid);
if (!ptlrpc_conn) {
CDEBUG(D_HA, "can't find connection %s\n", uuid->uuid);
RETURN (-ENOENT);
return -ENOENT;
}
if (create) {
@ -114,13 +114,13 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
}
spin_unlock(&imp->imp_lock);
RETURN(0);
return 0;
out_free:
if (imp_conn)
OBD_FREE(imp_conn, sizeof(*imp_conn));
out_put:
ptlrpc_connection_put(ptlrpc_conn);
RETURN(rc);
return rc;
}
int import_set_conn_priority(struct obd_import *imp, struct obd_uuid *uuid)
@ -185,7 +185,7 @@ out:
spin_unlock(&imp->imp_lock);
if (rc == -ENOENT)
CERROR("connection %s not found\n", uuid->uuid);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(client_import_del_conn);
@ -209,7 +209,7 @@ int client_import_find_conn(struct obd_import *imp, lnet_nid_t peer,
}
}
spin_unlock(&imp->imp_lock);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(client_import_find_conn);
@ -301,27 +301,27 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
} else {
CERROR("unknown client OBD type \"%s\", can't setup\n",
name);
RETURN(-EINVAL);
return -EINVAL;
}
if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
CERROR("requires a TARGET UUID\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (LUSTRE_CFG_BUFLEN(lcfg, 1) > 37) {
CERROR("client UUID must be less than 38 characters\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1) {
CERROR("setup requires a SERVER UUID\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (LUSTRE_CFG_BUFLEN(lcfg, 2) > 37) {
CERROR("target UUID must be less than 38 characters\n");
RETURN(-EINVAL);
return -EINVAL;
}
init_rwsem(&cli->cl_sem);
@ -448,14 +448,14 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
cli->cl_qchk_stat = CL_NOT_QUOTACHECKED;
RETURN(rc);
return rc;
err_import:
class_destroy_import(imp);
err_ldlm:
ldlm_put_ref();
err:
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(client_obd_setup);
@ -468,7 +468,7 @@ int client_obd_cleanup(struct obd_device *obddev)
LASSERT(obddev->u.cli.cl_import == NULL);
ldlm_put_ref();
RETURN(0);
return 0;
}
EXPORT_SYMBOL(client_obd_cleanup);
@ -548,7 +548,7 @@ int client_disconnect_export(struct obd_export *exp)
if (!obd) {
CERROR("invalid export for disconnect: exp %p cookie "LPX64"\n",
exp, exp ? exp->exp_handle.h_cookie : -1);
RETURN(-EINVAL);
return -EINVAL;
}
cli = &obd->u.cli;
@ -604,7 +604,7 @@ out_disconnect:
up_write(&cli->cl_sem);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(client_disconnect_export);
@ -622,7 +622,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
!exp_connect_lru_resize(req->rq_export))) {
lustre_msg_set_slv(req->rq_repmsg, 0);
lustre_msg_set_limit(req->rq_repmsg, 0);
RETURN(0);
return 0;
}
/* OBD is alive here as export is alive, which we checked above. */
@ -633,7 +633,7 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
lustre_msg_set_limit(req->rq_repmsg, obd->obd_pool_limit);
read_unlock(&obd->obd_pool_lock);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(target_pack_pool_reply);

View File

@ -251,7 +251,7 @@ int ldlm_lock_remove_from_lru(struct ldlm_lock *lock)
if (lock->l_flags & LDLM_FL_NS_SRV) {
LASSERT(list_empty(&lock->l_lru));
RETURN(0);
return 0;
}
spin_lock(&ns->ns_lock);
@ -439,7 +439,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
OBD_SLAB_ALLOC_PTR_GFP(lock, ldlm_lock_slab, __GFP_IO);
if (lock == NULL)
RETURN(NULL);
return NULL;
spin_lock_init(&lock->l_lock);
lock->l_resource = resource;
@ -475,7 +475,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
#endif
INIT_LIST_HEAD(&lock->l_exp_list);
RETURN(lock);
return lock;
}
/**
@ -497,7 +497,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
sizeof(lock->l_resource->lr_name)) == 0) {
/* Nothing to do */
unlock_res_and_lock(lock);
RETURN(0);
return 0;
}
LASSERT(new_resid->name[0] != 0);
@ -510,7 +510,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
newres = ldlm_resource_get(ns, NULL, new_resid, type, 1);
if (newres == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lu_ref_add(&newres->lr_reference, "lock", lock);
/*
@ -538,7 +538,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
lu_ref_del(&oldres->lr_reference, "lock", lock);
ldlm_resource_putref(oldres);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_lock_change_resource);
@ -572,13 +572,13 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
lock = class_handle2object(handle->cookie);
if (lock == NULL)
RETURN(NULL);
return NULL;
/* It's unlikely but possible that someone marked the lock as
* destroyed after we did handle2object on it */
if (flags == 0 && ((lock->l_flags & LDLM_FL_DESTROYED)== 0)) {
lu_ref_add(&lock->l_reference, "handle", current);
RETURN(lock);
return lock;
}
lock_res_and_lock(lock);
@ -590,20 +590,20 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
unlock_res_and_lock(lock);
CDEBUG(D_INFO, "lock already destroyed: lock %p\n", lock);
LDLM_LOCK_PUT(lock);
RETURN(NULL);
return NULL;
}
if (flags && (lock->l_flags & flags)) {
unlock_res_and_lock(lock);
LDLM_LOCK_PUT(lock);
RETURN(NULL);
return NULL;
}
if (flags)
lock->l_flags |= flags;
unlock_res_and_lock(lock);
RETURN(lock);
return lock;
}
EXPORT_SYMBOL(__ldlm_handle2lock);
/** @} ldlm_handles */
@ -1280,7 +1280,7 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
res = ldlm_resource_get(ns, NULL, res_id, type, 0);
if (res == NULL) {
LASSERT(old_lock == NULL);
RETURN(0);
return 0;
}
LDLM_RESOURCE_ADDREF(res);
@ -1433,7 +1433,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lustre_swab_ost_lvb);
if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO);
return -EPROTO;
}
memcpy(data, lvb, size);
@ -1450,7 +1450,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lustre_swab_ost_lvb_v1);
if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO);
return -EPROTO;
}
memcpy(data, lvb, size);
@ -1460,7 +1460,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
} else {
LDLM_ERROR(lock, "Replied unexpected ost LVB size %d",
size);
RETURN(-EINVAL);
return -EINVAL;
}
break;
case LVB_T_LQUOTA:
@ -1475,14 +1475,14 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lustre_swab_lquota_lvb);
if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO);
return -EPROTO;
}
memcpy(data, lvb, size);
} else {
LDLM_ERROR(lock, "Replied unexpected lquota LVB size %d",
size);
RETURN(-EINVAL);
return -EINVAL;
}
break;
case LVB_T_LAYOUT:
@ -1495,7 +1495,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
lvb = req_capsule_server_get(pill, &RMF_DLM_LVB);
if (unlikely(lvb == NULL)) {
LDLM_ERROR(lock, "no LVB");
RETURN(-EPROTO);
return -EPROTO;
}
memcpy(data, lvb, size);
@ -1503,10 +1503,10 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
default:
LDLM_ERROR(lock, "Unknown LVB type: %d\n", lock->l_lvb_type);
dump_stack();
RETURN(-EINVAL);
return -EINVAL;
}
RETURN(0);
return 0;
}
/**
@ -1526,12 +1526,12 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
res = ldlm_resource_get(ns, NULL, res_id, type, 1);
if (res == NULL)
RETURN(NULL);
return NULL;
lock = ldlm_lock_new(res);
if (lock == NULL)
RETURN(NULL);
return NULL;
lock->l_req_mode = mode;
lock->l_ast_data = data;
@ -1562,7 +1562,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_NEW_LOCK))
GOTO(out, 0);
RETURN(lock);
return lock;
out:
ldlm_lock_destroy(lock);
@ -1606,11 +1606,11 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
LDLM_LOCK_RELEASE(lock);
}
*flags |= LDLM_FL_LOCK_CHANGED;
RETURN(0);
return 0;
} else if (rc != ELDLM_OK ||
(rc == ELDLM_OK && (*flags & LDLM_FL_INTENT_ONLY))) {
ldlm_lock_destroy(lock);
RETURN(rc);
return rc;
}
}
@ -1692,7 +1692,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
struct ldlm_lock *lock;
if (list_empty(arg->list))
RETURN(-ENOENT);
return -ENOENT;
lock = list_entry(arg->list->next, struct ldlm_lock, l_bl_ast);
@ -1713,7 +1713,7 @@ ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
lock->l_blocking_lock = NULL;
LDLM_LOCK_RELEASE(lock);
RETURN(rc);
return rc;
}
/**
@ -1728,7 +1728,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
ldlm_completion_callback completion_callback;
if (list_empty(arg->list))
RETURN(-ENOENT);
return -ENOENT;
lock = list_entry(arg->list->next, struct ldlm_lock, l_cp_ast);
@ -1757,7 +1757,7 @@ ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
rc = completion_callback(lock, 0, (void *)arg);
LDLM_LOCK_RELEASE(lock);
RETURN(rc);
return rc;
}
/**
@ -1772,7 +1772,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
struct ldlm_lock *lock;
if (list_empty(arg->list))
RETURN(-ENOENT);
return -ENOENT;
lock = list_entry(arg->list->next, struct ldlm_lock, l_rk_ast);
list_del_init(&lock->l_rk_ast);
@ -1785,7 +1785,7 @@ ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
rc = lock->l_blocking_ast(lock, &desc, (void*)arg, LDLM_CB_BLOCKING);
LDLM_LOCK_RELEASE(lock);
RETURN(rc);
return rc;
}
/**
@ -1799,7 +1799,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
int rc = 0;
if (list_empty(arg->list))
RETURN(-ENOENT);
return -ENOENT;
gl_work = list_entry(arg->list->next, struct ldlm_glimpse_work,
gl_list);
@ -1819,7 +1819,7 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
if ((gl_work->gl_flags & LDLM_GL_WORK_NOFREE) == 0)
OBD_FREE_PTR(gl_work);
RETURN(rc);
return rc;
}
/**
@ -1836,11 +1836,11 @@ int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,
int rc;
if (list_empty(rpc_list))
RETURN(0);
return 0;
OBD_ALLOC_PTR(arg);
if (arg == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
atomic_set(&arg->restart, 0);
arg->list = rpc_list;
@ -2027,7 +2027,7 @@ int ldlm_lock_set_data(struct lustre_handle *lockh, void *data)
rc = 0;
LDLM_LOCK_PUT(lock);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_lock_set_data);
@ -2136,7 +2136,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
/* Just return if mode is unchanged. */
if (new_mode == lock->l_granted_mode) {
*flags |= LDLM_FL_BLOCK_GRANTED;
RETURN(lock->l_resource);
return lock->l_resource;
}
/* I can't check the type of lock here because the bitlock of lock
@ -2144,7 +2144,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, __GFP_IO);
if (node == NULL)
/* Actually, this causes EDEADLOCK to be returned */
RETURN(NULL);
return NULL;
LASSERTF((new_mode == LCK_PW && lock->l_granted_mode == LCK_PR),
"new_mode %u, granted %u\n", new_mode, lock->l_granted_mode);
@ -2203,7 +2203,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode,
ldlm_run_ast_work(ns, &rpc_list, LDLM_WORK_CP_AST);
if (node)
OBD_SLAB_FREE(node, ldlm_interval_slab, sizeof(*node));
RETURN(res);
return res;
}
EXPORT_SYMBOL(ldlm_lock_convert);

View File

@ -127,12 +127,12 @@ struct ldlm_bl_work_item {
int ldlm_del_waiting_lock(struct ldlm_lock *lock)
{
RETURN(0);
return 0;
}
int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout)
{
RETURN(0);
return 0;
}
@ -395,7 +395,7 @@ static int __ldlm_bl_to_thread(struct ldlm_bl_work_item *blwi,
if (!(cancel_flags & LCF_ASYNC))
wait_for_completion(&blwi->blwi_comp);
RETURN(0);
return 0;
}
static inline void init_blwi(struct ldlm_bl_work_item *blwi,
@ -440,17 +440,17 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
ldlm_cancel_flags_t cancel_flags)
{
if (cancels && count == 0)
RETURN(0);
return 0;
if (cancel_flags & LCF_ASYNC) {
struct ldlm_bl_work_item *blwi;
OBD_ALLOC(blwi, sizeof(*blwi));
if (blwi == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
init_blwi(blwi, ns, ld, cancels, count, lock, cancel_flags);
RETURN(__ldlm_bl_to_thread(blwi, cancel_flags));
return __ldlm_bl_to_thread(blwi, cancel_flags);
} else {
/* if it is synchronous call do minimum mem alloc, as it could
* be triggered from kernel shrinker
@ -459,7 +459,7 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
memset(&blwi, 0, sizeof(blwi));
init_blwi(&blwi, ns, ld, cancels, count, lock, cancel_flags);
RETURN(__ldlm_bl_to_thread(&blwi, cancel_flags));
return __ldlm_bl_to_thread(&blwi, cancel_flags);
}
}
@ -493,14 +493,14 @@ static int ldlm_handle_setinfo(struct ptlrpc_request *req)
key = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
if (key == NULL) {
DEBUG_REQ(D_IOCTL, req, "no set_info key");
RETURN(-EFAULT);
return -EFAULT;
}
keylen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_KEY,
RCL_CLIENT);
val = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL);
if (val == NULL) {
DEBUG_REQ(D_IOCTL, req, "no set_info val");
RETURN(-EFAULT);
return -EFAULT;
}
vallen = req_capsule_get_size(&req->rq_pill, &RMF_SETINFO_VAL,
RCL_CLIENT);
@ -542,7 +542,7 @@ static int ldlm_handle_qc_callback(struct ptlrpc_request *req)
oqctl = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
if (oqctl == NULL) {
CERROR("Can't unpack obd_quotactl\n");
RETURN(-EPROTO);
return -EPROTO;
}
oqctl->qc_stat = ptlrpc_status_ntoh(oqctl->qc_stat);
@ -566,7 +566,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
/* do nothing for sec context finalize */
if (lustre_msg_get_opc(req->rq_reqmsg) == SEC_CTX_FINI)
RETURN(0);
return 0;
req_capsule_init(&req->rq_pill, req, RCL_SERVER);
@ -574,7 +574,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -ENOTCONN);
ldlm_callback_errmsg(req, "Operate on unconnected server",
rc, NULL);
RETURN(0);
return 0;
}
LASSERT(req->rq_export != NULL);
@ -583,71 +583,71 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
switch (lustre_msg_get_opc(req->rq_reqmsg)) {
case LDLM_BL_CALLBACK:
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_BL_CALLBACK_NET))
RETURN(0);
return 0;
break;
case LDLM_CP_CALLBACK:
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CP_CALLBACK_NET))
RETURN(0);
return 0;
break;
case LDLM_GL_CALLBACK:
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_GL_CALLBACK_NET))
RETURN(0);
return 0;
break;
case LDLM_SET_INFO:
rc = ldlm_handle_setinfo(req);
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
case OBD_LOG_CANCEL: /* remove this eventually - for 1.4.0 compat */
CERROR("shouldn't be handling OBD_LOG_CANCEL on DLM thread\n");
req_capsule_set(&req->rq_pill, &RQF_LOG_CANCEL);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_NET))
RETURN(0);
return 0;
rc = llog_origin_handle_cancel(req);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOG_CANCEL_REP))
RETURN(0);
return 0;
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
case LLOG_ORIGIN_HANDLE_CREATE:
req_capsule_set(&req->rq_pill, &RQF_LLOG_ORIGIN_HANDLE_CREATE);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0);
return 0;
rc = llog_origin_handle_open(req);
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
case LLOG_ORIGIN_HANDLE_NEXT_BLOCK:
req_capsule_set(&req->rq_pill,
&RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0);
return 0;
rc = llog_origin_handle_next_block(req);
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
case LLOG_ORIGIN_HANDLE_READ_HEADER:
req_capsule_set(&req->rq_pill,
&RQF_LLOG_ORIGIN_HANDLE_READ_HEADER);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0);
return 0;
rc = llog_origin_handle_read_header(req);
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
case LLOG_ORIGIN_HANDLE_CLOSE:
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET))
RETURN(0);
return 0;
rc = llog_origin_handle_close(req);
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
case OBD_QC_CALLBACK:
req_capsule_set(&req->rq_pill, &RQF_QC_CALLBACK);
if (OBD_FAIL_CHECK(OBD_FAIL_OBD_QC_CALLBACK_NET))
RETURN(0);
return 0;
rc = ldlm_handle_qc_callback(req);
ldlm_callback_reply(req, rc);
RETURN(0);
return 0;
default:
CERROR("unknown opcode %u\n",
lustre_msg_get_opc(req->rq_reqmsg));
ldlm_callback_reply(req, -EPROTO);
RETURN(0);
return 0;
}
ns = req->rq_export->exp_obd->obd_namespace;
@ -660,7 +660,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -EPROTO);
ldlm_callback_errmsg(req, "Operate without parameter", rc,
NULL);
RETURN(0);
return 0;
}
/* Force a known safe race, send a cancel to the server for a lock
@ -679,7 +679,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -EINVAL);
ldlm_callback_errmsg(req, "Operate with invalid parameter", rc,
&dlm_req->lock_handle[0]);
RETURN(0);
return 0;
}
if ((lock->l_flags & LDLM_FL_FAIL_LOC) &&
@ -706,7 +706,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
rc = ldlm_callback_reply(req, -EINVAL);
ldlm_callback_errmsg(req, "Operate on stale lock", rc,
&dlm_req->lock_handle[0]);
RETURN(0);
return 0;
}
/* BL_AST locks are not needed in LRU.
* Let ldlm_cancel_lru() be fast. */
@ -752,7 +752,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
LBUG(); /* checked above */
}
RETURN(0);
return 0;
}
@ -894,7 +894,7 @@ static int ldlm_bl_thread_main(void *arg)
atomic_dec(&blp->blp_busy_threads);
atomic_dec(&blp->blp_num_threads);
complete(&blp->blp_comp);
RETURN(0);
return 0;
}
@ -913,7 +913,7 @@ int ldlm_get_ref(void)
}
mutex_unlock(&ldlm_ref_mutex);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_get_ref);
@ -1014,9 +1014,9 @@ int ldlm_init_export(struct obd_export *exp)
CFS_HASH_NBLK_CHANGE);
if (!exp->exp_lock_hash)
RETURN(-ENOMEM);
return -ENOMEM;
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_init_export);
@ -1037,11 +1037,11 @@ static int ldlm_setup(void)
int i;
if (ldlm_state != NULL)
RETURN(-EALREADY);
return -EALREADY;
OBD_ALLOC(ldlm_state, sizeof(*ldlm_state));
if (ldlm_state == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
#ifdef LPROCFS
rc = ldlm_proc_setup();
@ -1121,11 +1121,11 @@ static int ldlm_setup(void)
CERROR("Failed to initialize LDLM pools: %d\n", rc);
GOTO(out, rc);
}
RETURN(0);
return 0;
out:
ldlm_cleanup();
RETURN(rc);
return rc;
}
static int ldlm_cleanup(void)
@ -1135,7 +1135,7 @@ static int ldlm_cleanup(void)
CERROR("ldlm still has namespaces; clean these up first.\n");
ldlm_dump_all_namespaces(LDLM_NAMESPACE_SERVER, D_DLMTRACE);
ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
RETURN(-EBUSY);
return -EBUSY;
}
ldlm_pools_fini();
@ -1168,7 +1168,7 @@ static int ldlm_cleanup(void)
OBD_FREE(ldlm_state, sizeof(*ldlm_state));
ldlm_state = NULL;
RETURN(0);
return 0;
}
int ldlm_init(void)

View File

@ -338,13 +338,13 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period)
RETURN(0);
return 0;
spin_lock(&pl->pl_lock);
recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
RETURN(0);
return 0;
}
/*
* Recalc SLV after last period. This should be done
@ -366,7 +366,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
recalc_interval_sec);
spin_unlock(&pl->pl_lock);
RETURN(0);
return 0;
}
/**
@ -393,7 +393,7 @@ static int ldlm_srv_pool_shrink(struct ldlm_pool *pl,
* and can't cancel anything. Let's catch this race.
*/
if (atomic_read(&pl->pl_granted) == 0)
RETURN(0);
return 0;
spin_lock(&pl->pl_lock);
@ -475,7 +475,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period)
RETURN(0);
return 0;
spin_lock(&pl->pl_lock);
/*
@ -484,7 +484,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
recalc_interval_sec = cfs_time_current_sec() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
RETURN(0);
return 0;
}
/*
@ -501,7 +501,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
* Do not cancel locks in case lru resize is disabled for this ns.
*/
if (!ns_connect_lru_resize(ldlm_pl2ns(pl)))
RETURN(0);
return 0;
/*
* In the time of canceling locks on client we do not need to maintain
@ -509,8 +509,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
* It may be called when SLV has changed much, this is why we do not
* take into account pl->pl_recalc_time here.
*/
RETURN(ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC,
LDLM_CANCEL_LRUR));
return ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC, LDLM_CANCEL_LRUR);
}
/**
@ -530,7 +529,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl,
* Do not cancel locks in case lru resize is disabled for this ns.
*/
if (!ns_connect_lru_resize(ns))
RETURN(0);
return 0;
/*
* Make sure that pool knows last SLV and Limit from obd.
@ -734,7 +733,7 @@ static int ldlm_pool_proc_init(struct ldlm_pool *pl)
OBD_ALLOC(var_name, MAX_STRING_SIZE + 1);
if (!var_name)
RETURN(-ENOMEM);
return -ENOMEM;
parent_ns_proc = ns->ns_proc_dir_entry;
if (parent_ns_proc == NULL) {
@ -858,11 +857,11 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
pl->pl_client_lock_volume = 0;
rc = ldlm_pool_proc_init(pl);
if (rc)
RETURN(rc);
return rc;
CDEBUG(D_DLMTRACE, "Lock pool %s is initialized\n", pl->pl_name);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_pool_init);
@ -1343,11 +1342,11 @@ static int ldlm_pools_thread_start(void)
task_t *task;
if (ldlm_pools_thread != NULL)
RETURN(-EALREADY);
return -EALREADY;
OBD_ALLOC_PTR(ldlm_pools_thread);
if (ldlm_pools_thread == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
init_completion(&ldlm_pools_comp);
init_waitqueue_head(&ldlm_pools_thread->t_ctl_waitq);
@ -1358,11 +1357,11 @@ static int ldlm_pools_thread_start(void)
CERROR("Can't start pool thread, error %ld\n", PTR_ERR(task));
OBD_FREE(ldlm_pools_thread, sizeof(*ldlm_pools_thread));
ldlm_pools_thread = NULL;
RETURN(PTR_ERR(task));
return PTR_ERR(task);
}
l_wait_event(ldlm_pools_thread->t_ctl_waitq,
thread_is_running(ldlm_pools_thread), &lwi);
RETURN(0);
return 0;
}
static void ldlm_pools_thread_stop(void)
@ -1397,7 +1396,7 @@ int ldlm_pools_init(void)
set_shrinker(DEFAULT_SEEKS,
ldlm_pools_cli_shrink);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_pools_init);

View File

@ -98,7 +98,7 @@ int ldlm_expired_completion_wait(void *data)
static cfs_time_t next_dump = 0, last_dump = 0;
if (ptlrpc_check_suspend())
RETURN(0);
return 0;
LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", "
CFS_DURATION_T"s ago)\n",
@ -119,7 +119,7 @@ int ldlm_expired_completion_wait(void *data)
if (last_dump == 0)
libcfs_debug_dumplog();
}
RETURN(0);
return 0;
}
obd = lock->l_conn_export->exp_obd;
@ -131,7 +131,7 @@ int ldlm_expired_completion_wait(void *data)
cfs_time_sub(cfs_time_current_sec(), lock->l_last_activity),
obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_expired_completion_wait);
@ -185,19 +185,19 @@ int ldlm_completion_ast_async(struct ldlm_lock *lock, __u64 flags, void *data)
{
if (flags == LDLM_FL_WAIT_NOREPROC) {
LDLM_DEBUG(lock, "client-side enqueue waiting on pending lock");
RETURN(0);
return 0;
}
if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
LDLM_FL_BLOCK_CONV))) {
wake_up(&lock->l_waitq);
RETURN(ldlm_completion_tail(lock));
return ldlm_completion_tail(lock);
}
LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
"going forward");
ldlm_reprocess_all(lock->l_resource);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_completion_ast_async);
@ -240,7 +240,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
LDLM_FL_BLOCK_CONV))) {
wake_up(&lock->l_waitq);
RETURN(0);
return 0;
}
LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock, "
@ -291,10 +291,10 @@ noreproc:
if (rc) {
LDLM_DEBUG(lock, "client-side enqueue waking up: failed (%d)",
rc);
RETURN(rc);
return rc;
}
RETURN(ldlm_completion_tail(lock));
return ldlm_completion_tail(lock);
}
EXPORT_SYMBOL(ldlm_completion_ast);
@ -330,7 +330,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock)
LDLM_DEBUG(lock, "Lock still has references, will be "
"cancelled later");
}
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_blocking_ast_nocheck);
@ -352,7 +352,7 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
{
if (flag == LDLM_CB_CANCELING) {
/* Don't need to do anything here. */
RETURN(0);
return 0;
}
lock_res_and_lock(lock);
@ -363,9 +363,9 @@ int ldlm_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
* early, if so. */
if (lock->l_blocking_ast != ldlm_blocking_ast) {
unlock_res_and_lock(lock);
RETURN(0);
return 0;
}
RETURN(ldlm_blocking_ast_nocheck(lock));
return ldlm_blocking_ast_nocheck(lock);
}
EXPORT_SYMBOL(ldlm_blocking_ast);
@ -526,7 +526,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
/* ldlm_cli_enqueue is holding a reference on this lock. */
if (!lock) {
LASSERT(type == LDLM_FLOCK);
RETURN(-ENOLCK);
return -ENOLCK;
}
LASSERTF(ergo(lvb_len != 0, lvb_len == lock->l_lvb_len),
@ -782,7 +782,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
rc = ptlrpc_request_pack(req, version, opc);
if (rc) {
ldlm_lock_list_put(cancels, l_bl_ast, count);
RETURN(rc);
return rc;
}
if (ns_connect_cancelset(ns)) {
@ -802,7 +802,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
} else {
ldlm_lock_list_put(cancels, l_bl_ast, count);
}
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_prep_elc_req);
@ -821,17 +821,17 @@ struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp, int lvb_len)
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
if (req == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
if (rc) {
ptlrpc_request_free(req);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
ptlrpc_request_set_replen(req);
RETURN(req);
return req;
}
EXPORT_SYMBOL(ldlm_enqueue_pack);
@ -881,7 +881,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
einfo->ei_mode, &cbs, einfo->ei_cbdata,
lvb_len, lvb_type);
if (lock == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* for the local lock, add the reference */
ldlm_lock_addref_internal(lock, einfo->ei_mode);
ldlm_lock2handle(lock, lockh);
@ -922,7 +922,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
if (req == NULL) {
failed_lock_cleanup(ns, lock, einfo->ei_mode);
LDLM_LOCK_RELEASE(lock);
RETURN(-ENOMEM);
return -ENOMEM;
}
req_passed_in = 0;
if (reqp)
@ -963,7 +963,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
if (async) {
LASSERT(reqp != NULL);
RETURN(0);
return 0;
}
LDLM_DEBUG(lock, "sending request");
@ -987,7 +987,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
*reqp = NULL;
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_cli_enqueue);
@ -1012,7 +1012,7 @@ static int ldlm_cli_convert_local(struct ldlm_lock *lock, int new_mode,
}
LDLM_DEBUG(lock, "client-side local convert handler END");
LDLM_LOCK_PUT(lock);
RETURN(rc);
return rc;
}
/* FIXME: one of ldlm_cli_convert or the server side should reject attempted
@ -1031,12 +1031,12 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags)
lock = ldlm_handle2lock(lockh);
if (!lock) {
LBUG();
RETURN(-EINVAL);
return -EINVAL;
}
*flags = 0;
if (lock->l_conn_export == NULL)
RETURN(ldlm_cli_convert_local(lock, new_mode, flags));
return ldlm_cli_convert_local(lock, new_mode, flags);
LDLM_DEBUG(lock, "client-side convert");
@ -1045,7 +1045,7 @@ int ldlm_cli_convert(struct lustre_handle *lockh, int new_mode, __u32 *flags)
LDLM_CONVERT);
if (req == NULL) {
LDLM_LOCK_PUT(lock);
RETURN(-ENOMEM);
return -ENOMEM;
}
body = req_capsule_client_get(&req->rq_pill, &RMF_DLM_REQ);
@ -1129,7 +1129,7 @@ static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock)
ldlm_reprocess_all(lock->l_resource);
}
RETURN(rc);
return rc;
}
/**
@ -1184,7 +1184,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels,
CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_PAUSE_CANCEL, cfs_fail_val);
if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_RACE))
RETURN(count);
return count;
free = ldlm_format_handles_avail(class_exp2cliimp(exp),
&RQF_LDLM_CANCEL, RCL_CLIENT, 0);
@ -1196,7 +1196,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels,
if (imp == NULL || imp->imp_invalid) {
CDEBUG(D_DLMTRACE,
"skipping cancel on invalid import %p\n", imp);
RETURN(count);
return count;
}
req = ptlrpc_request_alloc(imp, &RQF_LDLM_CANCEL);
@ -1275,7 +1275,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
/*
* Do nothing for corner cases.
*/
RETURN(0);
return 0;
}
/* In some cases RPC may contain SLV and limit zeroed out. This
@ -1289,7 +1289,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
"(SLV: "LPU64", Limit: %u)",
lustre_msg_get_slv(req->rq_repmsg),
lustre_msg_get_limit(req->rq_repmsg));
RETURN(0);
return 0;
}
new_limit = lustre_msg_get_limit(req->rq_repmsg);
@ -1306,7 +1306,7 @@ int ldlm_cli_update_pool(struct ptlrpc_request *req)
obd->obd_pool_limit = new_limit;
write_unlock(&obd->obd_pool_lock);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_cli_update_pool);
@ -1329,13 +1329,13 @@ int ldlm_cli_cancel(struct lustre_handle *lockh,
lock = ldlm_handle2lock_long(lockh, LDLM_FL_CANCELING);
if (lock == NULL) {
LDLM_DEBUG_NOLOCK("lock is already being destroyed\n");
RETURN(0);
return 0;
}
rc = ldlm_cli_cancel_local(lock);
if (rc == LDLM_FL_LOCAL_ONLY) {
LDLM_LOCK_RELEASE(lock);
RETURN(0);
return 0;
}
/* Even if the lock is marked as LDLM_FL_BL_AST, this is a LDLM_CANCEL
* RPC which goes to canceld portal, so we can cancel other LRU locks
@ -1357,7 +1357,7 @@ int ldlm_cli_cancel(struct lustre_handle *lockh,
LCF_BL_AST, flags);
}
ldlm_cli_cancel_list(&cancels, count, NULL, cancel_flags);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_cli_cancel);
@ -1407,7 +1407,7 @@ int ldlm_cli_cancel_list_local(struct list_head *cancels, int count,
ldlm_cli_cancel_list(&head, bl_ast, NULL, 0);
}
RETURN(count);
return count;
}
EXPORT_SYMBOL(ldlm_cli_cancel_list_local);
@ -1439,7 +1439,7 @@ static ldlm_policy_res_t ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns,
}
unlock_res_and_lock(lock);
RETURN(result);
return result;
}
/**
@ -1730,7 +1730,7 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, struct list_head *ca
unused--;
}
spin_unlock(&ns->ns_lock);
RETURN(added);
return added;
}
int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels,
@ -1764,9 +1764,9 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
count = ldlm_prepare_lru_list(ns, &cancels, nr, 0, flags);
rc = ldlm_bl_to_thread_list(ns, NULL, &cancels, count, cancel_flags);
if (rc == 0)
RETURN(count);
return count;
RETURN(0);
return 0;
}
/**
@ -1822,7 +1822,7 @@ int ldlm_cancel_resource_local(struct ldlm_resource *res,
}
unlock_res(res);
RETURN(ldlm_cli_cancel_list_local(cancels, count, cancel_flags));
return ldlm_cli_cancel_list_local(cancels, count, cancel_flags);
}
EXPORT_SYMBOL(ldlm_cancel_resource_local);
@ -1843,7 +1843,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
int res = 0;
if (list_empty(cancels) || count == 0)
RETURN(0);
return 0;
/* XXX: requests (both batched and not) could be sent in parallel.
* Usually it is enough to have just 1 RPC, but it is possible that
@ -1879,7 +1879,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
ldlm_lock_list_put(cancels, l_bl_ast, res);
}
LASSERT(count == 0);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_cli_cancel_list);
@ -1904,7 +1904,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
if (res == NULL) {
/* This is not a problem. */
CDEBUG(D_INFO, "No resource "LPU64"\n", res_id->name[0]);
RETURN(0);
return 0;
}
LDLM_RESOURCE_ADDREF(res);
@ -1916,7 +1916,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
LDLM_RESOURCE_DELREF(res);
ldlm_resource_putref(res);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(ldlm_cli_cancel_unused_resource);
@ -1959,16 +1959,16 @@ int ldlm_cli_cancel_unused(struct ldlm_namespace *ns,
};
if (ns == NULL)
RETURN(ELDLM_OK);
return ELDLM_OK;
if (res_id != NULL) {
RETURN(ldlm_cli_cancel_unused_resource(ns, res_id, NULL,
return ldlm_cli_cancel_unused_resource(ns, res_id, NULL,
LCK_MINMODE, flags,
opaque));
opaque);
} else {
cfs_hash_for_each_nolock(ns->ns_rs_hash,
ldlm_cli_hash_cancel_unused, &arg);
RETURN(ELDLM_OK);
return ELDLM_OK;
}
}
EXPORT_SYMBOL(ldlm_cli_cancel_unused);
@ -1983,7 +1983,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
int rc = LDLM_ITER_CONTINUE;
if (!res)
RETURN(LDLM_ITER_CONTINUE);
return LDLM_ITER_CONTINUE;
lock_res(res);
list_for_each_safe(tmp, next, &res->lr_granted) {
@ -2008,7 +2008,7 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
}
out:
unlock_res(res);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_resource_foreach);
@ -2067,13 +2067,13 @@ int ldlm_resource_iterate(struct ldlm_namespace *ns,
res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
if (res == NULL)
RETURN(0);
return 0;
LDLM_RESOURCE_ADDREF(res);
rc = ldlm_resource_foreach(res, iter, data);
LDLM_RESOURCE_DELREF(res);
ldlm_resource_putref(res);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_resource_iterate);
@ -2147,7 +2147,7 @@ out:
if (rc != ELDLM_OK)
ptlrpc_connect_import(req->rq_import);
RETURN(rc);
return rc;
}
static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
@ -2160,7 +2160,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
/* Bug 11974: Do not replay a lock which is actively being canceled */
if (lock->l_flags & LDLM_FL_CANCELING) {
LDLM_DEBUG(lock, "Not replaying canceled lock:");
RETURN(0);
return 0;
}
/* If this is reply-less callback lock, we cannot replay it, since
@ -2169,7 +2169,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
if (lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK) {
LDLM_DEBUG(lock, "Not replaying reply-less lock:");
ldlm_lock_cancel(lock);
RETURN(0);
return 0;
}
/*
@ -2198,7 +2198,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
req = ptlrpc_request_alloc_pack(imp, &RQF_LDLM_ENQUEUE,
LUSTRE_DLM_VERSION, LDLM_ENQUEUE);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* We're part of recovery, so don't wait for it. */
req->rq_send_state = LUSTRE_IMP_REPLAY_LOCKS;
@ -2228,7 +2228,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
req->rq_interpret_reply = (ptlrpc_interpterer_t)replay_lock_interpret;
ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
RETURN(0);
return 0;
}
/**
@ -2271,7 +2271,7 @@ int ldlm_replay_locks(struct obd_import *imp)
/* don't replay locks if import failed recovery */
if (imp->imp_vbr_failed)
RETURN(0);
return 0;
/* ensure this doesn't fall to 0 before all have been queued */
atomic_inc(&imp->imp_replay_inflight);
@ -2293,6 +2293,6 @@ int ldlm_replay_locks(struct obd_import *imp)
atomic_dec(&imp->imp_replay_inflight);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ldlm_replay_locks);

View File

@ -78,7 +78,7 @@ static ssize_t lprocfs_wr_dump_ns(struct file *file, const char *buffer,
{
ldlm_dump_all_namespaces(LDLM_NAMESPACE_SERVER, D_DLMTRACE);
ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
RETURN(count);
return count;
}
LPROC_SEQ_FOPS_WR_ONLY(ldlm, dump_ns);
@ -126,7 +126,7 @@ int ldlm_proc_setup(void)
rc = lprocfs_add_vars(ldlm_type_proc_dir, list, NULL);
RETURN(0);
return 0;
err_ns:
lprocfs_remove(&ldlm_ns_proc_dir);
@ -136,7 +136,7 @@ err:
ldlm_svc_proc_dir = NULL;
ldlm_type_proc_dir = NULL;
ldlm_ns_proc_dir = NULL;
RETURN(rc);
return rc;
}
void ldlm_proc_cleanup(void)
@ -573,7 +573,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
rc = ldlm_get_ref();
if (rc) {
CERROR("ldlm_get_ref failed: %d\n", rc);
RETURN(NULL);
return NULL;
}
for (idx = 0;;idx++) {
@ -647,7 +647,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
}
ldlm_namespace_register(ns, client);
RETURN(ns);
return ns;
out_proc:
ldlm_namespace_proc_unregister(ns);
ldlm_namespace_cleanup(ns, 0);
@ -657,7 +657,7 @@ out_ns:
OBD_FREE_PTR(ns);
out_ref:
ldlm_put_ref();
RETURN(NULL);
return NULL;
}
EXPORT_SYMBOL(ldlm_namespace_new);
@ -837,13 +837,13 @@ force_wait:
"with %d resources in use, (rc=%d)\n",
ldlm_ns_name(ns),
atomic_read(&ns->ns_bref), rc);
RETURN(ELDLM_NAMESPACE_EXISTS);
return ELDLM_NAMESPACE_EXISTS;
}
CDEBUG(D_DLMTRACE, "dlm namespace %s free done waiting\n",
ldlm_ns_name(ns));
}
RETURN(ELDLM_OK);
return ELDLM_OK;
}
/**

View File

@ -458,14 +458,6 @@ void libcfs_debug_set_level(unsigned int debug_level)
EXPORT_SYMBOL(libcfs_debug_set_level);
long libcfs_log_return(struct libcfs_debug_msg_data *msgdata, long rc)
{
libcfs_debug_msg(msgdata, "Process leaving (rc=%lu : %ld : %lx)\n",
rc, rc, rc);
return rc;
}
EXPORT_SYMBOL(libcfs_log_return);
void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, const char *label,
long_ptr_t rc)
{

View File

@ -1053,7 +1053,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
CFS_HASH_NAME_LEN : CFS_HASH_BIGNAME_LEN;
LIBCFS_ALLOC(hs, offsetof(cfs_hash_t, hs_name[len]));
if (hs == NULL)
RETURN(NULL);
return NULL;
strncpy(hs->hs_name, name, len);
hs->hs_name[len - 1] = '\0';
@ -1085,7 +1085,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
return hs;
LIBCFS_FREE(hs, offsetof(cfs_hash_t, hs_name[len]));
RETURN(NULL);
return NULL;
}
EXPORT_SYMBOL(cfs_hash_create);
@ -1483,7 +1483,7 @@ cfs_hash_for_each_tight(cfs_hash_t *hs, cfs_hash_for_each_cb_t func,
cfs_hash_unlock(hs, 0);
cfs_hash_for_each_exit(hs);
RETURN(count);
return count;
}
typedef struct {
@ -1645,18 +1645,18 @@ cfs_hash_for_each_nolock(cfs_hash_t *hs,
if (cfs_hash_with_no_lock(hs) ||
cfs_hash_with_rehash_key(hs) ||
!cfs_hash_with_no_itemref(hs))
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
if (CFS_HOP(hs, get) == NULL ||
(CFS_HOP(hs, put) == NULL &&
CFS_HOP(hs, put_locked) == NULL))
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
cfs_hash_for_each_enter(hs);
cfs_hash_for_each_relax(hs, func, data);
cfs_hash_for_each_exit(hs);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(cfs_hash_for_each_nolock);
@ -1691,7 +1691,7 @@ cfs_hash_for_each_empty(cfs_hash_t *hs,
hs->hs_name, i++);
}
cfs_hash_for_each_exit(hs);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(cfs_hash_for_each_empty);

View File

@ -248,7 +248,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
struct kkuc_reg *reg, *next;
if (kkuc_groups[group].next == NULL)
RETURN(0);
return 0;
if (uid == 0) {
/* Broadcast a shutdown message */
@ -274,7 +274,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
}
up_write(&kg_sem);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(libcfs_kkuc_group_rem);
@ -303,7 +303,7 @@ int libcfs_kkuc_group_put(int group, void *payload)
if (one_success)
rc = 0;
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(libcfs_kkuc_group_put);
@ -321,12 +321,12 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
if (group > KUC_GRP_MAX) {
CDEBUG(D_WARNING, "Kernelcomm: bad group %d\n", group);
RETURN(-EINVAL);
return -EINVAL;
}
/* no link for this group */
if (kkuc_groups[group].next == NULL)
RETURN(0);
return 0;
down_read(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
@ -336,7 +336,7 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
}
up_read(&kg_sem);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(libcfs_kkuc_group_foreach);

View File

@ -215,12 +215,12 @@ int cfs_get_environ(const char *key, char *value, int *val_len)
buffer = kmalloc(buf_len, GFP_USER);
if (!buffer)
RETURN(-ENOMEM);
return -ENOMEM;
mm = get_task_mm(current);
if (!mm) {
kfree(buffer);
RETURN(-EINVAL);
return -EINVAL;
}
/* Avoid deadlocks on mmap_sem if called from sys_mmap_pgoff(),

View File

@ -51,31 +51,31 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
err = copy_from_user(buf, (void *)arg, sizeof(*hdr));
if (err)
RETURN(err);
return err;
if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) {
CERROR("PORTALS: version mismatch kernel vs application\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (hdr->ioc_len + buf >= end) {
CERROR("PORTALS: user buffer exceeds kernel buffer\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (hdr->ioc_len < sizeof(struct libcfs_ioctl_data)) {
CERROR("PORTALS: user buffer too small for ioctl\n");
RETURN(-EINVAL);
return -EINVAL;
}
err = copy_from_user(buf, (void *)arg, hdr->ioc_len);
if (err)
RETURN(err);
return err;
if (libcfs_ioctl_is_invalid(data)) {
CERROR("PORTALS: ioctl not correctly formatted\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (data->ioc_inllen1)
@ -85,7 +85,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
data->ioc_inlbuf2 = &data->ioc_bulk[0] +
cfs_size_round(data->ioc_inllen1);
RETURN(0);
return 0;
}
int libcfs_ioctl_popdata(void *arg, void *data, int size)

View File

@ -165,7 +165,7 @@ static int libcfs_psdev_open(unsigned long flags, void *args)
}
*(struct libcfs_device_userstate **)args = ldu;
RETURN(0);
return 0;
}
/* called when closing /dev/device */
@ -180,7 +180,7 @@ static int libcfs_psdev_release(unsigned long flags, void *args)
}
module_put(THIS_MODULE);
RETURN(0);
return 0;
}
static struct rw_semaphore ioctl_list_sem;
@ -224,7 +224,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
switch (cmd) {
case IOC_LIBCFS_CLEAR_DEBUG:
libcfs_debug_clear_buffer();
RETURN(0);
return 0;
/*
* case IOC_LIBCFS_PANIC:
* Handled in arch/cfs_module.c
@ -232,9 +232,9 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
case IOC_LIBCFS_MARK_DEBUG:
if (data->ioc_inlbuf1 == NULL ||
data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
RETURN(-EINVAL);
return -EINVAL;
libcfs_debug_mark_buffer(data->ioc_inlbuf1);
RETURN(0);
return 0;
#if LWT_SUPPORT
case IOC_LIBCFS_LWT_CONTROL:
err = lwt_control ((data->ioc_flags & 1) != 0,
@ -298,7 +298,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
ping(data);
symbol_put(kping_client);
}
RETURN(0);
return 0;
}
default: {
@ -319,7 +319,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile,unsigned long cmd,
}
}
RETURN(err);
return err;
}
static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg)
@ -330,7 +330,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a
LIBCFS_ALLOC_GFP(buf, 1024, GFP_IOFS);
if (buf == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* 'cmd' and permissions get checked in our arch-specific caller */
if (libcfs_ioctl_getdata(buf, buf + 800, (void *)arg)) {
@ -343,7 +343,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a
out:
LIBCFS_FREE(buf, 1024);
RETURN(err);
return err;
}

View File

@ -793,15 +793,15 @@ cfs_parse_nidlist(char *str, int len, struct list_head *nidlist)
rc = cfs_gettok(&src, ' ', &res);
if (rc == 0) {
cfs_free_nidlist(nidlist);
RETURN(0);
return 0;
}
rc = parse_nidrange(&res, nidlist);
if (rc == 0) {
cfs_free_nidlist(nidlist);
RETURN(0);
return 0;
}
}
RETURN(1);
return 1;
}
/*
@ -840,13 +840,13 @@ int cfs_match_nid(lnet_nid_t nid, struct list_head *nidlist)
if (nr->nr_netnum != LNET_NETNUM(LNET_NIDNET(nid)))
continue;
if (nr->nr_all)
RETURN(1);
return 1;
list_for_each_entry(ar, &nr->nr_addrranges, ar_link)
if (nr->nr_netstrfns->nf_match_addr(LNET_NIDADDR(nid),
&ar->ar_numaddr_ranges))
RETURN(1);
return 1;
}
RETURN(0);
return 0;
}

View File

@ -175,7 +175,7 @@ find_again:
new = alloc_entry(cache, key, args);
if (!new) {
CERROR("fail to alloc entry\n");
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
}
goto find_again;
} else {
@ -265,7 +265,7 @@ find_again:
/* Now we know it's good */
out:
spin_unlock(&cache->uc_lock);
RETURN(entry);
return entry;
}
EXPORT_SYMBOL(upcall_cache_get_entry);
@ -308,7 +308,7 @@ int upcall_cache_downcall(struct upcall_cache *cache, __u32 err, __u64 key,
cache->uc_name, key);
/* haven't found, it's possible */
spin_unlock(&cache->uc_lock);
RETURN(-EINVAL);
return -EINVAL;
}
if (err) {
@ -350,7 +350,7 @@ out:
wake_up_all(&entry->ue_waitq);
put_entry(cache, entry);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(upcall_cache_downcall);
@ -425,7 +425,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
LIBCFS_ALLOC(cache, sizeof(*cache));
if (!cache)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
spin_lock_init(&cache->uc_lock);
rwlock_init(&cache->uc_upcall_rwlock);
@ -438,7 +438,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
cache->uc_acquire_expire = 30;
cache->uc_ops = ops;
RETURN(cache);
return cache;
}
EXPORT_SYMBOL(upcall_cache_init);

View File

@ -86,10 +86,10 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name)
{
if (len != name->len)
RETURN(1);
return 1;
if (memcmp(str, name->name, len))
RETURN(1);
return 1;
CDEBUG(D_DENTRY, "found name %.*s(%p) flags %#x refc %d\n",
name->len, name->name, dentry, dentry->d_flags,
@ -97,12 +97,12 @@ int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
/* mountpoint is always valid */
if (d_mountpoint((struct dentry *)dentry))
RETURN(0);
return 0;
if (d_lustre_invalid(dentry))
RETURN(1);
return 1;
RETURN(0);
return 0;
}
static inline int return_if_equal(struct ldlm_lock *lock, void *data)
@ -128,16 +128,16 @@ static int find_cbdata(struct inode *inode)
rc = md_find_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
return_if_equal, NULL);
if (rc != 0)
RETURN(rc);
return rc;
lsm = ccc_inode_lsm_get(inode);
if (lsm == NULL)
RETURN(rc);
return rc;
rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
ccc_inode_lsm_put(inode, lsm);
RETURN(rc);
return rc;
}
/**
@ -172,8 +172,8 @@ static int ll_ddelete(const struct dentry *de)
#endif
if (d_lustre_invalid((struct dentry *)de))
RETURN(1);
RETURN(0);
return 1;
return 0;
}
static int ll_set_dd(struct dentry *de)
@ -196,11 +196,11 @@ static int ll_set_dd(struct dentry *de)
OBD_FREE_PTR(lld);
spin_unlock(&de->d_lock);
} else {
RETURN(-ENOMEM);
return -ENOMEM;
}
}
RETURN(0);
return 0;
}
int ll_dops_init(struct dentry *de, int block, int init_sa)
@ -304,14 +304,14 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
int rc = 0;
if (!request)
RETURN(0);
return 0;
if (it_disposition(it, DISP_LOOKUP_NEG))
RETURN(-ENOENT);
return -ENOENT;
rc = ll_prep_inode(&de->d_inode, request, NULL, it);
RETURN(rc);
return rc;
}
void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry)
@ -368,10 +368,10 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
away this negative dentry and actually do the request to
kernel to create whatever needs to be created (if possible)*/
if (it && (it->it_op & IT_CREAT))
RETURN(0);
return 0;
if (d_lustre_invalid(de))
RETURN(0);
return 0;
ibits = MDS_INODELOCK_UPDATE;
rc = ll_have_md_lock(parent, &ibits, LCK_MINMODE);
@ -398,7 +398,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
LASSERT(it);
if (it->it_op == IT_LOOKUP && !d_lustre_invalid(de))
RETURN(1);
return 1;
if (it->it_op == IT_OPEN) {
struct inode *inode = de->d_inode;
@ -445,7 +445,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
if it would be, we'll reopen the open request to
MDS later during file open path */
mutex_unlock(&lli->lli_och_mutex);
RETURN(1);
return 1;
} else {
mutex_unlock(&lli->lli_och_mutex);
}
@ -464,7 +464,7 @@ do_lock:
de->d_name.name, de->d_name.len,
0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
if (!IS_POSIXACL(parent) || !exp_connect_umask(exp))
it->it_create_mode &= ~current_umask();
@ -551,7 +551,7 @@ out:
mark:
if (it != NULL && it->it_op == IT_GETATTR && rc > 0)
ll_statahead_mark(parent, de);
RETURN(rc);
return rc;
/*
* This part is here to combat evil-evil race in real_lookup on 2.6
@ -583,7 +583,7 @@ do_lookup:
LUSTRE_OPC_CREATE :
LUSTRE_OPC_ANY), NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
rc = md_intent_lock(exp, op_data, NULL, 0, it, 0, &req,
ll_md_blocking_ast, 0);
@ -630,7 +630,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
if (!(flags & (LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE)) &&
ll_need_statahead(parent, dentry) > 0) {
if (flags & LOOKUP_RCU)
RETURN(-ECHILD);
return -ECHILD;
if (dentry->d_inode == NULL)
unplug = 1;
@ -638,7 +638,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
ll_statahead_mark(parent, dentry);
}
RETURN(1);
return 1;
}

View File

@ -589,7 +589,7 @@ int ll_dir_read(struct inode *inode, struct dir_context *ctx)
ctx->pos = pos;
ll_dir_chain_fini(&chain);
RETURN(rc);
return rc;
}
static int ll_readdir(struct file *filp, struct dir_context *ctx)
@ -629,7 +629,7 @@ out:
if (!rc)
ll_stats_ops_tally(sbi, LPROC_LL_READDIR, 1);
RETURN(rc);
return rc;
}
int ll_send_mgc_param(struct obd_export *mgc, char *string)
@ -716,7 +716,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
" %#08x != %#08x nor %#08x\n",
lump->lmm_magic, LOV_USER_MAGIC_V1,
LOV_USER_MAGIC_V3);
RETURN(-EINVAL);
return -EINVAL;
}
}
} else {
@ -726,7 +726,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
if (lump != NULL && lump->lmm_magic == cpu_to_le32(LMV_USER_MAGIC))
op_data->op_cli_flags |= CLI_SET_MEA;
@ -782,7 +782,7 @@ end:
if (param != NULL)
OBD_FREE(param, MGS_PARAM_MAXLEN);
}
RETURN(rc);
return rc;
}
int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
@ -797,13 +797,13 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
rc = ll_get_max_mdsize(sbi, &lmmsize);
if (rc)
RETURN(rc);
return rc;
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL,
0, lmmsize, LUSTRE_OPC_ANY,
NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr(sbi->ll_md_exp, op_data, &req);
@ -867,7 +867,7 @@ int ll_get_mdt_idx(struct inode *inode)
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0,
0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
op_data->op_flags |= MF_GET_MDT_IDX;
rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
@ -875,7 +875,7 @@ int ll_get_mdt_idx(struct inode *inode)
ll_finish_md_op_data(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
RETURN(rc);
return rc;
}
return mdtidx;
}
@ -945,7 +945,7 @@ progress:
rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
&hpk, NULL);
RETURN(rc);
return rc;
}
/**
@ -1044,7 +1044,7 @@ progress:
rc = obd_iocontrol(LL_IOC_HSM_PROGRESS, sbi->ll_md_exp, sizeof(hpk),
&hpk, NULL);
RETURN(rc);
return rc;
}
@ -1082,7 +1082,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
case Q_SETINFO:
if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EPERM);
return -EPERM;
break;
case Q_GETQUOTA:
if (((type == USRQUOTA &&
@ -1091,25 +1091,25 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
!in_egroup_p(make_kgid(&init_user_ns, id)))) &&
(!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT))
RETURN(-EPERM);
return -EPERM;
break;
case Q_GETINFO:
break;
default:
CERROR("unsupported quotactl op: %#x\n", cmd);
RETURN(-ENOTTY);
return -ENOTTY;
}
if (valid != QC_GENERAL) {
if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
if (cmd == Q_GETINFO)
qctl->qc_cmd = Q_GETOINFO;
else if (cmd == Q_GETQUOTA)
qctl->qc_cmd = Q_GETOQUOTA;
else
RETURN(-EINVAL);
return -EINVAL;
switch (valid) {
case QC_MDTIDX:
@ -1134,7 +1134,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
}
if (rc)
RETURN(rc);
return rc;
qctl->qc_cmd = cmd;
} else {
@ -1142,7 +1142,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
OBD_ALLOC_PTR(oqctl);
if (oqctl == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(sbi->ll_md_exp, oqctl);
@ -1152,7 +1152,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
obd_quotactl(sbi->ll_md_exp, oqctl);
}
OBD_FREE_PTR(oqctl);
RETURN(rc);
return rc;
}
/* If QIF_SPACE is not set, client should collect the
* space usage from OSSs by itself */
@ -1199,7 +1199,7 @@ out:
OBD_FREE_PTR(oqctl);
}
RETURN(rc);
return rc;
}
static char *
@ -1244,10 +1244,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
switch(cmd) {
case FSFILT_IOC_GETFLAGS:
case FSFILT_IOC_SETFLAGS:
RETURN(ll_iocontrol(inode, file, cmd, arg));
return ll_iocontrol(inode, file, cmd, arg);
case FSFILT_IOC_GETVERSION_OLD:
case FSFILT_IOC_GETVERSION:
RETURN(put_user(inode->i_generation, (int *)arg));
return put_user(inode->i_generation, (int *)arg);
/* We need to special case any other ioctls we want to handle,
* to send them to the MDS/OST as appropriate and to properly
* network encode the arg field.
@ -1259,10 +1259,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
mdtidx = ll_get_mdt_idx(inode);
if (mdtidx < 0)
RETURN(mdtidx);
return mdtidx;
if (put_user((int)mdtidx, (int*)arg))
RETURN(-EFAULT);
return -EFAULT;
return 0;
}
@ -1275,7 +1275,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
if (rc)
RETURN(rc);
return rc;
data = (void *)buf;
filename = data->ioc_inlbuf1;
@ -1314,7 +1314,7 @@ out_free:
rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
if (rc)
RETURN(rc);
return rc;
data = (void *)buf;
if (data->ioc_inlbuf1 == NULL || data->ioc_inlbuf2 == NULL ||
@ -1345,7 +1345,7 @@ out_free:
rc = ll_dir_setdirstripe(inode, lum, filename);
lmv_out_free:
obd_ioctl_freedata(buf, len);
RETURN(rc);
return rc;
}
case LL_IOC_LOV_SETSTRIPE: {
@ -1361,11 +1361,11 @@ lmv_out_free:
sizeof(lumv3p->lmm_objects[0]));
/* first try with v1 which is smaller than v3 */
if (copy_from_user(lumv1, lumv1p, sizeof(*lumv1)))
RETURN(-EFAULT);
return -EFAULT;
if ((lumv1->lmm_magic == LOV_USER_MAGIC_V3) ) {
if (copy_from_user(&lumv3, lumv3p, sizeof(lumv3)))
RETURN(-EFAULT);
return -EFAULT;
}
if (inode->i_sb->s_root == file->f_dentry)
@ -1374,7 +1374,7 @@ lmv_out_free:
/* in v1 and v3 cases lumv1 points to data */
rc = ll_dir_setstripe(inode, lumv1, set_default);
RETURN(rc);
return rc;
}
case LL_IOC_LMV_GETSTRIPE: {
struct lmv_user_md *lump = (struct lmv_user_md *)arg;
@ -1385,10 +1385,10 @@ lmv_out_free:
int mdtindex;
if (copy_from_user(&lum, lump, sizeof(struct lmv_user_md)))
RETURN(-EFAULT);
return -EFAULT;
if (lum.lum_magic != LMV_MAGIC_V1)
RETURN(-EINVAL);
return -EINVAL;
lum_size = lmv_user_md_size(1, LMV_MAGIC_V1);
OBD_ALLOC(tmp, lum_size);
@ -1411,7 +1411,7 @@ lmv_out_free:
free_lmv:
if (tmp)
OBD_FREE(tmp, lum_size);
RETURN(rc);
return rc;
}
case LL_IOC_REMOVE_ENTRY: {
char *filename = NULL;
@ -1428,7 +1428,7 @@ free_lmv:
filename = ll_getname((const char *)arg);
if (IS_ERR(filename))
RETURN(PTR_ERR(filename));
return PTR_ERR(filename);
namelen = strlen(filename);
if (namelen < 1)
@ -1438,12 +1438,12 @@ free_lmv:
out_rmdir:
if (filename)
ll_putname(filename);
RETURN(rc);
return rc;
}
case LL_IOC_LOV_SWAP_LAYOUTS:
RETURN(-EPERM);
return -EPERM;
case LL_IOC_OBD_STATFS:
RETURN(ll_obd_statfs(inode, (void *)arg));
return ll_obd_statfs(inode, (void *)arg);
case LL_IOC_LOV_GETSTRIPE:
case LL_IOC_MDC_GETINFO:
case IOC_MDC_GETFILEINFO:
@ -1459,7 +1459,7 @@ out_rmdir:
cmd == IOC_MDC_GETFILESTRIPE) {
filename = ll_getname((const char *)arg);
if (IS_ERR(filename))
RETURN(PTR_ERR(filename));
return PTR_ERR(filename);
rc = ll_lov_getstripe_ea_info(inode, filename, &lmm,
&lmmsize, &request);
@ -1539,11 +1539,11 @@ out_rmdir:
rc = ll_get_max_mdsize(sbi, &lmmsize);
if (rc)
RETURN(rc);
return rc;
OBD_ALLOC_LARGE(lmm, lmmsize);
if (lmm == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
if (copy_from_user(lmm, lum, lmmsize))
GOTO(free_lmm, rc = -EFAULT);
@ -1591,7 +1591,7 @@ out_rmdir:
return rc;
}
case OBD_IOC_LLOG_CATINFO: {
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
}
case OBD_IOC_QUOTACHECK: {
struct obd_quotactl *oqctl;
@ -1599,11 +1599,11 @@ out_rmdir:
if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EPERM);
return -EPERM;
OBD_ALLOC_PTR(oqctl);
if (!oqctl)
RETURN(-ENOMEM);
return -ENOMEM;
oqctl->qc_type = arg;
rc = obd_quotacheck(sbi->ll_md_exp, oqctl);
if (rc < 0) {
@ -1623,11 +1623,11 @@ out_rmdir:
if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
sbi->ll_flags & LL_SBI_RMT_CLIENT)
RETURN(-EPERM);
return -EPERM;
OBD_ALLOC_PTR(check);
if (!check)
RETURN(-ENOMEM);
return -ENOMEM;
rc = obd_iocontrol(cmd, sbi->ll_md_exp, 0, (void *)check,
NULL);
@ -1650,7 +1650,7 @@ out_rmdir:
}
out_poll:
OBD_FREE_PTR(check);
RETURN(rc);
return rc;
}
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0)
case LL_IOC_QUOTACTL_18: {
@ -1661,7 +1661,7 @@ out_rmdir:
OBD_ALLOC_PTR(qctl_18);
if (!qctl_18)
RETURN(-ENOMEM);
return -ENOMEM;
OBD_ALLOC_PTR(qctl_20);
if (!qctl_20)
@ -1701,7 +1701,7 @@ out_rmdir:
OBD_FREE_PTR(qctl_20);
out_quotactl_18:
OBD_FREE_PTR(qctl_18);
RETURN(rc);
return rc;
}
#else
#warning "remove old LL_IOC_QUOTACTL_18 compatibility code"
@ -1711,7 +1711,7 @@ out_rmdir:
OBD_ALLOC_PTR(qctl);
if (!qctl)
RETURN(-ENOMEM);
return -ENOMEM;
if (copy_from_user(qctl, (void *)arg, sizeof(*qctl)))
GOTO(out_quotactl, rc = -EFAULT);
@ -1723,13 +1723,13 @@ out_rmdir:
out_quotactl:
OBD_FREE_PTR(qctl);
RETURN(rc);
return rc;
}
case OBD_IOC_GETDTNAME:
case OBD_IOC_GETMDNAME:
RETURN(ll_get_obd_name(inode, cmd, arg));
return ll_get_obd_name(inode, cmd, arg);
case LL_IOC_FLUSHCTX:
RETURN(ll_flush_ctx(inode));
return ll_flush_ctx(inode);
#ifdef CONFIG_FS_POSIX_ACL
case LL_IOC_RMTACL: {
if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
@ -1740,9 +1740,9 @@ out_rmdir:
rc = rct_add(&sbi->ll_rct, current_pid(), arg);
if (!rc)
fd->fd_flags |= LL_FILE_RMTACL;
RETURN(rc);
return rc;
} else
RETURN(0);
return 0;
}
#endif
case LL_IOC_GETOBDCOUNT: {
@ -1750,7 +1750,7 @@ out_rmdir:
struct obd_export *exp;
if (copy_from_user(&count, (int *)arg, sizeof(int)))
RETURN(-EFAULT);
return -EFAULT;
/* get ost count when count is zero, get mdt count otherwise */
exp = count ? sbi->ll_md_exp : sbi->ll_dt_exp;
@ -1759,41 +1759,41 @@ out_rmdir:
KEY_TGT_COUNT, &vallen, &count, NULL);
if (rc) {
CERROR("get target count failed: %d\n", rc);
RETURN(rc);
return rc;
}
if (copy_to_user((int *)arg, &count, sizeof(int)))
RETURN(-EFAULT);
return -EFAULT;
RETURN(0);
return 0;
}
case LL_IOC_PATH2FID:
if (copy_to_user((void *)arg, ll_inode2fid(inode),
sizeof(struct lu_fid)))
RETURN(-EFAULT);
RETURN(0);
return -EFAULT;
return 0;
case LL_IOC_GET_CONNECT_FLAGS: {
RETURN(obd_iocontrol(cmd, sbi->ll_md_exp, 0, NULL, (void*)arg));
return obd_iocontrol(cmd, sbi->ll_md_exp, 0, NULL, (void*)arg);
}
case OBD_IOC_CHANGELOG_SEND:
case OBD_IOC_CHANGELOG_CLEAR:
rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
sizeof(struct ioc_changelog));
RETURN(rc);
return rc;
case OBD_IOC_FID2PATH:
RETURN(ll_fid2path(inode, (void *)arg));
return ll_fid2path(inode, (void *)arg);
case LL_IOC_HSM_REQUEST: {
struct hsm_user_request *hur;
int totalsize;
OBD_ALLOC_PTR(hur);
if (hur == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* We don't know the true size yet; copy the fixed-size part */
if (copy_from_user(hur, (void *)arg, sizeof(*hur))) {
OBD_FREE_PTR(hur);
RETURN(-EFAULT);
return -EFAULT;
}
/* Compute the whole struct size */
@ -1801,12 +1801,12 @@ out_rmdir:
OBD_FREE_PTR(hur);
OBD_ALLOC_LARGE(hur, totalsize);
if (hur == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* Copy the whole struct */
if (copy_from_user(hur, (void *)arg, totalsize)) {
OBD_FREE_LARGE(hur, totalsize);
RETURN(-EFAULT);
return -EFAULT;
}
rc = obd_iocontrol(cmd, ll_i2mdexp(inode), totalsize,
@ -1814,14 +1814,14 @@ out_rmdir:
OBD_FREE_LARGE(hur, totalsize);
RETURN(rc);
return rc;
}
case LL_IOC_HSM_PROGRESS: {
struct hsm_progress_kernel hpk;
struct hsm_progress hp;
if (copy_from_user(&hp, (void *)arg, sizeof(hp)))
RETURN(-EFAULT);
return -EFAULT;
hpk.hpk_fid = hp.hp_fid;
hpk.hpk_cookie = hp.hp_cookie;
@ -1834,12 +1834,12 @@ out_rmdir:
* reported to Lustre root */
rc = obd_iocontrol(cmd, sbi->ll_md_exp, sizeof(hpk), &hpk,
NULL);
RETURN(rc);
return rc;
}
case LL_IOC_HSM_CT_START:
rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg,
sizeof(struct lustre_kernelcomm));
RETURN(rc);
return rc;
case LL_IOC_HSM_COPY_START: {
struct hsm_copy *copy;
@ -1847,10 +1847,10 @@ out_rmdir:
OBD_ALLOC_PTR(copy);
if (copy == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
OBD_FREE_PTR(copy);
RETURN(-EFAULT);
return -EFAULT;
}
rc = ll_ioc_copy_start(inode->i_sb, copy);
@ -1858,7 +1858,7 @@ out_rmdir:
rc = -EFAULT;
OBD_FREE_PTR(copy);
RETURN(rc);
return rc;
}
case LL_IOC_HSM_COPY_END: {
struct hsm_copy *copy;
@ -1866,10 +1866,10 @@ out_rmdir:
OBD_ALLOC_PTR(copy);
if (copy == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
OBD_FREE_PTR(copy);
RETURN(-EFAULT);
return -EFAULT;
}
rc = ll_ioc_copy_end(inode->i_sb, copy);
@ -1877,11 +1877,10 @@ out_rmdir:
rc = -EFAULT;
OBD_FREE_PTR(copy);
RETURN(rc);
return rc;
}
default:
RETURN(obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL,
(void *)arg));
return obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL, (void *)arg);
}
}
@ -1937,12 +1936,12 @@ out:
int ll_dir_open(struct inode *inode, struct file *file)
{
RETURN(ll_file_open(inode, file));
return ll_file_open(inode, file);
}
int ll_dir_release(struct inode *inode, struct file *file)
{
RETURN(ll_file_release(inode, file));
return ll_file_release(inode, file);
}
struct file_operations ll_dir_operations = {

File diff suppressed because it is too large Load Diff

View File

@ -279,7 +279,7 @@ static int capa_thread_main(void *unused)
thread_set_flags(&ll_capa_thread, SVC_STOPPED);
wake_up(&ll_capa_thread.t_ctl_waitq);
RETURN(0);
return 0;
}
void ll_capa_timer_callback(unsigned long unused)
@ -297,12 +297,12 @@ int ll_capa_thread_start(void)
if (IS_ERR(task)) {
CERROR("cannot start expired capa thread: rc %ld\n",
PTR_ERR(task));
RETURN(PTR_ERR(task));
return PTR_ERR(task);
}
wait_event(ll_capa_thread.t_ctl_waitq,
thread_is_running(&ll_capa_thread));
RETURN(0);
return 0;
}
void ll_capa_thread_stop(void)
@ -320,7 +320,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
int found = 0;
if ((ll_i2sbi(inode)->ll_flags & LL_SBI_OSS_CAPA) == 0)
RETURN(NULL);
return NULL;
LASSERT(opc == CAPA_OPC_OSS_WRITE || opc == CAPA_OPC_OSS_RW ||
opc == CAPA_OPC_OSS_TRUNC);
@ -364,7 +364,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
}
spin_unlock(&capa_lock);
RETURN(ocapa);
return ocapa;
}
EXPORT_SYMBOL(ll_osscapa_get);
@ -376,7 +376,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
LASSERT(inode != NULL);
if ((ll_i2sbi(inode)->ll_flags & LL_SBI_MDS_CAPA) == 0)
RETURN(NULL);
return NULL;
spin_lock(&capa_lock);
ocapa = capa_get(lli->lli_mds_capa);
@ -386,7 +386,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
atomic_set(&ll_capa_debug, 0);
}
RETURN(ocapa);
return ocapa;
}
static struct obd_capa *do_add_mds_capa(struct inode *inode,
@ -554,7 +554,7 @@ int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa)
capa_put(ocapa);
iput(inode);
RETURN(rc);
return rc;
}
spin_lock(&ocapa->c_lock);

View File

@ -225,7 +225,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
OBDO_ALLOC(oa);
if (!oa) {
CERROR("can't allocate memory for Size-on-MDS update.\n");
RETURN(-ENOMEM);
return -ENOMEM;
}
old_flags = op_data->op_flags;
@ -255,7 +255,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
ptlrpc_req_finished(request);
OBDO_FREE(oa);
RETURN(rc);
return rc;
}
/**
@ -356,7 +356,7 @@ static int ll_close_thread(void *arg)
CDEBUG(D_INFO, "ll_close exiting\n");
complete(&lcq->lcq_comp);
RETURN(0);
return 0;
}
int ll_close_thread_start(struct ll_close_queue **lcq_ret)

View File

@ -81,7 +81,7 @@ static struct ll_sb_info *ll_init_sbi(void)
OBD_ALLOC(sbi, sizeof(*sbi));
if (!sbi)
RETURN(NULL);
return NULL;
spin_lock_init(&sbi->ll_lock);
mutex_init(&sbi->ll_lco.lco_lock);
@ -139,7 +139,7 @@ static struct ll_sb_info *ll_init_sbi(void)
atomic_set(&sbi->ll_agl_total, 0);
sbi->ll_flags |= LL_SBI_AGL_ENABLED;
RETURN(sbi);
return sbi;
}
void ll_free_sbi(struct super_block *sb)
@ -178,17 +178,17 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
obd = class_name2obd(md);
if (!obd) {
CERROR("MD %s: not setup or attached\n", md);
RETURN(-EINVAL);
return -EINVAL;
}
OBD_ALLOC_PTR(data);
if (data == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
OBD_ALLOC_PTR(osfs);
if (osfs == NULL) {
OBD_FREE_PTR(data);
RETURN(-ENOMEM);
return -ENOMEM;
}
if (proc_lustre_fs_root) {
@ -588,7 +588,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
if (osfs != NULL)
OBD_FREE_PTR(osfs);
RETURN(err);
return err;
out_root:
if (root)
iput(root);
@ -624,7 +624,7 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
if (rc)
CERROR("Get max mdsize error rc %d \n", rc);
RETURN(rc);
return rc;
}
void ll_dump_inode(struct inode *inode)
@ -726,20 +726,20 @@ char *ll_read_opt(const char *opt, char *data)
CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
if (strncmp(opt, data, strlen(opt)))
RETURN(NULL);
return NULL;
if ((value = strchr(data, '=')) == NULL)
RETURN(NULL);
return NULL;
value++;
OBD_ALLOC(retval, strlen(value) + 1);
if (!retval) {
CERROR("out of memory!\n");
RETURN(NULL);
return NULL;
}
memcpy(retval, value, strlen(value)+1);
CDEBUG(D_SUPER, "Assigned option: %s, value %s\n", opt, retval);
RETURN(retval);
return retval;
}
static inline int ll_set_opt(const char *opt, char *data, int fl)
@ -757,7 +757,7 @@ static int ll_options(char *options, int *flags)
char *s1 = options, *s2;
if (!options)
RETURN(0);
return 0;
CDEBUG(D_CONFIG, "Parsing opts %s\n", options);
@ -880,7 +880,7 @@ static int ll_options(char *options, int *flags)
}
LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n",
s1);
RETURN(-EINVAL);
return -EINVAL;
next:
/* Find next opt */
@ -889,7 +889,7 @@ next:
break;
s1 = s2 + 1;
}
RETURN(0);
return 0;
}
void ll_lli_init(struct ll_inode_info *lli)
@ -971,7 +971,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
OBD_ALLOC_PTR(cfg);
if (cfg == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
try_module_get(THIS_MODULE);
@ -980,7 +980,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
if (!sbi) {
module_put(THIS_MODULE);
OBD_FREE_PTR(cfg);
RETURN(-ENOMEM);
return -ENOMEM;
}
err = ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags);
@ -1046,7 +1046,7 @@ out_free:
LCONSOLE_WARN("Mounted %s\n", profilenm);
OBD_FREE_PTR(cfg);
RETURN(err);
return err;
} /* ll_fill_super */
void ll_put_super(struct super_block *sb)
@ -1235,7 +1235,7 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
op_data = ll_prep_md_op_data(op_data, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
rc = md_setattr(sbi->ll_md_exp, op_data, NULL, 0, NULL, 0,
&request, mod);
@ -1255,14 +1255,14 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
} else if (rc != -EPERM && rc != -EACCES && rc != -ETXTBSY) {
CERROR("md_setattr fails: rc = %d\n", rc);
}
RETURN(rc);
return rc;
}
rc = md_get_lustre_md(sbi->ll_md_exp, request, sbi->ll_dt_exp,
sbi->ll_md_exp, &md);
if (rc) {
ptlrpc_req_finished(request);
RETURN(rc);
return rc;
}
ia_valid = op_data->op_attr.ia_valid;
@ -1279,7 +1279,7 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
ll_update_inode(inode, &md);
ptlrpc_req_finished(request);
RETURN(rc);
return rc;
}
/* Close IO epoch and send Size-on-MDS attribute update. */
@ -1292,7 +1292,7 @@ static int ll_setattr_done_writing(struct inode *inode,
LASSERT(op_data != NULL);
if (!S_ISREG(inode->i_mode))
RETURN(0);
return 0;
CDEBUG(D_INODE, "Epoch "LPU64" closed on "DFID" for truncate\n",
op_data->op_ioepoch, PFID(&lli->lli_fid));
@ -1310,7 +1310,7 @@ static int ll_setattr_done_writing(struct inode *inode,
CERROR("inode %lu mdc truncate failed: rc = %d\n",
inode->i_ino, rc);
}
RETURN(rc);
return rc;
}
static int ll_setattr_ost(struct inode *inode, struct iattr *attr)
@ -1364,7 +1364,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
/* Check new size against VFS/VM file size limit and rlimit */
rc = inode_newsize_ok(inode, attr->ia_size);
if (rc)
RETURN(rc);
return rc;
/* The maximum Lustre file size is variable, based on the
* OST maximum object size and number of stripes. This
@ -1373,7 +1373,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
CDEBUG(D_INODE,"file "DFID" too large %llu > "LPU64"\n",
PFID(&lli->lli_fid), attr->ia_size,
ll_file_maxbytes(inode));
RETURN(-EFBIG);
return -EFBIG;
}
attr->ia_valid |= ATTR_MTIME | ATTR_CTIME;
@ -1383,7 +1383,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
if (attr->ia_valid & TIMES_SET_FLAGS) {
if ((!uid_eq(current_fsuid(), inode->i_uid)) &&
!cfs_capable(CFS_CAP_FOWNER))
RETURN(-EPERM);
return -EPERM;
}
/* We mark all of the fields "set" so MDS/OST does not re-set them */
@ -1420,7 +1420,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
OBD_ALLOC_PTR(op_data);
if (op_data == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
if (!S_ISDIR(inode->i_mode)) {
if (attr->ia_valid & ATTR_SIZE)
@ -1521,7 +1521,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
rc = obd_statfs(NULL, sbi->ll_md_exp, osfs, max_age, flags);
if (rc) {
CERROR("md_statfs fails: rc = %d\n", rc);
RETURN(rc);
return rc;
}
osfs->os_type = sb->s_magic;
@ -1535,7 +1535,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
rc = obd_statfs_rqset(sbi->ll_dt_exp, &obd_osfs, max_age, flags);
if (rc) {
CERROR("obd_statfs fails: rc = %d\n", rc);
RETURN(rc);
return rc;
}
CDEBUG(D_SUPER, "OSC blocks "LPU64"/"LPU64" objects "LPU64"/"LPU64"\n",
@ -1557,7 +1557,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
osfs->os_ffree = obd_osfs.os_ffree;
}
RETURN(rc);
return rc;
}
int ll_statfs(struct dentry *de, struct kstatfs *sfs)
{
@ -1851,14 +1851,14 @@ int ll_iocontrol(struct inode *inode, struct file *file,
0, 0, LUSTRE_OPC_ANY,
NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
op_data->op_valid = OBD_MD_FLFLAGS;
rc = md_getattr(sbi->ll_md_exp, op_data, &req);
ll_finish_md_op_data(op_data);
if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino);
RETURN(-abs(rc));
return -abs(rc);
}
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
@ -1867,7 +1867,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
ptlrpc_req_finished(req);
RETURN(put_user(flags, (int *)arg));
return put_user(flags, (int *)arg);
}
case FSFILT_IOC_SETFLAGS: {
struct lov_stripe_md *lsm;
@ -1875,12 +1875,12 @@ int ll_iocontrol(struct inode *inode, struct file *file,
struct md_op_data *op_data;
if (get_user(flags, (int *)arg))
RETURN(-EFAULT);
return -EFAULT;
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags = flags;
op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
@ -1889,20 +1889,20 @@ int ll_iocontrol(struct inode *inode, struct file *file,
ll_finish_md_op_data(op_data);
ptlrpc_req_finished(req);
if (rc)
RETURN(rc);
return rc;
inode->i_flags = ll_ext_to_inode_flags(flags);
lsm = ccc_inode_lsm_get(inode);
if (!lsm_has_objects(lsm)) {
ccc_inode_lsm_put(inode, lsm);
RETURN(0);
return 0;
}
OBDO_ALLOC(oinfo.oi_oa);
if (!oinfo.oi_oa) {
ccc_inode_lsm_put(inode, lsm);
RETURN(-ENOMEM);
return -ENOMEM;
}
oinfo.oi_md = lsm;
oinfo.oi_oa->o_oi = lsm->lsm_oi;
@ -1919,13 +1919,13 @@ int ll_iocontrol(struct inode *inode, struct file *file,
if (rc && rc != -EPERM && rc != -EACCES)
CERROR("osc_setattr_async fails: rc = %d\n", rc);
RETURN(rc);
return rc;
}
default:
RETURN(-ENOSYS);
return -ENOSYS;
}
RETURN(0);
return 0;
}
int ll_flush_ctx(struct inode *inode)
@ -2032,7 +2032,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
rc = md_get_lustre_md(sbi->ll_md_exp, req, sbi->ll_dt_exp,
sbi->ll_md_exp, &md);
if (rc)
RETURN(rc);
return rc;
if (*inode) {
ll_update_inode(*inode, &md);
@ -2094,7 +2094,7 @@ out:
if (md.lsm != NULL)
obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
md_free_lustre_md(sbi->ll_md_exp, &md);
RETURN(rc);
return rc;
}
int ll_obd_statfs(struct inode *inode, void *arg)
@ -2270,7 +2270,7 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry)
if (sbi->ll_flags & LL_SBI_USER_FID2PATH)
seq_puts(seq, ",user_fid2path");
RETURN(0);
return 0;
}
/**
@ -2286,16 +2286,16 @@ int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg)
else if (cmd == OBD_IOC_GETMDNAME)
obd = class_exp2obd(sbi->ll_md_exp);
else
RETURN(-EINVAL);
return -EINVAL;
if (!obd)
RETURN(-ENOENT);
return -ENOENT;
if (copy_to_user((void *)arg, obd->obd_name,
strlen(obd->obd_name) + 1))
RETURN(-EFAULT);
return -EFAULT;
RETURN(0);
return 0;
}
/**

View File

@ -82,7 +82,7 @@ struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
break;
}
}
RETURN(ret);
return ret;
}
/**
@ -111,7 +111,7 @@ struct cl_io *ll_fault_io_init(struct vm_area_struct *vma,
*env_ret = NULL;
if (ll_file_nolock(file))
RETURN(ERR_PTR(-EOPNOTSUPP));
return ERR_PTR(-EOPNOTSUPP);
/*
* page fault can be called when lustre IO is
@ -122,7 +122,7 @@ struct cl_io *ll_fault_io_init(struct vm_area_struct *vma,
*/
env = cl_env_nested_get(nest);
if (IS_ERR(env))
RETURN(ERR_PTR(-EINVAL));
return ERR_PTR(-EINVAL);
*env_ret = env;
@ -305,7 +305,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
io = ll_fault_io_init(vma, &env, &nest, vmf->pgoff, &ra_flags);
if (IS_ERR(io))
RETURN(to_fault_error(PTR_ERR(io)));
return to_fault_error(PTR_ERR(io));
result = io->ci_result;
if (result == 0) {
@ -332,7 +332,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
CDEBUG(D_MMAP, "%s fault %d/%d\n",
current->comm, fault_ret, result);
RETURN(fault_ret);
return fault_ret;
}
static int ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
@ -467,7 +467,7 @@ int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last)
last - first + 1, 0);
}
RETURN(rc);
return rc;
}
static struct vm_operations_struct ll_file_vm_ops = {
@ -483,7 +483,7 @@ int ll_file_mmap(struct file *file, struct vm_area_struct * vma)
int rc;
if (ll_file_nolock(file))
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_MAP, 1);
rc = generic_file_mmap(file, vma);
@ -494,5 +494,5 @@ int ll_file_mmap(struct file *file, struct vm_area_struct * vma)
rc = ll_glimpse_size(inode);
}
RETURN(rc);
return rc;
}

View File

@ -96,11 +96,11 @@ struct inode *search_inode_for_lustre(struct super_block *sb,
inode = ilookup5(sb, hash, ll_nfs_test_inode, (void *)fid);
if (inode)
RETURN(inode);
return inode;
rc = ll_get_max_mdsize(sbi, &eadatalen);
if (rc)
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
/* Because inode is NULL, ll_prep_md_op_data can not
* be used here. So we allocate op_data ourselves */
@ -118,14 +118,14 @@ struct inode *search_inode_for_lustre(struct super_block *sb,
if (rc) {
CERROR("can't get object attrs, fid "DFID", rc %d\n",
PFID(fid), rc);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
rc = ll_prep_inode(&inode, req, sb, NULL);
ptlrpc_req_finished(req);
if (rc)
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
RETURN(inode);
return inode;
}
struct lustre_nfs_fid {
@ -141,16 +141,16 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
CDEBUG(D_INFO, "Get dentry for fid: "DFID"\n", PFID(fid));
if (!fid_is_sane(fid))
RETURN(ERR_PTR(-ESTALE));
return ERR_PTR(-ESTALE);
inode = search_inode_for_lustre(sb, fid);
if (IS_ERR(inode))
RETURN(ERR_CAST(inode));
return ERR_CAST(inode);
if (is_bad_inode(inode)) {
/* we didn't find the right inode.. */
iput(inode);
RETURN(ERR_PTR(-ESTALE));
return ERR_PTR(-ESTALE);
}
/**
@ -168,11 +168,11 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
result = d_obtain_alias(inode);
if (IS_ERR(result))
RETURN(result);
return result;
ll_dops_init(result, 1, 0);
RETURN(result);
return result;
}
#define LUSTRE_NFS_FID 0x97
@ -196,13 +196,13 @@ static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
(int)sizeof(struct lustre_nfs_fid));
if (*plen < sizeof(struct lustre_nfs_fid) / 4)
RETURN(255);
return 255;
nfs_fid->lnf_child = *ll_inode2fid(inode);
nfs_fid->lnf_parent = *ll_inode2fid(parent);
*plen = sizeof(struct lustre_nfs_fid) / 4;
RETURN(LUSTRE_NFS_FID);
return LUSTRE_NFS_FID;
}
static int ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,
@ -255,9 +255,9 @@ static struct dentry *ll_fh_to_dentry(struct super_block *sb, struct fid *fid,
struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
if (fh_type != LUSTRE_NFS_FID)
RETURN(ERR_PTR(-EPROTO));
return ERR_PTR(-EPROTO);
RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_child, &nfs_fid->lnf_parent));
return ll_iget_for_nfs(sb, &nfs_fid->lnf_child, &nfs_fid->lnf_parent);
}
static struct dentry *ll_fh_to_parent(struct super_block *sb, struct fid *fid,
@ -266,9 +266,9 @@ static struct dentry *ll_fh_to_parent(struct super_block *sb, struct fid *fid,
struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
if (fh_type != LUSTRE_NFS_FID)
RETURN(ERR_PTR(-EPROTO));
return ERR_PTR(-EPROTO);
RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL));
return ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL);
}
static struct dentry *ll_get_parent(struct dentry *dchild)
@ -292,19 +292,19 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
rc = ll_get_max_mdsize(sbi, &lmmsize);
if (rc != 0)
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot,
strlen(dotdot), lmmsize,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN((void *)op_data);
return (void *)op_data;
rc = md_getattr_name(sbi->ll_md_exp, op_data, &req);
ll_finish_md_op_data(op_data);
if (rc) {
CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
LASSERT(body->valid & OBD_MD_FLID);
@ -315,7 +315,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL);
ptlrpc_req_finished(req);
RETURN(result);
return result;
}
struct export_operations lustre_export_operations = {

View File

@ -384,17 +384,17 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, const char *buffer,
buffer = lprocfs_find_named_value(buffer, "max_cached_mb:", &count);
rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
if (rc)
RETURN(rc);
return rc;
if (pages_number < 0 || pages_number > totalram_pages) {
CERROR("%s: can't set max cache more than %lu MB\n",
ll_get_fsname(sb, NULL, 0),
totalram_pages >> (20 - PAGE_CACHE_SHIFT));
RETURN(-ERANGE);
return -ERANGE;
}
if (sbi->ll_dt_exp == NULL)
RETURN(-ENODEV);
return -ENODEV;
spin_lock(&sbi->ll_lock);
diff = pages_number - cache->ccc_lru_max;
@ -878,7 +878,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
if (IS_ERR(sbi->ll_proc_root)) {
err = PTR_ERR(sbi->ll_proc_root);
sbi->ll_proc_root = NULL;
RETURN(err);
return err;
}
rc = lprocfs_seq_create(sbi->ll_proc_root, "dump_page_cache", 0444,
@ -992,7 +992,7 @@ out:
lprocfs_free_stats(&sbi->ll_ra_stats);
lprocfs_free_stats(&sbi->ll_stats);
}
RETURN(err);
return err;
}
void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi)

View File

@ -79,7 +79,7 @@ int ll_unlock(__u32 mode, struct lustre_handle *lockh)
{
ldlm_lock_decref(lockh, mode);
RETURN(0);
return 0;
}
@ -166,7 +166,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
CDEBUG(D_VFSTRACE, "got inode: %p for "DFID"\n",
inode, PFID(&md->body->fid1));
}
RETURN(inode);
return inode;
}
static void ll_invalidate_negative_children(struct inode *dir)
@ -204,7 +204,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
rc = ldlm_cli_cancel(&lockh, LCF_ASYNC);
if (rc < 0) {
CDEBUG(D_INODE, "ldlm_cli_cancel: %d\n", rc);
RETURN(rc);
return rc;
}
break;
case LDLM_CB_CANCELING: {
@ -296,7 +296,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
LBUG();
}
RETURN(0);
return 0;
}
__u32 ll_i2suppgid(struct inode *i)
@ -437,7 +437,7 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
if (!it_disposition(it, DISP_LOOKUP_NEG)) {
rc = ll_prep_inode(&inode, request, (*de)->d_sb, it);
if (rc)
RETURN(rc);
return rc;
ll_set_lock_data(ll_i2sbi(parent)->ll_md_exp, inode, it, &bits);
@ -478,7 +478,7 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
}
}
RETURN(0);
return 0;
}
static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
@ -493,7 +493,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
int rc;
if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen)
RETURN(ERR_PTR(-ENAMETOOLONG));
return ERR_PTR(-ENAMETOOLONG);
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p),intent=%s\n",
dentry->d_name.len, dentry->d_name.name, parent->i_ino,
@ -511,7 +511,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
rc = ll_inode_revalidate_it(parent->i_sb->s_root, it,
MDS_INODELOCK_LOOKUP);
if (rc)
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
if (it->it_op == IT_GETATTR) {
@ -536,7 +536,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
dentry->d_name.len, lookup_flags, opc,
NULL);
if (IS_ERR(op_data))
RETURN((void *)op_data);
return (void *)op_data;
/* enforce umask if acl disabled or MDS doesn't support umask */
if (!IS_POSIXACL(parent) || !exp_connect_umask(ll_i2mdexp(parent)))
@ -623,7 +623,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
OBD_ALLOC(it, sizeof(*it));
if (!it)
RETURN(-ENOMEM);
return -ENOMEM;
it->it_op = IT_OPEN;
if (mode) {
@ -682,7 +682,7 @@ out_release:
ll_intent_release(it);
OBD_FREE(it, sizeof(*it));
RETURN(rc);
return rc;
}
@ -745,18 +745,18 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, int mode,
rc = it_open_error(DISP_OPEN_CREATE, it);
if (rc)
RETURN(rc);
return rc;
inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
NULL, 0, mode, 0, it);
if (IS_ERR(inode))
RETURN(PTR_ERR(inode));
return PTR_ERR(inode);
if (filename_is_volatile(dentry->d_name.name, dentry->d_name.len, NULL))
ll_i2info(inode)->lli_volatile = true;
d_instantiate(dentry, inode);
RETURN(0);
return 0;
}
static void ll_update_times(struct ptlrpc_request *request,
@ -852,7 +852,7 @@ static int ll_mknod_generic(struct inode *dir, struct qstr *name, int mode,
if (!err)
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKNOD, 1);
RETURN(err);
return err;
}
/*
@ -893,7 +893,7 @@ static int ll_symlink_generic(struct inode *dir, struct qstr *name,
if (!err)
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_SYMLINK, 1);
RETURN(err);
return err;
}
static int ll_link_generic(struct inode *src, struct inode *dir,
@ -912,7 +912,7 @@ static int ll_link_generic(struct inode *src, struct inode *dir,
op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len,
0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
err = md_link(sbi->ll_md_exp, op_data, &request);
ll_finish_md_op_data(op_data);
@ -923,7 +923,7 @@ static int ll_link_generic(struct inode *src, struct inode *dir,
ll_stats_ops_tally(sbi, LPROC_LL_LINK, 1);
out:
ptlrpc_req_finished(request);
RETURN(err);
return err;
}
static int ll_mkdir_generic(struct inode *dir, struct qstr *name,
@ -943,7 +943,7 @@ static int ll_mkdir_generic(struct inode *dir, struct qstr *name,
if (!err)
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKDIR, 1);
RETURN(err);
return err;
}
/* Try to find the child dentry by its name.
@ -973,12 +973,12 @@ static int ll_rmdir_generic(struct inode *dir, struct dentry *dparent,
name->len, name->name, dir->i_ino, dir->i_generation, dir);
if (unlikely(ll_d_mountpoint(dparent, dchild, name)))
RETURN(-EBUSY);
return -EBUSY;
op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name, name->len,
S_IFDIR, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
ll_get_child_fid(dir, name, &op_data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
@ -990,7 +990,7 @@ static int ll_rmdir_generic(struct inode *dir, struct dentry *dparent,
}
ptlrpc_req_finished(request);
RETURN(rc);
return rc;
}
/**
@ -1008,7 +1008,7 @@ int ll_rmdir_entry(struct inode *dir, char *name, int namelen)
op_data = ll_prep_md_op_data(NULL, dir, NULL, name, strlen(name),
S_IFDIR, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
op_data->op_cli_flags |= CLI_RM_ENTRY;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
ll_finish_md_op_data(op_data);
@ -1018,7 +1018,7 @@ int ll_rmdir_entry(struct inode *dir, char *name, int namelen)
}
ptlrpc_req_finished(request);
RETURN(rc);
return rc;
}
int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
@ -1034,7 +1034,7 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
/* req is swabbed so this is safe */
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
if (!(body->valid & OBD_MD_FLEASIZE))
RETURN(0);
return 0;
if (body->eadatasize == 0) {
CERROR("OBD_MD_FLEASIZE set but eadatasize zero\n");
@ -1114,12 +1114,12 @@ static int ll_unlink_generic(struct inode *dir, struct dentry *dparent,
* just check it as vfs_unlink does.
*/
if (unlikely(ll_d_mountpoint(dparent, dchild, name)))
RETURN(-EBUSY);
return -EBUSY;
op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name,
name->len, 0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
ll_get_child_fid(dir, name, &op_data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
@ -1134,7 +1134,7 @@ static int ll_unlink_generic(struct inode *dir, struct dentry *dparent,
rc = ll_objects_destroy(request, dir);
out:
ptlrpc_req_finished(request);
RETURN(rc);
return rc;
}
static int ll_rename_generic(struct inode *src, struct dentry *src_dparent,
@ -1154,12 +1154,12 @@ static int ll_rename_generic(struct inode *src, struct dentry *src_dparent,
if (unlikely(ll_d_mountpoint(src_dparent, src_dchild, src_name) ||
ll_d_mountpoint(tgt_dparent, tgt_dchild, tgt_name)))
RETURN(-EBUSY);
return -EBUSY;
op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
ll_get_child_fid(src, src_name, &op_data->op_fid3);
ll_get_child_fid(tgt, tgt_name, &op_data->op_fid4);
@ -1176,7 +1176,7 @@ static int ll_rename_generic(struct inode *src, struct dentry *src_dparent,
ptlrpc_req_finished(request);
RETURN(err);
return err;
}
static int ll_mknod(struct inode *dir, struct dentry *dchild, ll_umode_t mode,

View File

@ -125,7 +125,7 @@ static int do_check_remote_perm(struct ll_inode_info *lli, int mask)
int found = 0, rc;
if (!lli->lli_remote_perms)
RETURN(-ENOENT);
return -ENOENT;
head = lli->lli_remote_perms +
remote_perm_hashfunc(from_kuid(&init_user_ns, current_uid()));
@ -176,7 +176,7 @@ int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm)
perm->rp_uid, perm->rp_gid, perm->rp_fsuid,
perm->rp_fsgid, current->uid, current->gid,
current->fsuid, current->fsgid);
RETURN(-EAGAIN);
return -EAGAIN;
}
#endif
@ -184,7 +184,7 @@ int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm)
perm_hash = alloc_rmtperm_hash();
if (perm_hash == NULL) {
CERROR("alloc lli_remote_perms failed!\n");
RETURN(-ENOMEM);
return -ENOMEM;
}
}
@ -218,7 +218,7 @@ again:
lrp = alloc_ll_remote_perm();
if (!lrp) {
CERROR("alloc memory for ll_remote_perm failed!\n");
RETURN(-ENOMEM);
return -ENOMEM;
}
spin_lock(&lli->lli_lock);
goto again;
@ -239,7 +239,7 @@ again:
lrp, lrp->lrp_uid, lrp->lrp_gid, lrp->lrp_fsuid, lrp->lrp_fsgid,
lrp->lrp_access_perm);
RETURN(0);
return 0;
}
int lustre_check_remote_perm(struct inode *inode, int mask)
@ -301,7 +301,7 @@ int lustre_check_remote_perm(struct inode *inode, int mask)
req = NULL;
} while (1);
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
#if 0 /* NB: remote perms can't be freed in ll_mdc_blocking_ast of UPDATE lock,

View File

@ -252,7 +252,7 @@ int ll_prepare_write(struct file *file, struct page *vmpage, unsigned from,
} else {
result = PTR_ERR(lcc);
}
RETURN(result);
return result;
}
int ll_commit_write(struct file *file, struct page *vmpage, unsigned from,
@ -282,7 +282,7 @@ int ll_commit_write(struct file *file, struct page *vmpage, unsigned from,
lu_ref_del(&page->cp_reference, "prepare_write", current);
cl_page_put(env, page);
ll_cl_fini(lcc);
RETURN(result);
return result;
}
struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt)
@ -351,7 +351,7 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi,
}
out:
RETURN(ret);
return ret;
}
void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len)
@ -483,7 +483,7 @@ static int cl_read_ahead_page(const struct lu_env *env, struct cl_io *io,
}
lu_ref_del(&page->cp_reference, "ra", current);
cl_page_put(env, page);
RETURN(rc);
return rc;
}
/**
@ -544,7 +544,7 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io,
ll_ra_stats_inc(mapping, which);
CDEBUG(D_READA, "%s\n", msg);
}
RETURN(rc);
return rc;
}
#define RIA_DEBUG(ria) \
@ -724,11 +724,11 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
cl_object_attr_unlock(clob);
if (ret != 0)
RETURN(ret);
return ret;
kms = attr->cat_kms;
if (kms == 0) {
ll_ra_stats_inc(mapping, RA_STAT_ZERO_LEN);
RETURN(0);
return 0;
}
spin_lock(&ras->ras_lock);
@ -786,11 +786,11 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
if (end == 0) {
ll_ra_stats_inc(mapping, RA_STAT_ZERO_WINDOW);
RETURN(0);
return 0;
}
len = ria_page_count(ria);
if (len == 0)
RETURN(0);
return 0;
reserved = ll_ra_count_get(ll_i2sbi(inode), ria, len);
if (reserved < len)
@ -829,7 +829,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
spin_unlock(&ras->ras_lock);
}
RETURN(ret);
return ret;
}
static void ras_set_start(struct inode *inode, struct ll_readahead_state *ras,
@ -1266,7 +1266,7 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc)
end = i_size_read(inode);
mapping->writeback_index = (end >> PAGE_CACHE_SHIFT) + 1;
}
RETURN(result);
return result;
}
int ll_readpage(struct file *file, struct page *vmpage)
@ -1294,5 +1294,5 @@ int ll_readpage(struct file *file, struct page *vmpage)
unlock_page(vmpage);
result = PTR_ERR(lcc);
}
RETURN(result);
return result;
}

View File

@ -180,7 +180,7 @@ static int ll_set_page_dirty(struct page *vmpage)
*/
vvp_write_pending(obj, cpg);
#endif
RETURN(__set_page_dirty_nobuffers(vmpage));
return __set_page_dirty_nobuffers(vmpage);
}
#define MAX_DIRECTIO_SIZE 2*1024*1024*1024UL
@ -332,7 +332,7 @@ ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,
cl_2queue_discard(env, io, queue);
cl_2queue_disown(env, io, queue);
cl_2queue_fini(env, queue);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(ll_direct_rw_pages);
@ -382,11 +382,11 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb,
int refcheck;
if (!lli->lli_has_smd)
RETURN(-EBADF);
return -EBADF;
/* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */
if ((file_offset & ~CFS_PAGE_MASK) || (count & ~CFS_PAGE_MASK))
RETURN(-EINVAL);
return -EINVAL;
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), size=%lu (max %lu), "
"offset=%lld=%llx, pages %lu (max %lu)\n",
@ -398,7 +398,7 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb,
for (seg = 0; seg < nr_segs; seg++) {
if (((unsigned long)iov[seg].iov_base & ~CFS_PAGE_MASK) ||
(iov[seg].iov_len & ~CFS_PAGE_MASK))
RETURN(-EINVAL);
return -EINVAL;
}
env = cl_env_get(&refcheck);
@ -491,7 +491,7 @@ out:
}
cl_env_put(env, &refcheck);
RETURN(tot_bytes ? : result);
return tot_bytes ? : result;
}
static int ll_write_begin(struct file *file, struct address_space *mapping,
@ -505,7 +505,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
page = grab_cache_page_write_begin(mapping, index, flags);
if (!page)
RETURN(-ENOMEM);
return -ENOMEM;
*pagep = page;
@ -514,7 +514,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
unlock_page(page);
page_cache_release(page);
}
RETURN(rc);
return rc;
}
static int ll_write_end(struct file *file, struct address_space *mapping,

View File

@ -204,7 +204,7 @@ ll_sa_entry_alloc(struct ll_statahead_info *sai, __u64 index,
entry_size = sizeof(struct ll_sa_entry) + (len & ~3) + 4;
OBD_ALLOC(entry, entry_size);
if (unlikely(entry == NULL))
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
CDEBUG(D_READA, "alloc sa entry %.*s(%p) index "LPU64"\n",
len, name, entry, index);
@ -253,7 +253,7 @@ ll_sa_entry_alloc(struct ll_statahead_info *sai, __u64 index,
atomic_inc(&sai->sai_cache_count);
RETURN(entry);
return entry;
}
/*
@ -467,7 +467,7 @@ static struct ll_statahead_info *ll_sai_alloc(void)
OBD_ALLOC_PTR(sai);
if (!sai)
RETURN(NULL);
return NULL;
atomic_set(&sai->sai_refcount, 1);
@ -494,7 +494,7 @@ static struct ll_statahead_info *ll_sai_alloc(void)
}
atomic_set(&sai->sai_cache_count, 0);
RETURN(sai);
return sai;
}
static inline struct ll_statahead_info *
@ -841,7 +841,7 @@ static int do_sa_lookup(struct inode *dir, struct ll_sa_entry *entry)
rc = sa_args_init(dir, NULL, entry, &minfo, &einfo, capas);
if (rc)
RETURN(rc);
return rc;
rc = md_intent_getattr_async(ll_i2mdexp(dir), minfo, einfo);
if (!rc) {
@ -851,7 +851,7 @@ static int do_sa_lookup(struct inode *dir, struct ll_sa_entry *entry)
sa_args_fini(minfo, einfo);
}
RETURN(rc);
return rc;
}
/**
@ -872,27 +872,27 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
int rc;
if (unlikely(inode == NULL))
RETURN(1);
return 1;
if (d_mountpoint(dentry))
RETURN(1);
return 1;
if (unlikely(dentry == dentry->d_sb->s_root))
RETURN(1);
return 1;
entry->se_inode = igrab(inode);
rc = md_revalidate_lock(ll_i2mdexp(dir), &it, ll_inode2fid(inode),NULL);
if (rc == 1) {
entry->se_handle = it.d.lustre.it_lock_handle;
ll_intent_release(&it);
RETURN(1);
return 1;
}
rc = sa_args_init(dir, inode, entry, &minfo, &einfo, capas);
if (rc) {
entry->se_inode = NULL;
iput(inode);
RETURN(rc);
return rc;
}
rc = md_intent_getattr_async(ll_i2mdexp(dir), minfo, einfo);
@ -905,7 +905,7 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,
sa_args_fini(minfo, einfo);
}
RETURN(rc);
return rc;
}
static void ll_statahead_one(struct dentry *parent, const char* entry_name,
@ -1009,7 +1009,7 @@ static int ll_agl_thread(void *arg)
ll_sai_put(sai);
CDEBUG(D_READA, "agl thread stopped: [pid %d] [parent %.*s]\n",
current_pid(), parent->d_name.len, parent->d_name.name);
RETURN(0);
return 0;
}
static void ll_start_agl(struct dentry *parent, struct ll_statahead_info *sai)
@ -1520,7 +1520,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
list_empty(&sai->sai_entries_stated))) {
/* to release resource */
ll_stop_statahead(dir, lli->lli_opendir_key);
RETURN(-EAGAIN);
return -EAGAIN;
}
if ((*dentryp)->d_name.name[0] == '.') {
@ -1546,14 +1546,14 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
* "sai_ls_all" enabled as above.
*/
sai->sai_miss_hidden++;
RETURN(-EAGAIN);
return -EAGAIN;
}
}
entry = ll_sa_entry_get_byname(sai, &(*dentryp)->d_name);
if (entry == NULL || only_unplug) {
ll_sai_unplug(sai, entry);
RETURN(entry ? 1 : -EAGAIN);
return entry ? 1 : -EAGAIN;
}
/* if statahead is busy in readdir, help it do post-work */
@ -1572,7 +1572,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
&lwi);
if (rc < 0) {
ll_sai_unplug(sai, entry);
RETURN(-EAGAIN);
return -EAGAIN;
}
}
@ -1602,7 +1602,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
inode->i_ino,
inode->i_generation);
ll_sai_unplug(sai, entry);
RETURN(-ESTALE);
return -ESTALE;
} else {
iput(inode);
}
@ -1616,7 +1616,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
}
ll_sai_unplug(sai, entry);
RETURN(rc);
return rc;
}
/* I am the "lli_opendir_pid" owner, only me can set "lli_sai". */
@ -1668,7 +1668,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED);
ll_sai_put(sai);
LASSERT(lli->lli_sai == NULL);
RETURN(-EAGAIN);
return -EAGAIN;
}
l_wait_event(thread->t_ctl_waitq,
@ -1679,7 +1679,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
* We don't stat-ahead for the first dirent since we are already in
* lookup.
*/
RETURN(-EAGAIN);
return -EAGAIN;
out:
if (sai != NULL)

View File

@ -63,13 +63,13 @@ static int ll_readlink_internal(struct inode *inode,
CDEBUG(D_INODE, "using cached symlink %s%.*s, len = %d\n",
print_limit < symlen ? "..." : "", print_limit,
(*symname) + symlen - print_limit, symlen);
RETURN(0);
return 0;
}
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, symlen,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
return PTR_ERR(op_data);
op_data->op_valid = OBD_MD_LINKNAME;
rc = md_getattr(sbi->ll_md_exp, op_data, request);
@ -109,10 +109,10 @@ static int ll_readlink_internal(struct inode *inode,
memcpy(lli->lli_symlink_name, *symname, symlen);
*symname = lli->lli_symlink_name;
}
RETURN(0);
return 0;
failed:
RETURN (rc);
return rc;
}
static int ll_readlink(struct dentry *dentry, char *buffer, int buflen)
@ -133,7 +133,7 @@ static int ll_readlink(struct dentry *dentry, char *buffer, int buflen)
out:
ptlrpc_req_finished(request);
ll_inode_size_unlock(inode);
RETURN(rc);
return rc;
}
static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
@ -166,7 +166,7 @@ static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
/* symname may contain a pointer to the request message buffer,
* we delay request releasing until ll_put_link then.
*/
RETURN(request);
return request;
}
static void ll_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)

View File

@ -213,7 +213,7 @@ int cl_sb_init(struct super_block *sb)
cl_env_put(env, &refcheck);
} else
rc = PTR_ERR(env);
RETURN(rc);
return rc;
}
int cl_sb_fini(struct super_block *sb)
@ -246,7 +246,7 @@ int cl_sb_fini(struct super_block *sb)
* automatically when last device is destroyed).
*/
lu_types_stop();
RETURN(result);
return result;
}
/****************************************************************************

View File

@ -180,14 +180,14 @@ static int vvp_mmap_locks(const struct lu_env *env,
LASSERT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE);
if (!cl_is_normalio(env, io))
RETURN(0);
return 0;
if (vio->cui_iov == NULL) /* nfs or loop back device write */
RETURN(0);
return 0;
/* No MM (e.g. NFS)? No vmas too. */
if (mm == NULL)
RETURN(0);
return 0;
for (seg = 0; seg < vio->cui_nrsegs; seg++) {
const struct iovec *iv = &vio->cui_iov[seg];
@ -233,7 +233,7 @@ static int vvp_mmap_locks(const struct lu_env *env,
descr->cld_end);
if (result < 0)
RETURN(result);
return result;
if (vma->vm_end - addr >= count)
break;
@ -243,7 +243,7 @@ static int vvp_mmap_locks(const struct lu_env *env,
}
up_read(&mm->mmap_sem);
}
RETURN(0);
return 0;
}
static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io,
@ -262,7 +262,7 @@ static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io,
result = vvp_mmap_locks(env, cio, io);
if (result == 0)
result = ccc_io_one_lock(env, io, ast_flags, mode, start, end);
RETURN(result);
return result;
}
static int vvp_io_read_lock(const struct lu_env *env,
@ -280,7 +280,7 @@ static int vvp_io_read_lock(const struct lu_env *env,
io->u.ci_rd.rd.crw_count - 1);
else
result = 0;
RETURN(result);
return result;
}
static int vvp_io_fault_lock(const struct lu_env *env,
@ -580,7 +580,7 @@ static int vvp_io_write_start(const struct lu_env *env,
cio->cui_fd, pos, result, WRITE);
result = 0;
}
RETURN(result);
return result;
}
static int vvp_io_kernel_fault(struct vvp_fault_io *cfio)
@ -813,7 +813,7 @@ static int vvp_io_read_page(const struct lu_env *env,
rc == -ENODATA ? "without a lock" :
"match failed", rc);
if (rc != -ENODATA)
RETURN(rc);
return rc;
}
if (cp->cpg_defer_uptodate) {
@ -830,7 +830,7 @@ static int vvp_io_read_page(const struct lu_env *env,
ll_readahead(env, io, ras,
vmpage->mapping, &queue->c2_qin, fd->fd_flags);
RETURN(0);
return 0;
}
static int vvp_page_sync_io(const struct lu_env *env, struct cl_io *io,
@ -934,7 +934,7 @@ static int vvp_io_prepare_write(const struct lu_env *env,
pg, cp, from, to);
} else
CL_PAGE_HEADER(D_PAGE, env, pg, "uptodate\n");
RETURN(result);
return result;
}
static int vvp_io_commit_write(const struct lu_env *env,
@ -1057,7 +1057,7 @@ static int vvp_io_commit_write(const struct lu_env *env,
cl_page_discard(env, io, pg);
}
ll_inode_size_unlock(inode);
RETURN(result);
return result;
}
static const struct cl_io_operations vvp_io_ops = {
@ -1163,7 +1163,7 @@ int vvp_io_init(const struct lu_env *env, struct cl_object *obj,
PFID(lu_object_fid(&obj->co_lu)), result);
}
RETURN(result);
return result;
}
static struct vvp_io *cl2vvp_io(const struct lu_env *env,

View File

@ -63,7 +63,7 @@ static unsigned long vvp_lock_weigh(const struct lu_env *env,
{
struct ccc_object *cob = cl2ccc(slice->cls_obj);
RETURN(atomic_read(&cob->cob_mmap_cnt) > 0 ? ~0UL >> 2 : 0);
return atomic_read(&cob->cob_mmap_cnt) > 0 ? ~0UL >> 2 : 0;
}
static const struct cl_lock_operations vvp_lock_ops = {

View File

@ -219,7 +219,7 @@ static int vvp_page_prep_read(const struct lu_env *env,
struct cl_io *unused)
{
/* Skip the page already marked as PG_uptodate. */
RETURN(PageUptodate(cl2vm_page(slice)) ? -EALREADY : 0);
return PageUptodate(cl2vm_page(slice)) ? -EALREADY : 0;
}
static int vvp_page_prep_write(const struct lu_env *env,
@ -366,7 +366,7 @@ static int vvp_page_make_ready(const struct lu_env *env,
LBUG();
}
unlock_page(vmpage);
RETURN(result);
return result;
}
static int vvp_page_print(const struct lu_env *env,

View File

@ -122,22 +122,22 @@ int ll_setxattr_common(struct inode *inode, const char *name,
xattr_type = get_xattr_type(name);
rc = xattr_type_filter(sbi, xattr_type);
if (rc)
RETURN(rc);
return rc;
/* b10667: ignore lustre special xattr for now */
if ((xattr_type == XATTR_TRUSTED_T && strcmp(name, "trusted.lov") == 0) ||
(xattr_type == XATTR_LUSTRE_T && strcmp(name, "lustre.lov") == 0))
RETURN(0);
return 0;
/* b15587: ignore security.capability xattr for now */
if ((xattr_type == XATTR_SECURITY_T &&
strcmp(name, "security.capability") == 0))
RETURN(0);
return 0;
/* LU-549: Disable security.selinux when selinux is disabled */
if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
strcmp(name, "security.selinux") == 0)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
#ifdef CONFIG_FS_POSIX_ACL
if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
@ -147,7 +147,7 @@ int ll_setxattr_common(struct inode *inode, const char *name,
if (rce == NULL ||
(rce->rce_ops != RMT_LSETFACL &&
rce->rce_ops != RMT_RSETFACL))
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
if (rce->rce_ops == RMT_LSETFACL) {
struct eacl_entry *ee;
@ -161,7 +161,7 @@ int ll_setxattr_common(struct inode *inode, const char *name,
size, ee->ee_acl);
if (IS_ERR(acl)) {
ee_free(ee);
RETURN(PTR_ERR(acl));
return PTR_ERR(acl);
}
size = CFS_ACL_XATTR_SIZE(\
le32_to_cpu(acl->a_count), \
@ -174,11 +174,11 @@ int ll_setxattr_common(struct inode *inode, const char *name,
(posix_acl_xattr_header *)value,
size, &new_value);
if (unlikely(size < 0))
RETURN(size);
return size;
pv = (const char *)new_value;
} else
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
valid |= rce_ops2valid(rce->rce_ops);
}
@ -200,11 +200,11 @@ int ll_setxattr_common(struct inode *inode, const char *name,
"it is not supported on the server\n");
sbi->ll_flags &= ~LL_SBI_USER_XATTR;
}
RETURN(rc);
return rc;
}
ptlrpc_req_finished(req);
RETURN(0);
return 0;
}
int ll_setxattr(struct dentry *dentry, const char *name,
@ -302,17 +302,17 @@ int ll_getxattr_common(struct inode *inode, const char *name,
xattr_type = get_xattr_type(name);
rc = xattr_type_filter(sbi, xattr_type);
if (rc)
RETURN(rc);
return rc;
/* b15587: ignore security.capability xattr for now */
if ((xattr_type == XATTR_SECURITY_T &&
strcmp(name, "security.capability") == 0))
RETURN(-ENODATA);
return -ENODATA;
/* LU-549: Disable security.selinux when selinux is disabled */
if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
strcmp(name, "security.selinux") == 0)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
#ifdef CONFIG_FS_POSIX_ACL
if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
@ -324,7 +324,7 @@ int ll_getxattr_common(struct inode *inode, const char *name,
rce->rce_ops != RMT_LGETFACL &&
rce->rce_ops != RMT_RSETFACL &&
rce->rce_ops != RMT_RGETFACL))
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
}
/* posix acl is under protection of LOOKUP lock. when calling to this,
@ -341,14 +341,14 @@ int ll_getxattr_common(struct inode *inode, const char *name,
spin_unlock(&lli->lli_lock);
if (!acl)
RETURN(-ENODATA);
return -ENODATA;
rc = posix_acl_to_xattr(&init_user_ns, acl, buffer, size);
posix_acl_release(acl);
RETURN(rc);
return rc;
}
if (xattr_type == XATTR_ACL_DEFAULT_T && !S_ISDIR(inode->i_mode))
RETURN(-ENODATA);
return -ENODATA;
#endif
do_getxattr:
@ -363,7 +363,7 @@ do_getxattr:
"it is not supported on the server\n");
sbi->ll_flags &= ~LL_SBI_USER_XATTR;
}
RETURN(rc);
return rc;
}
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);

View File

@ -69,7 +69,7 @@ int lmv_fld_lookup(struct lmv_obd *lmv,
if (rc) {
CERROR("Error while looking for mds number. Seq "LPX64
", err = %d\n", fid_seq(fid), rc);
RETURN(rc);
return rc;
}
CDEBUG(D_INODE, "FLD lookup got mds #%x for fid="DFID"\n",
@ -81,5 +81,5 @@ int lmv_fld_lookup(struct lmv_obd *lmv,
PFID(fid));
rc = -EINVAL;
}
RETURN(rc);
return rc;
}

View File

@ -72,7 +72,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm,
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
if (body == NULL)
RETURN(-EPROTO);
return -EPROTO;
LASSERT((body->valid & OBD_MD_MDS));
@ -169,7 +169,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
if (IS_ERR(tgt))
RETURN(PTR_ERR(tgt));
return PTR_ERR(tgt);
/* If it is ready to open the file by FID, do not need
* allocate FID at all, otherwise it will confuse MDT */
@ -182,7 +182,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
op_data->op_fid3 = op_data->op_fid2;
rc = lmv_fid_alloc(exp, &op_data->op_fid2, op_data);
if (rc != 0)
RETURN(rc);
return rc;
}
CDEBUG(D_INODE, "OPEN_INTENT with fid1="DFID", fid2="DFID","
@ -192,7 +192,7 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
rc = md_intent_lock(tgt->ltd_exp, op_data, lmm, lmmsize, it, flags,
reqp, cb_blocking, extra_lock_flags);
if (rc != 0)
RETURN(rc);
return rc;
/*
* Nothing is found, do not access body->fid1 as it is zero and thus
* pointless.
@ -200,16 +200,16 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
if ((it->d.lustre.it_disposition & DISP_LOOKUP_NEG) &&
!(it->d.lustre.it_disposition & DISP_OPEN_CREATE) &&
!(it->d.lustre.it_disposition & DISP_OPEN_OPEN))
RETURN(rc);
return rc;
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
if (body == NULL)
RETURN(-EPROTO);
return -EPROTO;
/*
* Not cross-ref case, just get out of here.
*/
if (likely(!(body->valid & OBD_MD_MDS)))
RETURN(0);
return 0;
/*
* Okay, MDS has returned success. Probably name has been resolved in
@ -229,10 +229,10 @@ int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
"%*s: %d\n", LL_IT2STR(it), PFID(&op_data->op_fid2),
PFID(&op_data->op_fid1), op_data->op_namelen,
op_data->op_name, rc);
RETURN(rc);
return rc;
}
RETURN(rc);
return rc;
}
/*
@ -252,7 +252,7 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
if (IS_ERR(tgt))
RETURN(PTR_ERR(tgt));
return PTR_ERR(tgt);
if (!fid_is_sane(&op_data->op_fid2))
fid_zero(&op_data->op_fid2);
@ -269,7 +269,7 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
flags, reqp, cb_blocking, extra_lock_flags);
if (rc < 0 || *reqp == NULL)
RETURN(rc);
return rc;
/*
* MDS has returned success. Probably name has been resolved in
@ -277,15 +277,15 @@ int lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
*/
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
if (body == NULL)
RETURN(-EPROTO);
return -EPROTO;
/* Not cross-ref case, just get out of here. */
if (likely(!(body->valid & OBD_MD_MDS)))
RETURN(0);
return 0;
rc = lmv_intent_remote(exp, lmm, lmmsize, it, NULL, flags, reqp,
cb_blocking, extra_lock_flags);
RETURN(rc);
return rc;
}
int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
@ -306,7 +306,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
rc = lmv_check_connect(obd);
if (rc)
RETURN(rc);
return rc;
if (it->it_op & (IT_LOOKUP | IT_GETATTR | IT_LAYOUT))
rc = lmv_intent_lookup(exp, op_data, lmm, lmmsize, it,
@ -318,5 +318,5 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
extra_lock_flags);
else
LBUG();
RETURN(rc);
return rc;
}

File diff suppressed because it is too large Load Diff

View File

@ -198,7 +198,7 @@ static struct lu_device *lov_device_fini(const struct lu_env *env,
LASSERT(ld->ld_lov != NULL);
if (ld->ld_target == NULL)
RETURN(NULL);
return NULL;
lov_foreach_target(ld, i) {
struct lovsub_device *lsd;
@ -209,7 +209,7 @@ static struct lu_device *lov_device_fini(const struct lu_env *env,
ld->ld_target[i] = NULL;
}
}
RETURN(NULL);
return NULL;
}
static int lov_device_init(const struct lu_env *env, struct lu_device *d,
@ -221,7 +221,7 @@ static int lov_device_init(const struct lu_env *env, struct lu_device *d,
LASSERT(d->ld_site != NULL);
if (ld->ld_target == NULL)
RETURN(rc);
return rc;
lov_foreach_target(ld, i) {
struct lovsub_device *lsd;
@ -249,7 +249,7 @@ static int lov_device_init(const struct lu_env *env, struct lu_device *d,
else
ld->ld_flags |= LOV_DEV_INITIALIZED;
RETURN(rc);
return rc;
}
static int lov_req_init(const struct lu_env *env, struct cl_device *dev,
@ -264,7 +264,7 @@ static int lov_req_init(const struct lu_env *env, struct cl_device *dev,
result = 0;
} else
result = -ENOMEM;
RETURN(result);
return result;
}
static const struct cl_device_operations lov_cl_ops = {
@ -365,7 +365,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
emerg = lov_emerg_alloc(tgt_size);
if (IS_ERR(emerg))
RETURN(PTR_ERR(emerg));
return PTR_ERR(emerg);
OBD_ALLOC(newd, tgt_size * sz);
if (newd != NULL) {
@ -386,7 +386,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
result = -ENOMEM;
}
}
RETURN(result);
return result;
}
static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
@ -407,7 +407,7 @@ static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
if (!tgt->ltd_obd->obd_set_up) {
CERROR("Target %s not set up\n", obd_uuid2str(&tgt->ltd_uuid));
RETURN(-EINVAL);
return -EINVAL;
}
rc = lov_expand_targets(env, ld);
@ -429,7 +429,7 @@ static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
}
}
obd_putref(obd);
RETURN(rc);
return rc;
}
static int lov_process_config(const struct lu_env *env,
@ -459,7 +459,7 @@ static int lov_process_config(const struct lu_env *env,
}
}
obd_putref(obd);
RETURN(rc);
return rc;
}
static const struct lu_device_operations lov_lu_ops = {
@ -478,7 +478,7 @@ static struct lu_device *lov_device_alloc(const struct lu_env *env,
OBD_ALLOC_PTR(ld);
if (ld == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
cl_device_init(&ld->ld_cl, t);
d = lov2lu_dev(ld);
@ -494,11 +494,11 @@ static struct lu_device *lov_device_alloc(const struct lu_env *env,
rc = lov_setup(obd, cfg);
if (rc) {
lov_device_free(env, d);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
ld->ld_lov = &obd->u.lov;
RETURN(d);
return d;
}
static const struct lu_device_type_operations lov_device_type_ops = {

View File

@ -207,7 +207,7 @@ static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio,
}
if (result != 0)
lov_io_sub_fini(env, lio, sub);
RETURN(result);
return result;
}
struct lov_io_sub *lov_sub_get(const struct lu_env *env,
@ -227,7 +227,7 @@ struct lov_io_sub *lov_sub_get(const struct lu_env *env,
lov_sub_enter(sub);
else
sub = ERR_PTR(rc);
RETURN(sub);
return sub;
}
void lov_sub_put(struct lov_io_sub *sub)
@ -249,7 +249,7 @@ static int lov_page_stripe(const struct cl_page *page)
lu_object_locate(page->cp_child->cp_obj->co_lu.lo_header,
&lovsub_device_type));
LASSERT(subobj != NULL);
RETURN(subobj->lso_index);
return subobj->lso_index;
}
struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
@ -265,7 +265,7 @@ struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio,
LASSERT(lio->lis_nr_subios > 0);
stripe = lov_page_stripe(page);
RETURN(lov_sub_get(env, lio, stripe));
return lov_sub_get(env, lio, stripe);
}
@ -290,7 +290,7 @@ static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio,
result = 0;
} else
result = -ENOMEM;
RETURN(result);
return result;
}
static void lov_io_slice_init(struct lov_io *lio,
@ -407,7 +407,7 @@ static int lov_io_iter_init(const struct lu_env *env,
else
break;
}
RETURN(rc);
return rc;
}
static int lov_io_rw_iter_init(const struct lu_env *env,
@ -443,7 +443,7 @@ static int lov_io_rw_iter_init(const struct lu_env *env,
* XXX The following call should be optimized: we know, that
* [lio->lis_pos, lio->lis_endpos) intersects with exactly one stripe.
*/
RETURN(lov_io_iter_init(env, ios));
return lov_io_iter_init(env, ios);
}
static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
@ -463,17 +463,17 @@ static int lov_io_call(const struct lu_env *env, struct lov_io *lio,
if (parent->ci_result == 0)
parent->ci_result = sub->sub_io->ci_result;
}
RETURN(rc);
return rc;
}
static int lov_io_lock(const struct lu_env *env, const struct cl_io_slice *ios)
{
RETURN(lov_io_call(env, cl2lov_io(env, ios), cl_io_lock));
return lov_io_call(env, cl2lov_io(env, ios), cl_io_lock);
}
static int lov_io_start(const struct lu_env *env, const struct cl_io_slice *ios)
{
RETURN(lov_io_call(env, cl2lov_io(env, ios), cl_io_start));
return lov_io_call(env, cl2lov_io(env, ios), cl_io_start);
}
static int lov_io_end_wrapper(const struct lu_env *env, struct cl_io *io)
@ -487,19 +487,19 @@ static int lov_io_end_wrapper(const struct lu_env *env, struct cl_io *io)
cl_io_end(env, io);
else
io->ci_state = CIS_IO_FINISHED;
RETURN(0);
return 0;
}
static int lov_io_iter_fini_wrapper(const struct lu_env *env, struct cl_io *io)
{
cl_io_iter_fini(env, io);
RETURN(0);
return 0;
}
static int lov_io_unlock_wrapper(const struct lu_env *env, struct cl_io *io)
{
cl_io_unlock(env, io);
RETURN(0);
return 0;
}
static void lov_io_end(const struct lu_env *env, const struct cl_io_slice *ios)
@ -585,7 +585,7 @@ static int lov_io_submit(const struct lu_env *env,
rc = cl_io_submit_rw(sub->sub_env, sub->sub_io,
crt, queue);
lov_sub_put(sub);
RETURN(rc);
return rc;
}
LASSERT(lio->lis_subs != NULL);
@ -593,7 +593,7 @@ static int lov_io_submit(const struct lu_env *env,
OBD_ALLOC_LARGE(stripes_qin,
sizeof(*stripes_qin) * lio->lis_nr_subios);
if (stripes_qin == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
for (stripe = 0; stripe < lio->lis_nr_subios; stripe++)
cl_page_list_init(&stripes_qin[stripe]);
@ -659,7 +659,7 @@ static int lov_io_submit(const struct lu_env *env,
mutex_unlock(&ld->ld_mutex);
}
RETURN(rc);
return rc;
#undef QIN
}
@ -680,7 +680,7 @@ static int lov_io_prepare_write(const struct lu_env *env,
lov_sub_put(sub);
} else
result = PTR_ERR(sub);
RETURN(result);
return result;
}
static int lov_io_commit_write(const struct lu_env *env,
@ -700,7 +700,7 @@ static int lov_io_commit_write(const struct lu_env *env,
lov_sub_put(sub);
} else
result = PTR_ERR(sub);
RETURN(result);
return result;
}
static int lov_io_fault_start(const struct lu_env *env,
@ -715,7 +715,7 @@ static int lov_io_fault_start(const struct lu_env *env,
sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page));
sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob;
lov_sub_put(sub);
RETURN(lov_io_start(env, ios));
return lov_io_start(env, ios);
}
static void lov_io_fsync_end(const struct lu_env *env,
@ -892,7 +892,7 @@ int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
atomic_inc(&lov->lo_active_ios);
}
}
RETURN(io->ci_result);
return io->ci_result;
}
int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
@ -929,7 +929,7 @@ int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
}
io->ci_result = result < 0 ? result : 0;
RETURN(result != 0);
return result != 0;
}
int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
@ -963,6 +963,6 @@ int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
}
io->ci_result = result < 0 ? result : 0;
RETURN(result != 0);
return result != 0;
}
/** @} lov */

View File

@ -176,7 +176,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env,
OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem);
} else
sublock = ERR_PTR(-ENOMEM);
RETURN(sublock);
return sublock;
}
static void lov_sublock_unlock(const struct lu_env *env,
@ -237,7 +237,7 @@ static int lov_sublock_lock(const struct lu_env *env,
}
}
}
RETURN(result);
return result;
}
/**
@ -273,7 +273,7 @@ static int lov_subresult(int result, int rc)
if (result_rank < rc_rank)
result = rc;
RETURN(result);
return result;
}
/**
@ -315,7 +315,7 @@ static int lov_lock_sub_init(const struct lu_env *env,
LASSERT(nr > 0);
OBD_ALLOC_LARGE(lck->lls_sub, nr * sizeof lck->lls_sub[0]);
if (lck->lls_sub == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lck->lls_nr = nr;
/*
@ -386,7 +386,7 @@ static int lov_lock_sub_init(const struct lu_env *env,
* because enqueue will create them anyway. Main duty of this function
* is to fill in sub-lock descriptions in a race free manner.
*/
RETURN(result);
return result;
}
static int lov_sublock_release(const struct lu_env *env, struct lov_lock *lck,
@ -431,7 +431,7 @@ static int lov_sublock_release(const struct lu_env *env, struct lov_lock *lck,
* sub-lock is destroyed.
*/
}
RETURN(rc);
return rc;
}
static void lov_sublock_hold(const struct lu_env *env, struct lov_lock *lck,
@ -491,7 +491,7 @@ static int lov_lock_enqueue_wait(const struct lu_env *env,
cl_lock_mutex_put(env, lock);
result = cl_lock_enqueue_wait(env, sublock, 0);
cl_lock_mutex_get(env, lock);
RETURN(result ?: CLO_REPEAT);
return result ?: CLO_REPEAT;
}
/**
@ -524,7 +524,7 @@ static int lov_lock_enqueue_one(const struct lu_env *env, struct lov_lock *lck,
if ((result == CLO_WAIT) && (sublock->cll_state <= CLS_HELD) &&
(enqflags & CEF_ASYNC) && (!last || (enqflags & CEF_AGL)))
result = 0;
RETURN(result);
return result;
}
/**
@ -661,7 +661,7 @@ static int lov_lock_enqueue(const struct lu_env *env,
break;
}
cl_lock_closure_fini(closure);
RETURN(result ?: minstate >= CLS_ENQUEUED ? 0 : CLO_WAIT);
return result ?: minstate >= CLS_ENQUEUED ? 0 : CLO_WAIT;
}
static int lov_lock_unuse(const struct lu_env *env,
@ -707,7 +707,7 @@ static int lov_lock_unuse(const struct lu_env *env,
result = -ESTALE;
}
cl_lock_closure_fini(closure);
RETURN(result);
return result;
}
@ -814,7 +814,7 @@ again:
if (result == 0 && reenqueued != 0)
goto again;
cl_lock_closure_fini(closure);
RETURN(result ?: minstate >= CLS_HELD ? 0 : CLO_WAIT);
return result ?: minstate >= CLS_HELD ? 0 : CLO_WAIT;
}
static int lov_lock_use(const struct lu_env *env,
@ -882,7 +882,7 @@ static int lov_lock_use(const struct lu_env *env,
result = -ESTALE;
}
cl_lock_closure_fini(closure);
RETURN(result);
return result;
}
#if 0
@ -1027,7 +1027,7 @@ static int lov_lock_fits_into(const struct lu_env *env,
PDESCR(&lov->lls_orig), PDESCR(&lov->lls_sub[0].sub_got),
lov->lls_sub[0].sub_stripe, lov->lls_nr, lov_r0(obj)->lo_nr,
result);
RETURN(result);
return result;
}
void lov_lock_unlink(const struct lu_env *env,
@ -1060,9 +1060,9 @@ struct lov_lock_link *lov_lock_link_find(const struct lu_env *env,
list_for_each_entry(scan, &sub->lss_parents, lll_list) {
if (scan->lll_super == lck)
RETURN(scan);
return scan;
}
RETURN(NULL);
return NULL;
}
/**
@ -1165,7 +1165,7 @@ int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj,
result = lov_lock_sub_init(env, lck, io);
} else
result = -ENOMEM;
RETURN(result);
return result;
}
static void lov_empty_lock_fini(const struct lu_env *env,
@ -1200,7 +1200,7 @@ int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
lck->lls_orig = lock->cll_descr;
result = 0;
}
RETURN(result);
return result;
}
static struct cl_lock_closure *lov_closure_get(const struct lu_env *env,

View File

@ -117,7 +117,7 @@ static int lov_llog_origin_add(const struct lu_env *env,
/* Note that rc is always 1 if llog_obd_add was successful */
cookies += rc;
}
RETURN(cookies);
return cookies;
}
static int lov_llog_origin_connect(struct llog_ctxt *ctxt,
@ -152,7 +152,7 @@ static int lov_llog_origin_connect(struct llog_ctxt *ctxt,
}
obd_putref(obd);
RETURN(err);
return err;
}
/* the replicators commit callback */
@ -191,7 +191,7 @@ static int lov_llog_repl_cancel(const struct lu_env *env,
}
}
obd_putref(obd);
RETURN(rc);
return rc;
}
static struct llog_operations lov_mds_ost_orig_logops = {
@ -214,7 +214,7 @@ int lov_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
rc = llog_setup(NULL, obd, olg, LLOG_MDS_OST_ORIG_CTXT, disk_obd,
&lov_mds_ost_orig_logops);
if (rc)
RETURN(rc);
return rc;
rc = llog_setup(NULL, obd, olg, LLOG_SIZE_REPL_CTXT, disk_obd,
&lov_size_repl_logops);
@ -268,5 +268,5 @@ int lov_llog_finish(struct obd_device *obd, int count)
llog_cleanup(NULL, ctxt);
/* lov->tgt llogs are cleaned during osc_cleanup. */
RETURN(0);
return 0;
}

View File

@ -109,7 +109,7 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
lvb->lvb_mtime = current_mtime;
lvb->lvb_atime = current_atime;
lvb->lvb_ctime = current_ctime;
RETURN(rc);
return rc;
}
/** Merge the lock value block(&lvb) attributes from each of the stripes in a
@ -136,7 +136,7 @@ int lov_merge_lvb(struct obd_export *exp,
CDEBUG(D_INODE, "merged for ID "DOSTID" s="LPU64" m="LPU64" a="LPU64
" c="LPU64" b="LPU64"\n", POSTID(&lsm->lsm_oi), lvb->lvb_size,
lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
RETURN(rc);
return rc;
}
/* Must be called under the lov_stripe_lock() */
@ -160,7 +160,7 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
loi->loi_kms, kms);
loi_kms_set(loi, loi->loi_lvb.lvb_size = kms);
}
RETURN(0);
return 0;
}
if (size > 0)
@ -173,7 +173,7 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
if (kms > loi->loi_kms)
loi_kms_set(loi, kms);
RETURN(0);
return 0;
}
void lov_merge_attrs(struct obdo *tgt, struct obdo *src, obd_valid valid,

View File

@ -135,14 +135,14 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
int rc;
if (!lov->lov_tgts[index])
RETURN(-EINVAL);
return -EINVAL;
tgt_uuid = &lov->lov_tgts[index]->ltd_uuid;
tgt_obd = lov->lov_tgts[index]->ltd_obd;
if (!tgt_obd->obd_set_up) {
CERROR("Target %s not set up\n", obd_uuid2str(tgt_uuid));
RETURN(-EINVAL);
return -EINVAL;
}
/* override the sp_me from lov */
@ -167,14 +167,14 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
if (rc) {
CERROR("Target %s register_observer error %d\n",
obd_uuid2str(tgt_uuid), rc);
RETURN(rc);
return rc;
}
if (imp->imp_invalid) {
CDEBUG(D_CONFIG, "not connecting OSC %s; administratively "
"disabled\n", obd_uuid2str(tgt_uuid));
RETURN(0);
return 0;
}
rc = obd_connect(NULL, &lov->lov_tgts[index]->ltd_exp, tgt_obd,
@ -182,7 +182,7 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
if (rc || !lov->lov_tgts[index]->ltd_exp) {
CERROR("Target %s connect error %d\n",
obd_uuid2str(tgt_uuid), rc);
RETURN(-ENODEV);
return -ENODEV;
}
lov->lov_tgts[index]->ltd_reap = 0;
@ -214,7 +214,7 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
}
}
RETURN(0);
return 0;
}
static int lov_connect(const struct lu_env *env,
@ -231,7 +231,7 @@ static int lov_connect(const struct lu_env *env,
rc = class_connect(&conn, obd, cluuid);
if (rc)
RETURN(rc);
return rc;
*exp = class_conn2export(&conn);
@ -268,7 +268,7 @@ static int lov_connect(const struct lu_env *env,
}
obd_putref(obd);
RETURN(0);
return 0;
}
static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
@ -312,7 +312,7 @@ static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
}
tgt->ltd_exp = NULL;
RETURN(0);
return 0;
}
static int lov_disconnect(struct obd_export *exp)
@ -346,7 +346,7 @@ static int lov_disconnect(struct obd_export *exp)
out:
rc = class_disconnect(exp); /* bz 9811 */
RETURN(rc);
return rc;
}
/* Error codes:
@ -433,7 +433,7 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
out:
obd_putref(obd);
RETURN(index);
return index;
}
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
@ -445,7 +445,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
down_read(&lov->lov_notify_lock);
if (!lov->lov_connects) {
up_read(&lov->lov_notify_lock);
RETURN(rc);
return rc;
}
if (ev == OBD_NOTIFY_ACTIVE || ev == OBD_NOTIFY_INACTIVE ||
@ -459,7 +459,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
CERROR("unexpected notification of %s %s!\n",
watched->obd_type->typ_name,
watched->obd_name);
RETURN(-EINVAL);
return -EINVAL;
}
uuid = &watched->u.cli.cl_target_uuid;
@ -471,7 +471,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
up_read(&lov->lov_notify_lock);
CERROR("event(%d) of %s failed: %d\n", ev,
obd_uuid2str(uuid), rc);
RETURN(rc);
return rc;
}
/* active event should be pass lov target index as data */
data = &rc;
@ -514,7 +514,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
}
up_read(&lov->lov_notify_lock);
RETURN(rc);
return rc;
}
static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
@ -531,13 +531,13 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
if (gen <= 0) {
CERROR("request to add OBD %s with invalid generation: %d\n",
uuidp->uuid, gen);
RETURN(-EINVAL);
return -EINVAL;
}
tgt_obd = class_find_client_obd(uuidp, LUSTRE_OSC_NAME,
&obd->obd_uuid);
if (tgt_obd == NULL)
RETURN(-EINVAL);
return -EINVAL;
mutex_lock(&lov->lov_lock);
@ -546,7 +546,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
CERROR("UUID %s already assigned at LOV target index %d\n",
obd_uuid2str(&tgt->ltd_uuid), index);
mutex_unlock(&lov->lov_lock);
RETURN(-EEXIST);
return -EEXIST;
}
if (index >= lov->lov_tgt_size) {
@ -560,7 +560,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
OBD_ALLOC(newtgts, sizeof(*newtgts) * newsize);
if (newtgts == NULL) {
mutex_unlock(&lov->lov_lock);
RETURN(-ENOMEM);
return -ENOMEM;
}
if (lov->lov_tgt_size) {
@ -583,14 +583,14 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
OBD_ALLOC_PTR(tgt);
if (!tgt) {
mutex_unlock(&lov->lov_lock);
RETURN(-ENOMEM);
return -ENOMEM;
}
rc = lov_ost_pool_add(&lov->lov_packed, index, lov->lov_tgt_size);
if (rc) {
mutex_unlock(&lov->lov_lock);
OBD_FREE_PTR(tgt);
RETURN(rc);
return rc;
}
tgt->ltd_uuid = *uuidp;
@ -614,7 +614,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
/* lov_connect hasn't been called yet. We'll do the
lov_connect_obd on this target when that fn first runs,
because we don't know the connect flags yet. */
RETURN(0);
return 0;
}
obd_getref(obd);
@ -647,7 +647,7 @@ out:
lov_del_target(obd, index, 0, 0);
}
obd_putref(obd);
RETURN(rc);
return rc;
}
/* Schedule a target for deletion */
@ -661,7 +661,7 @@ int lov_del_target(struct obd_device *obd, __u32 index,
if (index >= count) {
CERROR("LOV target index %d >= number of LOV OBDs %d.\n",
index, count);
RETURN(-EINVAL);
return -EINVAL;
}
/* to make sure there's no ongoing lov_notify() now */
@ -692,7 +692,7 @@ out:
obd_putref(obd);
up_write(&lov->lov_notify_lock);
RETURN(rc);
return rc;
}
static void __lov_del_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
@ -775,7 +775,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
CERROR("LOV setup requires a descriptor\n");
RETURN(-EINVAL);
return -EINVAL;
}
desc = (struct lov_desc *)lustre_cfg_buf(lcfg, 1);
@ -783,7 +783,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
if (sizeof(*desc) > LUSTRE_CFG_BUFLEN(lcfg, 1)) {
CERROR("descriptor size wrong: %d > %d\n",
(int)sizeof(*desc), LUSTRE_CFG_BUFLEN(lcfg, 1));
RETURN(-EINVAL);
return -EINVAL;
}
if (desc->ld_magic != LOV_DESC_MAGIC) {
@ -794,7 +794,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
} else {
CERROR("%s: Bad lov desc magic: %#x\n",
obd->obd_name, desc->ld_magic);
RETURN(-EINVAL);
return -EINVAL;
}
}
@ -839,7 +839,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
obd->obd_proc_entry,
NULL, NULL);
RETURN(0);
return 0;
out:
return rc;
@ -867,7 +867,7 @@ static int lov_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
CERROR("failed to cleanup llogging subsystems\n");
break;
}
RETURN(rc);
return rc;
}
static int lov_cleanup(struct obd_device *obd)
@ -913,7 +913,7 @@ static int lov_cleanup(struct obd_device *obd)
lov->lov_tgt_size);
lov->lov_tgt_size = 0;
}
RETURN(0);
return 0;
}
int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
@ -977,7 +977,7 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
}
}
out:
RETURN(rc);
return rc;
}
static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
@ -993,7 +993,7 @@ static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
OBD_ALLOC(obj_mdp, sizeof(*obj_mdp));
if (obj_mdp == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
ost_idx = src_oa->o_nlink;
lsm = *ea;
@ -1018,7 +1018,7 @@ static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
src_oa, &obj_mdp, oti);
out:
OBD_FREE(obj_mdp, sizeof(*obj_mdp));
RETURN(rc);
return rc;
}
/* the LOV expects oa->o_id to be set to the LOV object id */
@ -1031,7 +1031,7 @@ static int lov_create(const struct lu_env *env, struct obd_export *exp,
LASSERT(ea != NULL);
if (exp == NULL)
RETURN(-EINVAL);
return -EINVAL;
if ((src_oa->o_valid & OBD_MD_FLFLAGS) &&
src_oa->o_flags == OBD_FL_DELORPHAN) {
@ -1041,7 +1041,7 @@ static int lov_create(const struct lu_env *env, struct obd_export *exp,
lov = &exp->exp_obd->u.lov;
if (!lov->desc.ld_active_tgt_count)
RETURN(-EIO);
return -EIO;
obd_getref(exp->exp_obd);
/* Recreate a specific object id at the given OST index */
@ -1051,7 +1051,7 @@ static int lov_create(const struct lu_env *env, struct obd_export *exp,
}
obd_putref(exp->exp_obd);
RETURN(rc);
return rc;
}
#define ASSERT_LSM_MAGIC(lsmp) \
@ -1077,7 +1077,7 @@ static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
ASSERT_LSM_MAGIC(lsm);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
if (oa->o_valid & OBD_MD_FLCOOKIE) {
LASSERT(oti);
@ -1117,7 +1117,7 @@ static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
err = lov_fini_destroy_set(set);
out:
obd_putref(exp->exp_obd);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
@ -1133,13 +1133,13 @@ static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
ASSERT_LSM_MAGIC(oinfo->oi_md);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
rc = lov_prep_getattr_set(exp, oinfo, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each (pos, &set->set_list) {
req = list_entry(pos, struct lov_request, rq_link);
@ -1165,7 +1165,7 @@ static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
rc = lov_fini_getattr_set(set);
if (err)
rc = err;
RETURN(rc);
return rc;
}
static int lov_getattr_interpret(struct ptlrpc_request_set *rqset,
@ -1178,7 +1178,7 @@ static int lov_getattr_interpret(struct ptlrpc_request_set *rqset,
if (rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_getattr_set(lovset);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
static int lov_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
@ -1194,13 +1194,13 @@ static int lov_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
ASSERT_LSM_MAGIC(oinfo->oi_md);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
rc = lov_prep_getattr_set(exp, oinfo, &lovset);
if (rc)
RETURN(rc);
return rc;
CDEBUG(D_INFO, "objid "DOSTID": %ux%u byte stripes\n",
POSTID(&oinfo->oi_md->lsm_oi), oinfo->oi_md->lsm_stripe_count,
@ -1230,13 +1230,13 @@ static int lov_getattr_async(struct obd_export *exp, struct obd_info *oinfo,
LASSERT (rqset->set_interpret == NULL);
rqset->set_interpret = lov_getattr_interpret;
rqset->set_arg = (void *)lovset;
RETURN(rc);
return rc;
}
out:
if (rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_getattr_set(lovset);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
@ -1252,7 +1252,7 @@ static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
ASSERT_LSM_MAGIC(oinfo->oi_md);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
/* for now, we only expect the following updates here */
LASSERT(!(oinfo->oi_oa->o_valid & ~(OBD_MD_FLID | OBD_MD_FLTYPE |
@ -1265,7 +1265,7 @@ static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
lov = &exp->exp_obd->u.lov;
rc = lov_prep_setattr_set(exp, oinfo, oti, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each (pos, &set->set_list) {
req = list_entry(pos, struct lov_request, rq_link);
@ -1287,7 +1287,7 @@ static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
err = lov_fini_setattr_set(set);
if (!rc)
rc = err;
RETURN(rc);
return rc;
}
static int lov_setattr_interpret(struct ptlrpc_request_set *rqset,
@ -1299,7 +1299,7 @@ static int lov_setattr_interpret(struct ptlrpc_request_set *rqset,
if (rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_setattr_set(lovset);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
/* If @oti is given, the request goes from MDS and responses from OSTs are not
@ -1322,12 +1322,12 @@ static int lov_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
}
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
rc = lov_prep_setattr_set(exp, oinfo, oti, &set);
if (rc)
RETURN(rc);
return rc;
CDEBUG(D_INFO, "objid "DOSTID": %ux%u byte stripes\n",
POSTID(&oinfo->oi_md->lsm_oi),
@ -1362,14 +1362,14 @@ static int lov_setattr_async(struct obd_export *exp, struct obd_info *oinfo,
if (rc)
atomic_set(&set->set_completes, 0);
err = lov_fini_setattr_set(set);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
LASSERT(rqset->set_interpret == NULL);
rqset->set_interpret = lov_setattr_interpret;
rqset->set_arg = (void *)set;
RETURN(0);
return 0;
}
static int lov_punch_interpret(struct ptlrpc_request_set *rqset,
@ -1381,7 +1381,7 @@ static int lov_punch_interpret(struct ptlrpc_request_set *rqset,
if (rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_punch_set(lovset);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
/* FIXME: maybe we'll just make one node the authoritative attribute node, then
@ -1401,12 +1401,12 @@ static int lov_punch(const struct lu_env *env, struct obd_export *exp,
ASSERT_LSM_MAGIC(oinfo->oi_md);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
rc = lov_prep_punch_set(exp, oinfo, oti, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each (pos, &set->set_list) {
req = list_entry(pos, struct lov_request, rq_link);
@ -1426,14 +1426,14 @@ static int lov_punch(const struct lu_env *env, struct obd_export *exp,
if (rc || list_empty(&rqset->set_requests)) {
int err;
err = lov_fini_punch_set(set);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
LASSERT(rqset->set_interpret == NULL);
rqset->set_interpret = lov_punch_interpret;
rqset->set_arg = (void *)set;
RETURN(0);
return 0;
}
static int lov_sync_interpret(struct ptlrpc_request_set *rqset,
@ -1445,7 +1445,7 @@ static int lov_sync_interpret(struct ptlrpc_request_set *rqset,
if (rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_sync_set(lovset);
RETURN(rc ?: err);
return rc ?: err;
}
static int lov_sync(const struct lu_env *env, struct obd_export *exp,
@ -1462,12 +1462,12 @@ static int lov_sync(const struct lu_env *env, struct obd_export *exp,
LASSERT(rqset != NULL);
if (!exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
rc = lov_prep_sync_set(exp, oinfo, start, end, &set);
if (rc)
RETURN(rc);
return rc;
CDEBUG(D_INFO, "fsync objid "DOSTID" ["LPX64", "LPX64"]\n",
POSTID(&set->set_oi->oi_oa->o_oi), start, end);
@ -1493,14 +1493,14 @@ static int lov_sync(const struct lu_env *env, struct obd_export *exp,
if (rc || list_empty(&rqset->set_requests)) {
int err = lov_fini_sync_set(set);
RETURN(rc ?: err);
return rc ?: err;
}
LASSERT(rqset->set_interpret == NULL);
rqset->set_interpret = lov_sync_interpret;
rqset->set_arg = (void *)set;
RETURN(0);
return 0;
}
static int lov_brw_check(struct lov_obd *lov, struct obd_info *lov_oinfo,
@ -1550,12 +1550,12 @@ static int lov_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
if (cmd == OBD_BRW_CHECK) {
rc = lov_brw_check(lov, oinfo, oa_bufs, pga);
RETURN(rc);
return rc;
}
rc = lov_prep_brw_set(exp, oinfo, oa_bufs, pga, oti, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each (pos, &set->set_list) {
struct obd_export *sub_exp;
@ -1574,7 +1574,7 @@ static int lov_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
err = lov_fini_brw_set(set);
if (!rc)
rc = err;
RETURN(rc);
return rc;
}
static int lov_enqueue_interpret(struct ptlrpc_request_set *rqset,
@ -1583,7 +1583,7 @@ static int lov_enqueue_interpret(struct ptlrpc_request_set *rqset,
struct lov_request_set *lovset = (struct lov_request_set *)data;
rc = lov_fini_enqueue_set(lovset, lovset->set_ei->ei_mode, rc, rqset);
RETURN(rc);
return rc;
}
static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo,
@ -1605,12 +1605,12 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo,
LASSERT((oinfo->oi_flags & LDLM_FL_REPLAY) == 0);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
rc = lov_prep_enqueue_set(exp, oinfo, einfo, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each (pos, &set->set_list) {
req = list_entry(pos, struct lov_request, rq_link);
@ -1626,11 +1626,11 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo,
LASSERT(rqset->set_interpret == NULL);
rqset->set_interpret = lov_enqueue_interpret;
rqset->set_arg = (void *)set;
RETURN(rc);
return rc;
}
out:
rc = lov_fini_enqueue_set(set, mode, rc, rqset);
RETURN(rc);
return rc;
}
static int lov_change_cbdata(struct obd_export *exp,
@ -1643,7 +1643,7 @@ static int lov_change_cbdata(struct obd_export *exp,
ASSERT_LSM_MAGIC(lsm);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
for (i = 0; i < lsm->lsm_stripe_count; i++) {
@ -1660,7 +1660,7 @@ static int lov_change_cbdata(struct obd_export *exp,
rc = obd_change_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
&submd, it, data);
}
RETURN(rc);
return rc;
}
/* find any ldlm lock of the inode in lov
@ -1677,7 +1677,7 @@ static int lov_find_cbdata(struct obd_export *exp,
ASSERT_LSM_MAGIC(lsm);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
for (i = 0; i < lsm->lsm_stripe_count; i++) {
@ -1693,9 +1693,9 @@ static int lov_find_cbdata(struct obd_export *exp,
rc = obd_find_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
&submd, it, data);
if (rc != 0)
RETURN(rc);
return rc;
}
RETURN(rc);
return rc;
}
static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
@ -1712,13 +1712,13 @@ static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
ASSERT_LSM_MAGIC(lsm);
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
LASSERT(lockh);
lov = &exp->exp_obd->u.lov;
rc = lov_prep_cancel_set(exp, &oinfo, lsm, mode, lockh, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each(pos, &set->set_list) {
req = list_entry(pos, struct lov_request, rq_link);
@ -1738,7 +1738,7 @@ static int lov_cancel(struct obd_export *exp, struct lov_stripe_md *lsm,
}
lov_fini_cancel_set(set);
RETURN(err);
return err;
}
static int lov_cancel_unused(struct obd_export *exp,
@ -1749,7 +1749,7 @@ static int lov_cancel_unused(struct obd_export *exp,
int rc = 0, i;
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
return -ENODEV;
lov = &exp->exp_obd->u.lov;
if (lsm == NULL) {
@ -1763,7 +1763,7 @@ static int lov_cancel_unused(struct obd_export *exp,
if (!rc)
rc = err;
}
RETURN(rc);
return rc;
}
ASSERT_LSM_MAGIC(lsm);
@ -1795,7 +1795,7 @@ static int lov_cancel_unused(struct obd_export *exp,
rc = err;
}
}
RETURN(rc);
return rc;
}
int lov_statfs_interpret(struct ptlrpc_request_set *rqset, void *data, int rc)
@ -1807,7 +1807,7 @@ int lov_statfs_interpret(struct ptlrpc_request_set *rqset, void *data, int rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_statfs_set(lovset);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
@ -1826,7 +1826,7 @@ static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
lov = &obd->u.lov;
rc = lov_prep_statfs_set(obd, oinfo, &set);
if (rc)
RETURN(rc);
return rc;
list_for_each (pos, &set->set_list) {
req = list_entry(pos, struct lov_request, rq_link);
@ -1841,13 +1841,13 @@ static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
if (rc)
atomic_set(&set->set_completes, 0);
err = lov_fini_statfs_set(set);
RETURN(rc ? rc : err);
return rc ? rc : err;
}
LASSERT(rqset->set_interpret == NULL);
rqset->set_interpret = lov_statfs_interpret;
rqset->set_arg = (void *)set;
RETURN(0);
return 0;
}
static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
@ -1861,7 +1861,7 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
* statfs requests */
set = ptlrpc_prep_set();
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
oinfo.oi_osfs = osfs;
oinfo.oi_flags = flags;
@ -1870,7 +1870,7 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
return rc;
}
static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
@ -1891,23 +1891,23 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
memcpy(&index, data->ioc_inlbuf2, sizeof(__u32));
if ((index >= count))
RETURN(-ENODEV);
return -ENODEV;
if (!lov->lov_tgts[index])
/* Try again with the next index */
RETURN(-EAGAIN);
return -EAGAIN;
if (!lov->lov_tgts[index]->ltd_active)
RETURN(-ENODATA);
return -ENODATA;
osc_obd = class_exp2obd(lov->lov_tgts[index]->ltd_exp);
if (!osc_obd)
RETURN(-EINVAL);
return -EINVAL;
/* copy UUID */
if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(osc_obd),
min((int) data->ioc_plen2,
(int) sizeof(struct obd_uuid))))
RETURN(-EFAULT);
return -EFAULT;
flags = uarg ? *(__u32*)uarg : 0;
/* got statfs data */
@ -1915,11 +1915,11 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
flags);
if (rc)
RETURN(rc);
return rc;
if (copy_to_user(data->ioc_pbuf1, &stat_buf,
min((int) data->ioc_plen1,
(int) sizeof(stat_buf))))
RETURN(-EFAULT);
return -EFAULT;
break;
}
case OBD_IOC_LOV_GET_CONFIG: {
@ -1930,23 +1930,23 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
len = 0;
if (obd_ioctl_getdata(&buf, &len, (void *)uarg))
RETURN(-EINVAL);
return -EINVAL;
data = (struct obd_ioctl_data *)buf;
if (sizeof(*desc) > data->ioc_inllen1) {
obd_ioctl_freedata(buf, len);
RETURN(-EINVAL);
return -EINVAL;
}
if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) {
obd_ioctl_freedata(buf, len);
RETURN(-EINVAL);
return -EINVAL;
}
if (sizeof(__u32) * count > data->ioc_inllen3) {
obd_ioctl_freedata(buf, len);
RETURN(-EINVAL);
return -EINVAL;
}
desc = (struct lov_desc *)data->ioc_inlbuf1;
@ -1983,11 +1983,11 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
if (qctl->qc_valid == QC_OSTIDX) {
if (qctl->qc_idx < 0 || count <= qctl->qc_idx)
RETURN(-EINVAL);
return -EINVAL;
tgt = lov->lov_tgts[qctl->qc_idx];
if (!tgt || !tgt->ltd_exp)
RETURN(-EINVAL);
return -EINVAL;
} else if (qctl->qc_valid == QC_UUID) {
for (i = 0; i < count; i++) {
tgt = lov->lov_tgts[i];
@ -1997,21 +1997,21 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
continue;
if (tgt->ltd_exp == NULL)
RETURN(-EINVAL);
return -EINVAL;
break;
}
} else {
RETURN(-EINVAL);
return -EINVAL;
}
if (i >= count)
RETURN(-EAGAIN);
return -EAGAIN;
LASSERT(tgt && tgt->ltd_exp);
OBD_ALLOC_PTR(oqctl);
if (!oqctl)
RETURN(-ENOMEM);
return -ENOMEM;
QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(tgt->ltd_exp, oqctl);
@ -2027,7 +2027,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
int set = 0;
if (count == 0)
RETURN(-ENOTTY);
return -ENOTTY;
for (i = 0; i < count; i++) {
int err;
@ -2044,7 +2044,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
err = obd_iocontrol(cmd, lov->lov_tgts[i]->ltd_exp,
len, karg, uarg);
if (err == -ENODATA && cmd == OBD_IOC_POLL_QUOTACHECK) {
RETURN(err);
return err;
} else if (err) {
if (lov->lov_tgts[i]->ltd_active) {
CDEBUG(err == -ENOTTY ?
@ -2065,7 +2065,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
}
}
RETURN(rc);
return rc;
}
#define FIEMAP_BUFFER_SIZE 4096
@ -2434,7 +2434,7 @@ static int lov_get_info(const struct lu_env *env, struct obd_export *exp,
int i, rc;
if (!vallen || !val)
RETURN(-EFAULT);
return -EFAULT;
obd_getref(obddev);
@ -2515,7 +2515,7 @@ static int lov_get_info(const struct lu_env *env, struct obd_export *exp,
out:
obd_putref(obddev);
RETURN(rc);
return rc;
}
static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
@ -2536,7 +2536,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
no_set = 1;
set = ptlrpc_prep_set();
if (!set)
RETURN(-ENOMEM);
return -ENOMEM;
}
obd_getref(obddev);
@ -2628,7 +2628,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
rc = err;
ptlrpc_set_destroy(set);
}
RETURN(rc);
return rc;
}
static int lov_extent_calc(struct obd_export *exp, struct lov_stripe_md *lsm,
@ -2652,7 +2652,7 @@ static int lov_extent_calc(struct obd_export *exp, struct lov_stripe_md *lsm,
LBUG();
}
RETURN(0);
return 0;
}
void lov_stripe_lock(struct lov_stripe_md *md)
@ -2688,7 +2688,7 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
oqctl->qc_cmd != LUSTRE_Q_SETQUOTA &&
oqctl->qc_cmd != Q_FINVALIDATE) {
CERROR("bad quota opc %x for lov obd", oqctl->qc_cmd);
RETURN(-EFAULT);
return -EFAULT;
}
/* for lov tgt */
@ -2730,7 +2730,7 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
oqctl->qc_dqblk.dqb_curspace = curspace;
oqctl->qc_dqblk.dqb_bhardlimit = bhardlimit;
}
RETURN(rc);
return rc;
}
static int lov_quotacheck(struct obd_device *obd, struct obd_export *exp,
@ -2773,7 +2773,7 @@ static int lov_quotacheck(struct obd_device *obd, struct obd_export *exp,
out:
obd_putref(obd);
RETURN(rc);
return rc;
}
struct obd_ops lov_obd_ops = {
@ -2856,7 +2856,7 @@ int __init lov_init(void)
lu_kmem_fini(lov_caches);
}
RETURN(rc);
return rc;
}
static void /*__exit*/ lov_exit(void)

View File

@ -118,7 +118,7 @@ static struct cl_object *lov_sub_find(const struct lu_env *env,
o = lu_object_find_at(env, cl2lu_dev(dev), fid, &conf->coc_lu);
LASSERT(ergo(!IS_ERR(o), o->lo_dev->ld_type == &lovsub_device_type));
RETURN(lu2cl(o));
return lu2cl(o);
}
static int lov_init_sub(const struct lu_env *env, struct lov_object *lov,
@ -252,7 +252,7 @@ static int lov_init_raid0(const struct lu_env *env,
} else
result = -ENOMEM;
out:
RETURN(result);
return result;
}
static int lov_init_released(const struct lu_env *env,
@ -353,7 +353,7 @@ static int lov_delete_raid0(const struct lu_env *env, struct lov_object *lov,
}
}
cl_object_prune(env, &lov->lo_cl);
RETURN(0);
return 0;
}
static void lov_fini_empty(const struct lu_env *env, struct lov_object *lov,
@ -497,7 +497,7 @@ static int lov_attr_get_raid0(const struct lu_env *env, struct cl_object *obj,
if (attr->cat_mtime < lov_attr->cat_mtime)
attr->cat_mtime = lov_attr->cat_mtime;
}
RETURN(result);
return result;
}
const static struct lov_layout_operations lov_dispatch[] = {
@ -631,7 +631,7 @@ static int lov_layout_wait(const struct lu_env *env, struct lov_object *lov)
l_wait_event(lov->lo_waitq,
atomic_read(&lov->lo_active_ios) == 0, &lwi);
}
RETURN(0);
return 0;
}
static int lov_layout_change(const struct lu_env *unused,
@ -659,7 +659,7 @@ static int lov_layout_change(const struct lu_env *unused,
env = cl_env_get(&refcheck);
if (IS_ERR(env)) {
cl_env_reexit(cookie);
RETURN(PTR_ERR(env));
return PTR_ERR(env);
}
old_ops = &lov_dispatch[lov->lo_type];
@ -689,7 +689,7 @@ static int lov_layout_change(const struct lu_env *unused,
cl_env_put(env, &refcheck);
cl_env_reexit(cookie);
RETURN(result);
return result;
}
/*****************************************************************************
@ -719,7 +719,7 @@ int lov_object_init(const struct lu_env *env, struct lu_object *obj,
result = ops->llo_init(env, dev, lov, cconf, set);
if (result == 0)
ops->llo_install(env, lov, set);
RETURN(result);
return result;
}
static int lov_conf_set(const struct lu_env *env, struct cl_object *obj,
@ -767,7 +767,7 @@ static int lov_conf_set(const struct lu_env *env, struct cl_object *obj,
out:
lov_conf_unlock(lov);
RETURN(result);
return result;
}
static void lov_object_delete(const struct lu_env *env, struct lu_object *obj)
@ -880,7 +880,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env,
obj->lo_ops = &lov_lu_obj_ops;
} else
obj = NULL;
RETURN(obj);
return obj;
}
struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov)
@ -965,7 +965,7 @@ int lov_read_and_clear_async_rc(struct cl_object *clob)
}
lov_conf_thaw(lov);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(lov_read_and_clear_async_rc);

View File

@ -54,7 +54,7 @@ obd_size lov_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size,
int magic = lsm->lsm_magic;
if (ost_size == 0)
RETURN(0);
return 0;
LASSERT(lsm_op_find(magic) != NULL);
lsm_op_find(magic)->lsm_stripe_by_index(lsm, &stripeno, NULL, &swidth);
@ -66,7 +66,7 @@ obd_size lov_stripe_size(struct lov_stripe_md *lsm, obd_size ost_size,
else
lov_size = (ost_size - 1) * swidth + (stripeno + 1) * ssize;
RETURN(lov_size);
return lov_size;
}
/* we have an offset in file backed by an lov and want to find out where

View File

@ -158,7 +158,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
(lmm_magic != LOV_MAGIC_V3)) {
CERROR("bad mem LOV MAGIC: 0x%08X != 0x%08X nor 0x%08X\n",
lmm_magic, LOV_MAGIC_V1, LOV_MAGIC_V3);
RETURN(-EINVAL);
return -EINVAL;
}
@ -189,20 +189,20 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
lmm_size = lov_mds_md_size(stripe_count, lmm_magic);
if (!lmmp)
RETURN(lmm_size);
return lmm_size;
if (*lmmp && !lsm) {
stripe_count = le16_to_cpu((*lmmp)->lmm_stripe_count);
lmm_size = lov_mds_md_size(stripe_count, lmm_magic);
OBD_FREE_LARGE(*lmmp, lmm_size);
*lmmp = NULL;
RETURN(0);
return 0;
}
if (!*lmmp) {
OBD_ALLOC_LARGE(*lmmp, lmm_size);
if (!*lmmp)
RETURN(-ENOMEM);
return -ENOMEM;
}
CDEBUG(D_INFO, "lov_packmd: LOV_MAGIC 0x%08X, lmm_size = %d \n",
@ -216,7 +216,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
lmmv1->lmm_magic = cpu_to_le32(LOV_MAGIC_V1);
if (!lsm)
RETURN(lmm_size);
return lmm_size;
/* lmmv1 and lmmv3 point to the same struct and have the
* same first fields
@ -230,7 +230,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
cplen = strlcpy(lmmv3->lmm_pool_name, lsm->lsm_pool_name,
sizeof(lmmv3->lmm_pool_name));
if (cplen >= sizeof(lmmv3->lmm_pool_name))
RETURN(-E2BIG);
return -E2BIG;
lmm_objects = lmmv3->lmm_objects;
} else {
lmm_objects = lmmv1->lmm_objects;
@ -247,7 +247,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
lmm_objects[i].l_ost_idx = cpu_to_le32(loi->loi_ost_idx);
}
RETURN(lmm_size);
return lmm_size;
}
/* Find the max stripecount we should use */
@ -314,7 +314,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, __u16 stripe_count,
*lsmp = lsm_alloc_plain(stripe_count, &lsm_size);
if (!*lsmp) {
CERROR("can't allocate lsmp stripe_count %d\n", stripe_count);
RETURN(-ENOMEM);
return -ENOMEM;
}
atomic_set(&(*lsmp)->lsm_refc, 1);
@ -331,7 +331,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, __u16 stripe_count,
for (i = 0; i < stripe_count; i++)
loi_init((*lsmp)->lsm_oinfo[i]);
RETURN(lsm_size);
return lsm_size;
}
int lov_free_memmd(struct lov_stripe_md **lsmp)
@ -366,7 +366,7 @@ int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
if (lmm) {
rc = lov_verify_lmm(lmm, lmm_bytes, &stripe_count);
if (rc)
RETURN(rc);
return rc;
magic = le32_to_cpu(lmm->lmm_magic);
} else {
magic = LOV_MAGIC;
@ -377,31 +377,31 @@ int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
if (!lsmp) {
/* XXX LOV STACKING call into osc for sizes */
LBUG();
RETURN(lov_stripe_md_size(stripe_count));
return lov_stripe_md_size(stripe_count);
}
/* If we are passed an allocated struct but nothing to unpack, free */
if (*lsmp && !lmm) {
lov_free_memmd(lsmp);
RETURN(0);
return 0;
}
pattern = le32_to_cpu(lmm->lmm_pattern);
lsm_size = lov_alloc_memmd(lsmp, stripe_count, pattern, magic);
if (lsm_size < 0)
RETURN(lsm_size);
return lsm_size;
/* If we are passed a pointer but nothing to unpack, we only alloc */
if (!lmm)
RETURN(lsm_size);
return lsm_size;
LASSERT(lsm_op_find(magic) != NULL);
rc = lsm_op_find(magic)->lsm_unpackmd(lov, *lsmp, lmm);
if (rc) {
lov_free_memmd(lsmp);
RETURN(rc);
return rc;
}
RETURN(lsm_size);
return lsm_size;
}
static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
@ -420,7 +420,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
rc = lov_lum_swab_if_needed(lumv3, &lmm_magic, lump);
if (rc)
RETURN(rc);
return rc;
/* in the rest of the tests, as *lumv1 and lumv3 have the same
* fields, we use lumv1 to avoid code duplication */
@ -433,7 +433,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
if (lov_pattern(lumv1->lmm_pattern) != LOV_PATTERN_RAID0) {
CDEBUG(D_IOCTL, "bad userland stripe pattern: %#x\n",
lumv1->lmm_pattern);
RETURN(-EINVAL);
return -EINVAL;
}
/* 64kB is the largest common page size we see (ia64), and matches the
@ -449,7 +449,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
(typeof(lumv1->lmm_stripe_offset))(-1))) {
CDEBUG(D_IOCTL, "stripe offset %u > number of OSTs %u\n",
lumv1->lmm_stripe_offset, lov->desc.ld_tgt_count);
RETURN(-EINVAL);
return -EINVAL;
}
stripe_count = lov_get_stripecnt(lov, lmm_magic,
lumv1->lmm_stripe_count);
@ -479,7 +479,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
lumv3->lmm_stripe_offset, pool);
if (rc < 0) {
lov_pool_putref(pool);
RETURN(-EINVAL);
return -EINVAL;
}
}
@ -508,7 +508,7 @@ static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
rc = 0;
}
RETURN(rc);
return rc;
}
/* Configure object striping information on a new file.
@ -529,7 +529,7 @@ int lov_setstripe(struct obd_export *exp, int max_lmm_size,
rc = __lov_setstripe(exp, max_lmm_size, lsmp, lump);
set_fs(seg);
RETURN(rc);
return rc;
}
int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
@ -553,26 +553,26 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
rc = obd_get_info(NULL, oexp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
&len, &last_id, NULL);
if (rc)
RETURN(rc);
return rc;
if (ostid_id(&lmm_objects[i].l_ost_oi) > last_id) {
CERROR("Setting EA for object > than last id on"
" ost idx %d "DOSTID" > "LPD64" \n",
lmm_objects[i].l_ost_idx,
POSTID(&lmm_objects[i].l_ost_oi), last_id);
RETURN(-EINVAL);
return -EINVAL;
}
}
rc = lov_setstripe(exp, 0, lsmp, lump);
if (rc)
RETURN(rc);
return rc;
for (i = 0; i < lump->lmm_stripe_count; i++) {
(*lsmp)->lsm_oinfo[i]->loi_ost_idx =
lmm_objects[i].l_ost_idx;
(*lsmp)->lsm_oinfo[i]->loi_oi = lmm_objects[i].l_ost_oi;
}
RETURN(0);
return 0;
}
@ -596,7 +596,7 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
mm_segment_t seg;
if (!lsm)
RETURN(-ENODATA);
return -ENODATA;
/*
* "Switch to kernel segment" to allow copying from kernel space by
@ -674,5 +674,5 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
obd_free_diskmd(exp, &lmmk);
out_set:
set_fs(seg);
RETURN(rc);
return rc;
}

View File

@ -95,7 +95,7 @@ static int lov_page_own(const struct lu_env *env,
lov_sub_put(sub);
} else
LBUG(); /* Arrgh */
RETURN(0);
return 0;
}
static void lov_page_assume(const struct lu_env *env,
@ -124,7 +124,7 @@ static int lov_page_cache_add(const struct lu_env *env,
rc = PTR_ERR(sub);
CL_PAGE_DEBUG(D_ERROR, env, slice->cpl_page, "rc = %d\n", rc);
}
RETURN(rc);
return rc;
}
static int lov_page_print(const struct lu_env *env,
@ -221,7 +221,7 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
memset(addr, 0, cl_page_size(obj));
kunmap(vmpage);
cl_page_export(env, page, 1);
RETURN(0);
return 0;
}

View File

@ -330,7 +330,7 @@ int lov_ost_pool_init(struct ost_pool *op, unsigned int count)
OBD_ALLOC(op->op_array, op->op_size * sizeof(op->op_array[0]));
if (op->op_array == NULL) {
op->op_size = 0;
RETURN(-ENOMEM);
return -ENOMEM;
}
return 0;
}
@ -399,13 +399,13 @@ int lov_ost_pool_remove(struct ost_pool *op, __u32 idx)
}
up_write(&op->op_rw_sem);
RETURN(-EINVAL);
return -EINVAL;
}
int lov_ost_pool_free(struct ost_pool *op)
{
if (op->op_size == 0)
RETURN(0);
return 0;
down_write(&op->op_rw_sem);
@ -415,7 +415,7 @@ int lov_ost_pool_free(struct ost_pool *op)
op->op_size = 0;
up_write(&op->op_rw_sem);
RETURN(0);
return 0;
}
@ -428,11 +428,11 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
lov = &(obd->u.lov);
if (strlen(poolname) > LOV_MAXPOOLNAME)
RETURN(-ENAMETOOLONG);
return -ENAMETOOLONG;
OBD_ALLOC_PTR(new_pool);
if (new_pool == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
strncpy(new_pool->pool_name, poolname, LOV_MAXPOOLNAME);
new_pool->pool_name[LOV_MAXPOOLNAME] = '\0';
@ -481,7 +481,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
CDEBUG(D_CONFIG, LOV_POOLNAMEF" is pool #%d\n",
poolname, lov->lov_pool_count);
RETURN(0);
return 0;
out_err:
spin_lock(&obd->obd_dev_lock);
@ -508,7 +508,7 @@ int lov_pool_del(struct obd_device *obd, char *poolname)
/* lookup and kill hash reference */
pool = cfs_hash_del_key(lov->lov_pools_hash_body, poolname);
if (pool == NULL)
RETURN(-ENOENT);
return -ENOENT;
if (pool->pool_proc_entry != NULL) {
CDEBUG(D_INFO, "proc entry %p\n", pool->pool_proc_entry);
@ -524,7 +524,7 @@ int lov_pool_del(struct obd_device *obd, char *poolname)
/* release last reference */
lov_pool_putref(pool);
RETURN(0);
return 0;
}
@ -540,7 +540,7 @@ int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname)
pool = cfs_hash_lookup(lov->lov_pools_hash_body, poolname);
if (pool == NULL)
RETURN(-ENOENT);
return -ENOENT;
obd_str2uuid(&ost_uuid, ostname);
@ -585,7 +585,7 @@ int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname)
pool = cfs_hash_lookup(lov->lov_pools_hash_body, poolname);
if (pool == NULL)
RETURN(-ENOENT);
return -ENOENT;
obd_str2uuid(&ost_uuid, ostname);

View File

@ -129,7 +129,7 @@ int lov_update_common_set(struct lov_request_set *set,
rc = 0;
/* FIXME in raid1 regime, should return 0 */
RETURN(rc);
return rc;
}
void lov_set_add_req(struct lov_request *req, struct lov_request_set *set)
@ -250,7 +250,7 @@ int lov_update_enqueue_set(struct lov_request *req, __u32 mode, int rc)
req->rq_idx, &oi->oi_md->lsm_oi, rc);
lov_stripe_unlock(oi->oi_md);
lov_update_set(set, req, rc);
RETURN(rc);
return rc;
}
/* The callback for osc_enqueue that updates lov info for every OSC request. */
@ -274,7 +274,7 @@ static int enqueue_done(struct lov_request_set *set, __u32 mode)
/* enqueue/match success, just return */
if (completes && completes == atomic_read(&set->set_success))
RETURN(0);
return 0;
/* cancel enqueued/matched locks */
list_for_each_entry(req, &set->set_list, rq_link) {
@ -300,7 +300,7 @@ static int enqueue_done(struct lov_request_set *set, __u32 mode)
}
if (set->set_lockh)
lov_llh_put(set->set_lockh);
RETURN(rc);
return rc;
}
int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
@ -309,7 +309,7 @@ int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
int ret = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
/* Do enqueue_done only for sync requests and if any request
* succeeded. */
@ -322,7 +322,7 @@ int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
lov_put_reqset(set);
RETURN(rc ? rc : ret);
return rc ? rc : ret;
}
static void lov_llh_addref(void *llhp)
@ -366,7 +366,7 @@ int lov_prep_enqueue_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -438,10 +438,10 @@ int lov_prep_enqueue_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(0);
return 0;
out_set:
lov_fini_enqueue_set(set, einfo->ei_mode, rc, NULL);
RETURN(rc);
return rc;
}
int lov_fini_match_set(struct lov_request_set *set, __u32 mode, int flags)
@ -449,7 +449,7 @@ int lov_fini_match_set(struct lov_request_set *set, __u32 mode, int flags)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
rc = enqueue_done(set, mode);
if ((set->set_count == atomic_read(&set->set_success)) &&
@ -458,7 +458,7 @@ int lov_fini_match_set(struct lov_request_set *set, __u32 mode, int flags)
lov_put_reqset(set);
RETURN(rc);
return rc;
}
int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
@ -472,7 +472,7 @@ int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -526,10 +526,10 @@ int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_match_set(set, mode, 0);
RETURN(rc);
return rc;
}
int lov_fini_cancel_set(struct lov_request_set *set)
@ -537,7 +537,7 @@ int lov_fini_cancel_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (set->set_lockh)
@ -545,7 +545,7 @@ int lov_fini_cancel_set(struct lov_request_set *set)
lov_put_reqset(set);
RETURN(rc);
return rc;
}
int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
@ -558,7 +558,7 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -606,10 +606,10 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_cancel_set(set);
RETURN(rc);
return rc;
}
static int common_attr_done(struct lov_request_set *set)
{
@ -621,10 +621,10 @@ static int common_attr_done(struct lov_request_set *set)
LASSERT(set->set_oi != NULL);
if (set->set_oi->oi_oa == NULL)
RETURN(0);
return 0;
if (!atomic_read(&set->set_success))
RETURN(-EIO);
return -EIO;
OBDO_ALLOC(tmp_oa);
if (tmp_oa == NULL)
@ -658,7 +658,7 @@ static int common_attr_done(struct lov_request_set *set)
out:
if (tmp_oa)
OBDO_FREE(tmp_oa);
RETURN(rc);
return rc;
}
@ -681,7 +681,7 @@ static int brw_done(struct lov_request_set *set)
loi->loi_lvb.lvb_blocks = req->rq_oi.oi_oa->o_blocks;
}
RETURN(0);
return 0;
}
int lov_fini_brw_set(struct lov_request_set *set)
@ -689,7 +689,7 @@ int lov_fini_brw_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (atomic_read(&set->set_completes)) {
rc = brw_done(set);
@ -697,7 +697,7 @@ int lov_fini_brw_set(struct lov_request_set *set)
}
lov_put_reqset(set);
RETURN(rc);
return rc;
}
int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
@ -716,7 +716,7 @@ int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -817,7 +817,7 @@ out:
else
lov_fini_brw_set(set);
RETURN(rc);
return rc;
}
int lov_fini_getattr_set(struct lov_request_set *set)
@ -825,14 +825,14 @@ int lov_fini_getattr_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (atomic_read(&set->set_completes))
rc = common_attr_done(set);
lov_put_reqset(set);
RETURN(rc);
return rc;
}
/* The callback for osc_getattr_async that finilizes a request info when a
@ -854,7 +854,7 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -896,16 +896,16 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_getattr_set(set);
RETURN(rc);
return rc;
}
int lov_fini_destroy_set(struct lov_request_set *set)
{
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (atomic_read(&set->set_completes)) {
/* FIXME update qos data here */
@ -913,7 +913,7 @@ int lov_fini_destroy_set(struct lov_request_set *set)
lov_put_reqset(set);
RETURN(0);
return 0;
}
int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
@ -927,7 +927,7 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -967,10 +967,10 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_destroy_set(set);
RETURN(rc);
return rc;
}
int lov_fini_setattr_set(struct lov_request_set *set)
@ -978,7 +978,7 @@ int lov_fini_setattr_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (atomic_read(&set->set_completes)) {
rc = common_attr_done(set);
@ -986,7 +986,7 @@ int lov_fini_setattr_set(struct lov_request_set *set)
}
lov_put_reqset(set);
RETURN(rc);
return rc;
}
int lov_update_setattr_set(struct lov_request_set *set,
@ -1014,7 +1014,7 @@ int lov_update_setattr_set(struct lov_request_set *set,
req->rq_oi.oi_oa->o_atime;
}
RETURN(rc);
return rc;
}
/* The callback for osc_setattr_async that finilizes a request info when a
@ -1037,7 +1037,7 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -1090,10 +1090,10 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_setattr_set(set);
RETURN(rc);
return rc;
}
int lov_fini_punch_set(struct lov_request_set *set)
@ -1101,7 +1101,7 @@ int lov_fini_punch_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (atomic_read(&set->set_completes)) {
rc = -EIO;
@ -1112,7 +1112,7 @@ int lov_fini_punch_set(struct lov_request_set *set)
lov_put_reqset(set);
RETURN(rc);
return rc;
}
int lov_update_punch_set(struct lov_request_set *set,
@ -1137,7 +1137,7 @@ int lov_update_punch_set(struct lov_request_set *set,
lov_stripe_unlock(lsm);
}
RETURN(rc);
return rc;
}
/* The callback for osc_punch that finilizes a request info when a response
@ -1160,7 +1160,7 @@ int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_oi = oinfo;
@ -1212,10 +1212,10 @@ int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_punch_set(set);
RETURN(rc);
return rc;
}
int lov_fini_sync_set(struct lov_request_set *set)
@ -1223,7 +1223,7 @@ int lov_fini_sync_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
LASSERT(set->set_exp);
if (atomic_read(&set->set_completes)) {
if (!atomic_read(&set->set_success))
@ -1233,7 +1233,7 @@ int lov_fini_sync_set(struct lov_request_set *set)
lov_put_reqset(set);
RETURN(rc);
return rc;
}
/* The callback for osc_sync that finilizes a request info when a
@ -1257,7 +1257,7 @@ int lov_prep_sync_set(struct obd_export *exp, struct obd_info *oinfo,
OBD_ALLOC_PTR(set);
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_exp = exp;
@ -1302,10 +1302,10 @@ int lov_prep_sync_set(struct obd_export *exp, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_sync_set(set);
RETURN(rc);
return rc;
}
#define LOV_U64_MAX ((__u64)~0ULL)
@ -1331,10 +1331,10 @@ int lov_fini_statfs(struct obd_device *obd, struct obd_statfs *osfs,int success)
memcpy(&obd->obd_osfs, osfs, sizeof(*osfs));
obd->obd_osfs_age = cfs_time_current_64();
spin_unlock(&obd->obd_osfs_lock);
RETURN(0);
return 0;
}
RETURN(-EIO);
return -EIO;
}
int lov_fini_statfs_set(struct lov_request_set *set)
@ -1342,14 +1342,14 @@ int lov_fini_statfs_set(struct lov_request_set *set)
int rc = 0;
if (set == NULL)
RETURN(0);
return 0;
if (atomic_read(&set->set_completes)) {
rc = lov_fini_statfs(set->set_obd, set->set_oi->oi_osfs,
atomic_read(&set->set_success));
}
lov_put_reqset(set);
RETURN(rc);
return rc;
}
void lov_update_statfs(struct obd_statfs *osfs, struct obd_statfs *lov_sfs,
@ -1456,7 +1456,7 @@ out:
atomic_read(&set->set_success));
}
RETURN(0);
return 0;
}
int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
@ -1468,7 +1468,7 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
OBD_ALLOC(set, sizeof(*set));
if (set == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lov_init_set(set);
set->set_obd = obd;
@ -1511,8 +1511,8 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
if (!set->set_count)
GOTO(out_set, rc = -EIO);
*reqset = set;
RETURN(rc);
return rc;
out_set:
lov_fini_statfs_set(set);
RETURN(rc);
return rc;
}

View File

@ -103,13 +103,13 @@ static int lovsub_device_init(const struct lu_env *env, struct lu_device *d,
rc = ldt->ldt_ops->ldto_device_init(env, next, ldt->ldt_name, NULL);
if (rc) {
next->ld_site = NULL;
RETURN(rc);
return rc;
}
lu_device_get(next);
lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init);
lsd->acid_next = lu2cl_dev(next);
RETURN(rc);
return rc;
}
static struct lu_device *lovsub_device_fini(const struct lu_env *env,
@ -122,7 +122,7 @@ static struct lu_device *lovsub_device_fini(const struct lu_env *env,
next = cl2lu_dev(lsd->acid_next);
lsd->acid_super = NULL;
lsd->acid_next = NULL;
RETURN(next);
return next;
}
static struct lu_device *lovsub_device_free(const struct lu_env *env,

View File

@ -136,7 +136,7 @@ static unsigned long lovsub_lock_weigh(const struct lu_env *env,
} else
dumbbell = 0;
RETURN(dumbbell);
return dumbbell;
}
/**
@ -240,7 +240,7 @@ static int lovsub_lock_modify(const struct lu_env *env,
lovsub_parent_unlock(env, lov);
result = result ?: rc;
}
RETURN(result);
return result;
}
static int lovsub_lock_closure(const struct lu_env *env,
@ -263,7 +263,7 @@ static int lovsub_lock_closure(const struct lu_env *env,
if (result != 0)
break;
}
RETURN(result);
return result;
}
/**
@ -278,7 +278,7 @@ static int lovsub_lock_delete_one(const struct lu_env *env,
parent = lov->lls_cl.cls_lock;
if (parent->cll_error)
RETURN(0);
return 0;
result = 0;
switch (parent->cll_state) {
@ -370,7 +370,7 @@ static int lovsub_lock_delete_one(const struct lu_env *env,
break;
}
RETURN(result);
return result;
}
/**
@ -460,7 +460,7 @@ int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
result = 0;
} else
result = -ENOMEM;
RETURN(result);
return result;
}
/** @} lov */

View File

@ -69,7 +69,7 @@ int lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
result = 0;
} else
result = -ENOMEM;
RETURN(result);
return result;
}
@ -108,7 +108,7 @@ static int lovsub_attr_set(const struct lu_env *env, struct cl_object *obj,
struct lov_object *lov = cl2lovsub(obj)->lso_super;
lov_r0(lov)->lo_attr_valid = 0;
RETURN(0);
return 0;
}
static int lovsub_object_glimpse(const struct lu_env *env,
@ -117,7 +117,7 @@ static int lovsub_object_glimpse(const struct lu_env *env,
{
struct lovsub_object *los = cl2lovsub(obj);
RETURN(cl_object_glimpse(env, &los->lso_super->lo_cl, lvb));
return cl_object_glimpse(env, &los->lso_super->lo_cl, lvb);
}
@ -158,7 +158,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env,
obj->lo_ops = &lovsub_lu_obj_ops;
} else
obj = NULL;
RETURN(obj);
return obj;
}
/** @} lov */

View File

@ -65,7 +65,7 @@ int lovsub_page_init(const struct lu_env *env, struct cl_object *obj,
struct lovsub_page *lsb = cl_object_page_slice(obj, page);
cl_page_slice_add(page, &lsb->lsb_cl, obj, &lovsub_page_ops);
RETURN(0);
return 0;
}
/** @} lov */

View File

@ -67,7 +67,7 @@ int fsfilt_register_ops(struct fsfilt_operations *fs_ops)
CERROR("different operations for type %s\n",
fs_ops->fs_type);
/* unlock fsfilt_types list */
RETURN(-EEXIST);
return -EEXIST;
}
} else {
try_module_get(THIS_MODULE);
@ -119,7 +119,7 @@ struct fsfilt_operations *fsfilt_get_ops(const char *type)
if (rc) {
CERROR("Can't find %s interface\n", name);
RETURN(ERR_PTR(rc < 0 ? rc : -rc));
return ERR_PTR(rc < 0 ? rc : -rc);
/* unlock fsfilt_types list */
}
}

View File

@ -210,7 +210,7 @@ int lustre_rename(struct dentry *dir, struct vfsmount *mnt,
dchild_old = ll_lookup_one_len(oldname, dir, strlen(oldname));
if (IS_ERR(dchild_old))
RETURN(PTR_ERR(dchild_old));
return PTR_ERR(dchild_old);
if (!dchild_old->d_inode)
GOTO(put_old, err = -ENOENT);
@ -225,7 +225,7 @@ int lustre_rename(struct dentry *dir, struct vfsmount *mnt,
dput(dchild_new);
put_old:
dput(dchild_old);
RETURN(err);
return err;
}
EXPORT_SYMBOL(lustre_rename);
@ -250,7 +250,7 @@ __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
__s64 ret = 0;
if (lc == NULL || header == NULL)
RETURN(0);
return 0;
switch (field) {
case LPROCFS_FIELDS_FLAGS_CONFIG:
@ -280,7 +280,7 @@ __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
break;
};
RETURN(ret);
return ret;
}
EXPORT_SYMBOL(lprocfs_read_helper);
#endif /* LPROCFS */

View File

@ -95,10 +95,10 @@ static ssize_t mdc_kuc_write(struct file *file, const char *buffer,
rc = lprocfs_write_helper(buffer, count, &fd);
if (rc)
RETURN(rc);
return rc;
if (fd < 0)
RETURN(-ERANGE);
return -ERANGE;
CWARN("message to fd %d\n", fd);
len = sizeof(*lh) + sizeof(*hal) + MTI_NAME_MAXLEN +
@ -139,8 +139,8 @@ static ssize_t mdc_kuc_write(struct file *file, const char *buffer,
}
OBD_FREE(lh, len);
if (rc < 0)
RETURN(rc);
RETURN(count);
return rc;
return count;
}
struct file_operations mdc_kuc_fops = {

View File

@ -509,7 +509,7 @@ static int mdc_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
client_obd_list_lock(&cli->cl_loi_list_lock);
rc = list_empty(&mcw->mcw_entry);
client_obd_list_unlock(&cli->cl_loi_list_lock);
RETURN(rc);
return rc;
};
/* We record requests in flight in cli->cl_r_in_flight here.

View File

@ -120,7 +120,7 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
*bits = 0;
if (!*lockh)
RETURN(0);
return 0;
lock = ldlm_handle2lock((struct lustre_handle *)lockh);
@ -143,7 +143,7 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
unlock_res_and_lock(lock);
LDLM_LOCK_PUT(lock);
RETURN(0);
return 0;
}
ldlm_mode_t mdc_lock_match(struct obd_export *exp, __u64 flags,
@ -157,7 +157,7 @@ ldlm_mode_t mdc_lock_match(struct obd_export *exp, __u64 flags,
fid_build_reg_res_name(fid, &res_id);
rc = ldlm_lock_match(class_exp2obd(exp)->obd_namespace, flags,
&res_id, type, policy, mode, lockh, 0);
RETURN(rc);
return rc;
}
int mdc_cancel_unused(struct obd_export *exp,
@ -174,7 +174,7 @@ int mdc_cancel_unused(struct obd_export *exp,
fid_build_reg_res_name(fid, &res_id);
rc = ldlm_cli_cancel_unused_resource(obd->obd_namespace, &res_id,
policy, mode, flags, opaque);
RETURN(rc);
return rc;
}
int mdc_null_inode(struct obd_export *exp,
@ -190,14 +190,14 @@ int mdc_null_inode(struct obd_export *exp,
res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
if(res == NULL)
RETURN(0);
return 0;
lock_res(res);
res->lr_lvb_inode = NULL;
unlock_res(res);
ldlm_resource_putref(res);
RETURN(0);
return 0;
}
/* find any ldlm lock of the inode in mdc
@ -215,10 +215,10 @@ int mdc_find_cbdata(struct obd_export *exp,
rc = ldlm_resource_iterate(class_exp2obd(exp)->obd_namespace, &res_id,
it, data);
if (rc == LDLM_ITER_STOP)
RETURN(1);
return 1;
else if (rc == LDLM_ITER_CONTINUE)
RETURN(0);
RETURN(rc);
return 0;
return rc;
}
static inline void mdc_clear_replay_flag(struct ptlrpc_request *req, int rc)
@ -307,7 +307,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
&RQF_LDLM_INTENT_OPEN);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
}
/* parent capability */
@ -359,7 +359,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_LDLM_INTENT_UNLINK);
if (req == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@ -368,7 +368,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
if (rc) {
ptlrpc_request_free(req);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
/* pack the intent */
@ -383,7 +383,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
req_capsule_set_size(&req->rq_pill, &RMF_ACL, RCL_SERVER,
obddev->u.cli.cl_max_mds_cookiesize);
ptlrpc_request_set_replen(req);
RETURN(req);
return req;
}
static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
@ -403,7 +403,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_LDLM_INTENT_GETATTR);
if (req == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@ -412,7 +412,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
if (rc) {
ptlrpc_request_free(req);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
/* pack the intent */
@ -429,7 +429,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
req_capsule_set_size(&req->rq_pill, &RMF_ACL, RCL_SERVER,
sizeof(struct mdt_remote_perm));
ptlrpc_request_set_replen(req);
RETURN(req);
return req;
}
static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
@ -445,13 +445,13 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_LDLM_INTENT_LAYOUT);
if (req == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT, 0);
rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
if (rc) {
ptlrpc_request_free(req);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
/* pack the intent */
@ -467,7 +467,7 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
obd->u.cli.cl_max_mds_easize);
ptlrpc_request_set_replen(req);
RETURN(req);
return req;
}
static struct ptlrpc_request *
@ -478,17 +478,17 @@ mdc_enqueue_pack(struct obd_export *exp, int lvb_len)
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
if (req == NULL)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
if (rc) {
ptlrpc_request_free(req);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
ptlrpc_request_set_replen(req);
RETURN(req);
return req;
}
static int mdc_finish_enqueue(struct obd_export *exp,
@ -567,7 +567,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
body = req_capsule_server_get(pill, &RMF_MDT_BODY);
if (body == NULL) {
CERROR ("Can't swab mdt_body\n");
RETURN (-EPROTO);
return -EPROTO;
}
if (it_disposition(it, DISP_OPEN_OPEN) &&
@ -593,7 +593,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
eadata = req_capsule_server_sized_get(pill, &RMF_MDT_MD,
body->eadatasize);
if (eadata == NULL)
RETURN(-EPROTO);
return -EPROTO;
/* save lvb data and length in case this is for layout
* lock */
@ -637,14 +637,14 @@ static int mdc_finish_enqueue(struct obd_export *exp,
perm = req_capsule_server_swab_get(pill, &RMF_ACL,
lustre_swab_mdt_remote_perm);
if (perm == NULL)
RETURN(-EPROTO);
return -EPROTO;
}
if (body->valid & OBD_MD_FLMDSCAPA) {
struct lustre_capa *capa, *p;
capa = req_capsule_server_get(pill, &RMF_CAPA1);
if (capa == NULL)
RETURN(-EPROTO);
return -EPROTO;
if (it->it_op & IT_OPEN) {
/* client fid capa will be checked in replay */
@ -658,7 +658,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
capa = req_capsule_server_get(pill, &RMF_CAPA2);
if (capa == NULL)
RETURN(-EPROTO);
return -EPROTO;
}
} else if (it->it_op & IT_LAYOUT) {
/* maybe the lock was granted right away and layout
@ -668,7 +668,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
lvb_data = req_capsule_server_sized_get(pill,
&RMF_DLM_LVB, lvb_len);
if (lvb_data == NULL)
RETURN(-EPROTO);
return -EPROTO;
}
}
@ -683,7 +683,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
OBD_ALLOC_LARGE(lmm, lvb_len);
if (lmm == NULL) {
LDLM_LOCK_PUT(lock);
RETURN(-ENOMEM);
return -ENOMEM;
}
memcpy(lmm, lvb_data, lvb_len);
@ -701,7 +701,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
if (lock != NULL)
LDLM_LOCK_PUT(lock);
RETURN(rc);
return rc;
}
/* We always reserve enough space in the reply packet for a stripe MD, because
@ -767,17 +767,17 @@ resend:
req = mdc_enqueue_pack(exp, 0);
} else if (it->it_op & IT_LAYOUT) {
if (!imp_connect_lvb_type(class_exp2cliimp(exp)))
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
req = mdc_intent_layout_pack(exp, it, op_data);
lvb_type = LVB_T_LAYOUT;
} else {
LBUG();
RETURN(-EINVAL);
return -EINVAL;
}
if (IS_ERR(req))
RETURN(PTR_ERR(req));
return PTR_ERR(req);
if (req != NULL && it && it->it_op & IT_CREAT)
/* ask ptlrpc not to resend on EINPROGRESS since we have our own
@ -800,7 +800,7 @@ resend:
mdc_put_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
mdc_clear_replay_flag(req, 0);
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
}
@ -817,7 +817,7 @@ resend:
current FLocks upon exit) that can't be trashed */
if ((rc == -EINTR) || (rc == -ETIMEDOUT))
goto resend;
RETURN(rc);
return rc;
}
mdc_exit_request(&obddev->u.cli);
@ -827,7 +827,7 @@ resend:
CERROR("ldlm_cli_enqueue: %d\n", rc);
mdc_clear_replay_flag(req, rc);
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
lockrep = req_capsule_server_get(&req->rq_pill, &RMF_DLM_REP);
@ -852,7 +852,7 @@ resend:
goto resend;
} else {
CDEBUG(D_HA, "resend cross eviction\n");
RETURN(-EIO);
return -EIO;
}
}
@ -864,7 +864,7 @@ resend:
}
ptlrpc_req_finished(req);
}
RETURN(rc);
return rc;
}
static int mdc_finish_intent_lock(struct obd_export *exp,
@ -886,11 +886,11 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
/* The server failed before it even started executing the
* intent, i.e. because it couldn't unpack the request. */
LASSERT(it->d.lustre.it_status != 0);
RETURN(it->d.lustre.it_status);
return it->d.lustre.it_status;
}
rc = it_open_error(DISP_IT_EXECD, it);
if (rc)
RETURN(rc);
return rc;
mdt_body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
LASSERT(mdt_body != NULL); /* mdc_enqueue checked */
@ -912,13 +912,13 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
CDEBUG(D_DENTRY, "Found stale data "DFID"("DFID")/"DFID
"\n", PFID(&op_data->op_fid2),
PFID(&op_data->op_fid2), PFID(&mdt_body->fid1));
RETURN(-ESTALE);
return -ESTALE;
}
}
rc = it_open_error(DISP_LOOKUP_EXECD, it);
if (rc)
RETURN(rc);
return rc;
/* keep requests around for the multiple phases of the call
* this shows the DISP_XX must guarantee we make it into the call
@ -979,7 +979,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
CDEBUG(D_DENTRY,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
op_data->op_namelen, op_data->op_name, ldlm_it2str(it->it_op),
it->d.lustre.it_status, it->d.lustre.it_disposition, rc);
RETURN(rc);
return rc;
}
int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
@ -1023,7 +1023,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
it->d.lustre.it_lock_mode = 0;
}
RETURN(!!mode);
return !!mode;
}
/*
@ -1081,7 +1081,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
/* Only return failure if it was not GETATTR by cfid
(from inode_revalidate) */
if (rc || op_data->op_namelen != 0)
RETURN(rc);
return rc;
}
/* lookup_it may be called only after revalidate_it has run, because
@ -1105,13 +1105,13 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_fid_alloc(exp, &op_data->op_fid2, op_data);
if (rc < 0) {
CERROR("Can't alloc new fid, rc %d\n", rc);
RETURN(rc);
return rc;
}
}
rc = mdc_enqueue(exp, &einfo, it, op_data, &lockh,
lmm, lmmsize, NULL, extra_lock_flags);
if (rc < 0)
RETURN(rc);
return rc;
} else if (!fid_is_sane(&op_data->op_fid2) ||
!(it->it_create_mode & M_CHECK_STALE)) {
/* DISP_ENQ_COMPLETE set means there is extra reference on
@ -1122,7 +1122,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
}
*reqp = it->d.lustre.it_data;
rc = mdc_finish_intent_lock(exp, *reqp, op_data, it, &lockh);
RETURN(rc);
return rc;
}
static int mdc_intent_getattr_async_interpret(const struct lu_env *env,
@ -1201,12 +1201,12 @@ int mdc_intent_getattr_async(struct obd_export *exp,
fid_build_reg_res_name(&op_data->op_fid1, &res_id);
req = mdc_intent_getattr_pack(exp, it, op_data);
if (!req)
RETURN(-ENOMEM);
return -ENOMEM;
rc = mdc_enter_request(&obddev->u.cli);
if (rc != 0) {
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
rc = ldlm_cli_enqueue(exp, &req, einfo, &res_id, &policy, &flags, NULL,
@ -1214,7 +1214,7 @@ int mdc_intent_getattr_async(struct obd_export *exp,
if (rc < 0) {
mdc_exit_request(&obddev->u.cli);
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
CLASSERT(sizeof(*ga) <= sizeof(req->rq_async_args));
@ -1226,5 +1226,5 @@ int mdc_intent_getattr_async(struct obd_export *exp,
req->rq_interpret_reply = mdc_intent_getattr_async_interpret;
ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
RETURN(0);
return 0;
}

View File

@ -83,13 +83,13 @@ int mdc_resource_get_unused(struct obd_export *exp, struct lu_fid *fid,
* when we still want to cancel locks in advance and just cancel them
* locally, without sending any RPC. */
if (exp_connect_cancelset(exp) && !ns_connect_cancelset(ns))
RETURN(0);
return 0;
fid_build_reg_res_name(fid, &res_id);
res = ldlm_resource_get(exp->exp_obd->obd_namespace,
NULL, &res_id, 0, 0);
if (res == NULL)
RETURN(0);
return 0;
LDLM_RESOURCE_ADDREF(res);
/* Initialize ibits lock policy. */
policy.l_inodebits.bits = bits;
@ -97,7 +97,7 @@ int mdc_resource_get_unused(struct obd_export *exp, struct lu_fid *fid,
mode, 0, 0, NULL);
LDLM_RESOURCE_DELREF(res);
ldlm_resource_putref(res);
RETURN(count);
return count;
}
int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
@ -125,7 +125,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
&RQF_MDS_REINT_SETATTR);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(-ENOMEM);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
if ((op_data->op_flags & (MF_SOM_CHANGE | MF_EPOCH_OPEN)) == 0)
@ -138,7 +138,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
rpc_lock = obd->u.cli.cl_rpc_lock;
@ -201,7 +201,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
obd_mod_put(*mod);
req->rq_commit_cb(req);
}
RETURN(rc);
return rc;
}
int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
@ -225,7 +225,7 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_fid_alloc(exp, &op_data->op_fid2, op_data);
if (rc < 0) {
CERROR("Can't alloc new fid, rc %d\n", rc);
RETURN(rc);
return rc;
}
}
@ -241,7 +241,7 @@ rebuild:
&RQF_MDS_REINT_CREATE_RMT_ACL);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(-ENOMEM);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@ -252,7 +252,7 @@ rebuild:
rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
/*
@ -295,7 +295,7 @@ rebuild:
goto rebuild;
} else {
CDEBUG(D_HA, "resend cross eviction\n");
RETURN(-EIO);
return -EIO;
}
} else if (rc == 0) {
struct mdt_body *body;
@ -312,7 +312,7 @@ rebuild:
}
*request = req;
RETURN(rc);
return rc;
}
int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
@ -341,7 +341,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
&RQF_MDS_REINT_UNLINK);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(-ENOMEM);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@ -350,7 +350,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_unlink_pack(req, op_data);
@ -366,7 +366,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_reint(req, obd->u.cli.cl_rpc_lock, LUSTRE_IMP_FULL);
if (rc == -ERESTARTSYS)
rc = 0;
RETURN(rc);
return rc;
}
int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
@ -391,7 +391,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_REINT_LINK);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(-ENOMEM);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
mdc_set_capa_size(req, &RMF_CAPA2, op_data->op_capa2);
@ -401,7 +401,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_link_pack(req, op_data);
@ -412,7 +412,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
if (rc == -ERESTARTSYS)
rc = 0;
RETURN(rc);
return rc;
}
int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
@ -449,7 +449,7 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
&RQF_MDS_REINT_RENAME);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(-ENOMEM);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
@ -460,7 +460,7 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
rc = mdc_prep_elc_req(exp, req, MDS_REINT, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
if (exp_connect_cancelset(exp) && req)
@ -479,5 +479,5 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
if (rc == -ERESTARTSYS)
rc = 0;
RETURN(rc);
return rc;
}

View File

@ -69,16 +69,16 @@ int mdc_unpack_capa(struct obd_export *exp, struct ptlrpc_request *req,
/* swabbed already in mdc_enqueue */
capa = req_capsule_server_get(&req->rq_pill, field);
if (capa == NULL)
RETURN(-EPROTO);
return -EPROTO;
c = alloc_capa(CAPA_SITE_CLIENT);
if (IS_ERR(c)) {
CDEBUG(D_INFO, "alloc capa failed!\n");
RETURN(PTR_ERR(c));
return PTR_ERR(c);
} else {
c->c_capa = *capa;
*oc = c;
RETURN(0);
return 0;
}
}
@ -112,7 +112,7 @@ static int send_getstatus(struct obd_import *imp, struct lu_fid *rootfid,
req = ptlrpc_request_alloc_pack(imp, &RQF_MDS_GETSTATUS,
LUSTRE_MDS_VERSION, MDS_GETSTATUS);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_pack_body(req, NULL, NULL, 0, 0, -1, 0);
lustre_msg_add_flags(req->rq_reqmsg, msg_flags);
@ -173,12 +173,12 @@ static int mdc_getattr_common(struct obd_export *exp,
/* Request message already built. */
rc = ptlrpc_queue_wait(req);
if (rc != 0)
RETURN(rc);
return rc;
/* sanity check for the reply */
body = req_capsule_server_get(pill, &RMF_MDT_BODY);
if (body == NULL)
RETURN(-EPROTO);
return -EPROTO;
CDEBUG(D_NET, "mode: %o\n", body->mode);
@ -188,7 +188,7 @@ static int mdc_getattr_common(struct obd_export *exp,
eadata = req_capsule_server_sized_get(pill, &RMF_MDT_MD,
body->eadatasize);
if (eadata == NULL)
RETURN(-EPROTO);
return -EPROTO;
}
if (body->valid & OBD_MD_FLRMTPERM) {
@ -198,17 +198,17 @@ static int mdc_getattr_common(struct obd_export *exp,
perm = req_capsule_server_swab_get(pill, &RMF_ACL,
lustre_swab_mdt_remote_perm);
if (perm == NULL)
RETURN(-EPROTO);
return -EPROTO;
}
if (body->valid & OBD_MD_FLMDSCAPA) {
struct lustre_capa *capa;
capa = req_capsule_server_get(pill, &RMF_CAPA1);
if (capa == NULL)
RETURN(-EPROTO);
return -EPROTO;
}
RETURN(0);
return 0;
}
int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
@ -220,19 +220,19 @@ int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
/* Single MDS without an LMV case */
if (op_data->op_flags & MF_GET_MDT_IDX) {
op_data->op_mds = 0;
RETURN(0);
return 0;
}
*request = NULL;
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_GETATTR);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GETATTR);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@ -252,7 +252,7 @@ int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
ptlrpc_req_finished(req);
else
*request = req;
RETURN(rc);
return rc;
}
int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
@ -265,7 +265,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_MDS_GETATTR_NAME);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
@ -274,7 +274,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GETATTR_NAME);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@ -297,7 +297,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
ptlrpc_req_finished(req);
else
*request = req;
RETURN(rc);
return rc;
}
static int mdc_is_subdir(struct obd_export *exp,
@ -313,7 +313,7 @@ static int mdc_is_subdir(struct obd_export *exp,
&RQF_MDS_IS_SUBDIR, LUSTRE_MDS_VERSION,
MDS_IS_SUBDIR);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_is_subdir_pack(req, pfid, cfid, 0);
ptlrpc_request_set_replen(req);
@ -323,7 +323,7 @@ static int mdc_is_subdir(struct obd_export *exp,
ptlrpc_req_finished(req);
else
*request = req;
RETURN(rc);
return rc;
}
static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
@ -341,7 +341,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
*request = NULL;
req = ptlrpc_request_alloc(class_exp2cliimp(exp), fmt);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, oc);
if (xattr_name) {
@ -358,7 +358,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, opcode);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
if (opcode == MDS_REINT) {
@ -411,7 +411,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
ptlrpc_req_finished(req);
else
*request = req;
RETURN(rc);
return rc;
}
int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
@ -446,29 +446,29 @@ static int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md)
int rc;
if (!body->aclsize)
RETURN(0);
return 0;
buf = req_capsule_server_sized_get(pill, &RMF_ACL, body->aclsize);
if (!buf)
RETURN(-EPROTO);
return -EPROTO;
acl = posix_acl_from_xattr(&init_user_ns, buf, body->aclsize);
if (IS_ERR(acl)) {
rc = PTR_ERR(acl);
CERROR("convert xattr to acl: %d\n", rc);
RETURN(rc);
return rc;
}
rc = posix_acl_valid(acl);
if (rc) {
CERROR("validate acl: %d\n", rc);
posix_acl_release(acl);
RETURN(rc);
return rc;
}
md->posix_acl = acl;
RETURN(0);
return 0;
}
#else
#define mdc_unpack_acl(req, md) 0
@ -531,7 +531,7 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
if (md->body->eadatasize == 0) {
CDEBUG(D_INFO, "OBD_MD_FLDIREA is set, "
"but eadatasize 0\n");
RETURN(-EPROTO);
return -EPROTO;
}
if (md->body->valid & OBD_MD_MEA) {
lmvsize = md->body->eadatasize;
@ -617,7 +617,7 @@ out:
int mdc_free_lustre_md(struct obd_export *exp, struct lustre_md *md)
{
RETURN(0);
return 0;
}
/**
@ -708,7 +708,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
struct obd_import *imp = open_req->rq_import;
if (!open_req->rq_replay)
RETURN(0);
return 0;
rec = req_capsule_client_get(&open_req->rq_pill, &RMF_REC_REINT);
body = req_capsule_server_get(&open_req->rq_pill, &RMF_MDT_BODY);
@ -723,7 +723,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
if (mod == NULL) {
DEBUG_REQ(D_ERROR, open_req,
"Can't allocate md_open_data");
RETURN(0);
return 0;
}
/**
@ -755,7 +755,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
}
DEBUG_REQ(D_RPCTRACE, open_req, "Set up open replay data");
RETURN(0);
return 0;
}
int mdc_clear_open_replay_data(struct obd_export *exp,
@ -768,7 +768,7 @@ int mdc_clear_open_replay_data(struct obd_export *exp,
* lookup and ll_file_open().
**/
if (mod == NULL)
RETURN(0);
return 0;
LASSERT(mod != LP_POISON);
@ -776,7 +776,7 @@ int mdc_clear_open_replay_data(struct obd_export *exp,
och->och_mod = NULL;
obd_mod_put(mod);
RETURN(0);
return 0;
}
/* Prepares the request for the replay by the given reply */
@ -805,14 +805,14 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
*request = NULL;
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_CLOSE);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_CLOSE);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
/* To avoid a livelock (bug 7034), we need to send CLOSE RPCs to a
@ -893,7 +893,7 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
}
*request = req;
mdc_close_handle_reply(req, op_data, rc);
RETURN(rc);
return rc;
}
int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
@ -906,13 +906,13 @@ int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_MDS_DONE_WRITING);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_DONE_WRITING);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
if (mod != NULL) {
@ -959,7 +959,7 @@ int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data,
mdc_close_handle_reply(req, op_data, rc);
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
@ -980,14 +980,14 @@ int mdc_readpage(struct obd_export *exp, struct md_op_data *op_data,
restart_bulk:
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_READPAGE);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
req->rq_request_portal = MDS_READPAGE_PORTAL;
@ -997,7 +997,7 @@ restart_bulk:
MDS_BULK_PORTAL);
if (desc == NULL) {
ptlrpc_request_free(req);
RETURN(-ENOMEM);
return -ENOMEM;
}
/* NB req now owns desc and will free it when it gets freed */
@ -1013,12 +1013,12 @@ restart_bulk:
if (rc) {
ptlrpc_req_finished(req);
if (rc != -ETIMEDOUT)
RETURN(rc);
return rc;
resends++;
if (!client_should_resend(resends, &exp->exp_obd->u.cli)) {
CERROR("too many resend retries, returning error\n");
RETURN(-EIO);
return -EIO;
}
lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL, NULL);
l_wait_event(waitq, 0, &lwi);
@ -1030,7 +1030,7 @@ restart_bulk:
req->rq_bulk->bd_nob_transferred);
if (rc < 0) {
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
if (req->rq_bulk->bd_nob_transferred & ~LU_PAGE_MASK) {
@ -1038,11 +1038,11 @@ restart_bulk:
req->rq_bulk->bd_nob_transferred,
PAGE_CACHE_SIZE * op_data->op_npages);
ptlrpc_req_finished(req);
RETURN(-EPROTO);
return -EPROTO;
}
*request = req;
RETURN(0);
return 0;
}
static int mdc_statfs(const struct lu_env *env,
@ -1064,7 +1064,7 @@ static int mdc_statfs(const struct lu_env *env,
imp = class_import_get(obd->u.cli.cl_import);
up_read(&obd->u.cli.cl_sem);
if (!imp)
RETURN(-ENODEV);
return -ENODEV;
req = ptlrpc_request_alloc_pack(imp, &RQF_MDS_STATFS,
LUSTRE_MDS_VERSION, MDS_STATFS);
@ -1106,15 +1106,15 @@ static int mdc_ioc_fid2path(struct obd_export *exp, struct getinfo_fid2path *gf)
int rc;
if (gf->gf_pathlen > PATH_MAX)
RETURN(-ENAMETOOLONG);
return -ENAMETOOLONG;
if (gf->gf_pathlen < 2)
RETURN(-EOVERFLOW);
return -EOVERFLOW;
/* Key is KEY_FID2PATH + getinfo_fid2path description */
keylen = cfs_size_round(sizeof(KEY_FID2PATH)) + sizeof(*gf);
OBD_ALLOC(key, keylen);
if (key == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
memcpy(key, KEY_FID2PATH, sizeof(KEY_FID2PATH));
memcpy(key + cfs_size_round(sizeof(KEY_FID2PATH)), gf, sizeof(*gf));
@ -1218,14 +1218,14 @@ static int mdc_ioc_hsm_current_action(struct obd_export *exp,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_MDS_HSM_ACTION);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_ACTION);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@ -1282,14 +1282,14 @@ static int mdc_ioc_hsm_state_get(struct obd_export *exp,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_MDS_HSM_STATE_GET);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_STATE_GET);
if (rc != 0) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@ -1323,14 +1323,14 @@ static int mdc_ioc_hsm_state_set(struct obd_export *exp,
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_MDS_HSM_STATE_SET);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_STATE_SET);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
@ -1375,7 +1375,7 @@ static int mdc_ioc_hsm_request(struct obd_export *exp,
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_HSM_REQUEST);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, NULL, NULL, OBD_MD_FLRMTPERM, 0, 0, 0);
@ -1446,14 +1446,14 @@ static int changelog_kkuc_cb(const struct lu_env *env, struct llog_handle *llh,
CERROR("%s: not a changelog rec %x/%d: rc = %d\n",
cs->cs_obd->obd_name, rec->cr_hdr.lrh_type,
rec->cr.cr_type, rc);
RETURN(rc);
return rc;
}
if (rec->cr.cr_index < cs->cs_startrec) {
/* Skip entries earlier than what we are interested in */
CDEBUG(D_CHANGELOG, "rec="LPU64" start="LPU64"\n",
rec->cr.cr_index, cs->cs_startrec);
RETURN(0);
return 0;
}
CDEBUG(D_CHANGELOG, LPU64" %02d%-5s "LPU64" 0x%x t="DFID" p="DFID
@ -1472,7 +1472,7 @@ static int changelog_kkuc_cb(const struct lu_env *env, struct llog_handle *llh,
rc = libcfs_kkuc_msg_put(cs->cs_fp, lh);
CDEBUG(D_CHANGELOG, "kucmsg fp %p len %d rc %d\n", cs->cs_fp, len,rc);
RETURN(rc);
return rc;
}
static int mdc_changelog_send_thread(void *csdata)
@ -1576,7 +1576,7 @@ static int mdc_quotacheck(struct obd_device *unused, struct obd_export *exp,
&RQF_MDS_QUOTACHECK, LUSTRE_MDS_VERSION,
MDS_QUOTACHECK);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
body = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
*body = *oqctl;
@ -1590,7 +1590,7 @@ static int mdc_quotacheck(struct obd_device *unused, struct obd_export *exp,
if (rc)
cli->cl_qchk_stat = rc;
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
static int mdc_quota_poll_check(struct obd_export *exp,
@ -1606,7 +1606,7 @@ static int mdc_quota_poll_check(struct obd_export *exp,
/* the client is not the previous one */
if (rc == CL_NOT_QUOTACHECKED)
rc = -EINTR;
RETURN(rc);
return rc;
}
static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
@ -1620,7 +1620,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
&RQF_MDS_QUOTACTL, LUSTRE_MDS_VERSION,
MDS_QUOTACTL);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
oqc = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
*oqc = *oqctl;
@ -1642,7 +1642,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
}
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
static int mdc_ioc_swap_layouts(struct obd_export *exp,
@ -1670,7 +1670,7 @@ static int mdc_ioc_swap_layouts(struct obd_export *exp,
&RQF_MDS_SWAP_LAYOUTS);
if (req == NULL) {
ldlm_lock_list_put(&cancels, l_bl_ast, count);
RETURN(-ENOMEM);
return -ENOMEM;
}
mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
@ -1679,7 +1679,7 @@ static int mdc_ioc_swap_layouts(struct obd_export *exp,
rc = mdc_prep_elc_req(exp, req, MDS_SWAP_LAYOUTS, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_swap_layouts_pack(req, op_data);
@ -1815,7 +1815,7 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
OBD_ALLOC_PTR(oqctl);
if (!oqctl)
RETURN(-ENOMEM);
return -ENOMEM;
QCTL_COPY(oqctl, qctl);
rc = obd_quotactl(exp, oqctl);
@ -1860,7 +1860,7 @@ int mdc_get_info_rpc(struct obd_export *exp,
req = ptlrpc_request_alloc(imp, &RQF_MDS_GET_INFO);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
req_capsule_set_size(&req->rq_pill, &RMF_GETINFO_KEY,
RCL_CLIENT, keylen);
@ -1870,7 +1870,7 @@ int mdc_get_info_rpc(struct obd_export *exp,
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GET_INFO);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
tmp = req_capsule_client_get(&req->rq_pill, &RMF_GETINFO_KEY);
@ -1895,7 +1895,7 @@ int mdc_get_info_rpc(struct obd_export *exp,
}
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
static void lustre_swab_hai(struct hsm_action_item *h)
@ -1973,14 +1973,14 @@ static int mdc_hsm_copytool_send(int len, void *val)
if (len < sizeof(*lh) + sizeof(*hal)) {
CERROR("Short HSM message %d < %d\n", len,
(int) (sizeof(*lh) + sizeof(*hal)));
RETURN(-EPROTO);
return -EPROTO;
}
if (lh->kuc_magic == __swab16(KUC_MAGIC)) {
lustre_swab_kuch(lh);
lustre_swab_hal(hal);
} else if (lh->kuc_magic != KUC_MAGIC) {
CERROR("Bad magic %x!=%x\n", lh->kuc_magic, KUC_MAGIC);
RETURN(-EPROTO);
return -EPROTO;
}
CDEBUG(D_HSM, " Received message mg=%x t=%d m=%d l=%d actions=%d "
@ -1991,7 +1991,7 @@ static int mdc_hsm_copytool_send(int len, void *val)
/* Broadcast to HSM listeners */
rc = libcfs_kkuc_group_put(KUC_GRP_HSM, lh);
RETURN(rc);
return rc;
}
/**
@ -2036,7 +2036,7 @@ int mdc_set_info_async(const struct lu_env *env,
if (KEY_IS(KEY_READ_ONLY)) {
if (vallen != sizeof(int))
RETURN(-EINVAL);
return -EINVAL;
spin_lock(&imp->imp_lock);
if (*((int *)val)) {
@ -2052,15 +2052,15 @@ int mdc_set_info_async(const struct lu_env *env,
rc = do_set_info_async(imp, MDS_SET_INFO, LUSTRE_MDS_VERSION,
keylen, key, vallen, val, set);
RETURN(rc);
return rc;
}
if (KEY_IS(KEY_SPTLRPC_CONF)) {
sptlrpc_conf_client_adapt(exp->exp_obd);
RETURN(0);
return 0;
}
if (KEY_IS(KEY_FLUSH_CTX)) {
sptlrpc_import_flush_my_ctx(imp);
RETURN(0);
return 0;
}
if (KEY_IS(KEY_MDS_CONN)) {
/* mds-mds import */
@ -2069,20 +2069,20 @@ int mdc_set_info_async(const struct lu_env *env,
spin_unlock(&imp->imp_lock);
imp->imp_client->cli_request_portal = MDS_MDS_PORTAL;
CDEBUG(D_OTHER, "%s: timeout / 2\n", exp->exp_obd->obd_name);
RETURN(0);
return 0;
}
if (KEY_IS(KEY_CHANGELOG_CLEAR)) {
rc = do_set_info_async(imp, MDS_SET_INFO, LUSTRE_MDS_VERSION,
keylen, key, vallen, val, set);
RETURN(rc);
return rc;
}
if (KEY_IS(KEY_HSM_COPYTOOL_SEND)) {
rc = mdc_hsm_copytool_send(vallen, val);
RETURN(rc);
return rc;
}
CERROR("Unknown key %s\n", (char *)key);
RETURN(-EINVAL);
return -EINVAL;
}
int mdc_get_info(const struct lu_env *env, struct obd_export *exp,
@ -2095,30 +2095,30 @@ int mdc_get_info(const struct lu_env *env, struct obd_export *exp,
int mdsize, *max_easize;
if (*vallen != sizeof(int))
RETURN(-EINVAL);
return -EINVAL;
mdsize = *(int*)val;
if (mdsize > exp->exp_obd->u.cli.cl_max_mds_easize)
exp->exp_obd->u.cli.cl_max_mds_easize = mdsize;
max_easize = val;
*max_easize = exp->exp_obd->u.cli.cl_max_mds_easize;
RETURN(0);
return 0;
} else if (KEY_IS(KEY_CONN_DATA)) {
struct obd_import *imp = class_exp2cliimp(exp);
struct obd_connect_data *data = val;
if (*vallen != sizeof(*data))
RETURN(-EINVAL);
return -EINVAL;
*data = imp->imp_connect_data;
RETURN(0);
return 0;
} else if (KEY_IS(KEY_TGT_COUNT)) {
*((int *)val) = 1;
RETURN(0);
return 0;
}
rc = mdc_get_info_rpc(exp, keylen, key, *vallen, val);
RETURN(rc);
return rc;
}
static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid,
@ -2131,14 +2131,14 @@ static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid,
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_PIN);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, oc);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_PIN);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, fid, oc, 0, 0, -1, flags);
@ -2167,11 +2167,11 @@ static int mdc_pin(struct obd_export *exp, const struct lu_fid *fid,
}
handle->och_mod->mod_open_req = req; /* will be dropped by unpin */
RETURN(0);
return 0;
err_out:
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle,
@ -2184,7 +2184,7 @@ static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle,
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_MDS_UNPIN,
LUSTRE_MDS_VERSION, MDS_UNPIN);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
body = req_capsule_client_get(&req->rq_pill, &RMF_MDT_BODY);
body->handle = handle->och_fh;
@ -2203,7 +2203,7 @@ static int mdc_unpin(struct obd_export *exp, struct obd_client_handle *handle,
ptlrpc_req_finished(handle->och_mod->mod_open_req);
obd_mod_put(handle->och_mod);
RETURN(rc);
return rc;
}
int mdc_sync(struct obd_export *exp, const struct lu_fid *fid,
@ -2215,14 +2215,14 @@ int mdc_sync(struct obd_export *exp, const struct lu_fid *fid,
*request = NULL;
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_SYNC);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, oc);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_SYNC);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, fid, oc, 0, 0, -1, 0);
@ -2234,7 +2234,7 @@ int mdc_sync(struct obd_export *exp, const struct lu_fid *fid,
ptlrpc_req_finished(req);
else
*request = req;
RETURN(rc);
return rc;
}
static int mdc_import_event(struct obd_device *obd, struct obd_import *imp,
@ -2287,7 +2287,7 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp,
CERROR("Unknown import event %x\n", event);
LBUG();
}
RETURN(rc);
return rc;
}
int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
@ -2296,7 +2296,7 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
struct client_obd *cli = &exp->exp_obd->u.cli;
struct lu_client_seq *seq = cli->cl_seq;
RETURN(seq_client_alloc_fid(NULL, seq, fid));
return seq_client_alloc_fid(NULL, seq, fid);
}
struct obd_uuid *mdc_get_uuid(struct obd_export *exp) {
@ -2312,15 +2312,15 @@ struct obd_uuid *mdc_get_uuid(struct obd_export *exp) {
static int mdc_cancel_for_recovery(struct ldlm_lock *lock)
{
if (lock->l_resource->lr_type != LDLM_IBITS)
RETURN(0);
return 0;
/* FIXME: if we ever get into a situation where there are too many
* opened files with open locks on a single node, then we really
* should replay these open locks to reget it */
if (lock->l_policy_data.l_inodebits.bits & MDS_INODELOCK_OPEN)
RETURN(0);
return 0;
RETURN(1);
return 1;
}
static int mdc_resource_inode_free(struct ldlm_resource *res)
@ -2343,7 +2343,7 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
OBD_ALLOC(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
if (!cli->cl_rpc_lock)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_init_rpc_lock(cli->cl_rpc_lock);
ptlrpcd_addref();
@ -2371,14 +2371,14 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
CERROR("failed to setup llogging subsystems\n");
}
RETURN(rc);
return rc;
err_close_lock:
OBD_FREE(cli->cl_close_lock, sizeof (*cli->cl_close_lock));
err_rpc_lock:
OBD_FREE(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
ptlrpcd_decref();
RETURN(rc);
return rc;
}
/* Initialize the default and maximum LOV EA and cookie sizes. This allows
@ -2400,7 +2400,7 @@ static int mdc_init_ea_size(struct obd_export *exp, int easize,
if (cli->cl_max_mds_cookiesize < cookiesize)
cli->cl_max_mds_cookiesize = cookiesize;
RETURN(0);
return 0;
}
static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
@ -2424,7 +2424,7 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
CERROR("failed to cleanup llogging subsystems\n");
break;
}
RETURN(rc);
return rc;
}
static int mdc_cleanup(struct obd_device *obd)
@ -2451,13 +2451,13 @@ static int mdc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
rc = llog_setup(NULL, obd, olg, LLOG_CHANGELOG_REPL_CTXT, tgt,
&llog_client_ops);
if (rc)
RETURN(rc);
return rc;
ctxt = llog_group_get_ctxt(olg, LLOG_CHANGELOG_REPL_CTXT);
llog_initiator_connect(ctxt);
llog_ctxt_put(ctxt);
RETURN(0);
return 0;
}
static int mdc_llog_finish(struct obd_device *obd, int count)
@ -2468,7 +2468,7 @@ static int mdc_llog_finish(struct obd_device *obd, int count)
if (ctxt)
llog_cleanup(NULL, ctxt);
RETURN(0);
return 0;
}
static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf)
@ -2503,14 +2503,14 @@ int mdc_get_remote_perm(struct obd_export *exp, const struct lu_fid *fid,
*request = NULL;
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_GETATTR);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
mdc_set_capa_size(req, &RMF_CAPA1, oc);
rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_GETATTR);
if (rc) {
ptlrpc_request_free(req);
RETURN(rc);
return rc;
}
mdc_pack_body(req, fid, oc, OBD_MD_FLRMTPERM, 0, suppgid, 0);
@ -2525,7 +2525,7 @@ int mdc_get_remote_perm(struct obd_export *exp, const struct lu_fid *fid,
ptlrpc_req_finished(req);
else
*request = req;
RETURN(rc);
return rc;
}
static int mdc_interpret_renew_capa(const struct lu_env *env,
@ -2563,7 +2563,7 @@ static int mdc_renew_capa(struct obd_export *exp, struct obd_capa *oc,
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_MDS_GETATTR,
LUSTRE_MDS_VERSION, MDS_GETATTR);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
/* NB, OBD_MD_FLOSSCAPA is set here, but it doesn't necessarily mean the
* capa to renew is oss capa.
@ -2577,7 +2577,7 @@ static int mdc_renew_capa(struct obd_export *exp, struct obd_capa *oc,
ra->ra_cb = cb;
req->rq_interpret_reply = mdc_interpret_renew_capa;
ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
RETURN(0);
return 0;
}
static int mdc_connect(const struct lu_env *env,
@ -2671,7 +2671,7 @@ int __init mdc_init(void)
rc = class_register_type(&mdc_obd_ops, &mdc_md_ops, lvars.module_vars,
LUSTRE_MDC_NAME, NULL);
RETURN(rc);
return rc;
}
static void /*__exit*/ mdc_exit(void)

View File

@ -72,13 +72,13 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
GOTO(err_cleanup, rc);
}
RETURN(rc);
return rc;
err_cleanup:
client_obd_cleanup(obd);
err_decref:
ptlrpcd_decref();
RETURN(rc);
return rc;
}
static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
@ -94,7 +94,7 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
CERROR("failed to cleanup llogging subsystems\n");
break;
}
RETURN(rc);
return rc;
}
static int mgc_cleanup(struct obd_device *obd)
@ -107,7 +107,7 @@ static int mgc_cleanup(struct obd_device *obd)
ptlrpcd_decref();
rc = client_obd_cleanup(obd);
RETURN(rc);
return rc;
}
static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
@ -120,13 +120,13 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
rc = llog_setup(NULL, obd, olg, LLOG_CONFIG_REPL_CTXT, tgt,
&llog_client_ops);
if (rc < 0)
RETURN(rc);
return rc;
ctxt = llog_group_get_ctxt(olg, LLOG_CONFIG_REPL_CTXT);
llog_initiator_connect(ctxt);
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
static int mgc_llog_finish(struct obd_device *obd, int count)
@ -138,7 +138,7 @@ static int mgc_llog_finish(struct obd_device *obd, int count)
if (ctxt)
llog_cleanup(NULL, ctxt);
RETURN(0);
return 0;
}
struct obd_ops mgc_obd_ops = {

View File

@ -121,7 +121,7 @@ static int config_log_get(struct config_llog_data *cld)
atomic_inc(&cld->cld_refcount);
CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname,
atomic_read(&cld->cld_refcount));
RETURN(0);
return 0;
}
/* Drop a reference to a config log. When no longer referenced,
@ -180,7 +180,7 @@ struct config_llog_data *config_log_find(char *logname,
LASSERT(found->cld_stopping == 0 || cld_is_sptlrpc(found) == 0);
}
spin_unlock(&config_list_lock);
RETURN(found);
return found;
}
static
@ -198,7 +198,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
OBD_ALLOC(cld, sizeof(*cld) + strlen(logname) + 1);
if (!cld)
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
strcpy(cld->cld_logname, logname);
if (cfg)
@ -228,7 +228,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
if (rc) {
config_log_put(cld);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
if (cld_is_sptlrpc(cld)) {
@ -237,7 +237,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
CERROR("failed processing sptlrpc log: %d\n", rc);
}
RETURN(cld);
return cld;
}
static struct config_llog_data *config_recover_log_add(struct obd_device *obd,
@ -299,7 +299,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
ptr = strrchr(logname, '-');
if (ptr == NULL || ptr - logname > 8) {
CERROR("logname %s is too long\n", logname);
RETURN(-EINVAL);
return -EINVAL;
}
memcpy(seclogname, logname, ptr - logname);
@ -311,7 +311,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
CONFIG_T_SPTLRPC, NULL, NULL);
if (IS_ERR(sptlrpc_cld)) {
CERROR("can't create sptlrpc log: %s\n", seclogname);
RETURN(PTR_ERR(sptlrpc_cld));
return PTR_ERR(sptlrpc_cld);
}
}
@ -319,7 +319,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
if (IS_ERR(cld)) {
CERROR("can't create log: %s\n", logname);
config_log_put(sptlrpc_cld);
RETURN(PTR_ERR(cld));
return PTR_ERR(cld);
}
cld->cld_sptlrpc = sptlrpc_cld;
@ -331,12 +331,12 @@ static int config_log_add(struct obd_device *obd, char *logname,
recover_cld = config_recover_log_add(obd, seclogname, cfg, sb);
if (IS_ERR(recover_cld)) {
config_log_put(cld);
RETURN(PTR_ERR(recover_cld));
return PTR_ERR(recover_cld);
}
cld->cld_recover = recover_cld;
}
RETURN(0);
return 0;
}
DEFINE_MUTEX(llog_process_lock);
@ -352,7 +352,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
cld = config_log_find(logname, cfg);
if (cld == NULL)
RETURN(-ENOENT);
return -ENOENT;
mutex_lock(&cld->cld_lock);
/*
@ -366,7 +366,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
mutex_unlock(&cld->cld_lock);
/* drop the ref from the find */
config_log_put(cld);
RETURN(rc);
return rc;
}
cld->cld_stopping = 1;
@ -397,7 +397,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
CDEBUG(D_MGC, "end config log %s (%d)\n", logname ? logname : "client",
rc);
RETURN(rc);
return rc;
}
int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
@ -421,7 +421,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
}
spin_unlock(&config_list_lock);
RETURN(0);
return 0;
}
/* reenqueue any lost locks */
@ -542,7 +542,7 @@ static int mgc_requeue_thread(void *data)
complete(&rq_exit);
CDEBUG(D_MGC, "Ending requeue thread\n");
RETURN(rc);
return rc;
}
/* Add a cld to the list to requeue. Start the requeue thread if needed.
@ -602,7 +602,7 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
up(&cli->cl_mgc_sem);
CERROR("%s: No fstype %s: rc = %ld\n", lsi->lsi_fstype,
obd->obd_name, PTR_ERR(obd->obd_fsops));
RETURN(PTR_ERR(obd->obd_fsops));
return PTR_ERR(obd->obd_fsops);
}
cli->cl_mgc_vfsmnt = mnt;
@ -636,14 +636,14 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
CDEBUG(D_MGC, "MGC using disk labelled=%s\n", label);
/* We keep the cl_mgc_sem until mgc_fs_cleanup */
RETURN(0);
return 0;
err_ops:
fsfilt_put_ops(obd->obd_fsops);
obd->obd_fsops = NULL;
cli->cl_mgc_vfsmnt = NULL;
up(&cli->cl_mgc_sem);
RETURN(err);
return err;
}
static int mgc_fs_cleanup(struct obd_device *obd)
@ -668,7 +668,7 @@ static int mgc_fs_cleanup(struct obd_device *obd)
up(&cli->cl_mgc_sem);
RETURN(rc);
return rc;
}
static atomic_t mgc_count = ATOMIC_INIT(0);
@ -699,7 +699,7 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
CERROR("failed to cleanup llogging subsystems\n");
break;
}
RETURN(rc);
return rc;
}
static int mgc_cleanup(struct obd_device *obd)
@ -719,7 +719,7 @@ static int mgc_cleanup(struct obd_device *obd)
ptlrpcd_decref();
rc = client_obd_cleanup(obd);
RETURN(rc);
return rc;
}
static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
@ -760,13 +760,13 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
rc = 0;
}
RETURN(rc);
return rc;
err_cleanup:
client_obd_cleanup(obd);
err_decref:
ptlrpcd_decref();
RETURN(rc);
return rc;
}
/* based on ll_mdc_blocking_ast */
@ -824,7 +824,7 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
LBUG();
}
RETURN(rc);
return rc;
}
/* Not sure where this should go... */
@ -844,12 +844,12 @@ static int mgc_set_mgs_param(struct obd_export *exp,
&RQF_MGS_SET_INFO, LUSTRE_MGS_VERSION,
MGS_SET_INFO);
if (!req)
RETURN(-ENOMEM);
return -ENOMEM;
req_msp = req_capsule_client_get(&req->rq_pill, &RMF_MGS_SEND_PARAM);
if (!req_msp) {
ptlrpc_req_finished(req);
RETURN(-ENOMEM);
return -ENOMEM;
}
memcpy(req_msp, msp, sizeof(*req_msp));
@ -865,7 +865,7 @@ static int mgc_set_mgs_param(struct obd_export *exp,
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
/* Take a config lock so we can get cancel notifications */
@ -895,7 +895,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
&RQF_LDLM_ENQUEUE, LUSTRE_DLM_VERSION,
LDLM_ENQUEUE);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, 0);
ptlrpc_request_set_replen(req);
@ -913,7 +913,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
/* A failed enqueue should still call the mgc_blocking_ast,
where it will be requeued if needed ("grant failed"). */
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
@ -921,7 +921,7 @@ static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md,
{
ldlm_lock_decref(lockh, mode);
RETURN(0);
return 0;
}
static void mgc_notify_active(struct obd_device *unused)
@ -947,12 +947,12 @@ static int mgc_target_register(struct obd_export *exp,
&RQF_MGS_TARGET_REG, LUSTRE_MGS_VERSION,
MGS_TARGET_REG);
if (req == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
req_mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO);
if (!req_mti) {
ptlrpc_req_finished(req);
RETURN(-ENOMEM);
return -ENOMEM;
}
memcpy(req_mti, mti, sizeof(*req_mti));
@ -971,7 +971,7 @@ static int mgc_target_register(struct obd_export *exp,
}
ptlrpc_req_finished(req);
RETURN(rc);
return rc;
}
int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
@ -985,7 +985,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
struct obd_import *imp = class_exp2cliimp(exp);
int value;
if (vallen != sizeof(int))
RETURN(-EINVAL);
return -EINVAL;
value = *(int *)val;
CDEBUG(D_MGC, "InitRecov %s %d/d%d:i%d:r%d:or%d:%s\n",
imp->imp_obd->obd_name, value,
@ -996,46 +996,46 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
if ((imp->imp_state != LUSTRE_IMP_FULL &&
imp->imp_state != LUSTRE_IMP_NEW) || value > 1)
ptlrpc_reconnect_import(imp);
RETURN(0);
return 0;
}
/* FIXME move this to mgc_process_config */
if (KEY_IS(KEY_REGISTER_TARGET)) {
struct mgs_target_info *mti;
if (vallen != sizeof(struct mgs_target_info))
RETURN(-EINVAL);
return -EINVAL;
mti = (struct mgs_target_info *)val;
CDEBUG(D_MGC, "register_target %s %#x\n",
mti->mti_svname, mti->mti_flags);
rc = mgc_target_register(exp, mti);
RETURN(rc);
return rc;
}
if (KEY_IS(KEY_SET_FS)) {
struct super_block *sb = (struct super_block *)val;
struct lustre_sb_info *lsi;
if (vallen != sizeof(struct super_block))
RETURN(-EINVAL);
return -EINVAL;
lsi = s2lsi(sb);
rc = mgc_fs_setup(exp->exp_obd, sb, lsi->lsi_srv_mnt);
if (rc) {
CERROR("set_fs got %d\n", rc);
}
RETURN(rc);
return rc;
}
if (KEY_IS(KEY_CLEAR_FS)) {
if (vallen != 0)
RETURN(-EINVAL);
return -EINVAL;
rc = mgc_fs_cleanup(exp->exp_obd);
if (rc) {
CERROR("clear_fs got %d\n", rc);
}
RETURN(rc);
return rc;
}
if (KEY_IS(KEY_SET_INFO)) {
struct mgs_send_param *msp;
msp = (struct mgs_send_param *)val;
rc = mgc_set_mgs_param(exp, msp);
RETURN(rc);
return rc;
}
if (KEY_IS(KEY_MGSSEC)) {
struct client_obd *cli = &exp->exp_obd->u.cli;
@ -1050,7 +1050,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
*/
if (vallen == 0) {
if (cli->cl_flvr_mgc.sf_rpc != SPTLRPC_FLVR_INVALID)
RETURN(0);
return 0;
val = "null";
vallen = 4;
}
@ -1059,7 +1059,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
if (rc) {
CERROR("invalid sptlrpc flavor %s to MGS\n",
(char *) val);
RETURN(rc);
return rc;
}
/*
@ -1078,10 +1078,10 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
(char *) val, str);
rc = -EPERM;
}
RETURN(rc);
return rc;
}
RETURN(rc);
return rc;
}
static int mgc_get_info(const struct lu_env *env, struct obd_export *exp,
@ -1142,7 +1142,7 @@ static int mgc_import_event(struct obd_device *obd,
CERROR("Unknown import event %#x\n", event);
LBUG();
}
RETURN(rc);
return rc;
}
static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
@ -1166,12 +1166,12 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
llog_initiator_connect(ctxt);
llog_ctxt_put(ctxt);
RETURN(0);
return 0;
out:
ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
if (ctxt)
llog_cleanup(NULL, ctxt);
RETURN(rc);
return rc;
}
static int mgc_llog_finish(struct obd_device *obd, int count)
@ -1185,7 +1185,7 @@ static int mgc_llog_finish(struct obd_device *obd, int count)
ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
if (ctxt)
llog_cleanup(NULL, ctxt);
RETURN(0);
return 0;
}
enum {
@ -1216,7 +1216,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
OBD_ALLOC(inst, PAGE_CACHE_SIZE);
if (inst == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
if (!IS_SERVER(lsi)) {
pos = snprintf(inst, PAGE_CACHE_SIZE, "%p", cfg->cfg_instance);
@ -1230,7 +1230,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
PAGE_CACHE_SIZE);
if (rc) {
OBD_FREE(inst, PAGE_CACHE_SIZE);
RETURN(-EINVAL);
return -EINVAL;
}
pos = strlen(inst);
}
@ -1388,7 +1388,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
}
OBD_FREE(inst, PAGE_CACHE_SIZE);
RETURN(rc);
return rc;
}
/**
@ -1560,7 +1560,7 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
* read it up here.
*/
if (cld_is_sptlrpc(cld) && local_only)
RETURN(0);
return 0;
if (cld->cld_cfg.cfg_sb)
lsi = s2lsi(cld->cld_cfg.cfg_sb);
@ -1568,12 +1568,12 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
ctxt = llog_get_context(mgc, LLOG_CONFIG_REPL_CTXT);
if (!ctxt) {
CERROR("missing llog context\n");
RETURN(-EINVAL);
return -EINVAL;
}
OBD_ALLOC_PTR(saved_ctxt);
if (saved_ctxt == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
lctxt = llog_get_context(mgc, LLOG_CONFIG_ORIG_CTXT);
@ -1614,7 +1614,7 @@ out_pop:
strlen("-sptlrpc"));
}
RETURN(rc);
return rc;
}
/** Get a config log from the MGS and process it.
@ -1636,7 +1636,7 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
mutex_lock(&cld->cld_lock);
if (cld->cld_stopping) {
mutex_unlock(&cld->cld_lock);
RETURN(0);
return 0;
}
OBD_FAIL_TIMEOUT(OBD_FAIL_MGC_PAUSE_PROCESS_LOG, 20);
@ -1685,7 +1685,7 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
CERROR("Can't drop cfg lock: %d\n", rcl);
}
RETURN(rc);
return rc;
}
@ -1783,7 +1783,7 @@ static int mgc_process_config(struct obd_device *obd, obd_count len, void *buf)
}
}
out:
RETURN(rc);
return rc;
}
struct obd_ops mgc_obd_ops = {

View File

@ -146,7 +146,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
ext_acl_xattr_header *new;
if (unlikely(size < 0))
RETURN(ERR_PTR(-EINVAL));
return ERR_PTR(-EINVAL);
else if (!size)
count = 0;
else
@ -154,7 +154,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
esize = CFS_ACL_XATTR_SIZE(count, ext_acl_xattr);
OBD_ALLOC(new, esize);
if (unlikely(new == NULL))
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
new->a_count = cpu_to_le32(count);
for (i = 0; i < count; i++) {
@ -164,7 +164,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
new->a_entries[i].e_stat = cpu_to_le32(ES_UNK);
}
RETURN(new);
return new;
}
EXPORT_SYMBOL(lustre_posix_acl_xattr_2ext);
@ -179,13 +179,13 @@ int lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
posix_acl_xattr_header *new;
if (unlikely(size < 0))
RETURN(-EINVAL);
return -EINVAL;
else if (!size)
RETURN(0);
return 0;
OBD_ALLOC(new, size);
if (unlikely(new == NULL))
RETURN(-ENOMEM);
return -ENOMEM;
new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
count = CFS_ACL_XATTR_COUNT(size, posix_acl_xattr);
@ -308,7 +308,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
posix_size = CFS_ACL_XATTR_SIZE(posix_count, posix_acl_xattr);
OBD_ALLOC(new, posix_size);
if (unlikely(new == NULL))
RETURN(-ENOMEM);
return -ENOMEM;
new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
for (i = 0, j = 0; i < ext_count; i++) {
@ -345,7 +345,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
int ori_posix_count;
if (unlikely(size < 0))
RETURN(-EINVAL);
return -EINVAL;
else if (!size)
ori_posix_count = 0;
else
@ -356,7 +356,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
CFS_ACL_XATTR_SIZE(posix_count, posix_acl_xattr);
OBD_ALLOC(new, posix_size);
if (unlikely(new == NULL))
RETURN(-ENOMEM);
return -ENOMEM;
new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
/* 1. process the unchanged ACL entries
@ -417,7 +417,7 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
ext_acl_xattr_entry *ee, eae;
if (unlikely(size < 0))
RETURN(ERR_PTR(-EINVAL));
return ERR_PTR(-EINVAL);
else if (!size)
posix_count = 0;
else
@ -428,7 +428,7 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
OBD_ALLOC(new, ext_size);
if (unlikely(new == NULL))
RETURN(ERR_PTR(-ENOMEM));
return ERR_PTR(-ENOMEM);
for (i = 0, j = 0; i < posix_count; i++) {
lustre_posix_acl_le_to_cpu(&pae, &posix_header->a_entries[i]);

View File

@ -282,7 +282,7 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
if (IS_ERR(tfm)) {
CERROR("failed to load transform for aes\n");
RETURN(PTR_ERR(tfm));
return PTR_ERR(tfm);
}
min = ll_crypto_tfm_alg_min_keysize(tfm);
@ -332,7 +332,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
if (IS_ERR(tfm)) {
CERROR("failed to load transform for aes\n");
RETURN(PTR_ERR(tfm));
return PTR_ERR(tfm);
}
min = ll_crypto_tfm_alg_min_keysize(tfm);

View File

@ -172,7 +172,7 @@ static int cl_io_init0(const struct lu_env *env, struct cl_io *io,
}
if (result == 0)
io->ci_state = CIS_INIT;
RETURN(result);
return result;
}
/**
@ -232,7 +232,7 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io *io,
io->u.ci_rw.crw_nonblock, io->u.ci_wr.wr_append);
io->u.ci_rw.crw_pos = pos;
io->u.ci_rw.crw_count = count;
RETURN(cl_io_init(env, io, iot, io->ci_obj));
return cl_io_init(env, io, iot, io->ci_obj);
}
EXPORT_SYMBOL(cl_io_rw_init);
@ -335,9 +335,9 @@ int cl_queue_match(const struct list_head *queue,
list_for_each_entry(scan, queue, cill_linkage) {
if (cl_lock_descr_match(&scan->cill_descr, need))
RETURN(+1);
return +1;
}
RETURN(0);
return 0;
}
EXPORT_SYMBOL(cl_queue_match);
@ -353,9 +353,9 @@ static int cl_queue_merge(const struct list_head *queue,
CDEBUG(D_VFSTRACE, "lock: %d: [%lu, %lu]\n",
scan->cill_descr.cld_mode, scan->cill_descr.cld_start,
scan->cill_descr.cld_end);
RETURN(+1);
return +1;
}
RETURN(0);
return 0;
}
@ -394,7 +394,7 @@ static int cl_lockset_lock_one(const struct lu_env *env,
result = 0;
} else
result = PTR_ERR(lock);
RETURN(result);
return result;
}
static void cl_lock_link_fini(const struct lu_env *env, struct cl_io *io,
@ -442,7 +442,7 @@ static int cl_lockset_lock(const struct lu_env *env, struct cl_io *io,
break;
}
}
RETURN(result);
return result;
}
/**
@ -476,7 +476,7 @@ int cl_io_lock(const struct lu_env *env, struct cl_io *io)
cl_io_unlock(env, io);
else
io->ci_state = CIS_LOCKED;
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_lock);
@ -542,7 +542,7 @@ int cl_io_iter_init(const struct lu_env *env, struct cl_io *io)
}
if (result == 0)
io->ci_state = CIS_IT_STARTED;
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_iter_init);
@ -605,7 +605,7 @@ int cl_io_lock_add(const struct lu_env *env, struct cl_io *io,
list_add(&link->cill_linkage, &io->ci_lockset.cls_todo);
result = 0;
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_lock_add);
@ -634,7 +634,7 @@ int cl_io_lock_alloc_add(const struct lu_env *env, struct cl_io *io,
} else
result = -ENOMEM;
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_lock_alloc_add);
@ -660,7 +660,7 @@ int cl_io_start(const struct lu_env *env, struct cl_io *io)
}
if (result >= 0)
result = 0;
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_start);
@ -779,7 +779,7 @@ int cl_io_read_page(const struct lu_env *env, struct cl_io *io,
*/
cl_page_list_disown(env, io, &queue->c2_qin);
cl_2queue_fini(env, queue);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_read_page);
@ -812,7 +812,7 @@ int cl_io_prepare_write(const struct lu_env *env, struct cl_io *io,
break;
}
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_prepare_write);
@ -852,7 +852,7 @@ int cl_io_commit_write(const struct lu_env *env, struct cl_io *io,
}
}
LINVRNT(result <= 0);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_commit_write);
@ -886,7 +886,7 @@ int cl_io_submit_rw(const struct lu_env *env, struct cl_io *io,
* If ->cio_submit() failed, no pages were sent.
*/
LASSERT(ergo(result != 0, list_empty(&queue->c2_qout.pl_pages)));
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_io_submit_rw);
@ -1011,7 +1011,7 @@ int cl_io_loop(const struct lu_env *env, struct cl_io *io)
} while (result == 0 && io->ci_continue);
if (result == 0)
result = io->ci_result;
RETURN(result < 0 ? result : 0);
return result < 0 ? result : 0;
}
EXPORT_SYMBOL(cl_io_loop);
@ -1202,7 +1202,7 @@ int cl_page_list_own(const struct lu_env *env,
else
cl_page_list_del(env, plist, page);
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_page_list_own);
@ -1251,7 +1251,7 @@ int cl_page_list_unmap(const struct lu_env *env, struct cl_io *io,
if (result != 0)
break;
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_page_list_unmap);
@ -1336,7 +1336,7 @@ struct cl_io *cl_io_top(struct cl_io *io)
{
while (io->ci_parent != NULL)
io = io->ci_parent;
RETURN(io);
return io;
}
EXPORT_SYMBOL(cl_io_top);
@ -1413,7 +1413,7 @@ static int cl_req_init(const struct lu_env *env, struct cl_req *req,
}
page = page->cp_child;
} while (page != NULL && result == 0);
RETURN(result);
return result;
}
/**
@ -1467,7 +1467,7 @@ struct cl_req *cl_req_alloc(const struct lu_env *env, struct cl_page *page,
}
} else
req = ERR_PTR(-ENOMEM);
RETURN(req);
return req;
}
EXPORT_SYMBOL(cl_req_alloc);
@ -1549,7 +1549,7 @@ int cl_req_prep(const struct lu_env *env, struct cl_req *req)
break;
}
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_req_prep);
@ -1643,7 +1643,7 @@ int cl_sync_io_wait(const struct lu_env *env, struct cl_io *io,
}
POISON(anchor, 0x5a, sizeof *anchor);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(cl_sync_io_wait);

View File

@ -394,7 +394,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env *env,
}
} else
lock = ERR_PTR(-ENOMEM);
RETURN(lock);
return lock;
}
/**
@ -464,9 +464,9 @@ static int cl_lock_fits_into(const struct lu_env *env,
list_for_each_entry(slice, &lock->cll_layers, cls_linkage) {
if (slice->cls_ops->clo_fits_into != NULL &&
!slice->cls_ops->clo_fits_into(env, slice, need, io))
RETURN(0);
return 0;
}
RETURN(1);
return 1;
}
static struct cl_lock *cl_lock_lookup(const struct lu_env *env,
@ -494,10 +494,10 @@ static struct cl_lock *cl_lock_lookup(const struct lu_env *env,
if (matched) {
cl_lock_get_trust(lock);
CS_LOCK_INC(obj, hit);
RETURN(lock);
return lock;
}
}
RETURN(NULL);
return NULL;
}
/**
@ -549,7 +549,7 @@ static struct cl_lock *cl_lock_find(const struct lu_env *env,
}
}
}
RETURN(lock);
return lock;
}
/**
@ -621,9 +621,9 @@ const struct cl_lock_slice *cl_lock_at(const struct cl_lock *lock,
list_for_each_entry(slice, &lock->cll_layers, cls_linkage) {
if (slice->cls_obj->co_lu.lo_dev->ld_type == dtype)
RETURN(slice);
return slice;
}
RETURN(NULL);
return NULL;
}
EXPORT_SYMBOL(cl_lock_at);
@ -703,7 +703,7 @@ int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock)
cl_lock_mutex_tail(env, lock);
} else
result = -EBUSY;
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_lock_mutex_try);
@ -955,7 +955,7 @@ int cl_lock_state_wait(const struct lu_env *env, struct cl_lock *lock)
/* Restore old blocked signals */
cfs_restore_sigs(blocked);
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_lock_state_wait);
@ -1061,7 +1061,7 @@ int cl_use_try(const struct lu_env *env, struct cl_lock *lock, int atomic)
LASSERT(lock->cll_state == CLS_CACHED);
if (lock->cll_error)
RETURN(lock->cll_error);
return lock->cll_error;
result = -ENOSYS;
state = cl_lock_intransit(env, lock);
@ -1101,7 +1101,7 @@ int cl_use_try(const struct lu_env *env, struct cl_lock *lock, int atomic)
}
cl_lock_extransit(env, lock, state);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_use_try);
@ -1126,7 +1126,7 @@ static int cl_enqueue_kick(const struct lu_env *env,
}
}
LASSERT(result != -ENOSYS);
RETURN(result);
return result;
}
/**
@ -1189,7 +1189,7 @@ int cl_enqueue_try(const struct lu_env *env, struct cl_lock *lock,
LBUG();
}
} while (result == CLO_REPEAT);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_enqueue_try);
@ -1234,7 +1234,7 @@ int cl_lock_enqueue_wait(const struct lu_env *env,
cl_lock_mutex_get(env, lock);
LASSERT(rc <= 0);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(cl_lock_enqueue_wait);
@ -1265,7 +1265,7 @@ static int cl_enqueue_locked(const struct lu_env *env, struct cl_lock *lock,
LASSERT(ergo(result == 0 && !(enqflags & CEF_AGL),
lock->cll_state == CLS_ENQUEUED ||
lock->cll_state == CLS_HELD));
RETURN(result);
return result;
}
/**
@ -1290,7 +1290,7 @@ int cl_enqueue(const struct lu_env *env, struct cl_lock *lock,
cl_lock_lockdep_release(env, lock);
LASSERT(ergo(result == 0, lock->cll_state == CLS_ENQUEUED ||
lock->cll_state == CLS_HELD));
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_enqueue);
@ -1315,14 +1315,14 @@ int cl_unuse_try(const struct lu_env *env, struct cl_lock *lock)
if (lock->cll_users > 1) {
cl_lock_user_del(env, lock);
RETURN(0);
return 0;
}
/* Only if the lock is in CLS_HELD or CLS_ENQUEUED state, it can hold
* underlying resources. */
if (!(lock->cll_state == CLS_HELD || lock->cll_state == CLS_ENQUEUED)) {
cl_lock_user_del(env, lock);
RETURN(0);
return 0;
}
/*
@ -1368,7 +1368,7 @@ int cl_unuse_try(const struct lu_env *env, struct cl_lock *lock)
state = CLS_NEW;
cl_lock_extransit(env, lock, state);
}
RETURN(result ?: lock->cll_error);
return result ?: lock->cll_error;
}
EXPORT_SYMBOL(cl_unuse_try);
@ -1447,7 +1447,7 @@ int cl_wait_try(const struct lu_env *env, struct cl_lock *lock)
cl_lock_state_set(env, lock, CLS_HELD);
}
} while (result == CLO_REPEAT);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_wait_try);
@ -1487,7 +1487,7 @@ int cl_wait(const struct lu_env *env, struct cl_lock *lock)
cl_lock_trace(D_DLMTRACE, env, "wait lock", lock);
cl_lock_mutex_put(env, lock);
LASSERT(ergo(result == 0, lock->cll_state == CLS_HELD));
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_wait);
@ -1513,7 +1513,7 @@ unsigned long cl_lock_weigh(const struct lu_env *env, struct cl_lock *lock)
pound = ~0UL;
}
}
RETURN(pound);
return pound;
}
EXPORT_SYMBOL(cl_lock_weigh);
@ -1545,7 +1545,7 @@ int cl_lock_modify(const struct lu_env *env, struct cl_lock *lock,
if (slice->cls_ops->clo_modify != NULL) {
result = slice->cls_ops->clo_modify(env, slice, desc);
if (result != 0)
RETURN(result);
return result;
}
}
CL_LOCK_DEBUG(D_DLMTRACE, env, lock, " -> "DDESCR"@"DFID"\n",
@ -1558,7 +1558,7 @@ int cl_lock_modify(const struct lu_env *env, struct cl_lock *lock,
spin_lock(&hdr->coh_lock_guard);
lock->cll_descr = *desc;
spin_unlock(&hdr->coh_lock_guard);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(cl_lock_modify);
@ -1613,7 +1613,7 @@ int cl_lock_closure_build(const struct lu_env *env, struct cl_lock *lock,
}
if (result != 0)
cl_lock_disclosure(env, closure);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_lock_closure_build);
@ -1660,7 +1660,7 @@ int cl_lock_enclosure(const struct lu_env *env, struct cl_lock *lock,
}
result = CLO_REPEAT;
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_lock_enclosure);
@ -1824,7 +1824,7 @@ struct cl_lock *cl_lock_at_pgoff(const struct lu_env *env,
}
}
spin_unlock(&head->coh_lock_guard);
RETURN(lock);
return lock;
}
EXPORT_SYMBOL(cl_lock_at_pgoff);
@ -1946,7 +1946,7 @@ int cl_lock_discard_pages(const struct lu_env *env, struct cl_lock *lock)
} while (res != CLP_GANG_OKAY);
out:
cl_io_fini(env, io);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_lock_discard_pages);
@ -2028,7 +2028,7 @@ static struct cl_lock *cl_lock_hold_mutex(const struct lu_env *env,
cl_lock_mutex_put(env, lock);
cl_lock_put(env, lock);
}
RETURN(lock);
return lock;
}
/**
@ -2047,7 +2047,7 @@ struct cl_lock *cl_lock_hold(const struct lu_env *env, const struct cl_io *io,
lock = cl_lock_hold_mutex(env, io, need, scope, source);
if (!IS_ERR(lock))
cl_lock_mutex_put(env, lock);
RETURN(lock);
return lock;
}
EXPORT_SYMBOL(cl_lock_hold);
@ -2094,7 +2094,7 @@ struct cl_lock *cl_lock_request(const struct lu_env *env, struct cl_io *io,
lock = ERR_PTR(rc);
}
} while (rc == 0);
RETURN(lock);
return lock;
}
EXPORT_SYMBOL(cl_lock_request);

View File

@ -93,7 +93,7 @@ int cl_object_header_init(struct cl_object_header *h)
INIT_LIST_HEAD(&h->coh_locks);
h->coh_page_bufsize = ALIGN(sizeof(struct cl_page), 8);
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_object_header_init);
@ -234,7 +234,7 @@ int cl_object_attr_get(const struct lu_env *env, struct cl_object *obj,
}
}
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_object_attr_get);
@ -266,7 +266,7 @@ int cl_object_attr_set(const struct lu_env *env, struct cl_object *obj,
}
}
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_object_attr_set);
@ -299,7 +299,7 @@ int cl_object_glimpse(const struct lu_env *env, struct cl_object *obj,
"ctime: "LPU64" blocks: "LPU64"\n",
lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_atime,
lvb->lvb_ctime, lvb->lvb_blocks);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_object_glimpse);
@ -321,7 +321,7 @@ int cl_conf_set(const struct lu_env *env, struct cl_object *obj,
break;
}
}
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_conf_set);

View File

@ -113,11 +113,11 @@ cl_page_at_trusted(const struct cl_page *page,
do {
list_for_each_entry(slice, &page->cp_layers, cpl_linkage) {
if (slice->cpl_obj->co_lu.lo_dev->ld_type == dtype)
RETURN(slice);
return slice;
}
page = page->cp_child;
} while (page != NULL);
RETURN(NULL);
return NULL;
}
/**
@ -241,7 +241,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct cl_object *obj,
}
if (tree_lock)
spin_unlock(&hdr->coh_page_guard);
RETURN(res);
return res;
}
EXPORT_SYMBOL(cl_page_gang_lookup);
@ -332,7 +332,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env *env,
} else {
page = ERR_PTR(-ENOMEM);
}
RETURN(page);
return page;
}
/**
@ -389,13 +389,13 @@ static struct cl_page *cl_page_find0(const struct lu_env *env,
if (page != NULL) {
CS_PAGE_INC(o, hit);
RETURN(page);
return page;
}
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
if (IS_ERR(page))
RETURN(page);
return page;
if (type == CPT_TRANSIENT) {
if (parent) {
@ -403,7 +403,7 @@ static struct cl_page *cl_page_find0(const struct lu_env *env,
page->cp_parent = parent;
parent->cp_child = page;
}
RETURN(page);
return page;
}
/*
@ -444,7 +444,7 @@ static struct cl_page *cl_page_find0(const struct lu_env *env,
cl_page_delete0(env, ghost, 0);
cl_page_free(env, ghost);
}
RETURN(page);
return page;
}
struct cl_page *cl_page_find(const struct lu_env *env, struct cl_object *o,
@ -627,7 +627,7 @@ struct page *cl_page_vmpage(const struct lu_env *env, struct cl_page *page)
do {
list_for_each_entry(slice, &page->cp_layers, cpl_linkage) {
if (slice->cpl_ops->cpo_vmpage != NULL)
RETURN(slice->cpl_ops->cpo_vmpage(env, slice));
return slice->cpl_ops->cpo_vmpage(env, slice);
}
page = page->cp_child;
} while (page != NULL);
@ -657,7 +657,7 @@ struct cl_page *cl_vmpage_page(struct page *vmpage, struct cl_object *obj)
*/
top = (struct cl_page *)vmpage->private;
if (top == NULL)
RETURN(NULL);
return NULL;
for (page = top; page != NULL; page = page->cp_child) {
if (cl_object_same(page->cp_obj, obj)) {
@ -666,7 +666,7 @@ struct cl_page *cl_vmpage_page(struct page *vmpage, struct cl_object *obj)
}
}
LASSERT(ergo(page, page->cp_type == CPT_CACHEABLE));
RETURN(page);
return page;
}
EXPORT_SYMBOL(cl_vmpage_page);
@ -771,10 +771,10 @@ static int cl_page_invoke(const struct lu_env *env,
{
PINVRNT(env, page, cl_object_same(page->cp_obj, io->ci_obj));
RETURN(CL_PAGE_INVOKE(env, page, op,
return CL_PAGE_INVOKE(env, page, op,
(const struct lu_env *,
const struct cl_page_slice *, struct cl_io *),
io));
io);
}
static void cl_page_invoid(const struct lu_env *env,
@ -836,7 +836,7 @@ void cl_page_disown0(const struct lu_env *env,
int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io)
{
LINVRNT(cl_object_same(pg->cp_obj, io->ci_obj));
RETURN(pg->cp_state == CPS_OWNED && pg->cp_owner == io);
return pg->cp_state == CPS_OWNED && pg->cp_owner == io;
}
EXPORT_SYMBOL(cl_page_is_owned);
@ -893,7 +893,7 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
}
}
PINVRNT(env, pg, ergo(result == 0, cl_page_invariant(pg)));
RETURN(result);
return result;
}
/**
@ -1161,13 +1161,13 @@ int cl_page_is_vmlocked(const struct lu_env *env, const struct cl_page *pg)
*/
result = slice->cpl_ops->cpo_is_vmlocked(env, slice);
PASSERT(env, pg, result == -EBUSY || result == -ENODATA);
RETURN(result == -EBUSY);
return result == -EBUSY;
}
EXPORT_SYMBOL(cl_page_is_vmlocked);
static enum cl_page_state cl_req_type_state(enum cl_req_type crt)
{
RETURN(crt == CRT_WRITE ? CPS_PAGEOUT : CPS_PAGEIN);
return crt == CRT_WRITE ? CPS_PAGEOUT : CPS_PAGEIN;
}
static void cl_page_io_start(const struct lu_env *env,
@ -1286,7 +1286,7 @@ int cl_page_make_ready(const struct lu_env *env, struct cl_page *pg,
PINVRNT(env, pg, crt < CRT_NR);
if (crt >= CRT_NR)
RETURN(-EINVAL);
return -EINVAL;
result = CL_PAGE_INVOKE(env, pg, CL_PAGE_OP(io[crt].cpo_make_ready),
(const struct lu_env *,
const struct cl_page_slice *));
@ -1295,7 +1295,7 @@ int cl_page_make_ready(const struct lu_env *env, struct cl_page *pg,
cl_page_io_start(env, pg, crt);
}
CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_page_make_ready);
@ -1322,7 +1322,7 @@ int cl_page_cache_add(const struct lu_env *env, struct cl_io *io,
PINVRNT(env, pg, cl_page_invariant(pg));
if (crt >= CRT_NR)
RETURN(-EINVAL);
return -EINVAL;
list_for_each_entry(scan, &pg->cp_layers, cpl_linkage) {
if (scan->cpl_ops->io[crt].cpo_cache_add == NULL)
@ -1333,7 +1333,7 @@ int cl_page_cache_add(const struct lu_env *env, struct cl_io *io,
break;
}
CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_page_cache_add);
@ -1356,7 +1356,7 @@ int cl_page_flush(const struct lu_env *env, struct cl_io *io,
result = cl_page_invoke(env, io, pg, CL_PAGE_OP(cpo_flush));
CL_PAGE_HEADER(D_TRACE, env, pg, "%d\n", result);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_page_flush);
@ -1379,7 +1379,7 @@ int cl_page_is_under_lock(const struct lu_env *env, struct cl_io *io,
const struct cl_page_slice *, struct cl_io *),
io);
PASSERT(env, page, rc != 0);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(cl_page_is_under_lock);
@ -1415,7 +1415,7 @@ int cl_pages_prune(const struct lu_env *env, struct cl_object *clobj)
result = cl_io_init(env, io, CIT_MISC, obj);
if (result != 0) {
cl_io_fini(env, io);
RETURN(io->ci_result);
return io->ci_result;
}
do {
@ -1426,7 +1426,7 @@ int cl_pages_prune(const struct lu_env *env, struct cl_object *clobj)
} while (result != CLP_GANG_OKAY);
cl_io_fini(env, io);
RETURN(result);
return result;
}
EXPORT_SYMBOL(cl_pages_prune);

View File

@ -116,14 +116,14 @@ int lustre_get_jobid(char *jobid)
memset(jobid, 0, JOBSTATS_JOBID_SIZE);
/* Jobstats isn't enabled */
if (strcmp(obd_jobid_var, JOBSTATS_DISABLE) == 0)
RETURN(0);
return 0;
/* Use process name + fsuid as jobid */
if (strcmp(obd_jobid_var, JOBSTATS_PROCNAME_UID) == 0) {
snprintf(jobid, JOBSTATS_JOBID_SIZE, "%s.%u",
current_comm(),
from_kuid(&init_user_ns, current_fsuid()));
RETURN(0);
return 0;
}
rc = cfs_get_environ(obd_jobid_var, jobid, &jobid_len);
@ -150,7 +150,7 @@ int lustre_get_jobid(char *jobid)
obd_jobid_var, rc);
}
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(lustre_get_jobid);
@ -213,7 +213,7 @@ int class_resolve_dev_name(__u32 len, const char *name)
rc = dev;
out:
RETURN(rc);
return rc;
}
int class_handle_ioctl(unsigned int cmd, unsigned long arg)
@ -235,7 +235,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
CDEBUG(D_IOCTL, "cmd = %x\n", cmd);
if (obd_ioctl_getdata(&buf, &len, (void *)arg)) {
CERROR("OBD ioctl: data error\n");
RETURN(-EINVAL);
return -EINVAL;
}
data = (struct obd_ioctl_data *)buf;
@ -426,7 +426,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
out:
if (buf)
obd_ioctl_freedata(buf, len);
RETURN(err);
return err;
} /* class_handle_ioctl */
extern struct miscdevice obd_psdev;
@ -522,7 +522,7 @@ static int __init init_obdclass(void)
LPROCFS_STATS_FLAG_IRQ_SAFE);
if (obd_memory == NULL) {
CERROR("kmalloc of 'obd_memory' failed\n");
RETURN(-ENOMEM);
return -ENOMEM;
}
lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,

View File

@ -377,11 +377,11 @@ struct dt_object *dt_find_or_create(const struct lu_env *env,
dto = dt_locate(env, dt, fid);
if (IS_ERR(dto))
RETURN(dto);
return dto;
LASSERT(dto != NULL);
if (dt_object_exists(dto))
RETURN(dto);
return dto;
th = dt_trans_create(env, dt);
if (IS_ERR(th))
@ -412,9 +412,9 @@ trans_stop:
out:
if (rc) {
lu_object_put(env, &dto->do_lu);
RETURN(ERR_PTR(rc));
return ERR_PTR(rc);
}
RETURN(dto);
return dto;
}
EXPORT_SYMBOL(dt_find_or_create);
@ -765,14 +765,14 @@ int dt_index_walk(const struct lu_env *env, struct dt_object *obj,
nob = rdpg->rp_count;
if (nob <= 0)
RETURN(-EFAULT);
return -EFAULT;
/* Iterate through index and fill containers from @rdpg */
iops = &obj->do_index_ops->dio_it;
LASSERT(iops != NULL);
it = iops->init(env, obj, rdpg->rp_attrs, BYPASS_CAPA);
if (IS_ERR(it))
RETURN(PTR_ERR(it));
return PTR_ERR(it);
rc = iops->load(env, it, rdpg->rp_hash);
if (rc == 0) {
@ -826,7 +826,7 @@ int dt_index_walk(const struct lu_env *env, struct dt_object *obj,
if (rc >= 0)
rc = min_t(unsigned int, nlupgs * LU_PAGE_SIZE, rdpg->rp_count);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(dt_index_walk);
@ -854,21 +854,21 @@ int dt_index_read(const struct lu_env *env, struct dt_device *dev,
/* rp_count shouldn't be null and should be a multiple of the container
* size */
if (rdpg->rp_count <= 0 && (rdpg->rp_count & (LU_PAGE_SIZE - 1)) != 0)
RETURN(-EFAULT);
return -EFAULT;
if (fid_seq(&ii->ii_fid) >= FID_SEQ_NORMAL)
/* we don't support directory transfer via OBD_IDX_READ for the
* time being */
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
if (!fid_is_quota(&ii->ii_fid))
/* block access to all local files except quota files */
RETURN(-EPERM);
return -EPERM;
/* lookup index object subject to the transfer */
obj = dt_locate(env, dev, &ii->ii_fid);
if (IS_ERR(obj))
RETURN(PTR_ERR(obj));
return PTR_ERR(obj);
if (dt_object_exists(obj) == 0)
GOTO(out, rc = -ENOENT);

View File

@ -169,13 +169,13 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
if (class_search_type(name)) {
CDEBUG(D_IOCTL, "Type %s already registered\n", name);
RETURN(-EEXIST);
return -EEXIST;
}
rc = -ENOMEM;
OBD_ALLOC(type, sizeof(*type));
if (type == NULL)
RETURN(rc);
return rc;
OBD_ALLOC_PTR(type->typ_dt_ops);
OBD_ALLOC_PTR(type->typ_md_ops);
@ -213,7 +213,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
list_add(&type->typ_chain, &obd_types);
spin_unlock(&obd_types_lock);
RETURN (0);
return 0;
failed:
if (type->typ_name != NULL)
@ -223,7 +223,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
if (type->typ_dt_ops != NULL)
OBD_FREE_PTR(type->typ_dt_ops);
OBD_FREE(type, sizeof(*type));
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(class_register_type);
@ -233,7 +233,7 @@ int class_unregister_type(const char *name)
if (!type) {
CERROR("unknown obd type\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (type->typ_refcnt) {
@ -242,7 +242,7 @@ int class_unregister_type(const char *name)
/* Remove ops, but leave the name for debugging */
OBD_FREE_PTR(type->typ_dt_ops);
OBD_FREE_PTR(type->typ_md_ops);
RETURN(-EBUSY);
return -EBUSY;
}
if (type->typ_procroot) {
@ -261,7 +261,7 @@ int class_unregister_type(const char *name)
if (type->typ_md_ops != NULL)
OBD_FREE_PTR(type->typ_md_ops);
OBD_FREE(type, sizeof(*type));
RETURN(0);
return 0;
} /* class_unregister_type */
EXPORT_SYMBOL(class_unregister_type);
@ -286,13 +286,13 @@ struct obd_device *class_newdev(const char *type_name, const char *name)
if (strlen(name) >= MAX_OBD_NAME) {
CERROR("name/uuid must be < %u bytes long\n", MAX_OBD_NAME);
RETURN(ERR_PTR(-EINVAL));
return ERR_PTR(-EINVAL);
}
type = class_get_type(type_name);
if (type == NULL){
CERROR("OBD: unknown type: %s\n", type_name);
RETURN(ERR_PTR(-ENODEV));
return ERR_PTR(-ENODEV);
}
newdev = obd_device_alloc();
@ -346,7 +346,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name)
CDEBUG(D_IOCTL, "Adding new device %s (%p)\n",
result->obd_name, result);
RETURN(result);
return result;
out:
obd_device_free(newdev);
out_type:
@ -678,10 +678,10 @@ int obd_init_caches(void)
if (!capa_cachep)
GOTO(out, -ENOMEM);
RETURN(0);
return 0;
out:
obd_cleanup_caches();
RETURN(-ENOMEM);
return -ENOMEM;
}
@ -692,17 +692,17 @@ struct obd_export *class_conn2export(struct lustre_handle *conn)
if (!conn) {
CDEBUG(D_CACHE, "looking for null handle\n");
RETURN(NULL);
return NULL;
}
if (conn->cookie == -1) { /* this means assign a new connection */
CDEBUG(D_CACHE, "want a new connection\n");
RETURN(NULL);
return NULL;
}
CDEBUG(D_INFO, "looking for export cookie "LPX64"\n", conn->cookie);
export = class_handle2object(conn->cookie);
RETURN(export);
return export;
}
EXPORT_SYMBOL(class_conn2export);
@ -888,7 +888,7 @@ struct obd_export *class_new_export(struct obd_device *obd,
export->exp_obd->obd_num_exports++;
spin_unlock(&obd->obd_dev_lock);
cfs_hash_putref(hash);
RETURN(export);
return export;
exit_unlock:
spin_unlock(&obd->obd_dev_lock);
@ -1107,14 +1107,14 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd,
export = class_new_export(obd, cluuid);
if (IS_ERR(export))
RETURN(PTR_ERR(export));
return PTR_ERR(export);
conn->cookie = export->exp_handle.h_cookie;
class_export_put(export);
CDEBUG(D_IOCTL, "connect: client %s, cookie "LPX64"\n",
cluuid->uuid, conn->cookie);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(class_connect);
@ -1173,7 +1173,7 @@ int class_disconnect(struct obd_export *export)
if (export == NULL) {
CWARN("attempting to free NULL export %p\n", export);
RETURN(-EINVAL);
return -EINVAL;
}
spin_lock(&export->exp_lock);
@ -1201,7 +1201,7 @@ int class_disconnect(struct obd_export *export)
class_unlink_export(export);
no_disconn:
class_export_put(export);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(class_disconnect);
@ -1622,7 +1622,7 @@ static int obd_zombie_impexp_check(void *arg)
!test_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags);
spin_unlock(&obd_zombie_impexp_lock);
RETURN(rc);
return rc;
}
/**
@ -1724,7 +1724,7 @@ static int obd_zombie_impexp_thread(void *unused)
complete(&obd_zombie_stop);
RETURN(0);
return 0;
}
@ -1745,10 +1745,10 @@ int obd_zombie_impexp_init(void)
task = kthread_run(obd_zombie_impexp_thread, NULL, "obd_zombid");
if (IS_ERR(task))
RETURN(PTR_ERR(task));
return PTR_ERR(task);
wait_for_completion(&obd_zombie_start);
RETURN(0);
return 0;
}
/**
* stop destroy zombie import/export thread

View File

@ -86,23 +86,23 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
err = copy_from_user(&hdr, (void *)arg, sizeof(hdr));
if ( err )
RETURN(err);
return err;
if (hdr.ioc_version != OBD_IOCTL_VERSION) {
CERROR("Version mismatch kernel (%x) vs application (%x)\n",
OBD_IOCTL_VERSION, hdr.ioc_version);
RETURN(-EINVAL);
return -EINVAL;
}
if (hdr.ioc_len > OBD_MAX_IOCTL_BUFFER) {
CERROR("User buffer len %d exceeds %d max buffer\n",
hdr.ioc_len, OBD_MAX_IOCTL_BUFFER);
RETURN(-EINVAL);
return -EINVAL;
}
if (hdr.ioc_len < sizeof(struct obd_ioctl_data)) {
CERROR("User buffer too small for ioctl (%d)\n", hdr.ioc_len);
RETURN(-EINVAL);
return -EINVAL;
}
/* When there are lots of processes calling vmalloc on multi-core
@ -113,7 +113,7 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
if (*buf == NULL) {
CERROR("Cannot allocate control buffer of len %d\n",
hdr.ioc_len);
RETURN(-EINVAL);
return -EINVAL;
}
*len = hdr.ioc_len;
data = (struct obd_ioctl_data *)*buf;
@ -121,13 +121,13 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
err = copy_from_user(*buf, (void *)arg, hdr.ioc_len);
if ( err ) {
OBD_FREE_LARGE(*buf, hdr.ioc_len);
RETURN(err);
return err;
}
if (obd_ioctl_is_invalid(data)) {
CERROR("ioctl not correctly formatted\n");
OBD_FREE_LARGE(*buf, hdr.ioc_len);
RETURN(-EINVAL);
return -EINVAL;
}
if (data->ioc_inllen1) {
@ -168,14 +168,14 @@ EXPORT_SYMBOL(obd_ioctl_popdata);
static int obd_class_open(struct inode * inode, struct file * file)
{
try_module_get(THIS_MODULE);
RETURN(0);
return 0;
}
/* closing /dev/obd */
static int obd_class_release(struct inode * inode, struct file * file)
{
module_put(THIS_MODULE);
RETURN(0);
return 0;
}
/* to control /dev/obd */
@ -186,13 +186,13 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
/* Allow non-root access for OBD_IOC_PING_TARGET - used by lfs check */
if (!cfs_capable(CFS_CAP_SYS_ADMIN) && (cmd != OBD_IOC_PING_TARGET))
RETURN(err = -EACCES);
return err = -EACCES;
if ((cmd & 0xffffff00) == ((int)'T') << 8) /* ignore all tty ioctls */
RETURN(err = -ENOTTY);
return err = -ENOTTY;
err = class_handle_ioctl(cmd, (unsigned long)arg);
RETURN(err);
return err;
}
/* declare character device */
@ -394,7 +394,7 @@ int class_procfs_init(void)
out:
if (rc)
CERROR("error adding /proc/fs/lustre/devices file\n");
RETURN(0);
return 0;
}
int class_procfs_clean(void)
@ -402,5 +402,5 @@ int class_procfs_clean(void)
if (proc_lustre_root) {
lprocfs_remove(&proc_lustre_root);
}
RETURN(0);
return 0;
}

View File

@ -117,14 +117,14 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
if (index == 0) {
CERROR("Can't cancel index 0 which is header\n");
RETURN(-EINVAL);
return -EINVAL;
}
spin_lock(&loghandle->lgh_hdr_lock);
if (!ext2_clear_bit(index, llh->llh_bitmap)) {
spin_unlock(&loghandle->lgh_hdr_lock);
CDEBUG(D_RPCTRACE, "Catalog index %u already clear?\n", index);
RETURN(-ENOENT);
return -ENOENT;
}
llh->llh_count--;
@ -142,7 +142,7 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
loghandle->lgh_id.lgl_ogen, rc);
GOTO(out_err, rc);
}
RETURN(1);
return 1;
}
spin_unlock(&loghandle->lgh_hdr_lock);
@ -155,7 +155,7 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
loghandle->lgh_id.lgl_ogen, rc);
GOTO(out_err, rc);
}
RETURN(0);
return 0;
out_err:
spin_lock(&loghandle->lgh_hdr_lock);
ext2_set_bit(index, llh->llh_bitmap);
@ -174,10 +174,10 @@ static int llog_read_header(const struct lu_env *env,
rc = llog_handle2ops(handle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_read_header == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = lop->lop_read_header(env, handle);
if (rc == LLOG_EEMPTY) {
@ -209,7 +209,7 @@ int llog_init_handle(const struct lu_env *env, struct llog_handle *handle,
OBD_ALLOC_PTR(llh);
if (llh == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
handle->lgh_hdr = llh;
/* first assign flags to use llog_client_ops */
llh->llh_flags = flags;
@ -261,7 +261,7 @@ out:
OBD_FREE_PTR(llh);
handle->lgh_hdr = NULL;
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_init_handle);
@ -286,7 +286,7 @@ int llog_copy_handler(const struct lu_env *env,
rec->lrh_index, rc, rec->lrh_len, lcfg->lcfg_command,
lustre_cfg_string(lcfg, 0), lustre_cfg_string(lcfg, 1));
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_copy_handler);
@ -308,7 +308,7 @@ static int llog_process_thread(void *arg)
OBD_ALLOC(buf, LLOG_CHUNK_SIZE);
if (!buf) {
lpi->lpi_rc = -ENOMEM;
RETURN(0);
return 0;
}
if (cd != NULL) {
@ -455,7 +455,7 @@ int llog_process_or_fork(const struct lu_env *env,
OBD_ALLOC_PTR(lpi);
if (lpi == NULL) {
CERROR("cannot alloc pointer\n");
RETURN(-ENOMEM);
return -ENOMEM;
}
lpi->lpi_loghandle = loghandle;
lpi->lpi_cb = cb;
@ -473,7 +473,7 @@ int llog_process_or_fork(const struct lu_env *env,
CERROR("%s: cannot start thread: rc = %d\n",
loghandle->lgh_ctxt->loc_obd->obd_name, rc);
OBD_FREE_PTR(lpi);
RETURN(rc);
return rc;
}
wait_for_completion(&lpi->lpi_completion);
} else {
@ -482,7 +482,7 @@ int llog_process_or_fork(const struct lu_env *env,
}
rc = lpi->lpi_rc;
OBD_FREE_PTR(lpi);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_process_or_fork);
@ -512,7 +512,7 @@ int llog_reverse_process(const struct lu_env *env,
OBD_ALLOC(buf, LLOG_CHUNK_SIZE);
if (!buf)
RETURN(-ENOMEM);
return -ENOMEM;
if (cd != NULL)
first_index = cd->lpcd_first_idx + 1;
@ -586,7 +586,7 @@ int llog_reverse_process(const struct lu_env *env,
out:
if (buf)
OBD_FREE(buf, LLOG_CHUNK_SIZE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_reverse_process);
@ -611,12 +611,12 @@ int llog_exist(struct llog_handle *loghandle)
rc = llog_handle2ops(loghandle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_exist == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = lop->lop_exist(loghandle);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_exist);
@ -628,9 +628,9 @@ int llog_declare_create(const struct lu_env *env,
rc = llog_handle2ops(loghandle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_declare_create == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
if (!raised)
@ -638,7 +638,7 @@ int llog_declare_create(const struct lu_env *env,
rc = lop->lop_declare_create(env, loghandle, th);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_declare_create);
@ -650,9 +650,9 @@ int llog_create(const struct lu_env *env, struct llog_handle *handle,
rc = llog_handle2ops(handle, &lop);
if (rc)
RETURN(rc);
return rc;
if (lop->lop_create == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
if (!raised)
@ -660,7 +660,7 @@ int llog_create(const struct lu_env *env, struct llog_handle *handle,
rc = lop->lop_create(env, handle, th);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_create);
@ -674,10 +674,10 @@ int llog_declare_write_rec(const struct lu_env *env,
rc = llog_handle2ops(handle, &lop);
if (rc)
RETURN(rc);
return rc;
LASSERT(lop);
if (lop->lop_declare_write_rec == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
if (!raised)
@ -685,7 +685,7 @@ int llog_declare_write_rec(const struct lu_env *env,
rc = lop->lop_declare_write_rec(env, handle, rec, idx, th);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_declare_write_rec);
@ -698,11 +698,11 @@ int llog_write_rec(const struct lu_env *env, struct llog_handle *handle,
rc = llog_handle2ops(handle, &lop);
if (rc)
RETURN(rc);
return rc;
LASSERT(lop);
if (lop->lop_write_rec == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
if (buf)
buflen = rec->lrh_len + sizeof(struct llog_rec_hdr) +
@ -718,7 +718,7 @@ int llog_write_rec(const struct lu_env *env, struct llog_handle *handle,
buf, idx, th);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_write_rec);
@ -729,7 +729,7 @@ int llog_add(const struct lu_env *env, struct llog_handle *lgh,
int raised, rc;
if (lgh->lgh_logops->lop_add == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
if (!raised)
@ -737,7 +737,7 @@ int llog_add(const struct lu_env *env, struct llog_handle *lgh,
rc = lgh->lgh_logops->lop_add(env, lgh, rec, logcookies, buf, th);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_add);
@ -747,7 +747,7 @@ int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh,
int raised, rc;
if (lgh->lgh_logops->lop_declare_add == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
if (!raised)
@ -755,7 +755,7 @@ int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh,
rc = lgh->lgh_logops->lop_declare_add(env, lgh, rec, th);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_declare_add);
@ -772,10 +772,10 @@ int llog_open_create(const struct lu_env *env, struct llog_ctxt *ctxt,
rc = llog_open(env, ctxt, res, logid, name, LLOG_OPEN_NEW);
if (rc)
RETURN(rc);
return rc;
if (llog_exist(*res))
RETURN(0);
return 0;
if ((*res)->lgh_obj != NULL) {
struct dt_device *d;
@ -801,7 +801,7 @@ int llog_open_create(const struct lu_env *env, struct llog_ctxt *ctxt,
out:
if (rc)
llog_close(env, *res);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_open_create);
@ -816,11 +816,11 @@ int llog_erase(const struct lu_env *env, struct llog_ctxt *ctxt,
/* nothing to erase */
if (name == NULL && logid == NULL)
RETURN(0);
return 0;
rc = llog_open(env, ctxt, &handle, logid, name, LLOG_OPEN_EXISTS);
if (rc < 0)
RETURN(rc);
return rc;
rc = llog_init_handle(env, handle, LLOG_F_IS_PLAIN, NULL);
if (rc == 0)
@ -829,7 +829,7 @@ int llog_erase(const struct lu_env *env, struct llog_ctxt *ctxt,
rc2 = llog_close(env, handle);
if (rc == 0)
rc = rc2;
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_erase);
@ -855,7 +855,7 @@ int llog_write(const struct lu_env *env, struct llog_handle *loghandle,
th = dt_trans_create(env, dt);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
return PTR_ERR(th);
rc = llog_declare_write_rec(env, loghandle, rec, idx, th);
if (rc)
@ -877,7 +877,7 @@ out_trans:
cookiecount, buf, idx, NULL);
up_write(&loghandle->lgh_lock);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_write);
@ -893,12 +893,12 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
if (ctxt->loc_logops->lop_open == NULL) {
*lgh = NULL;
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
}
*lgh = llog_alloc_handle();
if (*lgh == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
(*lgh)->lgh_ctxt = ctxt;
(*lgh)->lgh_logops = ctxt->loc_logops;
@ -912,7 +912,7 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
llog_free_handle(*lgh);
*lgh = NULL;
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_open);
@ -929,6 +929,6 @@ int llog_close(const struct lu_env *env, struct llog_handle *loghandle)
rc = lop->lop_close(env, loghandle);
out:
llog_handle_put(loghandle);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_close);

View File

@ -76,20 +76,20 @@ static int llog_cat_new_log(const struct lu_env *env,
/* maximum number of available slots in catlog is bitmap_size - 2 */
if (llh->llh_cat_idx == index) {
CERROR("no free catalog slots for log...\n");
RETURN(-ENOSPC);
return -ENOSPC;
}
if (OBD_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED))
RETURN(-ENOSPC);
return -ENOSPC;
rc = llog_create(env, loghandle, th);
/* if llog is already created, no need to initialize it */
if (rc == -EEXIST) {
RETURN(0);
return 0;
} else if (rc != 0) {
CERROR("%s: can't create new plain llog in catalog: rc = %d\n",
loghandle->lgh_ctxt->loc_obd->obd_name, rc);
RETURN(rc);
return rc;
}
rc = llog_init_handle(env, loghandle,
@ -133,10 +133,10 @@ static int llog_cat_new_log(const struct lu_env *env,
GOTO(out_destroy, rc);
loghandle->lgh_hdr->llh_cat_idx = index;
RETURN(0);
return 0;
out_destroy:
llog_destroy(env, loghandle);
RETURN(rc);
return rc;
}
/* Open an existent log handle and add it to the open list.
@ -155,7 +155,7 @@ int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
int rc = 0;
if (cathandle == NULL)
RETURN(-EBADF);
return -EBADF;
down_write(&cathandle->lgh_lock);
list_for_each_entry(loghandle, &cathandle->u.chd.chd_head,
@ -184,14 +184,14 @@ int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
CERROR("%s: error opening log id "DOSTID":%x: rc = %d\n",
cathandle->lgh_ctxt->loc_obd->obd_name,
POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
RETURN(rc);
return rc;
}
rc = llog_init_handle(env, loghandle, LLOG_F_IS_PLAIN, NULL);
if (rc < 0) {
llog_close(env, loghandle);
loghandle = NULL;
RETURN(rc);
return rc;
}
down_write(&cathandle->lgh_lock);
@ -240,7 +240,7 @@ int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle)
if (cathandle->lgh_ctxt->loc_handle == cathandle)
cathandle->lgh_ctxt->loc_handle = NULL;
rc = llog_close(env, cathandle);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_close);
@ -277,7 +277,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
if (llh == NULL ||
loghandle->lgh_last_idx < LLOG_BITMAP_SIZE(llh) - 1) {
up_read(&cathandle->lgh_lock);
RETURN(loghandle);
return loghandle;
} else {
up_write(&loghandle->lgh_lock);
}
@ -297,7 +297,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
LASSERT(llh);
if (loghandle->lgh_last_idx < LLOG_BITMAP_SIZE(llh) - 1) {
up_write(&cathandle->lgh_lock);
RETURN(loghandle);
return loghandle;
} else {
up_write(&loghandle->lgh_lock);
}
@ -311,7 +311,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
down_write_nested(&loghandle->lgh_lock, LLOGH_LOG);
up_write(&cathandle->lgh_lock);
LASSERT(loghandle);
RETURN(loghandle);
return loghandle;
}
/* Add a single record to the recovery log(s) using a catalog
@ -335,7 +335,7 @@ int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
rc = llog_cat_new_log(env, cathandle, loghandle, th);
if (rc < 0) {
up_write(&loghandle->lgh_lock);
RETURN(rc);
return rc;
}
}
/* now let's try to add the record */
@ -353,7 +353,7 @@ int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
rc = llog_cat_new_log(env, cathandle, loghandle, th);
if (rc < 0) {
up_write(&loghandle->lgh_lock);
RETURN(rc);
return rc;
}
}
/* now let's try to add the record */
@ -364,7 +364,7 @@ int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
up_write(&loghandle->lgh_lock);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_add_rec);
@ -427,7 +427,7 @@ int llog_cat_declare_add_rec(const struct lu_env *env,
llog_declare_write_rec(env, next, rec, -1, th);
}
out:
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_declare_add_rec);
@ -450,7 +450,7 @@ int llog_cat_add(const struct lu_env *env, struct llog_handle *cathandle,
th = dt_trans_create(env, dt);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
return PTR_ERR(th);
rc = llog_cat_declare_add_rec(env, cathandle, rec, th);
if (rc)
@ -469,7 +469,7 @@ out_trans:
rc = llog_cat_add_rec(env, cathandle, rec, reccookie,
buf, th);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_add);
@ -521,7 +521,7 @@ int llog_cat_cancel_records(const struct lu_env *env,
cathandle->lgh_ctxt->loc_obd->obd_name, failed, count,
rc);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_cancel_records);
@ -535,7 +535,7 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
if (rec->lrh_type != LLOG_LOGID_MAGIC) {
CERROR("invalid record in catalog\n");
RETURN(-EINVAL);
return -EINVAL;
}
CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
@ -546,12 +546,12 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
cat_llh->lgh_ctxt->loc_obd->obd_name,
POSTID(&lir->lid_id.lgl_oi), rc);
RETURN(rc);
return rc;
}
if (rec->lrh_index < d->lpd_startcat)
/* Skip processing of the logs until startcat */
RETURN(0);
return 0;
if (d->lpd_startidx > 0) {
struct llog_process_cat_data cd;
@ -568,7 +568,7 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
}
llog_handle_put(llh);
RETURN(rc);
return rc;
}
int llog_cat_process_or_fork(const struct lu_env *env,
@ -597,7 +597,7 @@ int llog_cat_process_or_fork(const struct lu_env *env,
rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb,
&d, &cd, fork);
if (rc != 0)
RETURN(rc);
return rc;
cd.lpcd_first_idx = 0;
cd.lpcd_last_idx = cat_llh->lgh_last_idx;
@ -608,7 +608,7 @@ int llog_cat_process_or_fork(const struct lu_env *env,
&d, NULL, fork);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_process_or_fork);
@ -631,7 +631,7 @@ static int llog_cat_reverse_process_cb(const struct lu_env *env,
if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
CERROR("invalid record in catalog\n");
RETURN(-EINVAL);
return -EINVAL;
}
CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
@ -642,12 +642,12 @@ static int llog_cat_reverse_process_cb(const struct lu_env *env,
CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
cat_llh->lgh_ctxt->loc_obd->obd_name,
POSTID(&lir->lid_id.lgl_oi), rc);
RETURN(rc);
return rc;
}
rc = llog_reverse_process(env, llh, d->lpd_cb, d->lpd_data, NULL);
llog_handle_put(llh);
RETURN(rc);
return rc;
}
int llog_cat_reverse_process(const struct lu_env *env,
@ -673,7 +673,7 @@ int llog_cat_reverse_process(const struct lu_env *env,
llog_cat_reverse_process_cb,
&d, &cd);
if (rc != 0)
RETURN(rc);
return rc;
cd.lpcd_first_idx = le32_to_cpu(llh->llh_cat_idx);
cd.lpcd_last_idx = 0;
@ -686,7 +686,7 @@ int llog_cat_reverse_process(const struct lu_env *env,
&d, NULL);
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cat_reverse_process);
@ -718,7 +718,7 @@ out:
POSTID(&cathandle->lgh_id.lgl_oi), llh->llh_cat_idx);
}
RETURN(0);
return 0;
}
/* Cleanup deleted plain llog traces from catalog */
@ -760,7 +760,7 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
if (rec->lrh_type != LLOG_LOGID_MAGIC) {
CERROR("invalid record in catalog\n");
RETURN(-EINVAL);
return -EINVAL;
}
CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
@ -776,7 +776,7 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
/* remove index from catalog */
llog_cat_cleanup(env, cathandle, NULL, rec->lrh_index);
}
RETURN(rc);
return rc;
}
llh = loghandle->lgh_hdr;
@ -792,7 +792,7 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
}
llog_handle_put(loghandle);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(cat_cancel_cb);
@ -804,12 +804,12 @@ int llog_cat_init_and_process(const struct lu_env *env,
rc = llog_init_handle(env, llh, LLOG_F_IS_CAT, NULL);
if (rc)
RETURN(rc);
return rc;
rc = llog_process_or_fork(env, llh, cat_cancel_cb, NULL, NULL, false);
if (rc)
CERROR("%s: llog_process() with cat_cancel_cb failed: rc = "
"%d\n", llh->lgh_ctxt->loc_obd->obd_name, rc);
RETURN(0);
return 0;
}
EXPORT_SYMBOL(llog_cat_init_and_process);

View File

@ -47,43 +47,43 @@ static int str2logid(struct llog_logid *logid, char *str, int len)
start = str;
if (*start != '#')
RETURN(-EINVAL);
return -EINVAL;
start++;
if (start - str >= len - 1)
RETURN(-EINVAL);
return -EINVAL;
end = strchr(start, '#');
if (end == NULL || end == start)
RETURN(-EINVAL);
return -EINVAL;
*end = '\0';
id = simple_strtoull(start, &endp, 0);
if (endp != end)
RETURN(-EINVAL);
return -EINVAL;
start = ++end;
if (start - str >= len - 1)
RETURN(-EINVAL);
return -EINVAL;
end = strchr(start, '#');
if (end == NULL || end == start)
RETURN(-EINVAL);
return -EINVAL;
*end = '\0';
seq = simple_strtoull(start, &endp, 0);
if (endp != end)
RETURN(-EINVAL);
return -EINVAL;
ostid_set_seq(&logid->lgl_oi, seq);
ostid_set_id(&logid->lgl_oi, id);
start = ++end;
if (start - str >= len - 1)
RETURN(-EINVAL);
return -EINVAL;
logid->lgl_ogen = simple_strtoul(start, &endp, 16);
if (*endp != '\0')
RETURN(-EINVAL);
return -EINVAL;
RETURN(0);
return 0;
}
static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
@ -103,19 +103,19 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
cfs_size_round(ioc_data->ioc_inllen3);
from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
return -EINVAL;
to = simple_strtol(ioc_data->ioc_inlbuf3, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
return -EINVAL;
ioc_data->ioc_inllen1 = 0;
out = ioc_data->ioc_bulk;
}
cur_index = rec->lrh_index;
if (cur_index < from)
RETURN(0);
return 0;
if (to > 0 && cur_index > to)
RETURN(-LLOG_EEMPTY);
return -LLOG_EEMPTY;
if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
@ -128,13 +128,13 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
rec->lrh_len);
}
if (handle->lgh_ctxt == NULL)
RETURN(-EOPNOTSUPP);
return -EOPNOTSUPP;
rc = llog_cat_id2handle(env, handle, &loghandle, &lir->lid_id);
if (rc) {
CDEBUG(D_IOCTL, "cannot find log #"DOSTID"#%08x\n",
POSTID(&lir->lid_id.lgl_oi),
lir->lid_id.lgl_ogen);
RETURN(rc);
return rc;
}
rc = llog_process(env, loghandle, llog_check_cb, NULL, NULL);
llog_handle_put(loghandle);
@ -164,10 +164,10 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
if (remains <= 0) {
CERROR("%s: no space to print log records\n",
handle->lgh_ctxt->loc_obd->obd_name);
RETURN(-LLOG_EEMPTY);
return -LLOG_EEMPTY;
}
}
RETURN(rc);
return rc;
}
static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
@ -187,26 +187,26 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
cfs_size_round(ioc_data->ioc_inllen3);
from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
return -EINVAL;
to = simple_strtol(ioc_data->ioc_inlbuf3, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
return -EINVAL;
out = ioc_data->ioc_bulk;
ioc_data->ioc_inllen1 = 0;
}
cur_index = rec->lrh_index;
if (cur_index < from)
RETURN(0);
return 0;
if (to > 0 && cur_index > to)
RETURN(-LLOG_EEMPTY);
return -LLOG_EEMPTY;
if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
if (rec->lrh_type != LLOG_LOGID_MAGIC) {
CERROR("invalid record in catalog\n");
RETURN(-EINVAL);
return -EINVAL;
}
l = snprintf(out, remains,
@ -218,7 +218,7 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
rc = class_config_parse_rec(rec, out, remains);
if (rc < 0)
RETURN(rc);
return rc;
l = rc;
} else {
l = snprintf(out, remains,
@ -229,10 +229,10 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
remains -= l;
if (remains <= 0) {
CERROR("not enough space for print log records\n");
RETURN(-LLOG_EEMPTY);
return -LLOG_EEMPTY;
}
RETURN(0);
return 0;
}
static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
struct llog_logid *logid)
@ -244,7 +244,7 @@ static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
if (rc) {
CDEBUG(D_IOCTL, "cannot find log #"DOSTID"#%08x\n",
POSTID(&logid->lgl_oi), logid->lgl_ogen);
RETURN(-ENOENT);
return -ENOENT;
}
rc = llog_destroy(env, log);
@ -255,7 +255,7 @@ static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
llog_cat_cleanup(env, cat, log, log->u.phd.phd_cookie.lgc_index);
out:
llog_handle_put(log);
RETURN(rc);
return rc;
}
@ -266,10 +266,10 @@ static int llog_delete_cb(const struct lu_env *env, struct llog_handle *handle,
int rc;
if (rec->lrh_type != LLOG_LOGID_MAGIC)
RETURN(-EINVAL);
return -EINVAL;
rc = llog_remove_log(env, handle, &lir->lid_id);
RETURN(rc);
return rc;
}
@ -283,20 +283,20 @@ int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
if (*data->ioc_inlbuf1 == '#') {
rc = str2logid(&logid, data->ioc_inlbuf1, data->ioc_inllen1);
if (rc)
RETURN(rc);
return rc;
rc = llog_open(env, ctxt, &handle, &logid, NULL,
LLOG_OPEN_EXISTS);
if (rc)
RETURN(rc);
return rc;
} else if (*data->ioc_inlbuf1 == '$') {
char *name = data->ioc_inlbuf1 + 1;
rc = llog_open(env, ctxt, &handle, NULL, name,
LLOG_OPEN_EXISTS);
if (rc)
RETURN(rc);
return rc;
} else {
RETURN(-EINVAL);
return -EINVAL;
}
rc = llog_init_handle(env, handle, 0, NULL);
@ -413,6 +413,6 @@ out_close:
llog_cat_close(env, handle);
else
llog_close(env, handle);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_ioctl);

View File

@ -85,7 +85,7 @@ static int llog_lvfs_pad(struct obd_device *obd, struct l_file *file,
}
out:
RETURN(rc);
return rc;
}
static int llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file,
@ -137,7 +137,7 @@ static int llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file,
if (saved_off > file->f_pos)
file->f_pos = saved_off;
LASSERT(rc <= 0);
RETURN(rc);
return rc;
}
static int llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file,
@ -149,9 +149,9 @@ static int llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file,
rc = fsfilt_read_record(obd, file, buf, size, &offset);
if (rc) {
CERROR("error reading log record: rc %d\n", rc);
RETURN(rc);
return rc;
}
RETURN(0);
return 0;
}
static int llog_lvfs_read_header(const struct lu_env *env,
@ -166,7 +166,7 @@ static int llog_lvfs_read_header(const struct lu_env *env,
if (i_size_read(handle->lgh_file->f_dentry->d_inode) == 0) {
CDEBUG(D_HA, "not reading header from 0-byte log\n");
RETURN(LLOG_EEMPTY);
return LLOG_EEMPTY;
}
rc = llog_lvfs_read_blob(obd, handle->lgh_file, handle->lgh_hdr,
@ -201,7 +201,7 @@ static int llog_lvfs_read_header(const struct lu_env *env,
handle->lgh_last_idx = handle->lgh_hdr->llh_tail.lrt_index;
handle->lgh_file->f_pos = i_size_read(handle->lgh_file->f_dentry->d_inode);
RETURN(rc);
return rc;
}
/* returns negative in on error; 0 if success && reccookie == 0; 1 otherwise */
@ -230,7 +230,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
else
rc = (reclen > LLOG_CHUNK_SIZE) ? -E2BIG : 0;
if (rc)
RETURN(rc);
return rc;
if (buf)
/* write_blob adds header and tail to lrh_len. */
@ -247,7 +247,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
}
if (idx && llh->llh_size && llh->llh_size != rec->lrh_len)
RETURN(-EINVAL);
return -EINVAL;
if (!ext2_test_bit(idx, llh->llh_bitmap))
CERROR("Modify unset record %u\n", idx);
@ -257,7 +257,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
rc = llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
/* we are done if we only write the header or on error */
if (rc || idx == 0)
RETURN(rc);
return rc;
if (buf) {
/* We assume that caller has set lgh_cur_* */
@ -271,7 +271,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
if (rec->lrh_index != loghandle->lgh_cur_idx) {
CERROR("modify idx mismatch %u/%d\n",
idx, loghandle->lgh_cur_idx);
RETURN(-EFAULT);
return -EFAULT;
}
} else {
/* Assumes constant lrh_len */
@ -284,7 +284,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
reccookie->lgc_index = idx;
rc = 1;
}
RETURN(rc);
return rc;
}
/* Make sure that records don't cross a chunk boundary, so we can
@ -302,12 +302,12 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
index = loghandle->lgh_last_idx + 1;
rc = llog_lvfs_pad(obd, file, left, index);
if (rc)
RETURN(rc);
return rc;
loghandle->lgh_last_idx++; /*for pad rec*/
}
/* if it's the last idx in log file, then return -ENOSPC */
if (loghandle->lgh_last_idx >= LLOG_BITMAP_SIZE(llh) - 1)
RETURN(-ENOSPC);
return -ENOSPC;
loghandle->lgh_last_idx++;
index = loghandle->lgh_last_idx;
LASSERT(index < LLOG_BITMAP_SIZE(llh));
@ -333,11 +333,11 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
rc = llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
if (rc)
RETURN(rc);
return rc;
rc = llog_lvfs_write_blob(obd, file, rec, buf, file->f_pos);
if (rc)
RETURN(rc);
return rc;
CDEBUG(D_RPCTRACE, "added record "DOSTID": idx: %u, %u \n",
POSTID(&loghandle->lgh_id.lgl_oi), index, rec->lrh_len);
@ -356,7 +356,7 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
if (rc == 0 && rec->lrh_type == LLOG_GEN_REC)
rc = 1;
RETURN(rc);
return rc;
}
/* We can skip reading at least as many log blocks as the number of
@ -387,7 +387,7 @@ static int llog_lvfs_next_block(const struct lu_env *env,
int rc;
if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
RETURN(-EINVAL);
return -EINVAL;
CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n",
next_idx, *cur_idx, *cur_offset);
@ -412,7 +412,7 @@ static int llog_lvfs_next_block(const struct lu_env *env,
POSTID(&loghandle->lgh_id.lgl_oi),
loghandle->lgh_id.lgl_ogen,
*cur_offset);
RETURN(rc);
return rc;
}
/* put number of bytes read into rc to make code simpler */
@ -423,13 +423,13 @@ static int llog_lvfs_next_block(const struct lu_env *env,
}
if (rc == 0) /* end of file, nothing to do */
RETURN(0);
return 0;
if (rc < sizeof(*tail)) {
CERROR("Invalid llog block at log id "DOSTID"/%u offset"
LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
loghandle->lgh_id.lgl_ogen, *cur_offset);
RETURN(-EINVAL);
return -EINVAL;
}
rec = buf;
@ -454,7 +454,7 @@ static int llog_lvfs_next_block(const struct lu_env *env,
CERROR("Invalid llog tail at log id "DOSTID"/%u offset "
LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
loghandle->lgh_id.lgl_ogen, *cur_offset);
RETURN(-EINVAL);
return -EINVAL;
}
if (tail->lrt_index < next_idx)
continue;
@ -464,11 +464,11 @@ static int llog_lvfs_next_block(const struct lu_env *env,
if (rec->lrh_index > next_idx) {
CERROR("missed desired record? %u > %u\n",
rec->lrh_index, next_idx);
RETURN(-ENOENT);
return -ENOENT;
}
RETURN(0);
return 0;
}
RETURN(-EIO);
return -EIO;
}
static int llog_lvfs_prev_block(const struct lu_env *env,
@ -479,7 +479,7 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
int rc;
if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
RETURN(-EINVAL);
return -EINVAL;
CDEBUG(D_OTHER, "looking for log index %u\n", prev_idx);
@ -500,20 +500,20 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
POSTID(&loghandle->lgh_id.lgl_oi),
loghandle->lgh_id.lgl_ogen,
cur_offset);
RETURN(rc);
return rc;
}
/* put number of bytes read into rc to make code simpler */
rc = cur_offset - ppos;
if (rc == 0) /* end of file, nothing to do */
RETURN(0);
return 0;
if (rc < sizeof(*tail)) {
CERROR("Invalid llog block at log id "DOSTID"/%u offset"
LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
loghandle->lgh_id.lgl_ogen, cur_offset);
RETURN(-EINVAL);
return -EINVAL;
}
rec = buf;
@ -536,7 +536,7 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
CERROR("Invalid llog tail at log id "DOSTID"/%u offset"
LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
loghandle->lgh_id.lgl_ogen, cur_offset);
RETURN(-EINVAL);
return -EINVAL;
}
if (tail->lrt_index < prev_idx)
continue;
@ -546,11 +546,11 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
if (rec->lrh_index > prev_idx) {
CERROR("missed desired record? %u > %u\n",
rec->lrh_index, prev_idx);
RETURN(-ENOENT);
return -ENOENT;
}
RETURN(0);
return 0;
}
RETURN(-EIO);
return -EIO;
}
static struct file *llog_filp_open(char *dir, char *name, int flags, int mode)
@ -651,12 +651,12 @@ static int llog_lvfs_open(const struct lu_env *env, struct llog_handle *handle,
if (open_param != LLOG_OPEN_NEW && handle->lgh_file == NULL)
GOTO(out_name, rc = -ENOENT);
RETURN(0);
return 0;
out_name:
if (handle->lgh_name != NULL)
OBD_FREE(handle->lgh_name, strlen(name) + 1);
out:
RETURN(rc);
return rc;
}
static int llog_lvfs_exist(struct llog_handle *handle)
@ -687,7 +687,7 @@ static int llog_lvfs_create(const struct lu_env *env,
file = llog_filp_open(MOUNT_CONFIGS_DIR, handle->lgh_name,
open_flags, 0644);
if (IS_ERR(file))
RETURN(PTR_ERR(file));
return PTR_ERR(file);
lustre_build_llog_lvfs_oid(&handle->lgh_id,
file->f_dentry->d_inode->i_ino,
@ -696,7 +696,7 @@ static int llog_lvfs_create(const struct lu_env *env,
} else {
OBDO_ALLOC(oa);
if (oa == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
ostid_set_seq_llog(&oa->o_oi);
oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
@ -724,7 +724,7 @@ static int llog_lvfs_create(const struct lu_env *env,
out:
OBDO_FREE(oa);
}
RETURN(rc);
return rc;
}
static int llog_lvfs_close(const struct lu_env *env,
@ -733,7 +733,7 @@ static int llog_lvfs_close(const struct lu_env *env,
int rc;
if (handle->lgh_file == NULL)
RETURN(0);
return 0;
rc = filp_close(handle->lgh_file, 0);
if (rc)
CERROR("%s: error closing llog #"DOSTID"#%08x: "
@ -745,7 +745,7 @@ static int llog_lvfs_close(const struct lu_env *env,
OBD_FREE(handle->lgh_name, strlen(handle->lgh_name) + 1);
handle->lgh_name = NULL;
}
RETURN(rc);
return rc;
}
static int llog_lvfs_destroy(const struct lu_env *env,
@ -780,12 +780,12 @@ static int llog_lvfs_destroy(const struct lu_env *env,
dput(fdentry);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
return rc;
}
OBDO_ALLOC(oa);
if (oa == NULL)
RETURN(-ENOMEM);
return -ENOMEM;
oa->o_oi = handle->lgh_id.lgl_oi;
oa->o_generation = handle->lgh_id.lgl_ogen;
@ -810,7 +810,7 @@ static int llog_lvfs_destroy(const struct lu_env *env,
rc = rc1;
out:
OBDO_FREE(oa);
RETURN(rc);
return rc;
}
static int llog_lvfs_declare_create(const struct lu_env *env,

View File

@ -138,7 +138,7 @@ int llog_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
l_wait_event(olg->olg_waitq,
llog_group_ctxt_null(olg, idx), &lwi);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cleanup);
@ -150,13 +150,13 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
int rc = 0;
if (index < 0 || index >= LLOG_MAX_CTXTS)
RETURN(-EINVAL);
return -EINVAL;
LASSERT(olg != NULL);
ctxt = llog_new_ctxt(obd);
if (!ctxt)
RETURN(-ENOMEM);
return -ENOMEM;
ctxt->loc_obd = obd;
ctxt->loc_olg = olg;
@ -187,7 +187,7 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
}
rc = 0;
}
RETURN(rc);
return rc;
}
if (op->lop_setup) {
@ -208,7 +208,7 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
ctxt->loc_flags &= ~LLOG_CTXT_FLAG_UNINITIALIZED;
}
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_setup);
@ -217,12 +217,12 @@ int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags)
int rc = 0;
if (!ctxt)
RETURN(0);
return 0;
if (CTXTP(ctxt, sync))
rc = CTXTP(ctxt, sync)(ctxt, exp, flags);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_sync);
@ -234,11 +234,11 @@ int llog_obd_add(const struct lu_env *env, struct llog_ctxt *ctxt,
if (!ctxt) {
CERROR("No ctxt\n");
RETURN(-ENODEV);
return -ENODEV;
}
if (ctxt->loc_flags & LLOG_CTXT_FLAG_UNINITIALIZED)
RETURN(-ENXIO);
return -ENXIO;
CTXT_CHECK_OP(ctxt, obd_add, -EOPNOTSUPP);
raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
@ -248,7 +248,7 @@ int llog_obd_add(const struct lu_env *env, struct llog_ctxt *ctxt,
numcookies);
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_obd_add);
@ -260,12 +260,12 @@ int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
if (!ctxt) {
CERROR("No ctxt\n");
RETURN(-ENODEV);
return -ENODEV;
}
CTXT_CHECK_OP(ctxt, cancel, -EOPNOTSUPP);
rc = CTXTP(ctxt, cancel)(env, ctxt, lsm, count, cookies, flags);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_cancel);
@ -278,7 +278,7 @@ int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
OBD_COUNTER_INCREMENT(obd, llog_init);
rc = OBP(obd, llog_init)(obd, olg, disk_obd, index);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(obd_llog_init);
@ -290,7 +290,7 @@ int obd_llog_finish(struct obd_device *obd, int count)
OBD_COUNTER_INCREMENT(obd, llog_finish);
rc = OBP(obd, llog_finish)(obd, count);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(obd_llog_finish);

View File

@ -120,7 +120,7 @@ static int llog_osd_pad(const struct lu_env *env, struct dt_object *o,
o->do_lu.lo_dev->ld_obd->obd_name, rc);
out:
dt_write_unlock(env, o);
RETURN(rc);
return rc;
}
static int llog_osd_write_blob(const struct lu_env *env, struct dt_object *o,
@ -195,7 +195,7 @@ out:
dt_attr_set(env, o, &lgi->lgi_attr, th, BYPASS_CAPA);
}
RETURN(rc);
return rc;
}
static int llog_osd_read_header(const struct lu_env *env,
@ -215,13 +215,13 @@ static int llog_osd_read_header(const struct lu_env *env,
rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
if (rc)
RETURN(rc);
return rc;
LASSERT(lgi->lgi_attr.la_valid & LA_SIZE);
if (lgi->lgi_attr.la_size == 0) {
CDEBUG(D_HA, "not reading header from 0-byte log\n");
RETURN(LLOG_EEMPTY);
return LLOG_EEMPTY;
}
lgi->lgi_off = 0;
@ -233,7 +233,7 @@ static int llog_osd_read_header(const struct lu_env *env,
CERROR("%s: error reading log header from "DFID": rc = %d\n",
o->do_lu.lo_dev->ld_obd->obd_name,
PFID(lu_object_fid(&o->do_lu)), rc);
RETURN(rc);
return rc;
}
llh_hdr = &handle->lgh_hdr->llh_hdr;
@ -246,7 +246,7 @@ static int llog_osd_read_header(const struct lu_env *env,
handle->lgh_name ? handle->lgh_name : "",
PFID(lu_object_fid(&o->do_lu)),
llh_hdr->lrh_type, LLOG_HDR_MAGIC);
RETURN(-EIO);
return -EIO;
} else if (llh_hdr->lrh_len != LLOG_CHUNK_SIZE) {
CERROR("%s: incorrectly sized log %s "DFID" header: "
"%#x (expected %#x)\n"
@ -255,12 +255,12 @@ static int llog_osd_read_header(const struct lu_env *env,
handle->lgh_name ? handle->lgh_name : "",
PFID(lu_object_fid(&o->do_lu)),
llh_hdr->lrh_len, LLOG_CHUNK_SIZE);
RETURN(-EIO);
return -EIO;
}
handle->lgh_last_idx = handle->lgh_hdr->llh_tail.lrt_index;
RETURN(0);
return 0;
}
static int llog_osd_declare_write_rec(const struct lu_env *env,
@ -283,18 +283,18 @@ static int llog_osd_declare_write_rec(const struct lu_env *env,
rc = dt_declare_record_write(env, o, sizeof(struct llog_log_hdr), 0,
th);
if (rc || idx == 0) /* if error or just header */
RETURN(rc);
return rc;
if (dt_object_exists(o)) {
rc = dt_attr_get(env, o, &lgi->lgi_attr, BYPASS_CAPA);
lgi->lgi_off = lgi->lgi_attr.la_size;
LASSERT(ergo(rc == 0, lgi->lgi_attr.la_valid & LA_SIZE));
if (rc)
RETURN(rc);
return rc;
rc = dt_declare_punch(env, o, lgi->lgi_off, OBD_OBJECT_EOF, th);
if (rc)
RETURN(rc);
return rc;
} else {
lgi->lgi_off = 0;
}
@ -302,7 +302,7 @@ static int llog_osd_declare_write_rec(const struct lu_env *env,
/* XXX: implement declared window or multi-chunks approach */
rc = dt_declare_record_write(env, o, 32 * 1024, lgi->lgi_off, th);
RETURN(rc);
return rc;
}
/* returns negative in on error; 0 if success && reccookie == 0; 1 otherwise */
@ -338,11 +338,11 @@ static int llog_osd_write_rec(const struct lu_env *env,
else
rc = (reclen > LLOG_CHUNK_SIZE) ? -E2BIG : 0;
if (rc)
RETURN(rc);
return rc;
rc = dt_attr_get(env, o, &lgi->lgi_attr, NULL);
if (rc)
RETURN(rc);
return rc;
if (buf)
/* write_blob adds header and tail to lrh_len. */
@ -355,7 +355,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
LBUG();
if (idx && llh->llh_size && llh->llh_size != rec->lrh_len)
RETURN(-EINVAL);
return -EINVAL;
if (!ext2_test_bit(idx, llh->llh_bitmap))
CERROR("%s: modify unset record %u\n",
@ -370,7 +370,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
&lgi->lgi_off, th);
/* we are done if we only write the header or on error */
if (rc || idx == 0)
RETURN(rc);
return rc;
if (buf) {
/* We assume that caller has set lgh_cur_* */
@ -386,7 +386,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
CERROR("%s: modify idx mismatch %u/%d\n",
o->do_lu.lo_dev->ld_obd->obd_name, idx,
loghandle->lgh_cur_idx);
RETURN(-EFAULT);
return -EFAULT;
}
} else {
/* Assumes constant lrh_len */
@ -399,7 +399,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
reccookie->lgc_index = idx;
rc = 1;
}
RETURN(rc);
return rc;
}
/* Make sure that records don't cross a chunk boundary, so we can
@ -418,12 +418,12 @@ static int llog_osd_write_rec(const struct lu_env *env,
index = loghandle->lgh_last_idx + 1;
rc = llog_osd_pad(env, o, &lgi->lgi_off, left, index, th);
if (rc)
RETURN(rc);
return rc;
loghandle->lgh_last_idx++; /*for pad rec*/
}
/* if it's the last idx in log file, then return -ENOSPC */
if (loghandle->lgh_last_idx >= LLOG_BITMAP_SIZE(llh) - 1)
RETURN(-ENOSPC);
return -ENOSPC;
loghandle->lgh_last_idx++;
index = loghandle->lgh_last_idx;
@ -495,7 +495,7 @@ out:
reccookie->lgc_subsys = -1;
rc = 1;
}
RETURN(rc);
return rc;
}
/* We can skip reading at least as many log blocks as the number of
@ -531,7 +531,7 @@ static int llog_osd_next_block(const struct lu_env *env,
LASSERT(lgi);
if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
RETURN(-EINVAL);
return -EINVAL;
CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n",
next_idx, *cur_idx, *cur_offset);
@ -653,7 +653,7 @@ static int llog_osd_prev_block(const struct lu_env *env,
int rc;
if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
RETURN(-EINVAL);
return -EINVAL;
CDEBUG(D_OTHER, "looking for log index %u\n", prev_idx);
@ -789,7 +789,7 @@ static int llog_osd_open(const struct lu_env *env, struct llog_handle *handle,
ls = ls_device_get(dt);
if (IS_ERR(ls))
RETURN(PTR_ERR(ls));
return PTR_ERR(ls);
mutex_lock(&ls->ls_los_mutex);
los = dt_los_find(ls, name != NULL ? FID_SEQ_LLOG_NAME : FID_SEQ_LLOG);
@ -844,7 +844,7 @@ static int llog_osd_open(const struct lu_env *env, struct llog_handle *handle,
handle->private_data = los;
LASSERT(handle->lgh_ctxt);
RETURN(rc);
return rc;
out_put:
lu_object_put(env, &o->do_lu);
@ -853,7 +853,7 @@ out_name:
OBD_FREE(handle->lgh_name, strlen(name) + 1);
out:
dt_los_put(los);
RETURN(rc);
return rc;
}
static int llog_osd_exist(struct llog_handle *handle)
@ -877,25 +877,25 @@ static int llog_osd_declare_create(const struct lu_env *env,
/* object can be created by another thread */
o = res->lgh_obj;
if (dt_object_exists(o))
RETURN(0);
return 0;
los = res->private_data;
LASSERT(los);
rc = llog_osd_declare_new_object(env, los, o, th);
if (rc)
RETURN(rc);
return rc;
rc = dt_declare_record_write(env, o, LLOG_CHUNK_SIZE, 0, th);
if (rc)
RETURN(rc);
return rc;
if (res->lgh_name) {
struct dt_object *llog_dir;
llog_dir = llog_osd_dir_get(env, res->lgh_ctxt);
if (IS_ERR(llog_dir))
RETURN(PTR_ERR(llog_dir));
return PTR_ERR(llog_dir);
logid_to_fid(&res->lgh_id, &lgi->lgi_fid);
rc = dt_declare_insert(env, llog_dir,
(struct dt_rec *)&lgi->lgi_fid,
@ -906,7 +906,7 @@ static int llog_osd_declare_create(const struct lu_env *env,
o->do_lu.lo_dev->ld_obd->obd_name,
res->lgh_name, rc);
}
RETURN(rc);
return rc;
}
/* This is a callback from the llog_* functions.
@ -925,7 +925,7 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
/* llog can be already created */
if (dt_object_exists(o))
RETURN(-EEXIST);
return -EEXIST;
los = res->private_data;
LASSERT(los);
@ -938,14 +938,14 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
dt_write_unlock(env, o);
if (rc)
RETURN(rc);
return rc;
if (res->lgh_name) {
struct dt_object *llog_dir;
llog_dir = llog_osd_dir_get(env, res->lgh_ctxt);
if (IS_ERR(llog_dir))
RETURN(PTR_ERR(llog_dir));
return PTR_ERR(llog_dir);
logid_to_fid(&res->lgh_id, &lgi->lgi_fid);
dt_read_lock(env, llog_dir, 0);
@ -960,7 +960,7 @@ static int llog_osd_create(const struct lu_env *env, struct llog_handle *res,
o->do_lu.lo_dev->ld_obd->obd_name,
res->lgh_name, rc);
}
RETURN(rc);
return rc;
}
static int llog_osd_close(const struct lu_env *env, struct llog_handle *handle)
@ -979,7 +979,7 @@ static int llog_osd_close(const struct lu_env *env, struct llog_handle *handle)
if (handle->lgh_name)
OBD_FREE(handle->lgh_name, strlen(handle->lgh_name) + 1);
RETURN(rc);
return rc;
}
static int llog_osd_destroy(const struct lu_env *env,
@ -1004,7 +1004,7 @@ static int llog_osd_destroy(const struct lu_env *env,
th = dt_trans_create(env, d);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
return PTR_ERR(th);
if (loghandle->lgh_name) {
llog_dir = llog_osd_dir_get(env, ctxt);
@ -1054,7 +1054,7 @@ out_trans:
dt_trans_stop(env, d, th);
if (llog_dir != NULL)
lu_object_put(env, &llog_dir->do_lu);
RETURN(rc);
return rc;
}
static int llog_osd_setup(const struct lu_env *env, struct obd_device *obd,
@ -1101,7 +1101,7 @@ static int llog_osd_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
dt = ctxt->loc_exp->exp_obd->obd_lvfs_ctxt.dt;
ls = ls_device_get(dt);
if (IS_ERR(ls))
RETURN(PTR_ERR(ls));
return PTR_ERR(ls);
mutex_lock(&ls->ls_los_mutex);
los = dt_los_find(ls, FID_SEQ_LLOG);
@ -1154,7 +1154,7 @@ int llog_osd_get_cat_list(const struct lu_env *env, struct dt_device *d,
o = dt_locate(env, d, &lgi->lgi_fid);
if (IS_ERR(o))
RETURN(PTR_ERR(o));
return PTR_ERR(o);
if (!dt_object_exists(o)) {
th = dt_trans_create(env, d);
@ -1223,7 +1223,7 @@ out_trans:
out:
lu_object_put(env, &o->do_lu);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_osd_get_cat_list);
@ -1237,7 +1237,7 @@ int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d,
int rc, size;
if (!count)
RETURN(0);
return 0;
LASSERT(d);
@ -1248,7 +1248,7 @@ int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d,
o = dt_locate(env, d, &lgi->lgi_fid);
if (IS_ERR(o))
RETURN(PTR_ERR(o));
return PTR_ERR(o);
if (!dt_object_exists(o))
GOTO(out, rc = -ENOENT);
@ -1285,6 +1285,6 @@ out_trans:
dt_trans_stop(env, d, th);
out:
lu_object_put(env, &o->do_lu);
RETURN(rc);
return rc;
}
EXPORT_SYMBOL(llog_osd_put_cat_list);

View File

@ -78,22 +78,22 @@ static int verify_handle(char *test, struct llog_handle *llh, int num_recs)
if (active_recs != num_recs) {
CERROR("%s: expected %d active recs after write, found %d\n",
test, num_recs, active_recs);
RETURN(-ERANGE);
return -ERANGE;
}
if (llh->lgh_hdr->llh_count != num_recs) {
CERROR("%s: handle->count is %d, expected %d after write\n",
test, llh->lgh_hdr->llh_count, num_recs);
RETURN(-ERANGE);
return -ERANGE;
}
if (llh->lgh_last_idx < last_idx) {
CERROR("%s: handle->last_idx is %d, expected %d after write\n",
test, llh->lgh_last_idx, last_idx);
RETURN(-ERANGE);
return -ERANGE;
}
RETURN(0);
return 0;
}
/* Test named-log create/open, close */
@ -132,7 +132,7 @@ out_close:
}
out:
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
/* Test named-log reopen; returns opened log on success */
@ -209,7 +209,7 @@ out_close_llh:
out_put:
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
/* Test record writing, single and in bulk */
@ -228,12 +228,12 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
num_recs++;
if (rc < 0) {
CERROR("3a: write one log record failed: %d\n", rc);
RETURN(rc);
return rc;
}
rc = verify_handle("3a", llh, num_recs);
if (rc)
RETURN(rc);
return rc;
CWARN("3b: write 10 cfg log records with 8 bytes bufs\n");
for (i = 0; i < 10; i++) {
@ -247,14 +247,14 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
if (rc < 0) {
CERROR("3b: write 10 records failed at #%d: %d\n",
i + 1, rc);
RETURN(rc);
return rc;
}
num_recs++;
}
rc = verify_handle("3b", llh, num_recs);
if (rc)
RETURN(rc);
return rc;
CWARN("3c: write 1000 more log records\n");
for (i = 0; i < 1000; i++) {
@ -262,14 +262,14 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
if (rc < 0) {
CERROR("3c: write 1000 records failed at #%d: %d\n",
i + 1, rc);
RETURN(rc);
return rc;
}
num_recs++;
}
rc = verify_handle("3c", llh, num_recs);
if (rc)
RETURN(rc);
return rc;
CWARN("3d: write log more than BITMAP_SIZE, return -ENOSPC\n");
for (i = 0; i < LLOG_BITMAP_SIZE(llh->lgh_hdr) + 1; i++) {
@ -293,20 +293,20 @@ static int llog_test_3(const struct lu_env *env, struct obd_device *obd,
} else if (rc < 0) {
CERROR("3d: write recs failed at #%d: %d\n",
i + 1, rc);
RETURN(rc);
return rc;
}
num_recs++;
}
if (rc != -ENOSPC) {
CWARN("3d: write record more than BITMAP size!\n");
RETURN(-EINVAL);
return -EINVAL;
}
CWARN("3d: wrote %d more records before end of llog is reached\n",
num_recs);
rc = verify_handle("3d", llh, num_recs);
RETURN(rc);
return rc;
}
/* Test catalogue additions */
@ -416,7 +416,7 @@ out:
}
ctxt_release:
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
static int cat_counter;
@ -429,7 +429,7 @@ static int cat_print_cb(const struct lu_env *env, struct llog_handle *llh,
if (rec->lrh_type != LLOG_LOGID_MAGIC) {
CERROR("invalid record in catalog\n");
RETURN(-EINVAL);
return -EINVAL;
}
logid_to_fid(&lir->lid_id, &fid);
@ -440,7 +440,7 @@ static int cat_print_cb(const struct lu_env *env, struct llog_handle *llh,
cat_counter++;
RETURN(0);
return 0;
}
static int plain_counter;
@ -452,7 +452,7 @@ static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
CERROR("log is not plain\n");
RETURN(-EINVAL);
return -EINVAL;
}
logid_to_fid(&llh->lgh_id, &fid);
@ -462,7 +462,7 @@ static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
plain_counter++;
RETURN(0);
return 0;
}
static int cancel_count;
@ -475,7 +475,7 @@ static int llog_cancel_rec_cb(const struct lu_env *env,
if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
CERROR("log is not plain\n");
RETURN(-EINVAL);
return -EINVAL;
}
cookie.lgc_lgl = llh->lgh_id;
@ -484,8 +484,8 @@ static int llog_cancel_rec_cb(const struct lu_env *env,
llog_cat_cancel_records(env, llh->u.phd.phd_cat_handle, 1, &cookie);
cancel_count++;
if (cancel_count == LLOG_TEST_RECNUM)
RETURN(-LLOG_EEMPTY);
RETURN(0);
return -LLOG_EEMPTY;
return 0;
}
/* Test log and catalogue processing */
@ -592,7 +592,7 @@ out:
out_put:
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
/* Test client api; open log by name and process */
@ -676,7 +676,7 @@ nctxt_put:
llog_ctxt_put(nctxt);
ctxt_release:
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
static union {
@ -721,7 +721,7 @@ static int llog_test_7_sub(const struct lu_env *env, struct llog_ctxt *ctxt)
rc = llog_open_create(env, ctxt, &llh, NULL, NULL);
if (rc) {
CERROR("7_sub: create log failed\n");
RETURN(rc);
return rc;
}
rc = llog_init_handle(env, llh,
@ -792,7 +792,7 @@ out_close:
if (rc)
llog_destroy(env, llh);
llog_close(env, llh);
RETURN(rc);
return rc;
}
/* Test all llog records writing and processing */
@ -881,7 +881,7 @@ static int llog_test_7(const struct lu_env *env, struct obd_device *obd)
}
out:
llog_ctxt_put(ctxt);
RETURN(rc);
return rc;
}
/* -------------------------------------------------------------------------
@ -957,14 +957,14 @@ static int llog_test_cleanup(struct obd_device *obd)
rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD);
if (rc)
RETURN(rc);
return rc;
tgt = obd->obd_lvfs_ctxt.dt->dd_lu_dev.ld_obd;
rc = llog_cleanup(&env, llog_get_context(tgt, LLOG_TEST_ORIG_CTXT));
if (rc)
CERROR("failed to llog_test_llog_finish: %d\n", rc);
lu_env_fini(&env);
RETURN(rc);
return rc;
}
static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
@ -978,12 +978,12 @@ static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
if (lcfg->lcfg_bufcount < 2) {
CERROR("requires a TARGET OBD name\n");
RETURN(-EINVAL);
return -EINVAL;
}
if (lcfg->lcfg_buflens[1] < 1) {
CERROR("requires a TARGET OBD name\n");
RETURN(-EINVAL);
return -EINVAL;
}
/* disk obd */
@ -991,12 +991,12 @@ static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
if (!tgt || !tgt->obd_attached || !tgt->obd_set_up) {
CERROR("target device not attached or not set up (%s)\n",
lustre_cfg_string(lcfg, 1));
RETURN(-EINVAL);
return -EINVAL;
}
rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD);
if (rc)
RETURN(rc);
return rc;
rc = lu_context_init(&test_session, LCT_SESSION);
if (rc)
@ -1037,7 +1037,7 @@ cleanup_session:
lu_context_fini(&test_session);
cleanup_env:
lu_env_fini(&env);
RETURN(rc);
return rc;
}
static struct obd_ops llog_obd_ops = {

Some files were not shown because too many files have changed in this diff Show More