diff --git a/acinclude.m4 b/acinclude.m4 index 5e753ec4d1..97c2d79d67 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -891,7 +891,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h]) AC_CHECK_LINUX_STRUCT([inode_operations], [truncate], [fs.h]) AC_CHECK_LINUX_STRUCT([key_type], [instantiate_prep], [key-type.h]) - AC_CHECK_LINUX_STRUCT([key_type], [match], [key-type.h]) + AC_CHECK_LINUX_STRUCT([key_type], [match_preparse], [key-type.h]) AC_CHECK_LINUX_STRUCT([key_type], [preparse], [key-type.h]) AC_CHECK_LINUX_STRUCT([nameidata], [path], [namei.h]) AC_CHECK_LINUX_STRUCT([proc_dir_entry], [owner], [proc_fs.h]) diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index f1d97a6641..3b068e5ce2 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -498,7 +498,13 @@ error: return code; } -#if defined(STRUCT_KEY_TYPE_HAS_MATCH) +#if !defined(STRUCT_KEY_TYPE_HAS_MATCH_PREPARSE) +/* Note that we only define a ->match function if struct + * key_type.match_preparse does _not_ exist. If key_type.match_preparse does + * exist, we would use that to specify an alternative comparison function; but + * since we just rely on default behavior, we don't need to actually specify + * one. But for kernels with no such match_preparse function, we need to + * specify a 'match' function, since there is no default. */ static int afs_pag_match(const struct key *key, const void *description) { return strcmp(key->description, description) == 0; @@ -529,7 +535,7 @@ struct key_type key_type_afs_pag = #else .instantiate = afs_pag_instantiate, #endif -#if defined(STRUCT_KEY_TYPE_HAS_MATCH) +#if !defined(STRUCT_KEY_TYPE_HAS_MATCH_PREPARSE) .match = afs_pag_match, #endif .destroy = afs_pag_destroy,