]> Pileus Git - ~andy/linux/blobdiff - net/ceph/ceph_common.c
Merge remote-tracking branches 'asoc/fix/sta32x', 'asoc/fix/wm8400', 'asoc/fix/wm8770...
[~andy/linux] / net / ceph / ceph_common.c
index 34b11ee8124ee9b04a7026063b9159e6ce864be2..67d7721d237e1638c21bc62da98f7275a9991026 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/statfs.h>
 #include <linux/string.h>
+#include <linux/vmalloc.h>
 #include <linux/nsproxy.h>
 #include <net/net_namespace.h>
 
@@ -170,6 +171,25 @@ int ceph_compare_options(struct ceph_options *new_opt,
 }
 EXPORT_SYMBOL(ceph_compare_options);
 
+void *ceph_kvmalloc(size_t size, gfp_t flags)
+{
+       if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
+               void *ptr = kmalloc(size, flags | __GFP_NOWARN);
+               if (ptr)
+                       return ptr;
+       }
+
+       return __vmalloc(size, flags | __GFP_HIGHMEM, PAGE_KERNEL);
+}
+
+void ceph_kvfree(const void *ptr)
+{
+       if (is_vmalloc_addr(ptr))
+               vfree(ptr);
+       else
+               kfree(ptr);
+}
+
 
 static int parse_fsid(const char *str, struct ceph_fsid *fsid)
 {
@@ -461,8 +481,8 @@ EXPORT_SYMBOL(ceph_client_id);
  * create a fresh client instance
  */
 struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private,
-                                      unsigned int supported_features,
-                                      unsigned int required_features)
+                                      u64 supported_features,
+                                      u64 required_features)
 {
        struct ceph_client *client;
        struct ceph_entity_addr *myaddr = NULL;