aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-02-06 04:38:32 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:12 -0500
commit7896b631823c6e8f1a520d89390624a51445840e (patch)
tree2f9f2151802d21ded60fc6f53df4daeee3eb054e /fs
parent162c0d91a365d501c6cc65cba451f2d855e8ee81 (diff)
fs/ecryptfs/: possible cleanups
- make the following needlessly global code static: - crypto.c:ecryptfs_lower_offset_for_extent() - crypto.c:key_tfm_list - crypto.c:key_tfm_list_mutex - inode.c:ecryptfs_getxattr() - main.c:ecryptfs_init_persistent_file() - remove the no longer used mmap.c:ecryptfs_lower_page_cache - #if 0 the unused read_write.c:ecryptfs_read() Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/crypto.c8
-rw-r--r--fs/ecryptfs/ecryptfs_kernel.h10
-rw-r--r--fs/ecryptfs/inode.c2
-rw-r--r--fs/ecryptfs/main.c2
-rw-r--r--fs/ecryptfs/mmap.c2
-rw-r--r--fs/ecryptfs/read_write.c2
6 files changed, 8 insertions, 18 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index f8ef0af919e7..5e7d018a3486 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -376,8 +376,8 @@ out:
376 * 376 *
377 * Convert an eCryptfs page index into a lower byte offset 377 * Convert an eCryptfs page index into a lower byte offset
378 */ 378 */
379void ecryptfs_lower_offset_for_extent(loff_t *offset, loff_t extent_num, 379static void ecryptfs_lower_offset_for_extent(loff_t *offset, loff_t extent_num,
380 struct ecryptfs_crypt_stat *crypt_stat) 380 struct ecryptfs_crypt_stat *crypt_stat)
381{ 381{
382 (*offset) = ((crypt_stat->extent_size 382 (*offset) = ((crypt_stat->extent_size
383 * crypt_stat->num_header_extents_at_front) 383 * crypt_stat->num_header_extents_at_front)
@@ -1802,8 +1802,8 @@ out:
1802} 1802}
1803 1803
1804struct kmem_cache *ecryptfs_key_tfm_cache; 1804struct kmem_cache *ecryptfs_key_tfm_cache;
1805struct list_head key_tfm_list; 1805static struct list_head key_tfm_list;
1806struct mutex key_tfm_list_mutex; 1806static struct mutex key_tfm_list_mutex;
1807 1807
1808int ecryptfs_init_crypto(void) 1808int ecryptfs_init_crypto(void)
1809{ 1809{
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index ce7a5d4aec36..466661c9fb21 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -322,9 +322,6 @@ struct ecryptfs_key_tfm {
322 unsigned char cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE + 1]; 322 unsigned char cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE + 1];
323}; 323};
324 324
325extern struct list_head key_tfm_list;
326extern struct mutex key_tfm_list_mutex;
327
328/** 325/**
329 * This struct is to enable a mount-wide passphrase/salt combo. This 326 * This struct is to enable a mount-wide passphrase/salt combo. This
330 * is more or less a stopgap to provide similar functionality to other 327 * is more or less a stopgap to provide similar functionality to other
@@ -525,7 +522,6 @@ extern struct kmem_cache *ecryptfs_header_cache_0;
525extern struct kmem_cache *ecryptfs_header_cache_1; 522extern struct kmem_cache *ecryptfs_header_cache_1;
526extern struct kmem_cache *ecryptfs_header_cache_2; 523extern struct kmem_cache *ecryptfs_header_cache_2;
527extern struct kmem_cache *ecryptfs_xattr_cache; 524extern struct kmem_cache *ecryptfs_xattr_cache;
528extern struct kmem_cache *ecryptfs_lower_page_cache;
529extern struct kmem_cache *ecryptfs_key_record_cache; 525extern struct kmem_cache *ecryptfs_key_record_cache;
530extern struct kmem_cache *ecryptfs_key_sig_cache; 526extern struct kmem_cache *ecryptfs_key_sig_cache;
531extern struct kmem_cache *ecryptfs_global_auth_tok_cache; 527extern struct kmem_cache *ecryptfs_global_auth_tok_cache;
@@ -576,8 +572,6 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length);
576int ecryptfs_inode_test(struct inode *inode, void *candidate_lower_inode); 572int ecryptfs_inode_test(struct inode *inode, void *candidate_lower_inode);
577int ecryptfs_inode_set(struct inode *inode, void *lower_inode); 573int ecryptfs_inode_set(struct inode *inode, void *lower_inode);
578void ecryptfs_init_inode(struct inode *inode, struct inode *lower_inode); 574void ecryptfs_init_inode(struct inode *inode, struct inode *lower_inode);
579ssize_t ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value,
580 size_t size);
581ssize_t 575ssize_t
582ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name, 576ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name,
583 void *value, size_t size); 577 void *value, size_t size);
@@ -631,8 +625,6 @@ int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key,
631 char *sig); 625 char *sig);
632int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start, 626int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start,
633 int num_zeros); 627 int num_zeros);
634void ecryptfs_lower_offset_for_extent(loff_t *offset, loff_t extent_num,
635 struct ecryptfs_crypt_stat *crypt_stat);
636int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data, 628int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
637 loff_t offset, size_t size); 629 loff_t offset, size_t size);
638int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode, 630int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode,
@@ -646,8 +638,6 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
646 pgoff_t page_index, 638 pgoff_t page_index,
647 size_t offset_in_page, size_t size, 639 size_t offset_in_page, size_t size,
648 struct inode *ecryptfs_inode); 640 struct inode *ecryptfs_inode);
649int ecryptfs_read(char *data, loff_t offset, size_t size,
650 struct file *ecryptfs_file);
651struct page *ecryptfs_get_locked_page(struct file *file, loff_t index); 641struct page *ecryptfs_get_locked_page(struct file *file, loff_t index);
652 642
653#endif /* #ifndef ECRYPTFS_KERNEL_H */ 643#endif /* #ifndef ECRYPTFS_KERNEL_H */
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 5a719180983c..ed0ed849ee28 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -954,7 +954,7 @@ out:
954 return rc; 954 return rc;
955} 955}
956 956
957ssize_t 957static ssize_t
958ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value, 958ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value,
959 size_t size) 959 size_t size)
960{ 960{
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 0249aa4ae181..d9f53c331a27 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -117,7 +117,7 @@ void __ecryptfs_printk(const char *fmt, ...)
117 * 117 *
118 * Returns zero on success; non-zero otherwise 118 * Returns zero on success; non-zero otherwise
119 */ 119 */
120int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry) 120static int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
121{ 121{
122 struct ecryptfs_inode_info *inode_info = 122 struct ecryptfs_inode_info *inode_info =
123 ecryptfs_inode_to_private(ecryptfs_dentry->d_inode); 123 ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 0535412d8c64..9a5e0d17f1c5 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -34,8 +34,6 @@
34#include <linux/scatterlist.h> 34#include <linux/scatterlist.h>
35#include "ecryptfs_kernel.h" 35#include "ecryptfs_kernel.h"
36 36
37struct kmem_cache *ecryptfs_lower_page_cache;
38
39/** 37/**
40 * ecryptfs_get_locked_page 38 * ecryptfs_get_locked_page
41 * 39 *
diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
index 948f57624c05..0c4928623bbc 100644
--- a/fs/ecryptfs/read_write.c
+++ b/fs/ecryptfs/read_write.c
@@ -293,6 +293,7 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
293 return rc; 293 return rc;
294} 294}
295 295
296#if 0
296/** 297/**
297 * ecryptfs_read 298 * ecryptfs_read
298 * @data: The virtual address into which to write the data read (and 299 * @data: The virtual address into which to write the data read (and
@@ -371,3 +372,4 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
371out: 372out:
372 return rc; 373 return rc;
373} 374}
375#endif /* 0 */