[-mm patch] fs/ecryptfs/: make code static

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Adrian Bunk
Date: Sunday, July 29, 2007 - 7:57 am

On Wed, Jul 25, 2007 at 04:03:04AM -0700, Andrew Morton wrote:

This patch makes some needlessly global code static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 fs/ecryptfs/crypto.c          |   15 +++++------
 fs/ecryptfs/ecryptfs_kernel.h |   10 -------
 fs/ecryptfs/keystore.c        |   43 +++++++++++++++++-----------------
 3 files changed, 29 insertions(+), 39 deletions(-)

--- linux-2.6.23-rc1-mm1/fs/ecryptfs/ecryptfs_kernel.h.old	2007-07-26 13:50:59.000000000 +0200
+++ linux-2.6.23-rc1-mm1/fs/ecryptfs/ecryptfs_kernel.h	2007-07-26 14:09:15.000000000 +0200
@@ -156,7 +156,6 @@
 	} token;
 } __attribute__ ((packed));
 
-int ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok);
 void ecryptfs_dump_auth_tok(struct ecryptfs_auth_tok *auth_tok);
 extern void ecryptfs_to_hex(char *dst, char *src, size_t src_size);
 extern void ecryptfs_from_hex(char *dst, char *src, int dst_size);
@@ -290,9 +289,6 @@
 	unsigned char cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE + 1];
 };
 
-extern struct list_head key_tfm_list;
-extern struct mutex key_tfm_list_mutex;
-
 /**
  * This struct is to enable a mount-wide passphrase/salt combo. This
  * is more or less a stopgap to provide similar functionality to other
@@ -520,9 +516,6 @@
 void ecryptfs_destruct_mount_crypt_stat(
 	struct ecryptfs_mount_crypt_stat *mount_crypt_stat);
 int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat);
-int ecryptfs_crypto_api_algify_cipher_name(char **algified_name,
-					   char *cipher_name,
-					   char *chaining_modifier);
 #define ECRYPTFS_LOWER_I_MUTEX_NOT_HELD 0
 #define ECRYPTFS_LOWER_I_MUTEX_HELD 1
 int ecryptfs_write_inode_size_to_metadata(struct file *lower_file,
@@ -563,13 +556,10 @@
 				     struct ecryptfs_crypt_stat *crypt_stat,
 				     struct dentry *ecryptfs_dentry,
 				     size_t *len, size_t max);
-int process_request_key_err(long err_code);
 int
 ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
 			  unsigned char *src, struct dentry *ecryptfs_dentry);
 int ecryptfs_truncate(struct dentry *dentry, loff_t new_length);
-int ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
-				char *cipher_name, size_t *key_size);
 int ecryptfs_inode_test(struct inode *inode, void *candidate_lower_inode);
 int ecryptfs_inode_set(struct inode *inode, void *lower_inode);
 void ecryptfs_init_inode(struct inode *inode, struct inode *lower_inode);
--- linux-2.6.23-rc1-mm1/fs/ecryptfs/crypto.c.old	2007-07-26 13:51:13.000000000 +0200
+++ linux-2.6.23-rc1-mm1/fs/ecryptfs/crypto.c	2007-07-26 13:59:12.000000000 +0200
@@ -123,9 +123,9 @@
 	return rc;
 }
 
-int ecryptfs_crypto_api_algify_cipher_name(char **algified_name,
-					   char *cipher_name,
-					   char *chaining_modifier)
+static int ecryptfs_crypto_api_algify_cipher_name(char **algified_name,
+						  char *cipher_name,
+						  char *chaining_modifier)
 {
 	int cipher_name_len = strlen(cipher_name);
 	int chaining_modifier_len = strlen(chaining_modifier);
@@ -1828,9 +1828,8 @@
  * should be released by other functions, such as on a superblock put
  * event, regardless of whether this function succeeds for fails.
  */
-int
-ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
-			    char *cipher_name, size_t *key_size)
+static int ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
+				       char *cipher_name, size_t *key_size)
 {
 	char dummy_key[ECRYPTFS_MAX_KEY_BYTES];
 	char *full_alg_name;
@@ -1874,8 +1873,8 @@
 }
 
 struct kmem_cache *ecryptfs_key_tfm_cache;
