linux: add read_descriptor_t configure test and ifdef
authorChristof Hanke <christof.hanke@rzg.mpg.de>
Thu, 26 May 2011 05:46:32 +0000 (07:46 +0200)
committerDerrick Brashear <shadow@dementia.org>
Thu, 26 May 2011 13:59:13 +0000 (06:59 -0700)
With linux 2.6.8 the struct read_descriptor_t changed.
Add a configure-test and respective ifdef to deal with that.

Change-Id: Iff1a6252707cd2119bdc0382c641934119ea0422
Reviewed-on: http://gerrit.openafs.org/4719
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/afs/LINUX/osi_fetchstore.c

index a8b3634..4ba2d40 100644 (file)
@@ -813,6 +813,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_STRUCT([task_struct], [thread_info], [sched.h])
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
 
+                dnl Check for typed structure elements
+                AC_CHECK_LINUX_TYPED_STRUCT([read_descriptor_t],
+                                            [buf], [fs.h])
+
                 dnl Function existence checks
 
                  AC_CHECK_LINUX_FUNC([bdi_init],
index 4989a01..4089bbb 100644 (file)
@@ -126,7 +126,11 @@ static int
 afs_linux_read_actor(read_descriptor_t *desc, struct page *page,
                     unsigned long offset, unsigned long size)
 {
+#ifdef READ_DESCRIPTOR_T_HAS_BUF
+    struct rxfs_storeVariables *svar = (void *) desc->buf;
+#else
     struct rxfs_storeVariables *svar = desc->arg.data;
+#endif
     unsigned long count = desc->count;
     int code;