])
#
-# 3.8 struct file has new memeber f_inode
+# 3.8 struct file has new member f_inode
#
AC_DEFUN([LC_HAVE_FILE_F_INODE],
[AC_MSG_CHECKING([if struct file has memeber f_inode])
])
])
+AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS],
+[AC_MSG_CHECKING([if sunrpc_cache_pipe_upcall takes 3 args])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/sunrpc/cache.h>
+],[
+ sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
+],[
+ AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
+ [sunrpc_cache_pipe_upcall takes 3 args])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
#
# 3.9 uses hlist_for_each_entry with 3 args
# b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
# 3.8
LC_HAVE_FILE_F_INODE
+ LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
# 3.9
LC_HAVE_HLIST_FOR_EACH_3ARG
struct cache_head *h,
char **bpp, int *blen)
{
- struct rsi *rsi = container_of(h, struct rsi, h);
- __u64 index = 0;
-
- /* if in_handle is null, provide kernel suggestion */
- if (rsi->in_handle.len == 0)
- index = gss_get_next_ctx_index();
-
- qword_addhex(bpp, blen, (char *) &rsi->lustre_svc,
- sizeof(rsi->lustre_svc));
- qword_addhex(bpp, blen, (char *) &rsi->nid, sizeof(rsi->nid));
- qword_addhex(bpp, blen, (char *) &index, sizeof(index));
- qword_addhex(bpp, blen, rsi->in_handle.data, rsi->in_handle.len);
- qword_addhex(bpp, blen, rsi->in_token.data, rsi->in_token.len);
- (*bpp)[-1] = '\n';
+ struct rsi *rsi = container_of(h, struct rsi, h);
+ __u64 index = 0;
+
+ /* if in_handle is null, provide kernel suggestion */
+ if (rsi->in_handle.len == 0)
+ index = gss_get_next_ctx_index();
+
+ qword_addhex(bpp, blen, (char *) &rsi->lustre_svc,
+ sizeof(rsi->lustre_svc));
+ qword_addhex(bpp, blen, (char *) &rsi->nid, sizeof(rsi->nid));
+ qword_addhex(bpp, blen, (char *) &index, sizeof(index));
+ qword_addhex(bpp, blen, rsi->in_handle.data, rsi->in_handle.len);
+ qword_addhex(bpp, blen, rsi->in_token.data, rsi->in_token.len);
+ (*bpp)[-1] = '\n';
}
+#ifdef HAVE_SUNRPC_UPCALL_HAS_3ARGS
static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
{
- return sunrpc_cache_pipe_upcall(cd, h, rsi_request);
+ return sunrpc_cache_pipe_upcall(cd, h, rsi_request);
}
+#else
+
+static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
+{
+ return sunrpc_cache_pipe_upcall(cd, h);
+}
+#endif
static inline void __rsi_init(struct rsi *new, struct rsi *item)
{
}
static struct cache_detail rsi_cache = {
- .hash_size = RSI_HASHMAX,
- .hash_table = rsi_table,
- .name = "auth.sptlrpc.init",
- .cache_put = rsi_put,
- .cache_upcall = rsi_upcall,
- .cache_parse = rsi_parse,
- .match = rsi_match,
- .init = rsi_init,
- .update = update_rsi,
- .alloc = rsi_alloc,
+ .hash_size = RSI_HASHMAX,
+ .hash_table = rsi_table,
+ .name = "auth.sptlrpc.init",
+ .cache_put = rsi_put,
+#ifndef HAVE_SUNRPC_UPCALL_HAS_3ARGS
+ .cache_request = rsi_request,
+#endif
+ .cache_upcall = rsi_upcall,
+ .cache_parse = rsi_parse,
+ .match = rsi_match,
+ .init = rsi_init,
+ .update = update_rsi,
+ .alloc = rsi_alloc,
};
static struct rsi *rsi_lookup(struct rsi *item)