amd64-linux-dewarn-20041202
authorJeffrey Hutzelman <jhutz@cmu.edu>
Wed, 1 Dec 2004 23:38:53 +0000 (23:38 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 1 Dec 2004 23:38:53 +0000 (23:38 +0000)
FIXES 16342

clean up warnings for amd64

31 files changed:
acinclude.m4
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_prototypes.h
src/afs/LINUX/osi_sleep.c
src/afs/LINUX/osi_vfs.hin
src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_call.c
src/afs/afs_conn.c
src/afs/afs_daemons.c
src/afs/afs_dcache.c
src/afs/afs_init.c
src/afs/afs_memcache.c
src/afs/afs_osi.c
src/afs/afs_pioctl.c
src/afs/afs_prototypes.h
src/afs/afs_segments.c
src/afs/afs_server.c
src/afs/afs_stats.h
src/afs/afs_util.c
src/afs/afs_volume.c
src/afs/sysincludes.h
src/cf/linux-test1.m4

index 5b4ef53..e38fbe2 100644 (file)
@@ -555,6 +555,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
                 LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
                 LINUX_INODE_SETATTR_RETURN_TYPE
+                LINUX_WRITE_INODE_RETURN_TYPE
+                LINUX_IOP_NAMEIDATA
+                LINUX_AOP_WRITEBACK_CONTROL
                 LINUX_KERNEL_LINUX_SYSCALL_H
                 LINUX_KERNEL_SELINUX
                 LINUX_KERNEL_SOCK_CREATE
@@ -642,6 +645,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
                  AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
                 fi
+                if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
+                 AC_DEFINE(WRITE_INODE_NOT_VOID, 1, [define if your sops.write_inode returns non-void])
+                fi
                 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
                  AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
                 fi
index e80af0b..23994d0 100644 (file)
@@ -96,11 +96,11 @@ linux_alloc(unsigned int asize, int drop_glock)
 #endif
                );
            if (new)            /* piggy back alloc type */
-               (unsigned long)new |= KM_TYPE;
+               new = (void *)(KM_TYPE | (unsigned long)new);
        } else {
            new = (void *)vmalloc(asize);
            if (new)            /* piggy back alloc type */
-               (unsigned long)new |= VM_TYPE;
+               new = (void *)(VM_TYPE | (unsigned long)new);
        }
 
        if (!new) {
@@ -143,8 +143,8 @@ linux_free(void *p)
        vfree(MEMADDR(p));
        break;
     default:
-       printf("afs_osi_Free: Asked to free unknown type %d at 0x%x\n",
-              MEMTYPE(p), MEMADDR(p));
+       printf("afs_osi_Free: Asked to free unknown type %d at 0x%lx\n",
+              (int)MEMTYPE(p), (unsigned long)MEMADDR(p));
        break;
     }
 
@@ -196,8 +196,8 @@ hash_verify(size_t index, unsigned key, void *data)
     memtype = MEMTYPE(lmp->chunk);
     if (memtype != KM_TYPE && memtype != VM_TYPE) {
        printf
-           ("osi_linux_verify_alloced_memory: unknown type %d at 0x%x, index=%d\n",
-            memtype, lmp->chunk, index);
+           ("osi_linux_verify_alloced_memory: unknown type %d at 0x%lx, index=%lu\n",
+            (int)memtype, (unsigned long)lmp->chunk, (unsigned long)index);
     }
     afs_linux_hash_verify_count++;
 }
index 97302e6..50eb6a4 100644 (file)
 RCSID
     ("$Header$");
 
+#include "h/module.h" /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
 #include "afs/afs_stats.h"     /* afs statistics */
 #include "h/smp_lock.h"
-#include "h/module.h"
 
 
 int afs_osicred_initialized = 0;
@@ -29,11 +29,9 @@ extern struct super_block *afs_cacheSBp;
 void *
 osi_UFSOpen(afs_int32 ainode)
 {
-    struct inode *ip;
     register struct osi_file *afile = NULL;
     extern int cacheDiskType;
     afs_int32 code = 0;
-    int dummy;
     struct inode *tip = NULL;
     struct file *filp = NULL;
     AFS_STATCNT(osi_UFSOpen);
@@ -121,7 +119,6 @@ osi_UFSClose(register struct osi_file *afile)
 int
 osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
 {
-    struct AFS_UCRED *oldCred;
     register afs_int32 code;
     struct osi_stat tstat;
     struct iattr newattrs;
@@ -184,10 +181,8 @@ int
 afs_osi_Read(register struct osi_file *afile, int offset, void *aptr,
             afs_int32 asize)
 {
-    struct AFS_UCRED *oldCred;
     size_t resid;
     register afs_int32 code;
-    register afs_int32 cnt1 = 0;
     AFS_STATCNT(osi_Read);
 
     /**
@@ -222,7 +217,6 @@ int
 afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr,
              afs_int32 asize)
 {
-    struct AFS_UCRED *oldCred;
     size_t resid;
     register afs_int32 code;
     AFS_STATCNT(osi_Write);
index 3a67257..5775e60 100644 (file)
@@ -167,7 +167,6 @@ int
 osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
 {
     struct file *filp = &osifile->file;
-    struct inode *ip = FILE_INODE(&osifile->file);
     KERNEL_SPACE_DECL;
     int code = 0;
     struct iovec *iov;
@@ -227,10 +226,10 @@ osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
  * Setup a uio struct.
  */
 void
-setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, afs_offs_t pos,
+setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
          int count, uio_flag_t flag, uio_seg_t seg)
 {
-    iovecp->iov_base = buf;
+    iovecp->iov_base = (char *)buf;
     iovecp->iov_len = count;
     uiop->uio_iov = iovecp;
     uiop->uio_iovcnt = 1;
@@ -248,7 +247,7 @@ setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, afs_offs_t pos,
 int
 uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop)
 {
-    int count, n;
+    int count;
     struct iovec *iov;
     int code;
 
@@ -371,8 +370,8 @@ osi_linux_free_inode_pages(void)
 #else
                if (ip->i_nrpages) {
 #endif
-                   printf("Failed to invalidate all pages on inode 0x%x\n",
-                          ip);
+                   printf("Failed to invalidate all pages on inode 0x%lx\n",
+                          (unsigned long)ip);
                }
            }
        }
@@ -387,11 +386,14 @@ osi_clear_inode(struct inode *ip)
 
 #if defined(AFS_LINUX24_ENV)
     if (atomic_read(&ip->i_count) > 1)
+       printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
+              (long)ip->i_ino, (unsigned long)ip,
+              (long)atomic_read(&ip->i_count));
 #else
     if (ip->i_count > 1)
+       printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
+              (long)ip->i_ino, (unsigned long)ip, (long)ip->i_count);
 #endif
-       printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip,
-              ip->i_count);
 
     afs_InactiveVCache(vcp, credp);
     ObtainWriteLock(&vcp->lock, 504);
index 35624d1..46948d2 100644 (file)
@@ -17,6 +17,7 @@
 RCSID
     ("$Header$");
 
+#include <linux/module.h> /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #include "h/unistd.h"          /* For syscall numbers. */
@@ -26,7 +27,6 @@ RCSID
 #include "../asm/ia32_unistd.h"
 #endif
 
-#include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/slab.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
@@ -68,7 +68,9 @@ static void **sys_call_table; /* safer for other linuces */
 
 extern struct file_system_type afs_fs_type;
 
+#if !defined(AFS_LINUX24_ENV)
 static long get_page_offset(void);