-struct list_head key_tfm_list;
-struct mutex key_tfm_list_mutex;
+static struct list_head key_tfm_list;
+static struct mutex key_tfm_list_mutex;
 
 int ecryptfs_init_crypto(void)
 {
--- linux-2.6.23-rc1-mm1/fs/ecryptfs/keystore.c.old	2007-07-26 14:01:08.000000000 +0200
+++ linux-2.6.23-rc1-mm1/fs/ecryptfs/keystore.c	2007-07-26 14:09:26.000000000 +0200
@@ -39,7 +39,7 @@
  * determine the type of error, make appropriate log entries, and
  * return an error code.
  */
-int process_request_key_err(long err_code)
+static int process_request_key_err(long err_code)
 {
 	int rc = 0;
 
@@ -396,6 +396,27 @@
 	return rc;
 }
 
+static int ecryptfs_get_auth_tok_sig(char **sig,
+				     struct ecryptfs_auth_tok *auth_tok)
+{
+	int rc = 0;
+
+	(*sig) = NULL;
+	switch (auth_tok->token_type) {
+	case ECRYPTFS_PASSWORD:
+		(*sig) = auth_tok->token.password.signature;
+		break;
+	case ECRYPTFS_PRIVATE_KEY:
+		(*sig) = auth_tok->token.private_key.signature;
+		break;
+	default:
+		printk(KERN_ERR "Cannot get sig for auth_tok of type [%d]\n",
+		       auth_tok->token_type);
+		rc = -EINVAL;
+	}
+	return rc;
+}
+
 /**
  * decrypt_pki_encrypted_session_key - Decrypt the session key with
  * the given auth_tok.
@@ -1080,26 +1101,6 @@
 	return rc;
 }
 
-int ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok)
-{
-	int rc = 0;
-
-	(*sig) = NULL;
-	switch (auth_tok->token_type) {
-	case ECRYPTFS_PASSWORD:
-		(*sig) = auth_tok->token.password.signature;
-		break;
-	case ECRYPTFS_PRIVATE_KEY:
-		(*sig) = auth_tok->token.private_key.signature;
-		break;
-	default:
-		printk(KERN_ERR "Cannot get sig for auth_tok of type [%d]\n",
-		       auth_tok->token_type);
-		rc = -EINVAL;
-	}
-	return rc;
-}
-
 /**
  * ecryptfs_parse_packet_set
  * @dest: The header page in memory

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 4:03 am)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Wed Jul 25, 5:25 am)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Wed Jul 25, 5:40 am)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Wed Jul 25, 5:55 am)
Re: 2.6.23-rc1-mm1: chipsfb_pci_suspend problem, Rafael J. Wysocki, (Wed Jul 25, 6:48 am)
Re: 2.6.23-rc1-mm1, Michal Piotrowski, (Wed Jul 25, 9:32 am)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Andy Whitcroft, (Wed Jul 25, 9:36 am)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Sam Ravnborg, (Wed Jul 25, 10:04 am)
Re: 2.6.23-rc1-mm1, Len Brown, (Wed Jul 25, 10:23 am)
2.6.23-rc1-mm1: SCSI_SRP_ATTRS compile error, Adrian Bunk, (Wed Jul 25, 11:06 am)
2.6.23-rc1-mm1: net/ipv4/fib_trie.c compile error, Adrian Bunk, (Wed Jul 25, 11:15 am)
2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Adrian Bunk, (Wed Jul 25, 11:22 am)
Re: 2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Edward Shishkin, (Wed Jul 25, 11:44 am)
Re: 2.6.23-rc1-mm1, Michal Piotrowski, (Wed Jul 25, 11:48 am)
Re: 2.6.23-rc1-mm1, Sam Ravnborg, (Wed Jul 25, 11:53 am)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 11:58 am)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Wed Jul 25, 12:13 pm)
Re: 2.6.23-rc1-mm1, H. Peter Anvin, (Wed Jul 25, 12:18 pm)
Re: 2.6.23-rc1-mm1, Sam Ravnborg, (Wed Jul 25, 12:21 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 1:05 pm)
Re: 2.6.23-rc1-mm1: chipsfb_pci_suspend problem, Andrew Morton, (Wed Jul 25, 1:22 pm)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Wed Jul 25, 1:22 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 1:36 pm)
Re: 2.6.23-rc1-mm1, Gabriel C, (Wed Jul 25, 1:58 pm)
2.6.23-rc1-mm1: m32r is_init() compile error, Adrian Bunk, (Wed Jul 25, 2:01 pm)
Re: 2.6.23-rc1-mm1, Gabriel C, (Wed Jul 25, 2:05 pm)
Re: 2.6.23-rc1-mm1, H. Peter Anvin, (Wed Jul 25, 2:11 pm)
Re: 2.6.23-rc1-mm1, Gabriel C, (Wed Jul 25, 2:13 pm)
2.6.23-rc1-mm1: git-kgdb breaks sh compilation, Adrian Bunk, (Wed Jul 25, 2:17 pm)
Re: 2.6.23-rc1-mm1: m32r is_init() compile error, sukadev, (Wed Jul 25, 2:42 pm)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Wed Jul 25, 2:52 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 2:56 pm)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Andy Whitcroft, (Wed Jul 25, 3:41 pm)
Re: 2.6.23-rc1-mm1: chipsfb_pci_suspend problem, Pavel Machek, (Wed Jul 25, 3:45 pm)
Re: 2.6.23-rc1-mm1, Len Brown, (Wed Jul 25, 4:26 pm)
Re: 2.6.23-rc1-mm1, Greg KH, (Wed Jul 25, 5:07 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 5:28 pm)
Re: 2.6.23-rc1-mm1: git-kgdb breaks sh compilation, Paul Mundt, (Wed Jul 25, 6:45 pm)
Re: 2.6.23-rc1-mm1, Dave Young, (Wed Jul 25, 6:55 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 7:23 pm)
[-mm patch] DMA engine kconfig improvements, Adrian Bunk, (Wed Jul 25, 10:26 pm)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Andrew Morton, (Wed Jul 25, 10:56 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Thu Jul 26, 12:25 am)
Re: 2.6.23-rc1-mm1, Mel Gorman, (Thu Jul 26, 2:41 am)
Re: 2.6.23-rc1-mm1: SCSI_SRP_ATTRS compile error, FUJITA Tomonori, (Thu Jul 26, 3:49 am)
Re: 2.6.23-rc1-mm1 sparsemem_vmemamp fix., KAMEZAWA Hiroyuki, (Thu Jul 26, 5:58 am)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Thu Jul 26, 6:53 am)
Re: 2.6.23-rc1-mm1 sparsemem_vmemamp fix., Andy Whitcroft, (Thu Jul 26, 7:39 am)
Re: 2.6.23-rc1-mm1 sparsemem_vmemamp fix., Andy Whitcroft, (Thu Jul 26, 7:44 am)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Yinghai Lu, (Thu Jul 26, 10:53 am)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Thu Jul 26, 10:54 am)
Re: 2.6.23-rc1-mm1, Dave Hansen, (Thu Jul 26, 1:18 pm)
Re: 2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Edward Shishkin, (Fri Jul 27, 5:35 am)
[-mm patch] xtensa console.c: remove duplicate #include, Frederik Deweerdt, (Fri Jul 27, 6:28 am)
Re: 2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Richard Purdie, (Fri Jul 27, 8:11 am)
Re: 2.6.23-rc1-mm1 - seems OK on Dell Latitude D820, excep ..., Valdis.Kletnieks, (Fri Jul 27, 12:44 pm)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Sat Jul 28, 7:03 am)
mm/sparse.c compile error ( Re: 2.6.23-rc1-mm1 ), Gabriel C, (Sat Jul 28, 10:07 am)
Re: mm/sparse.c compile error ( Re: 2.6.23-rc1-mm1 ), Andrew Morton, (Sat Jul 28, 10:30 am)
[PATCH -mm] Fix libata warnings with CONFIG_PM=n, Gabriel C, (Sat Jul 28, 12:32 pm)
[-mm patch] make hugetlbfs_read() static, Adrian Bunk, (Sun Jul 29, 7:57 am)
[-mm patch] fs/ecryptfs/: make code static, Adrian Bunk, (Sun Jul 29, 7:57 am)
[-mm patch] make struct sdio_dev_attrs[] static, Adrian Bunk, (Sun Jul 29, 7:58 am)
[-mm patch] MTD onenand_sim.c: make struct info static, Adrian Bunk, (Sun Jul 29, 7:58 am)
[-mm patch] make scsi_host_link_pm_policy() static, Adrian Bunk, (Sun Jul 29, 7:58 am)
[-mm patch] kernel/printk.c: make 2 variables static, Adrian Bunk, (Sun Jul 29, 7:59 am)
[-mm patch] export v4l2_int_device_{,un}register, Adrian Bunk, (Sun Jul 29, 7:59 am)
[-mm patch] kernel/pid.c: remove unused exports, Adrian Bunk, (Sun Jul 29, 7:59 am)
[-mm patch] security/ cleanups, Adrian Bunk, (Sun Jul 29, 8:00 am)
Re: 2.6.23-rc1-mm1, Grant Wilson, (Sun Jul 29, 8:49 am)
Re: [-mm patch] make struct sdio_dev_attrs[] static, Pierre Ossman, (Sun Jul 29, 12:29 pm)
Re: 2.6.23-rc1-mm1, Dave Young, (Mon Jul 30, 2:58 am)
Re: [-mm patch] security/ cleanups, James Morris, (Mon Jul 30, 4:47 am)
Re: mm/sparse.c compile error ( Re: 2.6.23-rc1-mm1 ), Andy Whitcroft, (Mon Jul 30, 5:16 am)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Mon Jul 30, 11:27 am)
Re: 2.6.23-rc1-mm1, Christoph Hellwig, (Mon Jul 30, 11:42 am)
Re: 2.6.23-rc1-mm1, Satyam Sharma, (Mon Jul 30, 3:18 pm)
Re: 2.6.23-rc1-mm1, Dave Young, (Mon Jul 30, 6:21 pm)
Re: 2.6.23-rc1-mm1 - seems OK on Dell Latitude D820, excep ..., Valdis.Kletnieks, (Tue Jul 31, 11:48 am)
Re: [-mm patch] USB: make dev_attr_authorized_default static, Inaky Perez-Gonzalez, (Tue Jul 31, 12:13 pm)
Re: [-mm patch] DMA engine kconfig improvements, Dan Williams, (Fri Aug 3, 7:15 pm)
[PATCH] docs: note about select in kconfig-language.txt, Jarek Poplawski, (Mon Aug 6, 4:51 am)
Re: [-mm patch] DMA engine kconfig improvements, Adrian Bunk, (Thu Aug 9, 5:43 pm)
RE: [-mm patch] DMA engine kconfig improvements, Nelson, Shannon, (Wed Aug 15, 4:36 pm)