#include "fld_internal.h"
#ifdef __KERNEL__
-struct fld_cache_info *fld_cache_init(int size)
+struct fld_cache_info *
+fld_cache_init(int size)
{
struct fld_cache_info *cache;
int i;
}
EXPORT_SYMBOL(fld_cache_init);
-void fld_cache_fini(struct fld_cache_info *cache)
+void
+fld_cache_fini(struct fld_cache_info *cache)
{
struct fld_cache_entry *flde;
struct hlist_head *bucket;
int
fld_server_init(struct lu_server_fld *fld,
const struct lu_context *ctx,
- const char *uuid,
- struct dt_device *dt)
+ struct dt_device *dt,
+ const char *uuid)
{
int rc;
struct ptlrpc_service_conf fld_conf = {
spin_lock(&fld->fld_lock);
hash = fld->fld_hash->fh_func(fld, seq);
- spin_unlock(&fld->fld_lock);
- spin_lock(&fld->fld_lock);
list_for_each_entry(target,
&fld->fld_targets, fldt_chain) {
if (target->fldt_idx == hash) {
}
#endif
+static inline int hash_is_sane(int hash)
+{
+ return (hash >= 0 && hash < LUSTRE_CLI_FLD_HASH_LAST);
+}
+
int
fld_client_init(struct lu_client_fld *fld,
const char *uuid, int hash)
LASSERT(fld != NULL);
- if (hash < 0 || hash >= LUSTRE_CLI_FLD_HASH_LAST) {
+ if (!hash_is_sane(hash)) {
CERROR("wrong hash function 0x%x\n", hash);
RETURN(-EINVAL);
}
/* server methods */
int fld_server_init(struct lu_server_fld *fld,
const struct lu_context *ctx,
- const char *uuid,
- struct dt_device *dt);
+ struct dt_device *dt,
+ const char *uuid);
void fld_server_fini(struct lu_server_fld *fld,
const struct lu_context *ctx);
if (ls->ls_server_fld != NULL) {
rc = fld_server_init(ls->ls_server_fld, ctx,
- uuid, m->mdt_bottom);
+ m->mdt_bottom, uuid);
if (rc) {
OBD_FREE_PTR(ls->ls_server_fld);
ls->ls_server_fld = NULL;