]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
eCryptfs: Remove ecryptfs_header_cache_2
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>
Tue, 24 May 2011 10:11:12 +0000 (05:11 -0500)
committerTyler Hicks <tyhicks@linux.vnet.ibm.com>
Sun, 29 May 2011 19:24:25 +0000 (14:24 -0500)
Now that ecryptfs_lookup_interpose() is no longer using
ecryptfs_header_cache_2 to read in metadata, the kmem_cache can be
removed and the ecryptfs_header_cache_1 kmem_cache can be renamed to
ecryptfs_header_cache.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
fs/ecryptfs/crypto.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/main.c

index 66d8e6748a4654f6160d4c2650d73e7087d85a45..58609bde3b9fc076187afa3317582788f2f6bc7f 100644 (file)
@@ -1234,8 +1234,7 @@ ecryptfs_write_header_metadata(char *virt,
        (*written) = 6;
 }
 
-struct kmem_cache *ecryptfs_header_cache_1;
-struct kmem_cache *ecryptfs_header_cache_2;
+struct kmem_cache *ecryptfs_header_cache;
 
 /**
  * ecryptfs_write_headers_virt
@@ -1601,7 +1600,7 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
        ecryptfs_copy_mount_wide_flags_to_inode_flags(crypt_stat,
                                                      mount_crypt_stat);
        /* Read the first page from the underlying file */
-       page_virt = kmem_cache_alloc(ecryptfs_header_cache_1, GFP_USER);
+       page_virt = kmem_cache_alloc(ecryptfs_header_cache, GFP_USER);
        if (!page_virt) {
                rc = -ENOMEM;
                printk(KERN_ERR "%s: Unable to allocate page_virt\n",
@@ -1646,7 +1645,7 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
 out:
        if (page_virt) {
                memset(page_virt, 0, PAGE_CACHE_SIZE);
-               kmem_cache_free(ecryptfs_header_cache_1, page_virt);
+               kmem_cache_free(ecryptfs_header_cache, page_virt);
        }
        return rc;
 }
index 8297ddaca7c4236fe9485d9fd73519dfd2e8e698..43c7c43b06f54f10c692a21df3b4158059257bbb 100644 (file)
@@ -605,8 +605,7 @@ extern struct kmem_cache *ecryptfs_file_info_cache;
 extern struct kmem_cache *ecryptfs_dentry_info_cache;
 extern struct kmem_cache *ecryptfs_inode_info_cache;
 extern struct kmem_cache *ecryptfs_sb_info_cache;
-extern struct kmem_cache *ecryptfs_header_cache_1;
-extern struct kmem_cache *ecryptfs_header_cache_2;
+extern struct kmem_cache *ecryptfs_header_cache;
 extern struct kmem_cache *ecryptfs_xattr_cache;
 extern struct kmem_cache *ecryptfs_key_record_cache;
 extern struct kmem_cache *ecryptfs_key_sig_cache;
index 943a4f55ed6d6039877b111b8e5ebf7b2eb669de..9f1bb747d77dd17bbcc907b3e249f3865cf4d31e 100644 (file)
@@ -635,13 +635,8 @@ static struct ecryptfs_cache_info {
                .size = sizeof(struct ecryptfs_sb_info),
        },
        {
-               .cache = &ecryptfs_header_cache_1,
-               .name = "ecryptfs_headers_1",
-               .size = PAGE_CACHE_SIZE,
-       },
-       {
-               .cache = &ecryptfs_header_cache_2,
-               .name = "ecryptfs_headers_2",
+               .cache = &ecryptfs_header_cache,
+               .name = "ecryptfs_headers",
                .size = PAGE_CACHE_SIZE,
        },
        {