+#endif
 
 #if defined(AFS_LINUX24_ENV)
 DECLARE_MUTEX(afs_global_lock);
@@ -142,10 +144,9 @@ int
 csdbproc_read(char *buffer, char **start, off_t offset, int count,
              int *eof, void *data)
 {
-    int len, i, j;
+    int len, j;
     struct afs_q *cq, *tq;
     struct cell *tc;
-    void *ret = NULL;
     char tbuffer[16];
     afs_uint32 addr;
     
@@ -184,15 +185,12 @@ peerproc_read(char *buffer, char **start, off_t offset, int count,
 {
     int len, i, j;
     struct rx_peer *sep;
-    void *ret = NULL;
-    char tbuffer[16];
-    afs_uint32 addr;
     
     len = 0;
     for (i = 0, j = 0; i < 256; i++) {
         for (sep = rx_peerHashTable[i]; sep; sep = sep->next, j++) {
-           len += sprintf(buffer + len, "%lx: next=0x%lx, host=0x%x, ", sep, sep->next,
-                   sep->host);
+           len += sprintf(buffer + len, "%lx: next=0x%lx, host=0x%x, ", (unsigned long)sep,
+                  (unsigned long)sep->next, sep->host);
             len += sprintf(buffer + len, "ifMTU=%d, natMTU=%d, maxMTU=%d\n", sep->ifMTU,
                    sep->natMTU, sep->maxMTU);
             len += sprintf(buffer + len, "\trtt=%d:%d, timeout(%d:%d), nSent=%d, reSends=%d\n",
@@ -200,8 +198,8 @@ peerproc_read(char *buffer, char **start, off_t offset, int count,
                    sep->timeout.usec, sep->nSent, sep->reSends);
             len += sprintf(buffer + len, "\trefCount=%d, port=%d, idleWhen=0x%x\n",
                    sep->refCount, sep->port, sep->idleWhen);
-            len += sprintf(buffer + len, "\tCongestionQueue (0x%x:0x%x), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
-                 sep->congestionQueue.prev, sep->congestionQueue.next,
+            len += sprintf(buffer + len, "\tCongestionQueue (0x%lx:0x%lx), inPacketSkew=0x%x, outPacketSkew=0x%x\n",
+                 (unsigned long)sep->congestionQueue.prev, (unsigned long)sep->congestionQueue.next,
                  sep->inPacketSkew, sep->outPacketSkew);
 #ifdef RX_ENABLE_LOCKS
             len += sprintf(buffer + len, "\tpeer_lock=%d\n", sep->peer_lock);
@@ -225,10 +223,7 @@ int
 rxstatsproc_read(char *buffer, char **start, off_t offset, int count,
              int *eof, void *data)
 {
-    int len, i, j;
-    void *ret = NULL;
-    char tbuffer[16];
-    afs_uint32 addr;
+    int len, i;
     
     len = 0;
     len += sprintf(buffer + len, "packetRequests = %d\n", rx_stats.packetRequests);
@@ -297,11 +292,7 @@ int
 rxproc_read(char *buffer, char **start, off_t offset, int count,
              int *eof, void *data)
 {
-    int len, i, j;
-    struct rx_peer *sep;
-    void *ret = NULL;
-    char tbuffer[16];
-    afs_uint32 addr;
+    int len, i;
     
     len = 0;
     len += sprintf(buffer + len, "rx_extraQuota = %d\n", rx_extraQuota);
@@ -314,7 +305,7 @@ rxproc_read(char *buffer, char **start, off_t offset, int count,
     len += sprintf(buffer + len, "rxi_nSendFrags = %d\n", rxi_nSendFrags);
     len += sprintf(buffer + len, "rx_nPackets = %d\n", rx_nPackets);
     len += sprintf(buffer + len, "rx_nFreePackets = %d\n", rx_nFreePackets);
-    len += sprintf(buffer + len, "rx_socket = 0x%x\n", rx_socket);
+    len += sprintf(buffer + len, "rx_socket = 0x%lx\n", (unsigned long)rx_socket);
     len += sprintf(buffer + len, "rx_Port = %d\n", rx_port);
     for (i = 0; i < RX_N_PACKET_CLASSES; i++)
        len += sprintf(buffer + len, "\trx_packetQuota[%d] = %d\n", i, rx_packetQuota[i]);
@@ -348,33 +339,30 @@ connproc_read(char *buffer, char **start, off_t offset, int count,
 {
     int len, i, j;
     struct rx_connection *sep;
-    void *ret = NULL;
-    char tbuffer[16];
-    afs_uint32 addr;
     
     len = 0;
     for (i = 0, j = 0; i < 256; i++) {
         for (sep = rx_connHashTable[i]; sep; sep = sep->next, j++) {
            len += sprintf(buffer + len, "%lx: next=0x%lx, peer=0x%lx, epoch=0x%x, cid=0x%x, ackRate=%d\n",
-                          sep, sep->next, sep->peer, sep->epoch, sep->cid, 
-                          sep->ackRate);
-           len += sprintf(buffer + len, "\tcall[%x=%d, %x=%d, %x=%d, %x=%d]\n", 
-                          sep->call[0], sep->callNumber[0], sep->call[1], 
-                          sep->callNumber[1], sep->call[2],
-                          sep->callNumber[2], sep->call[3], 
-                          sep->callNumber[3]);
+                          (unsigned long)sep, (unsigned long)sep->next, (unsigned long)sep->peer,
+                          sep->epoch, sep->cid, sep->ackRate);
+           len += sprintf(buffer + len, "\tcall[%lx=%d, %lx=%d, %lx=%d, %lx=%d]\n", 
+                          (unsigned long)sep->call[0], sep->callNumber[0],
+                          (unsigned long)sep->call[1], sep->callNumber[1],
+                          (unsigned long)sep->call[2], sep->callNumber[2],
+                          (unsigned long)sep->call[3], sep->callNumber[3]);
             len += sprintf(buffer + len, "\ttimeout=%d, flags=0x%x, type=0x%x, serviceId=%d, service=0x%lx, refCount=%d\n",
                           sep->timeout, sep->flags, sep->type, 
-                          sep->serviceId, sep->service, sep->refCount);
+                          sep->serviceId, (unsigned long)sep->service, sep->refCount);
             len += sprintf(buffer + len, "\tserial=%d, lastSerial=%d, secsUntilDead=%d, secsUntilPing=%d, secIndex=%d\n",
                           sep->serial, sep->lastSerial, sep->secondsUntilDead,
                           sep->secondsUntilPing, sep->securityIndex);
             len += sprintf(buffer + len, "\terror=%d, secObject=0x%lx, secData=0x%lx, secHeaderSize=%d, secmaxTrailerSize=%d\n",
-                          sep->error, sep->securityObject, sep->securityData,
-                          sep->securityHeaderSize, 
-                          sep->securityMaxTrailerSize);
+                          sep->error, (unsigned long)sep->securityObject,
+                          (unsigned long)sep->securityData,
+                          sep->securityHeaderSize, sep->securityMaxTrailerSize);
             len += sprintf(buffer + len, "\tchallEvent=0x%lx, lastSendTime=0x%x, maxSerial=%d, hardDeadTime=%d\n",
-                          sep->challengeEvent, sep->lastSendTime, 
+                          (unsigned long)sep->challengeEvent, sep->lastSendTime, 
                           sep->maxSerial, sep->hardDeadTime);
             if (sep->flags & RX_CONN_MAKECALL_WAITING)
                len += sprintf(buffer + len, "\t***** Conn in RX_CONN_MAKECALL_WAITING state *****\n");
@@ -404,18 +392,15 @@ servicesproc_read(char *buffer, char **start, off_t offset, int count,
 {
     int len, i, j;
     struct rx_service *sentry;
-    void *ret = NULL;
-    char tbuffer[16];
-    afs_uint32 addr;
     
     len = 0;
     for (i = 0, j = 0; i < RX_MAX_SERVICES; i++) {
-        if (sentry = rx_services[i]) {
+        if ((sentry = rx_services[i])) {
             j++;
            len += sprintf(buffer + len,
-                          "\t%lx: serviceId=%d, port=%d, serviceName=%s, socket=0x%x\n",
-                          sentry, sentry->serviceId, sentry->servicePort,
-                          sentry->serviceName, sentry->socket);
+                          "\t%lx: serviceId=%d, port=%d, serviceName=%s, socket=0x%lx\n",
+                          (unsigned long)sentry, sentry->serviceId, sentry->servicePort,
+                          sentry->serviceName, (unsigned long)sentry->socket);
            len += sprintf(buffer + len,
                           "\t\tnSecObj=%d, nReqRunning=%d, maxProcs=%d, minProcs=%d, connDeadTime=%d, idleDeadTime=%d\n",
                           sentry->nSecurityObjects, sentry->nRequestsRunning,
@@ -442,9 +427,6 @@ callproc_read(char *buffer, char **start, off_t offset, int count,
 {
     int len, i, j, k;
     struct rx_connection *sep;
-    void *ret = NULL;
-    char tbuffer[16];
-    afs_uint32 addr;
     
     len = 0;
     for (i = 0, j = 0; i < 256; i++) {
@@ -455,14 +437,16 @@ callproc_read(char *buffer, char **start, off_t offset, int count,
                     j++;
                    len += sprintf(buffer + len,
                                   "%lx: conn=0x%lx, qiheader(0x%lx:0x%lx), tq(0x%lx:0x%lx), rq(0x%lx:0x%lx)\n",
-                                  call, call->conn, call->queue_item_header.prev,
-                                  call->queue_item_header.next, call->tq.prev,
-                                  call->tq.next, call->rq.prev, call->rq.next);
+                                  (unsigned long)call, (unsigned long)call->conn,
+                                  (unsigned long)call->queue_item_header.prev,
+                                  (unsigned long)call->queue_item_header.next,
+                                  (unsigned long)call->tq.prev, (unsigned long)call->tq.next,
+                                  (unsigned long)call->rq.prev, (unsigned long)call->rq.next);
                     len += sprintf(buffer + len, 
-                                  "\t: curvec=%d, curpos=%d, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%x\n",
-                                  call->curvec, call->curpos, call->nLeft,
-                                  call->nFree, call->currentPacket,
-                                  call->callNumber);
+                                  "\t: curvec=%d, curpos=%lx, nLeft=%d, nFree=%d, currPacket=0x%lx, callNumber=0x%lx\n",
+                                  call->curvec, (unsigned long)call->curpos, call->nLeft,
+                                  call->nFree, (unsigned long)call->currentPacket,
+                                  (unsigned long)call->callNumber);
                    len += sprintf(buffer + len,
                                   "\t: channel=%d, state=0x%x, mode=0x%x, flags=0x%x, localStatus=0x%x, remStatus=0x%x\n",
                                   call->channel, call->state, call->mode,
@@ -475,13 +459,14 @@ callproc_read(char *buffer, char **start, off_t offset, int count,
                                   call->tnext);
                     len += sprintf(buffer + len,
                                   "\t: twind=%d, resendEvent=0x%lx, timeoutEvent=0x%lx, keepAliveEvent=0x%lx, delayedAckEvent=0x%lx\n",
-                                  call->twind, call->resendEvent,
-                                  call->timeoutEvent, call->keepAliveEvent,
-                                  call->delayedAckEvent);
+                                  call->twind, (unsigned long)call->resendEvent,
+                                  (unsigned long)call->timeoutEvent,
+                                  (unsigned long)call->keepAliveEvent,
+                                  (unsigned long)call->delayedAckEvent);
                    len += sprintf(buffer + len,
                                   "\t: lastSendTime=0x%x, lastReceiveTime=0x%x, lastAcked=0x%x, startTime=0x%x, startWait=0x%x\n",
                                   call->lastSendTime, call->lastReceiveTime,
-                                  call->lastAcked, call->startTime,
+                                  call->lastAcked, call->startTime.sec,
                                   call->startWait);
                     if (call->flags & RX_CALL_WAIT_PROC)
                         len += sprintf(buffer + len,
@@ -657,8 +642,11 @@ init_module(void)
     unsigned long *ptr;
     unsigned long offset=0;
     unsigned long datalen=0;
-    int ret;
+#if defined(EXPORTED_KALLSYMS_SYMBOL)
     unsigned long token=0;
+#endif
+#if defined(EXPORTED_KALLSYMS_SYMBOL) || defined(EXPORTED_KALLSYMS_ADDRESS)
+    int ret;
     char *mod_name;
     unsigned long mod_start=0;
     unsigned long mod_end=0;
@@ -668,6 +656,7 @@ init_module(void)
     char *sym_name;
     unsigned long sym_start=0;
     unsigned long sym_end=0;
+#endif
 #endif /* EXPORTED_SYS_CALL_TABLE */
 
     RWLOCK_INIT(&afs_xosi, "afs_xosi");
@@ -769,7 +758,7 @@ init_module(void)
     if (!sys_call_table) {
        printf("Failed to find address of sys_call_table\n");
     } else {
-       printf("Found sys_call_table at %x\n", sys_call_table);
+       printf("Found sys_call_table at %lx\n", (unsigned long)sys_call_table);
 #if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
        error cant support this yet.;
 #endif /* AFS_SPARC64_LINUX20_ENV */
@@ -831,10 +820,10 @@ init_module(void)
        if (!ia32_sys_call_table) {
            printf("Warning: Failed to find address of ia32_sys_call_table\n");
        } else {
-           printf("Found ia32_sys_call_table at %x\n", ia32_sys_call_table);
+           printf("Found ia32_sys_call_table at %lx\n", (unsigned long)ia32_sys_call_table);
        }
 #else
-       printf("Found ia32_sys_call_table at %x\n", ia32_sys_call_table);
+       printf("Found ia32_sys_call_table at %lx\n", (unsigned long)ia32_sys_call_table);
 #endif /* IA32_SYS_CALL_TABLE */
 #endif
 
@@ -939,8 +928,6 @@ void
 cleanup_module(void)
 #endif
 {
-    struct task_struct *t;
-
     osi_sysctl_clean();
     if (sys_call_table) {
 #if defined(AFS_IA64_LINUX20_ENV)
index 233e8af..bb87dff 100644 (file)
@@ -41,6 +41,10 @@ extern void afs_osi_SetTime(osi_timeval_t * tvp);
 extern void osi_linux_free_inode_pages(void);
 extern void check_bad_parent(struct dentry *dp);
 
+/* osi_sysctl.c */
+extern int osi_sysctl_init();
+extern void osi_sysctl_clean();
+
 /* osi_vm.c */
 extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
 extern void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred,
@@ -53,6 +57,11 @@ extern void osi_VM_Truncate(struct vcache *avc, int alen,
 
 /* osi_vfsops.c */
 extern void set_inode_cache(struct inode *ip, struct vattr *vp);
+extern void put_inode_on_dummy_list(struct inode *ip);
+extern void vattr2inode(struct inode *ip, struct vattr *vp);
 
+/* osi_vnodeops.c */
+extern int afs_linux_writepage_sync(struct inode *ip, struct page *pp,
+                                   unsigned long offset, unsigned int count);
 
 #endif /* _OSI_PROTO_H_ */
index e7f7a68..986fe26 100644 (file)
@@ -50,7 +50,6 @@ int
 afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
 {
     afs_int32 endTime;
-    struct timer_list *timer = NULL;
     int code;
 
     AFS_STATCNT(osi_Wait);
index 87d58fe..c6c52f4 100644 (file)
@@ -98,19 +98,6 @@ typedef struct vattr {
 #define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
 
 
-/* va_masks - these should match their respective ATTR_xxx #defines in fs.h.
- * afs_notify_change has to use the attr bits in both the Linux and AFS
- * meanings. The glue layer code uses the ATTR_xxx style names.
- */
-#define AT_SIZE                ATTR_SIZE
-#define AT_MODE                ATTR_MODE
-#undef AT_UID
-#define AT_UID         ATTR_UID
-#undef AT_GID
-#define AT_GID         ATTR_GID
-#define AT_MTIME       ATTR_MTIME
-
-
 #define vnodeops inode_operations
 
 #endif /* OSI_VFS_H_ */
index 3b895e4..b5df47d 100644 (file)
@@ -18,6 +18,8 @@
 RCSID
     ("$Header$");
 
+#define __NO_VERSION__         /* don't define kernel_version in module.h */
+#include <linux/module.h> /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #include "afs/afs_stats.h"
@@ -28,9 +30,6 @@ RCSID
 #include "h/smp_lock.h"
 #endif
 
-#define __NO_VERSION__         /* don't define kernel_version in module.h */
-#include <linux/module.h>
-
 
 struct vcache *afs_globalVp = 0;
 struct vfs *afs_globalVFS = 0;
@@ -52,7 +51,6 @@ static int afs_root(struct super_block *afsp);
 struct super_block *afs_read_super(struct super_block *sb, void *data, int silent);
 int afs_fill_super(struct super_block *sb, void *data, int silent);
 static struct super_block *afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data);
-void put_inode_on_dummy_list(struct inode *ip);
 
 /* afs_file_system
  * VFS entry for Linux - installed in init_module
@@ -267,7 +265,11 @@ static LIST_HEAD(dummy_inode_list);
  * has synced some pages of a file to disk.
  */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef WRITE_INODE_NOT_VOID
+static int
+#else
 static void
+#endif
 afs_write_inode(struct inode *ip, int unused)
 #else
 static void
@@ -280,6 +282,9 @@ afs_write_inode(struct inode *ip)
 
     /* for now we don't actually update the metadata during msync. This
      * is just to keep linux happy.  */
+#ifdef WRITE_INODE_NOT_VOID
+    return 0;
+#endif
 }
 
 
@@ -300,8 +305,6 @@ afs_destroy_inode(struct inode *ip)
 static void
 afs_delete_inode(struct inode *ip)
 {
-    struct vcache *vp = ITOAFS(ip);
-
 #ifdef AFS_LINUX26_ENV
     put_inode_on_dummy_list(ip);
 #endif
@@ -317,9 +320,7 @@ afs_delete_inode(struct inode *ip)
 static void
 afs_put_super(struct super_block *sbp)
 {
-    extern int afs_afs_cold_shutdown;
     int code = 0;
-    int fv_slept;
 
     AFS_GLOCK();
     AFS_STATCNT(afs_unmount);
@@ -339,7 +340,6 @@ afs_put_super(struct super_block *sbp)
 #endif
 
     osi_linux_verify_alloced_memory();
-  done:
     AFS_GUNLOCK();
 
     if (!code) {
index b64f89d..a414727 100644 (file)
@@ -36,6 +36,9 @@ RCSID
 #if defined(AFS_LINUX24_ENV)
 #include "h/smp_lock.h"
 #endif
+#if defined(AFS_LINUX26_ENV)
+#include "h/writeback.h"
+#endif
 
 #ifdef pgoff2loff
 #define pageoff(pp) pgoff2loff((pp)->index)
@@ -84,7 +87,6 @@ afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp)
        if (*offp + count > afs_vmMappingEnd) {
            uio_t tuio;
            struct iovec iov;
-           afs_size_t oldOffset = *offp;
            afs_int32 xfered = 0;
 
            if (*offp < afs_vmMappingEnd) {
@@ -145,7 +147,7 @@ static ssize_t
 afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp)
 {
     ssize_t code = 0;
-    int code2;
+    int code2 = 0;
     struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
     struct vrequest treq;
     cred_t *credp = crref();
@@ -252,6 +254,8 @@ afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp)
     return code;
 }
 
+extern int BlobScan(struct dcache * afile, afs_int32 ablob);
+
 /* This is a complete rewrite of afs_readdir, since we can make use of
  * filldir instead of afs_readdir_move. Note that changes to vcache/dcache
  * handling and use of bulkstats will need to be reflected here as well.
@@ -346,8 +350,8 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir)
        if (de->name)
            len = strlen(de->name);
        else {
-           printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %x, dirpos %d)\n", 
-                  &tdc->f.inode, dirpos);
+           printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %lx, dirpos %d)\n", 
+                  (unsigned long)&tdc->f.inode, dirpos);
            DRelease((struct buffer *) de, 0);
            afs_PutDCache(tdc);
            ReleaseReadLock(&avc->lock);
@@ -486,7 +490,6 @@ afs_linux_vma_close(struct vm_area_struct *vmap)
            ReleaseWriteLock(&vcp->lock);
     }
 
-  unlock_exit:
     AFS_GUNLOCK();
 }
 
@@ -837,14 +840,19 @@ afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *sta
  * later on, we shouldn't have to do it until later. Perhaps in the future..
  */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
+#ifdef DOP_REVALIDATE_TAKES_NAMEIDATA
+static int
+afs_linux_dentry_revalidate(struct dentry *dp, struct nameidata *nd)
+#else
 static int
 afs_linux_dentry_revalidate(struct dentry *dp, int flags)
+#endif
 #else
 static int
 afs_linux_dentry_revalidate(struct dentry *dp)
 #endif
 {
-    char *name;
+    char *name = NULL;
     cred_t *credp = crref();
     struct vrequest treq;
     struct vcache *lookupvcp = NULL;
@@ -985,13 +993,18 @@ struct dentry_operations afs_dentry_operations = {
  *
  * name is in kernel space at this point.
  */
+#ifdef IOP_CREATE_TAKES_NAMEIDATA
+int
+afs_linux_create(struct inode *dip, struct dentry *dp, int mode,
+                struct nameidata *nd)
+#else
 int
 afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
+#endif
 {
     int code;
     cred_t *credp = crref();
     struct vattr vattr;
-    enum vcexcl excl;
     const char *name = dp->d_name.name;
     struct inode *ip;
 
@@ -1003,7 +1016,7 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
 #endif
     AFS_GLOCK();
     code =
-       afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode,
+       afs_create(ITOAFS(dip), (char *)name, &vattr, NONEXCL, mode,
                   (struct vcache **)&ip, credp);
 
     if (!code) {
@@ -1045,8 +1058,14 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
 
 /* afs_linux_lookup */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
+#ifdef IOP_LOOKUP_TAKES_NAMEIDATA
+struct dentry *
+afs_linux_lookup(struct inode *dip, struct dentry *dp,
+                struct nameidata *nd)
+#else
 struct dentry *
 afs_linux_lookup(struct inode *dip, struct dentry *dp)
+#endif
 #else
 int
 afs_linux_lookup(struct inode *dip, struct dentry *dp)
@@ -1471,8 +1490,13 @@ afs_linux_readpage(struct file *fp, struct page *pp)
 }
 
 #if defined(AFS_LINUX24_ENV)
+#ifdef AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL
+int
+afs_linux_writepage(struct page *pp, struct writeback_control *wbc)
+#else
 int
 afs_linux_writepage(struct page *pp)
+#endif
 {
     struct address_space *mapping = pp->mapping;
     struct inode *inode;
@@ -1480,7 +1504,11 @@ afs_linux_writepage(struct page *pp)
     unsigned offset = PAGE_CACHE_SIZE;
     long status;
 
-#ifdef PageLaunder
+#if defined(AFS_LINUX26_ENV)
+    if (PageReclaim(pp)) {
+       return WRITEPAGE_ACTIVATE;
+    }
+#else
     if (PageLaunder(pp)) {
        return(fail_writepage(pp));
     }
@@ -1513,8 +1541,13 @@ afs_linux_writepage(struct page *pp)
 /* afs_linux_permission
  * Check access rights - returns error if can't check or permission denied.
  */
+#ifdef IOP_PERMISSION_TAKES_NAMEIDATA
+int
+afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd)
+#else
 int
 afs_linux_permission(struct inode *ip, int mode)
+#endif
 {
     int code;
     cred_t *credp = crref();
index 260702a..852ced3 100644 (file)
@@ -399,12 +399,16 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
 /* Boy, was this machine dependent bogosity hard to swallow????.... */
     if (av->va_mode != -1) {
 #else
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_MODE) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_MODE) {
 #else
     if (av->va_mode != ((unsigned short)-1)) {
 #endif
 #endif
+#endif
        mask |= AFS_SETMODE;
        as->UnixModeBits = av->va_mode & 0xffff;
        if (avc->states & CForeign) {
@@ -413,7 +417,10 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
            ReleaseWriteLock(&avc->lock);
        }
     }
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_GID) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_GID) {
 #else
 #if (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
@@ -426,10 +433,14 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
     if (av->va_gid != -1) {
 #endif
 #endif /* AFS_SUN5_ENV */
+#endif /* AFS_LINUX22_ENV */
        mask |= AFS_SETGROUP;
        as->Group = av->va_gid;
     }
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_UID) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_UID) {
 #else
 #if (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
@@ -442,14 +453,19 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
     if (av->va_uid != -1) {
 #endif
 #endif /* AFS_SUN5_ENV */
+#endif /* AFS_LINUX22_ENV */
        mask |= AFS_SETOWNER;
        as->Owner = av->va_uid;
     }
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_MTIME) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_MTIME) {
 #else
     if (av->va_mtime.tv_sec != -1) {
 #endif
+#endif
        mask |= AFS_SETMODTIME;
 #ifndef        AFS_SGI_ENV
 #if    defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
@@ -526,7 +542,10 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
      * path (unlike BSD or SUNOS), so we skip this check for Ultrix.
      *
      */
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (attrs->va_mask & ATTR_SIZE) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (attrs->va_mask & AT_SIZE) {
 #else
 #ifdef AFS_OSF_ENV
@@ -539,6 +558,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
 #endif
 #endif
 #endif
+#endif
        if (!afs_AccessOK(avc, PRSFS_WRITE, &treq, DONT_CHECK_MODE_BITS)) {
            code = EACCES;
            goto done;
@@ -560,7 +580,10 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
 #if defined(AFS_SGI_ENV)
     AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
 #endif
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (attrs->va_mask & ATTR_SIZE) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (attrs->va_mask & AT_SIZE) {
 #else
 #if    defined(AFS_OSF_ENV)
@@ -569,6 +592,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
     if (attrs->va_size != -1) {
 #endif
 #endif
+#endif
        afs_size_t tsize = attrs->va_size;
        ObtainWriteLock(&avc->lock, 128);
        avc->states |= CDirty;
index 90190ae..e462c5b 100644 (file)
@@ -469,15 +469,15 @@ DoLockWarning(void)
 
 
 #ifdef AFS_OSF_ENV
-afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
-           struct AFS_UCRED * acred, pid_t clid, off_t offset)
+int afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
+               struct AFS_UCRED * acred, pid_t clid, off_t offset)
 #elif defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
-           struct AFS_UCRED * acred, pid_t clid)
+int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
+               struct AFS_UCRED * acred, pid_t clid)
 #else
 u_int clid = 0;
-afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
-           struct AFS_UCRED * acred)
+int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
+               struct AFS_UCRED * acred)
 #endif
 {
     struct vrequest treq;
index b2042a9..a1d824c 100644 (file)
@@ -67,7 +67,7 @@ EvalMountPoint(register struct vcache *avc, struct vcache *advc,
     char *cpos, *volnamep;
     char type, *buf;
     afs_int32 prefetch;                /* 1=>None  2=>RO  3=>BK */
-    afs_int32 mtptCell, assocCell, hac = 0;
+    afs_int32 mtptCell, assocCell = 0, hac = 0;
     afs_int32 samecell, roname, len;
 
     AFS_STATCNT(EvalMountPoint);
@@ -432,7 +432,7 @@ afs_getsysname(register struct vrequest *areq, register struct vcache *adp,
 }
 
 void
-Check_AtSys(register struct vcache *avc, char *aname,
+Check_AtSys(register struct vcache *avc, const char *aname,
            struct sysname_info *state, struct vrequest *areq)
 {
     int num = 0;
@@ -448,7 +448,7 @@ Check_AtSys(register struct vcache *avc, char *aname,
        state->offset = -1;
        state->allocked = 0;
        state->index = 0;
-       state->name = aname;
+       state->name = (char *)aname;
     }
 }
 
@@ -500,10 +500,10 @@ Next_AtSys(register struct vcache *avc, struct vrequest *areq,
            }
            afs_PutUser(au, 0);
        }
-       if (++(state->index) >= num || !(*sysnamelist)[state->index])
+       if (++(state->index) >= num || !(*sysnamelist)[(unsigned int)state->index])
            return 0;           /* end of list */
     }
-    strcpy(state->name + state->offset, (*sysnamelist)[state->index]);
+    strcpy(state->name + state->offset, (*sysnamelist)[(unsigned int)state->index]);
     return 1;
 }
 
@@ -546,14 +546,14 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
     struct afs_q *tq;          /* temp queue variable */
     AFSCBFids fidParm;         /* file ID parm for bulk stat */
     AFSBulkStats statParm;     /* stat info parm for bulk stat */
-    int fidIndex;              /* which file were stating */
-    struct conn *tcp;          /* conn for call */
+    int fidIndex = 0;          /* which file were stating */
+    struct conn *tcp = 0;      /* conn for call */
     AFSCBs cbParm;             /* callback parm for bulk stat */
     struct server *hostp = 0;  /* host we got callback from */
     long startTime;            /* time we started the call,
                                 * for callback expiration base
                                 */
-    afs_size_t statSeqNo;      /* Valued of file size to detect races */
+    afs_size_t statSeqNo = 0;  /* Valued of file size to detect races */
     int code;                  /* error code */
     long newIndex;             /* new index in the dir */
     struct DirEntry *dirEntryp;        /* dir entry we are examining */
@@ -564,7 +564,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
     long volStates;            /* flags from vol structure */
     struct volume *volp = 0;   /* volume ptr */
     struct VenusFid dotdot;
-    int flagIndex;             /* First file with bulk fetch flag set */
+    int flagIndex = 0;         /* First file with bulk fetch flag set */
     int inlinebulk = 0;                /* Did we use InlineBulk RPC or not? */
     XSTATS_DECLS;
     /* first compute some basic parameters.  We dont want to prefetch more
@@ -606,12 +606,12 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
   tagain:
     code = afs_VerifyVCache(adp, areqp);
     if (code)
-       goto done;
+       goto done2;
 
     dcp = afs_GetDCache(adp, (afs_size_t) 0, areqp, &temp, &temp, 1);
     if (!dcp) {
        code = ENOENT;
-       goto done;
+       goto done2;
     }
 
     /* lock the directory cache entry */
@@ -1067,6 +1067,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
     } else {
        code = 0;
     }
+  done2:
     osi_FreeLargeSpace(statMemp);
     osi_FreeLargeSpace(cbfMemp);
     return code;
index 982a7d6..202fff9 100644 (file)
@@ -459,7 +459,9 @@ afs_remunlink(register struct vcache *avc, register int doit)
     struct VenusFid dirFid;
     register struct dcache *tdc;
     afs_int32 code = 0;
+#ifdef AFS_DARWIN14_ENV
     int oldref;
+#endif
 
     if (NBObtainWriteLock(&avc->lock, 423))
        return 0;
index 93b72fa..5e9feda 100644 (file)
@@ -181,7 +181,7 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio,
      * high-level write op.
      */
     if (avc->execsOrWriters <= 0) {
-       printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc,
+       printf("WARNING: afs_ufswr vp=%lx, exOrW=%d\n", (unsigned long)avc,
               avc->execsOrWriters);
     }
 #else
@@ -432,7 +432,7 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio,
      * high-level write op.
      */
     if (avc->execsOrWriters <= 0) {
-       printf("WARNING: afs_ufswr vcp=%x, exOrW=%d\n", avc,
+       printf("WARNING: afs_ufswr vcp=%lx, exOrW=%d\n", (unsigned long)avc,
               avc->execsOrWriters);
     }
 #else
index c801c04..ea2857a 100644 (file)
@@ -271,7 +271,7 @@ afsd_thread(void *rock)
        complete_and_exit(0, 0);
        break;
     default:
-       printf("Unknown op %d in StartDaemon()\n", parm);
+       printf("Unknown op %ld in StartDaemon()\n", (long)parm);
        break;
     }
     return 0;
@@ -1096,6 +1096,7 @@ struct iparam32 {
 };
 
 
+#if defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV))
 static void
 iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
 {
@@ -1104,6 +1105,7 @@ iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
     dst->param3 = src->param3;
     dst->param4 = src->param4;
 }
+#endif
 
 /*
  * If you need to change copyin_iparam(), you may also need to change
@@ -3018,7 +3020,7 @@ afs_icl_EnumerateSets(int (*aproc)
     for (tp = afs_icl_allSets; tp; tp = np) {
        tp->refCount++;         /* hold this guy */
        ReleaseWriteLock(&afs_icl_lock);
-       code = (*aproc) (tp->name, arock, tp);
+       code = (*aproc) (tp->name, arock, (struct afs_icl_log *)tp);
        ObtainWriteLock(&afs_icl_lock, 206);
        np = tp->nextp;         /* tp may disappear next, but not np */
        if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED))
index 744a234..78b2598 100644 (file)
@@ -220,7 +220,8 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
            }
            isec = 2;
            /* kerberos tickets on channel 2 */
-           csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey,
+           csec = rxkad_NewClientSecurityObject(level,
+                                                 (struct ktc_encryptionKey *)tu->ct.HandShakeKey,
                                                 /* kvno */
                                                 tu->ct.AuthHandle, tu->stLen,
                                                 tu->stp);
index eebb5e8..9e958e6 100644 (file)
@@ -292,33 +292,28 @@ afs_CheckRootVolume(void)
        strcpy(rootVolName, afs_rootVolumeName);
     }
 
-    if (!usingDynroot) {
+    if (usingDynroot) {
+       afs_GetDynrootFid(&afs_rootFid);
+       tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
+    } else {
        struct cell *lc = afs_GetPrimaryCell(READ_LOCK);
 
        if (!lc)
            return ENOENT;
        localcell = lc->cellNum;
        afs_PutCell(lc, READ_LOCK);
-    }
-
-    if (usingDynroot) {
-       afs_GetDynrootFid(&afs_rootFid);
-       tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
-    } else {
        tvp = afs_GetVolumeByName(rootVolName, localcell, 1, NULL, READ_LOCK);
-    }
-    if (!tvp && !usingDynroot) {
-       char buf[128];
-       int len = strlen(rootVolName);
-
-       if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
-           strcpy(buf, rootVolName);
-           afs_strcat(buf, ".readonly");
-           tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+       if (!tvp) {
+           char buf[128];
+           int len = strlen(rootVolName);
+
+           if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
+               strcpy(buf, rootVolName);
+               afs_strcat(buf, ".readonly");
+               tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+           }
        }
-    }
-    if (tvp) {
-       if (!usingDynroot) {
+       if (tvp) {
            int volid = (tvp->roVol ? tvp->roVol : tvp->volume);
            afs_rootFid.Cell = localcell;
            if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid
@@ -337,6 +332,8 @@ afs_CheckRootVolume(void)
            afs_rootFid.Fid.Vnode = 1;
            afs_rootFid.Fid.Unique = 1;
        }
+    }
+    if (tvp) {
        afs_initState = 300;    /* won */
        afs_osi_Wakeup(&afs_initState);
        afs_PutVolume(tvp, READ_LOCK);
index a347b00..f231db2 100644 (file)
@@ -1199,7 +1199,7 @@ afs_FindDCache(register struct vcache *avc, afs_size_t abyte)
 {
     afs_int32 chunk;
     register afs_int32 i, index;
-    register struct dcache *tdc;
+    register struct dcache *tdc = NULL;
 
     AFS_STATCNT(afs_FindDCache);
     chunk = AFS_CHUNK(abyte);
@@ -1526,7 +1526,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
     register struct osi_file *file;
     register struct conn *tc;
     int downDCount = 0;
-    struct server *newCallback;
+    struct server *newCallback = NULL;
     char setNewCallback;
     char setVcacheStatus;
     char doVcacheUpdate;
index b0f9d4c..921d2c9 100644 (file)
@@ -351,7 +351,9 @@ afs_InitCacheInfo(register char *afile)
     struct osi_stat tstat;
     register struct osi_file *tfile;
     struct afs_fheader theader;
+#ifndef AFS_LINUX22_ENV
     struct vnode *filevp;
+#endif
     int goodFile;
 
     AFS_STATCNT(afs_InitCacheInfo);
index 67a6c16..a449317 100644 (file)
@@ -84,13 +84,18 @@ afs_InitMemCache(int blkCount, int blkSize, int flags)
 }
 
 int
-afs_MemCacheClose(char *file)
+afs_MemCacheClose(struct osi_file *file)
 {
     return 0;
 }
 
+#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
 void *
 afs_MemCacheOpen(ino_t blkno)
+#else
+void *
+afs_MemCacheOpen(afs_int32 blkno)
+#endif
 {
     struct memCacheEntry *mep;
 
@@ -108,9 +113,10 @@ afs_MemCacheOpen(ino_t blkno)
  * this routine simulates a read in the Memory Cache 
  */
 int
-afs_MemReadBlk(register struct memCacheEntry *mceP, int offset, char *dest,
+afs_MemReadBlk(register struct osi_file *fP, int offset, void *dest,
               int size)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     int bytesRead;
 
     MObtainReadLock(&mceP->afs_memLock);
@@ -188,9 +194,10 @@ afs_MemReadUIO(ino_t blkno, struct uio *uioP)
 
 /*XXX: this extends a block arbitrarily to support big directories */
 int
-afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset, char *src,
+afs_MemWriteBlk(register struct osi_file *fP, int offset, void *src,
                int size)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     AFS_STATCNT(afs_MemWriteBlk);
     MObtainWriteLock(&mceP->afs_memLock, 560);
     if (size + offset > mceP->dataSize) {
@@ -300,8 +307,9 @@ afs_MemWriteUIO(ino_t blkno, struct uio *uioP)
 }
 
 int
-afs_MemCacheTruncate(register struct memCacheEntry *mceP, int size)
+afs_MemCacheTruncate(register struct osi_file *fP, int size)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     AFS_STATCNT(afs_MemCacheTruncate);
 
     MObtainWriteLock(&mceP->afs_memLock, 313);
@@ -321,11 +329,12 @@ afs_MemCacheTruncate(register struct memCacheEntry *mceP, int size)
 
 int
 afs_MemCacheStoreProc(register struct rx_call *acall,
-                     register struct memCacheEntry *mceP,
+                     register struct osi_file *fP,
                      register afs_int32 alen, struct vcache *avc,
                      int *shouldWake, afs_size_t * abytesToXferP,
-                     afs_size_t * abytesXferredP, afs_int32 length)
+                     afs_size_t * abytesXferredP)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
 
     register afs_int32 code;
     register int tlen;
@@ -407,11 +416,12 @@ afs_MemCacheStoreProc(register struct rx_call *acall,
 
 int
 afs_MemCacheFetchProc(register struct rx_call *acall,
-                     register struct memCacheEntry *mceP, afs_size_t abase,
+                     register struct osi_file *fP, afs_size_t abase,
                      struct dcache *adc, struct vcache *avc,
                      afs_size_t * abytesToXferP, afs_size_t * abytesXferredP,
                      afs_int32 lengthFound)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     register afs_int32 code;
     afs_int32 length;
     int moredata = 0;
index 4d61fa3..e270f32 100644 (file)
@@ -445,8 +445,10 @@ afs_osi_SetTime(osi_timeval_t * atv)
 void *
 afs_osi_Alloc(size_t x)
 {
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
     register struct osimem *tm = NULL;
     register int size;
+#endif
 
     AFS_STATCNT(osi_Alloc);
     /* 0-length allocs may return NULL ptr from AFS_KALLOC, so we special-case
index 4dbf33d..eb505e3 100644 (file)
@@ -195,6 +195,7 @@ static int (*(CpioctlSw[])) () = {
 #define PSetClientContext 99   /*  Special pioctl to setup caller's creds  */
 int afs_nobody = NFS_NOBODY;
 
+#if (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV))
 static void
 afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst)
 {
@@ -203,6 +204,7 @@ afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst)
     dst->in_size = src->in_size;
     dst->out_size = src->out_size;
 }
+#endif
 
 /*
  * If you need to change copyin_afs_ioctl(), you may also need to change
@@ -846,9 +848,12 @@ afs_syscall_pioctl(path, com, cmarg, follow)
      int follow;
 {
     struct afs_ioctl data;
-    struct AFS_UCRED *tmpcred, *foreigncreds = NULL;
+#ifdef AFS_NEED_CLIENTCONTEXT
+    struct AFS_UCRED *tmpcred;
+#endif
+    struct AFS_UCRED *foreigncreds = NULL;
     register afs_int32 code = 0;
-    struct vnode *vp;
+    struct vnode *vp = NULL;
 #ifdef AFS_DEC_ENV
     struct vnode *gp;
 #endif
@@ -1519,7 +1524,7 @@ DECL_PIOCTL(PGetVolumeStatus)
     char *motd = afs_osi_Alloc(256);
     register struct conn *tc;
     register afs_int32 code = 0;
-    struct VolumeStatus volstat;
+    struct AFSFetchVolumeStatus volstat;
     register char *cp;
     char *Name, *OfflineMsg, *MOTD;
     XSTATS_DECLS;
@@ -2691,7 +2696,7 @@ DECL_PIOCTL(PGetVnodeXStatus)
  /* for the reader.  */
 DECL_PIOCTL(PSetSysName)
 {
-    char *cp, *cp2, inname[MAXSYSNAME], outname[MAXSYSNAME];
+    char *cp, *cp2 = NULL, inname[MAXSYSNAME], outname[MAXSYSNAME];
     int setsysname, foundname = 0;
     register struct afs_exporter *exporter;
     register struct unixuser *au;
index addebe7..d388b03 100644 (file)
@@ -426,28 +426,31 @@ extern void shutdown_mariner(void);
 
 /* afs_memcache.c */
 extern int afs_InitMemCache(int blkCount, int blkSize, int flags);
-extern int afs_MemCacheClose(char *file);
+extern int afs_MemCacheClose(struct osi_file *file);
+#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
 extern void *afs_MemCacheOpen(ino_t blkno);
-extern int afs_MemReadBlk(register struct memCacheEntry *mceP, int offset,
-                         char *dest, int size);
+#else
+extern void *afs_MemCacheOpen(afs_int32 blkno);
+#endif
+extern int afs_MemReadBlk(register struct osi_file *fP, int offset,
+                         void *dest, int size);
 extern int afs_MemReadvBlk(register struct memCacheEntry *mceP, int offset,
                           struct iovec *iov, int nio, int size);
 extern int afs_MemReadUIO(ino_t blkno, struct uio *uioP);
-extern int afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset,
-                          char *src, int size);
+extern int afs_MemWriteBlk(register struct osi_file *fP, int offset,
+                          void *src, int size);
 extern int afs_MemWritevBlk(register struct memCacheEntry *mceP, int offset,
                            struct iovec *iov, int nio, int size);
 extern int afs_MemWriteUIO(ino_t blkno, struct uio *uioP);
-extern int afs_MemCacheTruncate(register struct memCacheEntry *mceP,
+extern int afs_MemCacheTruncate(register struct osi_file *fP,
                                int size);
 extern int afs_MemCacheStoreProc(register struct rx_call *acall,
-                                register struct memCacheEntry *mceP,
+                                register struct osi_file *fP,
                                 register afs_int32 alen, struct vcache *avc,
                                 int *shouldWake, afs_size_t * abytesToXferP,
-                                afs_size_t * abytesXferredP,
-                                afs_int32 length);
+                                afs_size_t * abytesXferredP);
 extern int afs_MemCacheFetchProc(register struct rx_call *acall,
-                                register struct memCacheEntry *mceP,
+                                register struct osi_file *fP,
                                 afs_size_t abase, struct dcache *adc,
                                 struct vcache *avc,
                                 afs_size_t * abytesToXferP,
@@ -547,7 +550,7 @@ extern int osi_InitCacheInfo(char *aname);
 extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp,
                    size_t asize, size_t * resid);
 extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
-extern void setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf,
+extern void setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf,
                      afs_offs_t pos, int count, uio_flag_t flag,
                      uio_seg_t seg);
 extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop);
@@ -661,6 +664,7 @@ extern struct vfs *afs_globalVFS;
 extern struct vcache *afs_globalVp;
 #ifdef AFS_LINUX20_ENV
 extern void vcache2inode(struct vcache *avc);
+extern void vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp);
 #endif
 
 /* afs_pioctl.c */
@@ -707,7 +711,7 @@ extern void afs_FlushServer(struct server *srvp);
 extern void afs_RemoveSrvAddr(struct srvAddr *sap);
 extern void afs_ActivateServer(struct srvAddr *sap);
 #ifdef AFS_USERSPACE_IP_ADDR
-extern int afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
+extern void afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
                                afs_uint32 subnetmask);
 #else
 #if (!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)
@@ -715,6 +719,7 @@ void afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa);
 #endif
 #endif
 extern int afs_HaveCallBacksFrom(struct server *aserver);
+extern void shutdown_server(void);
 
 
 
@@ -954,7 +959,7 @@ extern int afs_TryEvalFakeStat(struct vcache **avcp,
                               struct vrequest *areq);
 extern void afs_PutFakeStat(struct afs_fakestat_state *state);
 extern int afs_ENameOK(register char *aname);
-extern void Check_AtSys(register struct vcache *avc, char *aname,
+extern void Check_AtSys(register struct vcache *avc, const char *aname,
                        struct sysname_info *state, struct vrequest *areq);
 extern int Next_AtSys(register struct vcache *avc, struct vrequest *areq,
                      struct sysname_info *state);
@@ -983,6 +988,8 @@ extern int afs_MemRead(register struct vcache *avc, struct uio *auio,
 extern int afs_UFSRead(register struct vcache *avc, struct uio *auio,
                       struct AFS_UCRED *acred, daddr_t albn,
                       struct buf **abpp, int noLock);
+extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc,
+                             struct AFS_UCRED *acred, struct vrequest *areq);
 
 
 /* VNOPS/afs_vnop_readdir.c */
index 6f7560b..23c0a45 100644 (file)
@@ -236,7 +236,6 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
      */
     origCBs = afs_allCBs;
 
-  retry:
     maxStoredLength = 0;
     tlen = avc->m.Length;
     minj = 0;
@@ -301,7 +300,7 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
            afs_size_t base, bytes;
            afs_uint32 nchunks;
            int nomore;
-           unsigned int first;
+           unsigned int first = 0;
            int *shouldwake;
            struct conn *tc;
            struct osi_file *tfile;
index 4d7b388..c8ca36b 100644 (file)
@@ -498,9 +498,8 @@ afs_CheckServers(int adown, struct cell *acellp)
     struct conn *tc;
     afs_int32 i, j;
     afs_int32 code;
-    afs_int32 start, end, delta;
+    afs_int32 start, end = 0, delta;
     osi_timeval_t tv;
-    int setTimer;
     struct unixuser *tu;
     char tbuffer[CVBS];
     int srvAddrCount;
@@ -508,9 +507,7 @@ afs_CheckServers(int adown, struct cell *acellp)
     struct conn **conns;
     int nconns;
     struct rx_connection **rxconns;      
-    int nrxconns;
     afs_int32 *conntimer, *deltas;
-    XSTATS_DECLS;
 
     AFS_STATCNT(afs_CheckServers);
 
@@ -1053,7 +1050,7 @@ typedef struct ill_s {
  * afs_uint32 subnetmask;         subnet mask of local addr in net order
  *
  */
-int
+void
 afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
                     afs_uint32 subnetmask)
 {
index 2fa76aa..0206c47 100644 (file)
@@ -45,7 +45,7 @@
 typedef struct timeval osi_timeval_t;
 #endif /* !KERNEL */
 
-#define XSTATS_DECLS struct afs_stats_opTimingData *opP; \
+#define XSTATS_DECLS struct afs_stats_opTimingData *opP = NULL; \
     osi_timeval_t opStartTime, opStopTime, elapsedTime
 
 #define XSTATS_START_TIME(arg) \
index 8169271..0d6e37c 100644 (file)
@@ -301,7 +301,7 @@ afs_CheckLocks(void)
        for (i = 0; i < NSERVERS; i++) {
            for (ts = afs_servers[i]; ts; ts = ts->next) {
                if (ts->flags & SRVR_ISDOWN)
-                   printf("Server entry %x is marked down\n", ts);
+                   printf("Server entry %lx is marked down\n", (unsigned long)ts);
                for (sa = ts->addr; sa; sa = sa->next_sa) {
                    for (tc = sa->conns; tc; tc = tc->next) {
                        if (tc->refCount)
@@ -329,7 +329,7 @@ afs_CheckLocks(void)
        for (i = 0; i < NUSERS; i++) {
            for (tu = afs_users[i]; tu; tu = tu->next) {
                if (tu->refCount)
-                   printf("user at %x is held\n", tu);
+                   printf("user at %lx is held\n", (unsigned long)tu);
            }
        }
     }
index c59afe8..d89c8cd 100644 (file)
@@ -411,7 +411,7 @@ afs_GetVolume(struct VenusFid *afid, struct vrequest *areq,
 
 
 static struct volume *
-afs_SetupVolume(afs_int32 volid, char *aname, char *ve, struct cell *tcell,
+afs_SetupVolume(afs_int32 volid, char *aname, void *ve, struct cell *tcell,
                afs_int32 agood, afs_int32 type, struct vrequest *areq)
 {
     struct volume *tv;
index 1b0fec8..445de42 100644 (file)
@@ -72,7 +72,9 @@
 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
  * inclusion of uaccess.h.
  */
+#ifndef _LINUX_CODA_FS_I
 #define _LINUX_CODA_FS_I
+#endif
 #define _CFS_HEADER_
 struct coda_inode_info {
 };
index 44f2d9f..3772ed6 100644 (file)
@@ -14,3 +14,110 @@ ac_cv_linux_func_inode_setattr_returns_int=yes,
 ac_cv_linux_func_inode_setattr_returns_int=no)])
 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)
 CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE],[
+AC_MSG_CHECKING(for write_inode return type)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_func_write_inode_returns_int,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode; 
+struct super_operations _sops;
+int i; 
+i = _sops.write_inode(&_inode, 0);], 
+ac_cv_linux_func_write_inode_returns_int=yes,
+ac_cv_linux_func_write_inode_returns_int=no)])
+AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_IOP_NAMEIDATA],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether inode_operations.create takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_create_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
+ac_cv_linux_func_i_create_takes_nameidata=yes,
+ac_cv_linux_func_i_create_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)
+if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.lookup takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_lookup_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
+ac_cv_linux_func_i_lookup_takes_nameidata=yes,
+ac_cv_linux_func_i_lookup_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)
+if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.permission takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_permission_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+ac_cv_linux_func_i_permission_takes_nameidata=yes,
+ac_cv_linux_func_i_permission_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)
+if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether dentry_operations.d_revalidate takes a nameidata)
+CPPFLAGS="$CPPFLAGS -Werror"
+AC_CACHE_VAL(ac_cv_linux_func_d_revalidate_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct dentry _dentry; 
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
+ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
+ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)
+if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+  AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether address_space_operations.writepage takes a writeback_control)
+AC_CACHE_VAL(ac_cv_linux_func_a_writepage_takes_writeback_control,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>],
+[struct address_space_operations _aops; 
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);],
+ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
+ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
+AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)
+if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])