]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
nfs: fix a couple of minor portability issues
authorChris Metcalf <cmetcalf@tilera.com>
Wed, 10 Aug 2011 17:56:28 +0000 (13:56 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Wed, 10 Aug 2011 18:33:39 +0000 (14:33 -0400)
Building on tilepro revealed two minor portability issues: the
blocklayout.c file used prefetchw() without #include <linux/prefetch.h>,
and the nfs4filelayout.c file used do_div() on an s64 not a u64.
This change fixes those two issues so the NFS code builds on tilepro.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
fs/nfs/blocklayout/blocklayout.c
fs/nfs/nfs4filelayout.c

index e56564d2ef95a37608106fb439723ff3e3c1e90d..9561c8fc8bdb6d7fed807d94f6cb5c2e3bb52276 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/namei.h>
 #include <linux/bio.h>         /* struct bio */
 #include <linux/buffer_head.h> /* various write calls */
+#include <linux/prefetch.h>
 
 #include "blocklayout.h"
 
index e8915d4840ad48457f23ecaac9e551fed5fa5652..6976a72576f51c19e30927d3ac1ba4166f5c0d9a 100644 (file)
@@ -48,13 +48,13 @@ filelayout_get_dense_offset(struct nfs4_filelayout_segment *flseg,
                            loff_t offset)
 {
        u32 stripe_width = flseg->stripe_unit * flseg->dsaddr->stripe_count;
-       u64 tmp;
+       u64 tmp, uoff;
 
        offset -= flseg->pattern_offset;
-       tmp = offset;
+       tmp = uoff = offset;
        do_div(tmp, stripe_width);
 
-       return tmp * flseg->stripe_unit + do_div(offset, flseg->stripe_unit);
+       return tmp * flseg->stripe_unit + do_div(uoff, flseg->stripe_unit);
 }
 
 /* This function is used by the layout driver to calculate the