]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/rds/page.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[karo-tx-linux.git] / net / rds / page.c
index 1dfbfea12e9bc82ba8482277b4331289effa275b..b82d63e77b031a807392924dfa134f8453841f7f 100644 (file)
@@ -32,6 +32,7 @@
  */
 #include <linux/highmem.h>
 #include <linux/gfp.h>
+#include <linux/cpu.h>
 
 #include "rds.h"
 
@@ -40,7 +41,8 @@ struct rds_page_remainder {
        unsigned long   r_offset;
 };
 
-DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_page_remainder, rds_page_remainders);
+static DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_page_remainder,
+                                    rds_page_remainders);
 
 /*
  * returns 0 on success or -errno on failure.
@@ -103,7 +105,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
        /* jump straight to allocation if we're trying for a huge page */
        if (bytes >= PAGE_SIZE) {
                page = alloc_page(gfp);
-               if (page == NULL) {
+               if (!page) {
                        ret = -ENOMEM;
                } else {
                        sg_set_page(scat, page, PAGE_SIZE, 0);
@@ -149,7 +151,7 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
                rem = &per_cpu(rds_page_remainders, get_cpu());
                local_irq_save(flags);
 
-               if (page == NULL) {
+               if (!page) {
                        ret = -ENOMEM;
                        break;
                }
@@ -173,6 +175,7 @@ out:
                 ret ? 0 : scat->length);
        return ret;
 }
+EXPORT_SYMBOL_GPL(rds_page_remainder_alloc);
 
 static int rds_page_remainder_cpu_notify(struct notifier_block *self,
                                         unsigned long action, void *hcpu)