FreeBSD 9.1: Warning fixes
authorAndrew Deason <adeason@sinenomine.net>
Fri, 18 Jan 2013 23:05:12 +0000 (17:05 -0600)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 22 Jan 2013 15:34:46 +0000 (07:34 -0800)
Fix warnings caused by some changes in FreeBSD 9.1:

 - afs_cmount takes a uint64_t for flags instead of an int
 - vn_rdwr takes a ssize_t* for resid instead of an int*

[kaduk@mit.edu: rebase onto master and use fine-grained version checks]

Change-Id: I03ab805a625790004a910df96b96aeda1121e2a7
Reviewed-on: http://gerrit.openafs.org/8922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/afs/FBSD/osi_file.c

index 2b809dd..096e472 100644 (file)
@@ -158,7 +158,11 @@ int
 afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
             afs_int32 asize)
 {
+#if (__FreeBSD_version >= 900505 && __FreeBSD_Version < 1000000) ||__FreeBSD_version >= 1000009
+    ssize_t resid;
+#else
     int resid;
+#endif
     afs_int32 code;
     AFS_STATCNT(osi_Read);
 
@@ -185,7 +189,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        afile->offset += code;
        osi_DisableAtimes(afile->vnode);
     } else {
-       afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
+       afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, (int)resid,
                   ICL_TYPE_INT32, code);
        if (code > 0) {
            code = -code;
@@ -199,7 +203,11 @@ int
 afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
              afs_int32 asize)
 {
-    unsigned int resid;
+#if (__FreeBSD_version >= 900505 && __FreeBSD_Version < 1000000) ||__FreeBSD_version >= 1000009
+    ssize_t resid;
+#else
+    int resid;
+#endif
     afs_int32 code;
     AFS_STATCNT(osi_Write);
     if (!afile)