#ifndef LNET_RDMA_H
#define LNET_RDMA_H
+#define REGSTR2(x) x##_register_nvfs_dma_ops
+#define REGSTR(x) REGSTR2(x)
+
+#define UNREGSTR2(x) x##_unregister_nvfs_dma_ops
+#define UNREGSTR(x) UNREGSTR2(x)
+
+#define MODULE_PREFIX lustre_v1
+
+#define REGISTER_FUNC REGSTR(MODULE_PREFIX)
+#define UNREGISTER_FUNC UNREGSTR(MODULE_PREFIX)
+
struct device;
struct page;
enum dma_data_direction;
struct nvfs_dma_rw_ops;
-int REGISTER_FUNC (struct nvfs_dma_rw_ops *ops);
-
-void UNREGISTER_FUNC (void);
+int REGISTER_FUNC(struct nvfs_dma_rw_ops *ops);
+void UNREGISTER_FUNC(void);
unsigned int lnet_get_dev_prio(struct device *dev,
unsigned int dev_idx);
}
EXPORT_SYMBOL(lnet_mark_ping_buffer_for_update);
-void lnet_update_ping_buffer(struct work_struct *work)
+static void lnet_update_ping_buffer(struct work_struct *work)
{
struct lnet_ping_buffer *pbuf;
struct lnet_handle_md ping_mdh;
false))
lnet_ping_target_update(pbuf, ping_mdh);
-
mutex_unlock(&the_lnet.ln_api_mutex);
}
-
void lnet_queue_ping_buffer_update(void)
{
/* don't queue pb update if it is not needed */
/* MAX / MIN conflict */
#include <lnet/lib-lnet.h>
-#define REGSTR2(x) x##_register_nvfs_dma_ops
-#define REGSTR(x) REGSTR2(x)
-
-#define UNREGSTR2(x) x##_unregister_nvfs_dma_ops
-#define UNREGSTR(x) UNREGSTR2(x)
-
-#define MODULE_PREFIX lustre_v1
-
-#define REGISTER_FUNC REGSTR(MODULE_PREFIX)
-#define UNREGISTER_FUNC UNREGSTR(MODULE_PREFIX)
-
#define NVFS_IO_ERR -1
#define NVFS_CPU_REQ -2
#define START(n) ((n)->a)
#define LAST(n) ((n)->b)
struct rb_root_cached tree;
+ /* forward declare functions created by INTERVAL_TREE_DEFINE */
+ void ftree_insert(struct foo *, struct rb_root_cached *);
+ void ftree_remove(struct foo *, struct rb_root_cached *);
+ struct foo *ftree_iter_first(struct rb_root_cached *, int, int);
+ struct foo *ftree_iter_next(struct foo *, int, int);
INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
- START, LAST, , foo);
+ START, LAST, , ftree);
],[
- foo_insert(NULL, &tree);
+ ftree_insert(NULL, &tree);
],[-Werror])
])
AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
int cl_global_init(void);
void cl_global_fini(void);
+int lov_read_and_clear_async_rc(struct cl_object *clob);
+
#endif /* _LINUX_CL_OBJECT_H */
void lustre_swab_mdt_rec_reint(struct mdt_rec_reint *rr);
void lustre_swab_lmv_desc(struct lmv_desc *ld);
void lustre_swab_lmv_mds_md(union lmv_mds_md *lmm);
+void lustre_swab_lmv_user_md_objects(struct lmv_user_mds_data *lmd,
+ int stripe_count);
void lustre_swab_lov_desc(struct lov_desc *ld);
void lustre_swab_ldlm_res_id(struct ldlm_res_id *id);
void lustre_swab_ldlm_policy_data(union ldlm_wire_policy_data *d);
#include <dt_object.h>
#endif
+#ifdef HAVE_SERVER_SUPPORT
+#define SERVER_ONLY_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol)
+#define SERVER_ONLY
+#else
+#define SERVER_ONLY static
+#define SERVER_ONLY_EXPORT_SYMBOL(symbol)
+#endif
+
#define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay
* and resends for avoid deadlocks */
#define OBD_STATFS_FROM_CACHE 0x0002 /* the statfs callback should not update
char *new_param;
};
+#ifdef HAVE_SERVER_SUPPORT
+void lustre_register_quota_process_config(int (*qpc)(struct lustre_cfg *lcfg));
+#endif
+
char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index);
struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
const char *new_name);
#define OBD_IOC_ERROR(dev, cmd, msg, rc) \
obd_ioctl_msg(__FILE__, __func__, __LINE__, D_ERROR, dev, cmd, msg, rc)
+/* ldlm/ldlm_lib.c */
+void target_recovery_fini(struct obd_device *obd);
+void target_recovery_init(struct lu_target *lut, svc_handler_t handler);
+
+
#endif /* __LINUX_OBD_CLASS_H */
((void)sizeof(env), (void)sizeof(clob), (void)sizeof !!(expr))
#endif /* CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */
-int lov_read_and_clear_async_rc(struct cl_object *clob);
-
int vvp_io_init(const struct lu_env *env, struct cl_object *obj,
struct cl_io *io);
int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io);
void lod_sub_fini_llog(const struct lu_env *env,
struct dt_device *dt, struct task_struct **taskp);
int lodname2mdt_index(char *lodname, __u32 *mdt_index);
-extern void target_recovery_fini(struct obd_device *obd);
/* lod_lov.c */
void lod_getref(struct lod_tgt_descs *ltd);
.proc_release = seq_release,
};
-/**
- * Dump the pool target list into the Lustre debug log.
- *
- * This is a debugging function to allow dumping the list of targets
- * in \a pool to the Lustre kernel debug log at the given \a level.
- *
- * This is not currently called by any existing code, but can be called
- * from within gdb/crash to display the contents of the pool, or from
- * code under development.
- *
- * \param[in] level Lustre debug level (D_INFO, D_WARN, D_ERROR, etc)
- * \param[in] pool pool descriptor to be dumped
- */
-void lod_dump_pool(int level, struct lod_pool_desc *pool)
-{
- unsigned int i;
-
- pool_getref(pool);
-
- CDEBUG(level, "pool "LOV_POOLNAMEF" has %d members\n",
- pool->pool_name, pool->pool_obds.op_count);
- down_read(&pool_tgt_rw_sem(pool));
-
- for (i = 0; i < pool_tgt_count(pool) ; i++) {
- if (!pool_tgt(pool, i) || !(pool_tgt(pool, i))->ltd_exp)
- continue;
- CDEBUG(level, "pool "LOV_POOLNAMEF"[%d] = %s\n",
- pool->pool_name, i,
- obd_uuid2str(&((pool_tgt(pool, i))->ltd_uuid)));
- }
-
- up_read(&pool_tgt_rw_sem(pool));
- lod_pool_putref(pool);
-}
-
static void pools_hash_exit(void *vpool, void *data)
{
struct lod_pool_desc *pool = vpool;
RETURN(lfm_size);
}
-unsigned int lov_lsme_pack_foreign(struct lov_stripe_md_entry *lsme, void *lmm)
+static unsigned int lov_lsme_pack_foreign(struct lov_stripe_md_entry *lsme,
+ void *lmm)
{
struct lov_foreign_md *lfm = (struct lov_foreign_md *)lmm;
return lov_foreign_md_size(lsme->lsme_length);
}
-unsigned int lov_lsme_pack_v1v3(struct lov_stripe_md_entry *lsme,
- struct lov_mds_md *lmm)
+static unsigned int lov_lsme_pack_v1v3(struct lov_stripe_md_entry *lsme,
+ struct lov_mds_md *lmm)
{
struct lov_ost_data_v1 *lmm_objects;
__u16 stripe_count;
* \retval 0 success
* \retval -errno failure
*/
-int mdd_changelog_ns_pfid_set(const struct lu_env *env, struct mdd_device *mdd,
- struct mdd_object *parent,
- const struct lu_attr *pattr, struct lu_fid *pfid)
+static int mdd_changelog_ns_pfid_set(const struct lu_env *env,
+ struct mdd_device *mdd,
+ struct mdd_object *parent,
+ const struct lu_attr *pattr,
+ struct lu_fid *pfid)
{
int rc = 0;
kref_get(&car->car_refcount);
}
-void mdt_cdt_put_request_free(struct kref *kref)
+static void mdt_cdt_put_request_free(struct kref *kref)
{
struct cdt_agent_req *car;
void mdt_reconstruct_generic(struct mdt_thread_info *mti,
struct mdt_lock_handle *lhc);
-extern void target_recovery_fini(struct obd_device *obd);
-extern void target_recovery_init(struct lu_target *lut,
- svc_handler_t handler);
-
int mdt_export_stats_init(struct obd_device *obd,
struct obd_export *exp,
void *client_nid);
return 0;
}
-ssize_t job_xattr_show(struct kobject *kobj, struct attribute *attr, char *buf)
+static ssize_t job_xattr_show(struct kobject *kobj, struct attribute *attr,
+ char *buf)
{
struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kset.kobj);
*
* @return -EINVAL if the name is invalid, else count
*/
-ssize_t job_xattr_store(struct kobject *kobj, struct attribute *attr,
- const char *buffer, size_t count)
+static ssize_t job_xattr_store(struct kobject *kobj, struct attribute *attr,
+ const char *buffer, size_t count)
{
struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kset.kobj);
OBD_SLAB_FREE_PTR(obd, obd_device_cachep);
}
-struct obd_type *class_search_type(const char *name)
+SERVER_ONLY struct obd_type *class_search_type(const char *name)
{
struct kobject *kobj = kset_find_obj(lustre_kset, name);
kobject_put(kobj);
return NULL;
}
-EXPORT_SYMBOL(class_search_type);
+SERVER_ONLY_EXPORT_SYMBOL(class_search_type);
-struct obd_type *class_get_type(const char *name)
+SERVER_ONLY struct obd_type *class_get_type(const char *name)
{
struct obd_type *type;
rcu_read_unlock();
return type;
}
-EXPORT_SYMBOL(class_get_type);
+SERVER_ONLY_EXPORT_SYMBOL(class_get_type);
void class_put_type(struct obd_type *type)
{
#define DEBUG_SUBSYSTEM S_LOG
-
#include <lustre_log.h>
#include <lustre_update.h>
#include <llog_swab.h>
+#ifdef HAVE_SERVER_SUPPORT
+#define SERVER_ONLY_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol)
+#define SERVER_ONLY
+#else
+#define SERVER_ONLY static
+#define SERVER_ONLY_EXPORT_SYMBOL(symbol)
+#endif
+
static void print_llogd_body(struct llogd_body *d)
{
CDEBUG(D_OTHER, "llogd body: %p\n", d);
}
EXPORT_SYMBOL(lustre_swab_lu_seq_range);
-void lustre_swab_update_ops(struct update_ops *uops, unsigned int op_count)
+SERVER_ONLY void lustre_swab_update_ops(struct update_ops *uops,
+ unsigned int op_count)
{
unsigned int i;
unsigned int j;
__swab16s(&uops->uops_op[i].uop_params_off[j]);
}
}
-EXPORT_SYMBOL(lustre_swab_update_ops);
+SERVER_ONLY_EXPORT_SYMBOL(lustre_swab_update_ops);
void lustre_swab_llog_rec(struct llog_rec_hdr *rec)
{
* Call class_attach and class_setup. These methods in turn call
* OBD type-specific methods.
*/
+SERVER_ONLY
int lustre_start_simple(char *obdname, char *type, char *uuid,
char *s1, char *s2, char *s3, char *s4)
{
}
return rc;
}
-EXPORT_SYMBOL(lustre_start_simple);
+SERVER_ONLY_EXPORT_SYMBOL(lustre_start_simple);
static DEFINE_MUTEX(mgc_start_lock);
}
EXPORT_SYMBOL(lustre_start_mgc);
-int lustre_stop_mgc(struct super_block *sb)
+SERVER_ONLY int lustre_stop_mgc(struct super_block *sb)
{
struct lustre_sb_info *lsi = s2lsi(sb);
struct obd_device *obd;
mutex_unlock(&mgc_start_lock);
RETURN(rc);
}
-EXPORT_SYMBOL(lustre_stop_mgc);
+SERVER_ONLY_EXPORT_SYMBOL(lustre_stop_mgc);
/***************** lustre superblock **************/
EXPORT_SYMBOL(server_name2svname);
#endif /* HAVE_SERVER_SUPPORT */
+#ifdef HAVE_SERVER_SUPPORT
/**
* check server name is OST.
**/
return 0;
}
EXPORT_SYMBOL(server_name_is_ost);
+#endif /* HAVE_SERVER_SUPPORT */
/**
* Get the index from the target name MDTXXXX/OSTXXXX
* rc = server type, or rc < 0 on error
**/
-int target_name2index(const char *tgtname, u32 *idx, const char **endptr)
+SERVER_ONLY int target_name2index(const char *tgtname, u32 *idx, const char **endptr)
{
const char *dash = tgtname;
int type, len, rc;
return type;
}
-EXPORT_SYMBOL(target_name2index);
+SERVER_ONLY_EXPORT_SYMBOL(target_name2index);
/*
* Get the index from the OBD name.
};
};
-extern void target_recovery_fini(struct obd_device *obd);
-extern void target_recovery_init(struct lu_target *lut, svc_handler_t handler);
-
/* ofd_access_log.c */
bool ofd_access_log_size_is_valid(unsigned int size);
int ofd_access_log_module_init(void);
push_ctxt(save, newctxt);
}
-struct dentry *osd_lookup_one_len_common(struct osd_device *dev,
- const char *name,
- struct dentry *base, int len,
- enum oi_check_flags flags)
+static struct dentry *osd_lookup_one_len_common(struct osd_device *dev,
+ const char *name,
+ struct dentry *base, int len,
+ enum oi_check_flags flags)
{
struct dentry *dchild;
return false;
}
-void osd_tx_declaration_free(struct osd_thandle *oth)
+static void osd_tx_declaration_free(struct osd_thandle *oth)
{
struct osd_obj_declare *old, *tmp;
}
#ifdef HAVE_LDISKFS_JOURNAL_ENSURE_CREDITS
-void osd_ldiskfs_credits_for_revoke(struct osd_device *osd,
- struct osd_thandle *oh,
- int *credits, int *revoke)
+static void osd_ldiskfs_credits_for_revoke(struct osd_device *osd,
+ struct osd_thandle *oh,
+ int *credits, int *revoke)
{
int blocks = LDISKFS_MAX_EXTENT_DEPTH * oh->oh_declared_ext;
*revoke += ldiskfs_trans_default_revoke_credits(osd_sb(osd)) + blocks;
}
#else
-void osd_ldiskfs_credits_for_revoke(struct osd_device *osd,
- struct osd_thandle *oh,
- int *credits, int *revoke)
+static void osd_ldiskfs_credits_for_revoke(struct osd_device *osd,
+ struct osd_thandle *oh,
+ int *credits, int *revoke)
{
struct journal_s *journal = LDISKFS_SB(osd_sb(osd))->s_journal;
int blocks, jbsize, records_per_block;
OBD_FREE_PTR(diwork);
}
-noinline void osd_delayed_iput(struct inode *inode,
- struct osd_delayed_iput_work *diwork)
+noinline static void osd_delayed_iput(struct inode *inode,
+ struct osd_delayed_iput_work *diwork)
{
if (!diwork) {
iput(inode);
RETURN(rc);
}
-int osd_olc_lookup(const struct lu_env *env, struct osd_object *obj,
+static int osd_olc_lookup(const struct lu_env *env, struct osd_object *obj,
u64 iversion, struct dt_rec *rec,
const struct lu_name *ln, int *result)
{
return 0;
}
-void osd_olc_save(const struct lu_env *env, struct osd_object *obj,
- struct dt_rec *rec, const struct lu_name *ln,
- const int result, u64 iversion)
+static void osd_olc_save(const struct lu_env *env, struct osd_object *obj,
+ struct dt_rec *rec, const struct lu_name *ln,
+ const int result, u64 iversion)
{
struct osd_thread_info *oti = osd_oti_get(env);
struct osd_lookup_cache_entry *entry;
return (base <= ptr) && (ptr < base + size);
}
-static int iam_frame_invariant(struct iam_frame *f)
-{
- return
- (f->bh != NULL &&
- f->bh->b_data != NULL &&
- ptr_inside(f->bh->b_data, f->bh->b_size, f->entries) &&
- ptr_inside(f->bh->b_data, f->bh->b_size, f->at) &&
- f->entries <= f->at);
-}
-
-static int iam_leaf_invariant(struct iam_leaf *l)
-{
- return
- l->il_bh != NULL &&
- l->il_bh->b_data != NULL &&
- ptr_inside(l->il_bh->b_data, l->il_bh->b_size, l->il_entries) &&
- ptr_inside(l->il_bh->b_data, l->il_bh->b_size, l->il_at) &&
- l->il_entries <= l->il_at;
-}
-
-static int iam_path_invariant(struct iam_path *p)
-{
- int i;
-
- if (p->ip_container == NULL ||
- p->ip_indirect < 0 || p->ip_indirect > DX_MAX_TREE_HEIGHT - 1 ||
- p->ip_frame != p->ip_frames + p->ip_indirect ||
- !iam_leaf_invariant(&p->ip_leaf))
- return 0;
- for (i = 0; i < ARRAY_SIZE(p->ip_frames); ++i) {
- if (i <= p->ip_indirect) {
- if (!iam_frame_invariant(&p->ip_frames[i]))
- return 0;
- }
- }
- return 1;
-}
-
-int iam_it_invariant(struct iam_iterator *it)
-{
- return
- (it->ii_state == IAM_IT_DETACHED ||
- it->ii_state == IAM_IT_ATTACHED ||
- it->ii_state == IAM_IT_SKEWED) &&
- !(it->ii_flags & ~(IAM_IT_MOVE | IAM_IT_WRITE)) &&
- ergo(it->ii_state == IAM_IT_ATTACHED ||
- it->ii_state == IAM_IT_SKEWED,
- iam_path_invariant(&it->ii_path) &&
- equi(it_at_rec(it), it->ii_state == IAM_IT_SKEWED));
-}
-
/*
* Search container @c for record with key @k. If record is found, its data
* are moved into @r.
return le32_to_cpu(ent->vle_hash);
}
-static void e_print(const struct lvar_leaf_entry *ent)
-{
- CERROR(" %p %8.8x \"%*.*s\"\n", ent, e_hash(ent),
- e_keysize(ent), e_keysize(ent), e_char(ent));
-}
-
static inline struct lvar_leaf_entry *e_next(const struct iam_leaf *leaf,
const struct lvar_leaf_entry *ent)
{
return lentry_lvar(l->il_at);
}
-void n_print(const struct iam_leaf *l)
-{
- struct lvar_leaf_entry *scan;
-
- CERROR("used: %d\n", h_used(n_head(l)));
- for (scan = n_start(l); scan < n_end(l); scan = e_next(l, scan))
- e_print(scan);
-}
-
#if LDISKFS_CORRECTNESS_ON
static int n_at_rec(const struct iam_leaf *folio)
{
}
LUSTRE_RW_ATTR(fallocate_zero_blocks);
-ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr,
- const char *buffer, size_t count)
+static ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr,
+ const char *buffer, size_t count)
{
struct dt_device *dt = container_of(kobj, struct dt_device, dd_kobj);
struct osd_device *osd = osd_dt_dev(dt);
return sprintf(buf, "%d\n", dev->od_index_backup_policy);
}
-ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr,
- const char *buffer, size_t count)
+static ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr,
+ const char *buffer, size_t count)
{
struct dt_device *dt = container_of(kobj, struct dt_device,
dd_kobj);
#include "ptlrpc_internal.h"
-struct obd_import *llog_client_entry(struct llog_ctxt *ctxt)
+static struct obd_import *llog_client_entry(struct llog_ctxt *ctxt)
{
struct obd_import *imp = ERR_PTR(-EINVAL);
return imp;
}
-void llog_client_exit(struct llog_ctxt *ctxt, struct obd_import *imp)
+static void llog_client_exit(struct llog_ctxt *ctxt, struct obd_import *imp)
{
mutex_lock(&ctxt->loc_mutex);
if (ctxt->loc_imp != imp)
int nodemap_idx_range_add(const struct lu_nid_range *range);
int nodemap_idx_range_del(const struct lu_nid_range *range);
int nodemap_idx_nodemap_activate(bool value);
+int nodemap_index_read(struct lu_env *env, struct nm_config_file *ncf,
+ struct idx_info *ii, const struct lu_rdpg *rdpg);
+
#endif /* _NODEMAP_INTERNAL_H */
return rc;
}
-int nodemap_index_read(struct lu_env *env,
- struct nm_config_file *ncf,
- struct idx_info *ii,
- const struct lu_rdpg *rdpg)
+int nodemap_index_read(struct lu_env *env, struct nm_config_file *ncf,
+ struct idx_info *ii, const struct lu_rdpg *rdpg)
{
struct dt_object *nodemap_idx = ncf->ncf_obj;
__u64 version;
__swab32s(val);
}
+#ifdef HAVE_SERVER_SUPPORT
void lustre_swab_gl_lquota_desc(struct ldlm_gl_lquota_desc *desc)
{
lustre_swab_lu_fid(&desc->gl_id.qid_fid);
BUILD_BUG_ON(offsetof(typeof(*desc), lgbd_padding) == 0);
}
EXPORT_SYMBOL(lustre_swab_gl_barrier_desc);
+#endif /* HAVE_SERVER_SUPPORT */
void lustre_swab_ost_lvb_v1(struct ost_lvb_v1 *lvb)
{
__swab64s(&lr->lr_repaired);
}
+#ifdef HAVE_SERVER_SUPPORT
static void lustre_swab_orphan_rec(struct lu_orphan_rec *rec)
{
lustre_swab_lu_fid(&rec->lor_fid);
BUILD_BUG_ON(offsetof(typeof(ent->loe_rec), lor_padding_2) == 0);
}
EXPORT_SYMBOL(lustre_swab_orphan_ent_v3);
+#endif /* HAVE_SERVER_SUPPORT */
void lustre_swab_ladvise(struct lu_ladvise *ladvise)
{
}
EXPORT_SYMBOL(qsd_start);
-void lustre_register_quota_process_config(int (*qpc)(struct lustre_cfg *lcfg));
-
/*
* Global initialization performed at module load time
*/