fs/ecryptfs/: make code static
RFC PATCH 1/1 fs/ecryptfs/: make code static
This patch makes some needlessly global code static.
Signed-off-by Adrian Bunk <[email protected]>
---
fs/ecryptfs/crypto.c | 24 ++++++++++++------------ fs/ecryptfs/ecryptfs_kernel.h | 18 ------------------ fs/ecryptfs/messaging.c | 20 +++++++++++--------- 3 files changed, 23 insertions(+), 39 deletions(-)
fs/ecryptfs/ecryptfs_kernel.h renamed from fs/ecryptfs/ecryptfs_kernel.h.old +0 -18
@@ -329,18 +329,6 @@struct mutex mux; }; -extern struct list_head ecryptfs_msg_ctx_free_list; -extern struct list_head ecryptfs_msg_ctx_alloc_list; -extern struct mutex ecryptfs_msg_ctx_lists_mux; - -#define ecryptfs_uid_hash (uid) \ - hash_long((unsigned long)uid, ecryptfs_hash_buckets) -extern struct hlist_head *ecryptfs_daemon_id_hash; -extern struct mutex ecryptfs_daemon_id_hash_mux; -extern int ecryptfs_hash_buckets; - -extern unsigned int ecryptfs_msg_counter; -extern struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;extern unsigned int ecryptfs_transport;struct ecryptfs_daemon_id {
@@ -538,15 +526,9 @@int ecryptfs_decrypt_page (struct file *file,struct page *page);int ecryptfs_write_metadata (struct dentry *ecryptfs_dentry,struct file *lower_file); -int ecryptfs_write_headers_virt (char *page_virt,size_t *size, -struct ecryptfs_crypt_stat *crypt_stat, -struct dentry *ecryptfs_dentry);int ecryptfs_read_metadata (struct dentry *ecryptfs_dentry,struct file *lower_file);int ecryptfs_new_file_context (struct dentry *ecryptfs_dentry); -int contains_ecryptfs_marker (char *data); -int ecryptfs_read_header_region (char *data,struct dentry *dentry, -struct vfsmount *mnt);int ecryptfs_read_and_validate_header_region (char *data,struct dentry *dentry,struct vfsmount *mnt); int ecryptfs_read_and_validate_xattr_region(char *page_virt,
fs/ecryptfs/crypto.c renamed from fs/ecryptfs/crypto.c.old +12 -12
@@ -1026,7 +1026,7 @@* * Returns one if marker found; zero if not found */ -int contains_ecryptfs_marker (char *data) +static int contains_ecryptfs_marker (char *data) {u32 m_1, m_2;
@@ -1213,8 +1213,8 @@* * Returns zero on success; non-zero otherwise */ -int ecryptfs_read_header_region (char *data,struct dentry *dentry, -struct vfsmount *mnt) +static int ecryptfs_read_header_region (char *data,struct dentry *dentry, +struct vfsmount *mnt) {struct file *lower_file;mm_segment_t oldfs;
@@ -1310,9 +1310,9 @@* * Returns zero on success */ -int ecryptfs_write_headers_virt (char *page_virt,size_t *size, -struct ecryptfs_crypt_stat *crypt_stat, -struct dentry *ecryptfs_dentry) +static int ecryptfs_write_headers_virt (char *page_virt,size_t *size, +struct ecryptfs_crypt_stat *crypt_stat, +struct dentry *ecryptfs_dentry) {int rc;size_t written;
@@ -1339,9 +1339,9 @@return rc; } -int ecryptfs_write_metadata_to_contents (struct ecryptfs_crypt_stat *crypt_stat, -struct file *lower_file, -char *page_virt) +static int ecryptfs_write_metadata_to_contents (struct ecryptfs_crypt_stat *crypt_stat, +struct file *lower_file, +char *page_virt) {mm_segment_t oldfs;int current_header_page;
@@ -1366,9 +1366,9 @@return 0 ; } -int ecryptfs_write_metadata_to_xattr (struct dentry *ecryptfs_dentry, -struct ecryptfs_crypt_stat *crypt_stat, -char *page_virt,size_t size) +static int ecryptfs_write_metadata_to_xattr (struct dentry *ecryptfs_dentry, +struct ecryptfs_crypt_stat *crypt_stat, +char *page_virt,size_t size) {int rc;
fs/ecryptfs/messaging.c renamed from fs/ecryptfs/messaging.c.old +11 -9
@@ -22,16 +22,18 @@#include "ecryptfs_kernel.h" -LIST_HEAD (ecryptfs_msg_ctx_free_list); -LIST_HEAD (ecryptfs_msg_ctx_alloc_list); -struct mutex ecryptfs_msg_ctx_lists_mux; - -struct hlist_head *ecryptfs_daemon_id_hash; -struct mutex ecryptfs_daemon_id_hash_mux; -int ecryptfs_hash_buckets; +static LIST_HEAD (ecryptfs_msg_ctx_free_list); +static LIST_HEAD (ecryptfs_msg_ctx_alloc_list); +static struct mutex ecryptfs_msg_ctx_lists_mux; + +static struct hlist_head *ecryptfs_daemon_id_hash; +static struct mutex ecryptfs_daemon_id_hash_mux; +static int ecryptfs_hash_buckets; +#define ecryptfs_uid_hash (uid) \ + hash_long((unsigned long)uid, ecryptfs_hash_buckets) -unsigned int ecryptfs_msg_counter; -struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; +static unsigned int ecryptfs_msg_counter; +static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;/** * ecryptfs_acquire_free_msg_ctx