]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfs/internal.h
NFS: Fix some 'sparse' warnings...
[linux-2.6-omap-h63xx.git] / fs / nfs / internal.h
index 6610f2b0207743a26693a43db49b63b0d8c058b2..ad2b40db1e65f901d7081c27ed0b9650816a8f6d 100644 (file)
@@ -231,3 +231,15 @@ unsigned int nfs_page_length(struct page *page)
        }
        return 0;
 }
+
+/*
+ * Determine the number of pages in an array of length 'len' and
+ * with a base offset of 'base'
+ */
+static inline
+unsigned int nfs_page_array_len(unsigned int base, size_t len)
+{
+       return ((unsigned long)len + (unsigned long)base +
+               PAGE_SIZE - 1) >> PAGE_SHIFT;
+}
+