]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux 3.7: key instantiate API change
authorMarc Dionne <marc.c.dionne@gmail.com>
Fri, 16 Nov 2012 01:58:03 +0000 (20:58 -0500)
committerPaul Smeddle <paul.smeddle@gmail.com>
Wed, 5 Dec 2012 17:29:10 +0000 (09:29 -0800)
Adapt to the new parameters for the instantiate key operation.

Reviewed-on: http://gerrit.openafs.org/8470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit aeb2763b741a218ad6fd93adc6157a6a31f27e13)

Change-Id: I9ff22683aaf6e1002bdb2bc7666fbc0d8d597d20
Reviewed-on: http://gerrit.openafs.org/8560
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
acinclude.m4
src/afs/LINUX/osi_groups.c

index 07bcd0f520dce1b4ee97acc58fec7185cf99cb1f..11a30b3a2e6a271d17c4266fd4ce111a95a0104c 100644 (file)
@@ -803,6 +803,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
                 AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
                 AC_CHECK_LINUX_STRUCT([filename], [name], [fs.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])
                 AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h])
index 1903a5443502269ff0f581e855e03768dabbb46c..c2a0308a66085b6a31b6e87b9aa0a11b0ae439f3 100644 (file)
@@ -457,7 +457,11 @@ static void afs_pag_describe(const struct key *key, struct seq_file *m)
     seq_printf(m, ": %u", key->datalen);
 }
 
+#if defined(STRUCT_KEY_TYPE_HAS_PREPARSE)
+static int afs_pag_instantiate(struct key *key, struct key_preparsed_payload *prep)
+#else
 static int afs_pag_instantiate(struct key *key, const void *data, size_t datalen)
+#endif
 {
     int code;
     afs_uint32 *userpag, pag = NOPAG;
@@ -468,7 +472,11 @@ static int afs_pag_instantiate(struct key *key, const void *data, size_t datalen
     code = -EINVAL;
     get_group_info(current_group_info());
 
+#if defined(STRUCT_KEY_TYPE_HAS_PREPARSE)
+    if (prep->datalen != sizeof(afs_uint32) || !prep->data)
+#else
     if (datalen != sizeof(afs_uint32) || !data)
+#endif
        goto error;
 
     /* ensure key being set matches current pag */
@@ -477,7 +485,11 @@ static int afs_pag_instantiate(struct key *key, const void *data, size_t datalen
     if (pag == NOPAG)
        goto error;
 
-    userpag = (afs_uint32 *) data;
+#if defined(STRUCT_KEY_TYPE_HAS_PREPARSE)
+    userpag = (afs_uint32 *)prep->data;
+#else
+    userpag = (afs_uint32 *)data;
+#endif
     if (*userpag != pag)
        goto error;