LASSERT(atomic_read(&page->cp_ref) > 0);
return (atomic_read(&page->cp_ref) > refc);
}
+
#define cl_page_in_use(pg) __page_in_use(pg, 1)
#define cl_page_in_use_noref(pg) __page_in_use(pg, 0)
*/
__s64 lc_array_sum[1];
};
+
#define lc_sum lc_array_sum[0]
#define lc_sum_irq lc_array_sum[1]
ts->m = secs / 60;
ts->s = secs % 60;
}
+
#define DHMS_FMT "%dd%dh%02dm%02ds"
#define DHMS_VARS(x) (x)->d, (x)->h, (x)->m, (x)->s
LMAI_REMOTE_PARENT = 0x00000004, /* the parent of the object
is on the remote MDT */
};
+
#define LMA_INCOMPAT_SUPP (LMAI_AGENT | LMAI_REMOTE_PARENT)
/**
struct lustre_handle {
__u64 cookie;
};
+
#define DEAD_HANDLE_MAGIC 0xdeadbeefcafebabeULL
static inline int lustre_handle_is_used(struct lustre_handle *lh)
__u64 pb_padding[4];
char pb_jobid[JOBSTATS_JOBID_SIZE];
};
+
#define ptlrpc_body ptlrpc_body_v3
struct ptlrpc_body_v2 {
__u64 paddingE; /* added 2.1.0. also fix lustre_swab_connect */
__u64 paddingF; /* added 2.1.0. also fix lustre_swab_connect */
};
+
/* XXX README XXX:
* Please DO NOT use any fields here before first ensuring that this same
* field is not in use on some other branch. Please clear any such changes
LQUOTA_LAST_RES,
LQUOTA_FIRST_RES = LQUOTA_RES_MD
};
+
#define LQUOTA_NR_RES (LQUOTA_LAST_RES - LQUOTA_FIRST_RES + 1)
/*
__u64 gl_time;
__u64 gl_pad2;
};
+
#define gl_qunit gl_hardlimit /* current qunit value used when
* glimpsing per-ID quota locks */
__u64 idv_version;
__u64 idv_flags; /* See LL_DV_xxx */
};
+
#define LL_DV_NOFLUSH 0x01 /* Do not take READ EXTENT LOCK before sampling
version. Dirty caches are left unchanged. */
HPS_RUNNING = 2,
HPS_DONE = 3,
};
+
#define HPS_NONE 0
static inline char *hsm_progress_state2name(enum hsm_progress_states s)
{
return (val + 7) & (~0x7);
}
+
#define HAVE_CFS_SIZE_ROUND
#endif
hal_fsname)
+ 1));
}
+
/* Return pointer to next hai */
static inline struct hsm_action_item *hai_next(struct hsm_action_item *hai)
{
struct list_head li_group; /* the locks which have the same
* policy - group of the policy */
};
+
#define to_ldlm_interval(n) container_of(n, struct ldlm_interval, li_node)
/**
unsigned int h_size:31;
unsigned int h_in:1;
};
+
#define RCU2HANDLE(rcu) container_of(rcu, struct portals_handle, h_rcu)
/* handles.c */
at->at_worst_time = ktime_get_real_seconds();
spin_unlock(&at->at_lock);
}
+
static inline void at_init(struct adaptive_timeout *at, int val, int flags)
{
memset(at, 0, sizeof(*at));
at->at_flags = flags;
at_reset(at, val);
}
+
extern unsigned int at_min;
static inline int at_get(struct adaptive_timeout *at)
{
return (at->at_current > at_min) ? at->at_current : at_min;
}
+
int at_measured(struct adaptive_timeout *at, unsigned int val);
int import_at_get_index(struct obd_import *imp, int portal);
extern unsigned int at_max;
__u32 och_magic;
fmode_t och_flags;
};
+
#define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed
/* statfs_pack.c */
*/
return nrq->nr_enqueued && !nrq->nr_started && !req->rq_hp;
}
+
/** @} nrs */
/**
{
__ptlrpc_free_bulk(bulk, 1);
}
+
static inline void ptlrpc_free_bulk_nopin(struct ptlrpc_bulk_desc *bulk)
{
__ptlrpc_free_bulk(bulk, 0);
}
+
void __ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc,
struct page *page, int pageoffset, int len, int);
static inline void ptlrpc_prep_bulk_page_pin(struct ptlrpc_bulk_desc *desc,
enum timeout_event {
TIMEOUT_GRANT = 1
};
+
struct timeout_item;
typedef int (*timeout_cb_t)(struct timeout_item *, void *);
int ptlrpc_pinger_add_import(struct obd_import *imp);
/* hash tables for osc_quota_info */
struct cfs_hash *cl_quota_hash[MAXQUOTAS];
};
+
#define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)
struct obd_id_info {
struct obd_info lsd_oi;
struct obd_statfs lsd_statfs;
};
+
/* Stripe placement optimization */
struct lov_qos {
struct list_head lq_oss_list; /* list of OSSs that targets use */
int cfg_last_idx; /* for partial llog processing */
int cfg_flags;
};
+
int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
char *name, struct config_llog_instance *cfg);
enum {
{
return sprintf(buf, "%d\n", ldlm_cancel_unused_locks_before_replay);
}
+
static ssize_t cancel_unused_locks_before_replay_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer,
return 0;
}
+
LPROC_SEQ_FOPS_RO(lprocfs_pool_state);
static ssize_t grant_speed_show(struct kobject *kobj, struct attribute *attr,
ldlm_dump_all_namespaces(LDLM_NAMESPACE_CLIENT, D_DLMTRACE);
return count;
}
+
LPROC_SEQ_FOPS_WR_ONLY(ldlm, dump_ns);
LPROC_SEQ_FOPS_RW_TYPE(ldlm_rw, uint);
return 0;
}
+
#undef MAX_STRING_SIZE
static struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res)
return 0;
}
+
#undef DEBUG_SUBSYSTEM
#define DEBUG_SUBSYSTEM S_LNET
struct file *kr_fp;
__u32 kr_data;
};
+
static struct list_head kkuc_groups[KUC_GRP_MAX+1] = {};
/* Protect message sending against remove and adds */
static DECLARE_RWSEM(kg_sem);
*cksump = __adler32(*cksump, data, len);
return 0;
}
+
static int __adler32_finup(u32 *cksump, const u8 *data, unsigned int len,
u8 *out)
{
return __adler32_finup(crypto_shash_ctx(desc->tfm), data, len,
out);
}
+
static struct shash_alg alg = {
.setkey = adler32_setkey,
.init = adler32_init,
cfs_crypto_test_hashes();
return 0;
}
+
void cfs_crypto_unregister(void)
{
if (adler32 == 0)
return rc;
}
+
int ll_statfs(struct dentry *de, struct kstatfs *sfs)
{
struct super_block *sb = de->d_sb;
*/
return cl_site_stats_print(lu2cl_site(ll_s2sbi(sb)->ll_site), m);
}
+
LPROC_SEQ_FOPS_RO(ll_site_stats);
static ssize_t max_read_ahead_mb_show(struct kobject *kobj,
}
return rc;
}
+
LPROC_SEQ_FOPS(ll_max_cached_mb);
static ssize_t checksum_pages_show(struct kobject *kobj, struct attribute *attr,
atomic_read(&sbi->ll_agl_total));
return 0;
}
+
LPROC_SEQ_FOPS_RO(ll_statahead_stats);
static ssize_t lazystatfs_show(struct kobject *kobj,
seq_printf(m, "\b\n");
return 0;
}
+
LPROC_SEQ_FOPS_RO(ll_sbi_flags);
static ssize_t xattr_cache_show(struct kobject *kobj,
lprocfs_free_stats(&sbi->ll_stats);
}
}
+
#undef MAX_STRING_SIZE
#define pct(a, b) (b ? a * 100 / b : 0)
return len;
}
+
LPROC_SEQ_FOPS(ll_rw_extents_stats);
void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
{
return ras->ras_consecutive_stride_requests > 1;
}
+
/* The function calculates how much pages will be read in
* [off, off + length], in such stride IO area,
* stride_offset = st_off, stride_length = st_len,
seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
return 0;
}
+
LPROC_SEQ_FOPS_RO(lmv_desc_uuid);
static void *lmv_tgt_seq_start(struct seq_file *p, loff_t *pos)
{
sub->sub_reenter++;
}
+
static inline void lov_sub_exit(struct lov_io_sub *sub)
{
sub->sub_reenter--;
io->ci_result = result < 0 ? result : 0;
return result != 0;
}
+
/** @} lov */
desc->ld_default_stripe_size = val;
return count;
}
+
LPROC_SEQ_FOPS(lov_stripesize);
static int lov_stripeoffset_seq_show(struct seq_file *m, void *v)
desc->ld_default_stripe_offset = val;
return count;
}
+
LPROC_SEQ_FOPS(lov_stripeoffset);
static int lov_stripetype_seq_show(struct seq_file *m, void *v)
desc->ld_pattern = val;
return count;
}
+
LPROC_SEQ_FOPS(lov_stripetype);
static int lov_stripecount_seq_show(struct seq_file *m, void *v)
desc->ld_default_stripe_count = val;
return count;
}
+
LPROC_SEQ_FOPS(lov_stripecount);
static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr,
seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid);
return 0;
}
+
LPROC_SEQ_FOPS_RO(lov_desc_uuid);
static void *lov_tgt_seq_start(struct seq_file *p, loff_t *pos)
{
return lprocfs_mgc_rd_ir_state(m, m->private);
}
+
LPROC_SEQ_FOPS_RO(mgc_ir_state);
static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
env, h->coh_nesting, cl_lock_nr_mutexed(env),
func, line);
}
+
#define cl_lock_trace(level, env, prefix, lock) \
cl_lock_trace0(level, env, prefix, lock, __func__, __LINE__)
wait_for_completion(&obd_zombie_start);
return 0;
}
+
/**
* stop destroy zombie import/export thread
*/
flag2str(pingable, first);
return 0;
}
+
#undef flags2str
static void obd_connect_seq_flags2str(struct seq_file *m, __u64 flags, char *sep)
}
}
};
+
/** @} echo_page */
/** \defgroup echo_lock Locking
.coo_io_init = echo_io_init,
.coo_conf_set = echo_conf_set
};
+
/** @} echo_cl_ops */
/** \defgroup echo_lu_ops lu_object operations
.loo_object_print = echo_object_print,
.loo_object_invariant = NULL
};
+
/** @} echo_lu_ops */
/** \defgroup echo_lu_dev_ops lu_device operations
.ldt_ops = &echo_device_type_ops,
.ldt_ctx_tags = LCT_CL_THREAD,
};
+
/** @} echo_init */
/** \defgroup echo_exports Exported operations
cl_env_put(env, &refcheck);
return rc;
}
+
/** @} echo_exports */
static u64 last_object_id;
return count;
}
+
LPROC_SEQ_FOPS(osc_cached_mb);
static ssize_t cur_dirty_bytes_show(struct kobject *kobj,
}
return -EINVAL;
}
+
LPROC_SEQ_FOPS(osc_checksum_type);
static ssize_t resend_count_show(struct kobject *kobj,
return 0;
}
+
#undef pct
static ssize_t osc_rpc_stats_seq_write(struct file *file,
struct hlist_node oqi_hash;
u32 oqi_id;
};
+
int osc_quota_setup(struct obd_device *obd);
int osc_quota_cleanup(struct obd_device *obd);
int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
&RMF_LAYOUT_INTENT,
&RMF_EADATA /* for new layout to be set up */
};
+
static const struct req_msg_field *ldlm_intent_open_server[] = {
&RMF_PTLRPC_BODY,
&RMF_DLM_REP,
seq_printf(m, "%d\n", total);
return 0;
}
+
LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_req_history_len);
static int
return count;
}
+
LPROC_SEQ_FOPS(ptlrpc_lprocfs_req_history_max);
static ssize_t threads_min_show(struct kobject *kobj, struct attribute *attr,
return rc < 0 ? rc : count;
}
+
LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs);
/** @} nrs */
return 0;
}
+
LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_timeouts);
static ssize_t high_priority_ratio_show(struct kobject *kobj,
[BULK_HASH_ALG_SHA384] = CFS_HASH_ALG_SHA384,
[BULK_HASH_ALG_SHA512] = CFS_HASH_ALG_SHA512,
};
+
const char *sptlrpc_get_hash_name(__u8 hash_alg)
{
return cfs_crypto_hash_name(cfs_hash_alg_id[hash_alg]);
return (rule->sr_from != LUSTRE_SP_ANY ||
rule->sr_to != LUSTRE_SP_ANY);
}
+
static inline int rule_spec_net(struct sptlrpc_rule *rule)
{
return (rule->sr_netid != LNET_NIDNET(LNET_NID_ANY));
}
+
static inline int rule_match_dir(struct sptlrpc_rule *r1,
struct sptlrpc_rule *r2)
{
return (r1->sr_from == r2->sr_from && r1->sr_to == r2->sr_to);
}
+
static inline int rule_match_net(struct sptlrpc_rule *r1,
struct sptlrpc_rule *r2)
{
return 0;
}
+
/**
* given from/to/nid, determine a matching flavor in ruleset.
* return 1 if a match found, otherwise return 0.
out:
return 0;
}
+
LPROC_SEQ_FOPS_RO(sptlrpc_info_lprocfs);
static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v)
out:
return 0;
}
+
LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs);
int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)