Whamcloud - gitweb
LU-1346 libcfs: replace cfs_ memory wrappers
[fs/lustre-release.git] / lustre / obdclass / capa.c
index 02fb53d..47f52d0 100644 (file)
@@ -63,7 +63,7 @@
 #define NR_CAPAHASH 32
 #define CAPA_HASH_SIZE 3000              /* for MDS & OSS */
 
-cfs_mem_cache_t *capa_cachep = NULL;
+struct kmem_cache *capa_cachep;
 
 #ifdef __KERNEL__
 /* lock for capa hash/capa_list/fo_capa_keys */
@@ -85,19 +85,19 @@ EXPORT_SYMBOL(capa_count);
 
 cfs_hlist_head_t *init_capa_hash(void)
 {
-        cfs_hlist_head_t *hash;
-        int nr_hash, i;
+       cfs_hlist_head_t *hash;
+       int nr_hash, i;
 
-        OBD_ALLOC(hash, CFS_PAGE_SIZE);
-        if (!hash)
-                return NULL;
+       OBD_ALLOC(hash, PAGE_CACHE_SIZE);
+       if (!hash)
+               return NULL;
 
-        nr_hash = CFS_PAGE_SIZE / sizeof(cfs_hlist_head_t);
-        LASSERT(nr_hash > NR_CAPAHASH);
+       nr_hash = PAGE_CACHE_SIZE / sizeof(cfs_hlist_head_t);
+       LASSERT(nr_hash > NR_CAPAHASH);
 
-        for (i = 0; i < NR_CAPAHASH; i++)
-                CFS_INIT_HLIST_HEAD(hash + i);
-        return hash;
+       for (i = 0; i < NR_CAPAHASH; i++)
+               CFS_INIT_HLIST_HEAD(hash + i);
+       return hash;
 }
 EXPORT_SYMBOL(init_capa_hash);
 
@@ -131,7 +131,7 @@ void cleanup_capa_hash(cfs_hlist_head_t *hash)
        }
        spin_unlock(&capa_lock);
 
-       OBD_FREE(hash, CFS_PAGE_SIZE);
+       OBD_FREE(hash, PAGE_CACHE_SIZE);
 }
 EXPORT_SYMBOL(cleanup_capa_hash);
 
@@ -267,7 +267,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
 
         sg_set_page(&sl, virt_to_page(capa),
                     offsetof(struct lustre_capa, lc_hmac),
-                    (unsigned long)(capa) % CFS_PAGE_SIZE);
+                   (unsigned long)(capa) % PAGE_CACHE_SIZE);
 
         ll_crypto_hmac(tfm, key, &keylen, &sl, sl.length, hmac);
         ll_crypto_free_hash(tfm);
@@ -307,11 +307,11 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
                 GOTO(out, rc);
         }
 
-        sg_set_page(&sd, virt_to_page(d), 16,
-                    (unsigned long)(d) % CFS_PAGE_SIZE);
+       sg_set_page(&sd, virt_to_page(d), 16,
+                   (unsigned long)(d) % PAGE_CACHE_SIZE);
 
-        sg_set_page(&ss, virt_to_page(s), 16,
-                    (unsigned long)(s) % CFS_PAGE_SIZE);
+       sg_set_page(&ss, virt_to_page(s), 16,
+                   (unsigned long)(s) % PAGE_CACHE_SIZE);
         desc.tfm   = tfm;
         desc.info  = NULL;
         desc.flags = 0;
@@ -360,11 +360,11 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
                 GOTO(out, rc);
         }
 
-        sg_set_page(&sd, virt_to_page(d), 16,
-                    (unsigned long)(d) % CFS_PAGE_SIZE);
+       sg_set_page(&sd, virt_to_page(d), 16,
+                   (unsigned long)(d) % PAGE_CACHE_SIZE);
 
-        sg_set_page(&ss, virt_to_page(s), 16,
-                    (unsigned long)(s) % CFS_PAGE_SIZE);
+       sg_set_page(&ss, virt_to_page(s), 16,
+                   (unsigned long)(s) % PAGE_CACHE_SIZE);
 
         desc.tfm   = tfm;
         desc.info  = NULL;