summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bad49e3)
Starting with the 3.17 kernel the function match
used by struct key_type was replaced by a new
function match_preparse. This patch added support
for this change.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: I2db0860cf089b0ba8f70bad9155f48e52ec8c4b5
Reviewed-on: http://review.whamcloud.com/15804
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
#
]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
#
+# LC_KEY_MATCH_DATA
+#
+# 3.17 replaces key_type::match with match_preparse
+# and has new struct key_match_data
+#
+AC_DEFUN([LC_KEY_MATCH_DATA], [
+LB_CHECK_COMPILE([if struct key_match field exist],
+key_match, [
+ #include <linux/key-type.h>
+],[
+ struct key_match_data data;
+],[
+ AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
+ [struct key_match_data exist])
+])
+]) # LC_KEY_MATCH_DATA
+
+#
# LC_NFS_FILLDIR_USE_CTX
#
# 3.18 kernel moved from void cookie to struct dir_context
# LC_NFS_FILLDIR_USE_CTX
#
# 3.18 kernel moved from void cookie to struct dir_context
LC_HAVE_IOV_ITER_INIT_DIRECTION
LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
LC_HAVE_IOV_ITER_INIT_DIRECTION
LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
+ # 3.17
+ LC_KEY_MATCH_DATA
+
# 3.18
LC_NFS_FILLDIR_USE_CTX
# 3.18
LC_NFS_FILLDIR_USE_CTX
/*
* the timeout is only for the case that upcall child process die abnormally.
* in any other cases it should finally update kernel key.
/*
* the timeout is only for the case that upcall child process die abnormally.
* in any other cases it should finally update kernel key.
* FIXME we'd better to incorporate the client & server side upcall timeouts
* into the framework of Adaptive Timeouts, but we need to figure out how to
* make sure that kernel knows the upcall processes is in-progress or died
* FIXME we'd better to incorporate the client & server side upcall timeouts
* into the framework of Adaptive Timeouts, but we need to figure out how to
* make sure that kernel knows the upcall processes is in-progress or died
-static
-int gss_kt_match(const struct key *key, const void *desc)
+#ifndef HAVE_KEY_MATCH_DATA
+static int
+gss_kt_match(const struct key *key, const void *desc)
+{
+ return (strcmp(key->description, (const char *) desc) == 0);
+}
+#else /* ! HAVE_KEY_MATCH_DATA */
+static bool
+gss_kt_match(const struct key *key, const struct key_match_data *match_data)
+{
+ const char *desc = match_data->raw_data;
+
+ return (strcmp(key->description, desc) == 0);
+}
+
+/*
+ * Preparse the match criterion.
+ */
+static int gss_kt_match_preparse(struct key_match_data *match_data)
- return (strcmp(key->description, (const char *) desc) == 0);
+ match_data->lookup_type = KEYRING_SEARCH_LOOKUP_DIRECT;
+ match_data->cmp = gss_kt_match;
+ return 0;
+#endif /* HAVE_KEY_MATCH_DATA */
static
void gss_kt_destroy(struct key *key)
static
void gss_kt_destroy(struct key *key)
static struct key_type gss_key_type =
{
static struct key_type gss_key_type =
{
- .name = "lgssc",
- .def_datalen = 0,
- .instantiate = gss_kt_instantiate,
- .update = gss_kt_update,
- .match = gss_kt_match,
- .destroy = gss_kt_destroy,
- .describe = gss_kt_describe,
+ .name = "lgssc",
+ .def_datalen = 0,
+ .instantiate = gss_kt_instantiate,
+ .update = gss_kt_update,
+#ifdef HAVE_KEY_MATCH_DATA
+ .match_preparse = gss_kt_match_preparse,
+#else
+ .match = gss_kt_match,
+#endif
+ .destroy = gss_kt_destroy,
+ .describe = gss_kt_describe,
};
/****************************************
};
/****************************************