*
* Modifications for Lustre
*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
*
* Author: Eric Mei <ericm@clusterfs.com>
*/
(*bpp)[-1] = '\n';
}
+#ifdef HAVE_CACHE_UPCALL
+static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
+{
+ return sunrpc_cache_pipe_upcall(cd, h, rsi_request);
+}
+#endif
+
static inline void __rsi_init(struct rsi *new, struct rsi *item)
{
new->out_handle = RAWOBJ_EMPTY;
.hash_table = rsi_table,
.name = "auth.sptlrpc.init",
.cache_put = rsi_put,
+#ifdef HAVE_CACHE_UPCALL
+ .cache_upcall = rsi_upcall,
+#else
.cache_request = rsi_request,
+#endif
.cache_parse = rsi_parse,
#ifdef HAVE_SUNRPC_CACHE_V2
.match = rsi_match,
}
rsci.ctx.gsc_usr_mds = (tmp_int != 0);
+ /* oss user flag */
+ rv = get_int(&mesg, &tmp_int);
+ if (rv) {
+ CERROR("fail to get oss user flag\n");
+ goto out;
+ }
+ rsci.ctx.gsc_usr_oss = (tmp_int != 0);
+
/* mapped uid */
rv = get_int(&mesg, (int *) &rsci.ctx.gsc_mapped_uid);
if (rv) {
}
rsci.ctx.gsc_usr_mds = (tmp_int != 0);
+ /* oss user flag */
+ rv = get_int(&mesg, &tmp_int);
+ if (rv) {
+ CERROR("fail to get oss user flag\n");
+ goto out;
+ }
+ rsci.ctx.gsc_usr_oss = (tmp_int != 0);
+
/* mapped uid */
rv = get_int(&mesg, (int *) &rsci.ctx.gsc_mapped_uid);
if (rv) {
}
rsci.h.expiry_time = (time_t) ctx_expiry;
- /* FIXME */
- rsci.ctx.gsc_usr_root = 1;
- rsci.ctx.gsc_usr_mds= 1;
- rsci.ctx.gsc_reverse = 1;
+ if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0)
+ rsci.ctx.gsc_usr_mds = 1;
+ else if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0)
+ rsci.ctx.gsc_usr_oss = 1;
+ else
+ rsci.ctx.gsc_usr_root = 1;
rscp = rsc_update(&rsci, rscp);
if (rscp == NULL)
}
rsci.h.expiry_time = (time_t) ctx_expiry;
- /* FIXME */
- rsci.ctx.gsc_usr_root = 1;
- rsci.ctx.gsc_usr_mds= 1;
- rsci.ctx.gsc_reverse = 1;
+ if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0)
+ rsci.ctx.gsc_usr_mds = 1;
+ else if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0)
+ rsci.ctx.gsc_usr_oss = 1;
+ else
+ rsci.ctx.gsc_usr_root = 1;
rscp = rsc_lookup(&rsci, 1);
if (rscp == NULL) {
* sequence number checking, thus no chance to sent error notification
* back to clients.
*/
- ll_get_random_bytes(&__ctx_index, sizeof(__ctx_index));
+ cfs_get_random_bytes(&__ctx_index, sizeof(__ctx_index));
cache_register(&rsi_cache);