* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#define DEBUG_SUBSYSTEM S_SEC
#include <libcfs/libcfs.h>
-#ifndef __KERNEL__
-#include <liblustre.h>
-#include <libcfs/list.h>
-#else
#include <linux/crypto.h>
#include <linux/key.h>
-#endif
#include <obd.h>
#include <obd_class.h>
CERROR("unknown target %p(%s)\n", obd, type);
return LUSTRE_SP_ANY;
}
-EXPORT_SYMBOL(sptlrpc_target_sec_part);
/****************************************
* user supplied flavor string parsing *
rset->srs_nslot = nslot;
return 0;
}
-EXPORT_SYMBOL(sptlrpc_rule_set_expand);
static inline int rule_spec_dir(struct sptlrpc_rule *rule)
{
return 0;
}
-EXPORT_SYMBOL(sptlrpc_rule_set_choose);
void sptlrpc_rule_set_dump(struct sptlrpc_rule_set *rset)
{
r->sr_from, r->sr_to, r->sr_netid, r->sr_flvr.sf_rpc);
}
}
-EXPORT_SYMBOL(sptlrpc_rule_set_dump);
static int sptlrpc_rule_set_extract(struct sptlrpc_rule_set *gen,
struct sptlrpc_rule_set *tgt,
if (sptlrpc_rule_set_choose(rset, from, LUSTRE_SP_ANY, nid, sf) == 0)
get_default_flavor(sf);
}
-EXPORT_SYMBOL(sptlrpc_target_choose_flavor);
#define SEC_ADAPT_DELAY (10)
struct obd_import *imp;
ENTRY;
- LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
- strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) ==0);
- CDEBUG(D_SEC, "obd %s\n", obd->u.cli.cl_target_uuid.uuid);
+ LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
+ strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
+ strcmp(obd->obd_type->typ_name, LUSTRE_OSP_NAME) == 0 ||
+ strcmp(obd->obd_type->typ_name, LUSTRE_LWP_NAME) == 0);
+ CDEBUG(D_SEC, "obd %s\n", obd->u.cli.cl_target_uuid.uuid);
/* serialize with connect/disconnect import */
down_read(&obd->u.cli.cl_sem);
}
EXPORT_SYMBOL(sptlrpc_conf_client_adapt);
-#ifdef __KERNEL__
static void rule2string(struct sptlrpc_rule *r, char *buf, int buflen)
{
- char dirbuf[8];
- char *net;
- char *ptr = buf;
+ char dirbuf[8];
+ char net[LNET_NIDSTR_SIZE] = "default";
+ char *ptr = buf;
- if (r->sr_netid == LNET_NIDNET(LNET_NID_ANY))
- net = "default";
- else
- net = libcfs_net2str(r->sr_netid);
+ if (r->sr_netid != LNET_NIDNET(LNET_NID_ANY))
+ libcfs_net2str_r(r->sr_netid, net, sizeof(net));
if (r->sr_from == LUSTRE_SP_ANY && r->sr_to == LUSTRE_SP_ANY)
dirbuf[0] = '\0';
RETURN(rc);
}
-#endif /* __KRENEL__ */
/**
* called by target devices, extract sptlrpc rules which applies to
GOTO(out, rc);
}
-#ifdef __KERNEL__
if (conf->sc_updated == 0) {
/*
* always read from local copy. here another option is
else
CDEBUG(D_SEC, "unchanged, skip updating local copy\n");
}
-#endif
/* extract rule set for this target */
conf_tgt = sptlrpc_conf_get_tgt(conf, obd->obd_name, 0);
mutex_unlock(&sptlrpc_conf_lock);
RETURN(rc);
}
-EXPORT_SYMBOL(sptlrpc_conf_target_get_rules);
int sptlrpc_conf_init(void)
{