{
struct fld_cache *cache;
- LASSERT(name != NULL);
+ LASSERT(name);
LASSERT(cache_threshold < cache_size);
cache = kzalloc(sizeof(*cache), GFP_NOFS);
{
__u64 pct;
- LASSERT(cache != NULL);
+ LASSERT(cache);
fld_cache_flush(cache);
if (cache->fci_stat.fst_count > 0) {
struct list_head *curr;
int num = 0;
- LASSERT(cache != NULL);
-
if (cache->fci_cache_count < cache->fci_cache_size)
return 0;
}
}
- if (prev == NULL)
+ if (!prev)
prev = head;
CDEBUG(D_INFO, "insert range "DRANGE"\n", PRANGE(&f_new->fce_range));
cache->fci_stat.fst_count++;
list_for_each_entry(flde, head, fce_list) {
if (flde->fce_range.lsr_start > seq) {
- if (prev != NULL)
+ if (prev)
*range = prev->fce_range;
break;
}
fld->lcf_name, hash, seq, fld->lcf_count);
list_for_each_entry(target, &fld->lcf_targets, ft_chain) {
- const char *srv_name = target->ft_srv != NULL ?
+ const char *srv_name = target->ft_srv ?
target->ft_srv->lsf_name : "<null>";
- const char *exp_name = target->ft_exp != NULL ?
+ const char *exp_name = target->ft_exp ?
(char *)target->ft_exp->exp_obd->obd_uuid.uuid :
"<null>";
{
struct lu_fld_target *target;
- LASSERT(fld->lcf_hash != NULL);
+ LASSERT(fld->lcf_hash);
spin_lock(&fld->lcf_lock);
target = fld->lcf_hash->fh_scan_func(fld, seq);
spin_unlock(&fld->lcf_lock);
- if (target != NULL) {
+ if (target) {
CDEBUG(D_INFO, "%s: Found target (idx %llu) by seq %#llx\n",
fld->lcf_name, target->ft_idx, seq);
}
const char *name;
struct lu_fld_target *target, *tmp;
- LASSERT(tar != NULL);
+ LASSERT(tar);
name = fld_target_name(tar);
- LASSERT(name != NULL);
- LASSERT(tar->ft_srv != NULL || tar->ft_exp != NULL);
+ LASSERT(name);
+ LASSERT(tar->ft_srv || tar->ft_exp);
if (fld->lcf_flags != LUSTRE_FLD_INIT) {
CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip it\n",
}
target->ft_exp = tar->ft_exp;
- if (target->ft_exp != NULL)
+ if (target->ft_exp)
class_export_get(target->ft_exp);
target->ft_srv = tar->ft_srv;
target->ft_idx = tar->ft_idx;
list_del(&target->ft_chain);
spin_unlock(&fld->lcf_lock);
- if (target->ft_exp != NULL)
+ if (target->ft_exp)
class_export_put(target->ft_exp);
kfree(target);
int cache_size, cache_threshold;
int rc;
- LASSERT(fld != NULL);
-
snprintf(fld->lcf_name, sizeof(fld->lcf_name),
"cli-%s", prefix);
&fld->lcf_targets, ft_chain) {
fld->lcf_count--;
list_del(&target->ft_chain);
- if (target->ft_exp != NULL)
+ if (target->ft_exp)
class_export_put(target->ft_exp);
kfree(target);
}
spin_unlock(&fld->lcf_lock);
- if (fld->lcf_cache != NULL) {
+ if (fld->lcf_cache) {
if (!IS_ERR(fld->lcf_cache))
fld_cache_fini(fld->lcf_cache);
fld->lcf_cache = NULL;
int rc;
struct obd_import *imp;
- LASSERT(exp != NULL);
+ LASSERT(exp);
imp = class_exp2cliimp(exp);
req = ptlrpc_request_alloc_pack(imp, &RQF_FLD_QUERY, LUSTRE_MDS_VERSION,
FLD_QUERY);
- if (req == NULL)
+ if (!req)
return -ENOMEM;
op = req_capsule_client_get(&req->rq_pill, &RMF_FLD_OPC);
goto out_req;
prange = req_capsule_server_get(&req->rq_pill, &RMF_FLD_MDFLD);
- if (prange == NULL) {
+ if (!prange) {
rc = -EFAULT;
goto out_req;
}
/* Can not find it in the cache */
target = fld_client_get_target(fld, seq);
- LASSERT(target != NULL);
+ LASSERT(target);
CDEBUG(D_INFO, "%s: Lookup fld entry (seq: %#llx) on target %s (idx %llu)\n",
fld->lcf_name, seq, fld_target_name(target), target->ft_idx);
struct lu_client_fld *fld = (struct lu_client_fld *)m->private;
struct lu_fld_target *target;
- LASSERT(fld != NULL);
-
spin_lock(&fld->lcf_lock);
list_for_each_entry(target,
&fld->lcf_targets, ft_chain)
{
struct lu_client_fld *fld = (struct lu_client_fld *)m->private;
- LASSERT(fld != NULL);
-
spin_lock(&fld->lcf_lock);
seq_printf(m, "%s\n", fld->lcf_hash->fh_name);
spin_unlock(&fld->lcf_lock);
return -EFAULT;
fld = ((struct seq_file *)file->private_data)->private;
- LASSERT(fld != NULL);
- for (i = 0; fld_hash[i].fh_name != NULL; i++) {
+ for (i = 0; fld_hash[i].fh_name; i++) {
if (count != strlen(fld_hash[i].fh_name))
continue;
}
}
- if (hash != NULL) {
+ if (hash) {
spin_lock(&fld->lcf_lock);
fld->lcf_hash = hash;
spin_unlock(&fld->lcf_lock);
{
struct lu_client_fld *fld = file->private_data;
- LASSERT(fld != NULL);
-
fld_cache_flush(fld->lcf_cache);
CDEBUG(D_INFO, "%s: Lookup cache is flushed\n", fld->lcf_name);