+ fs-ecryptfs-possible-cleanups.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     fs/ecryptfs/: possible cleanups

has been added to the -mm tree.  Its filename is

     fs-ecryptfs-possible-cleanups.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: fs/ecryptfs/: possible cleanups
From: Adrian Bunk <bunk@xxxxxxxxx>

This patch contains the following possible cleanups:
- make needlessly global functions static
- there's usually no reason for functions in C files to be marked as
  inline - gcc usually knows best whether or not to inline a function

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>
Acked-by: Michael Halcrow <mhalcrow@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/ecryptfs/crypto.c          |   53 ++++++++++++++++++++------------
 fs/ecryptfs/ecryptfs_kernel.h |   15 ---------
 fs/ecryptfs/inode.c           |   11 +++---
 fs/ecryptfs/keystore.c        |    2 -
 fs/ecryptfs/main.c            |    4 +-
 fs/ecryptfs/mmap.c            |    2 -
 fs/ecryptfs/super.c           |    4 +-
 7 files changed, 46 insertions(+), 45 deletions(-)

diff -puN fs/ecryptfs/crypto.c~fs-ecryptfs-possible-cleanups fs/ecryptfs/crypto.c
--- a/fs/ecryptfs/crypto.c~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/crypto.c
@@ -36,6 +36,17 @@
 #include <asm/scatterlist.h>
 #include "ecryptfs_kernel.h"
 
+static int
+ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
+			     struct page *dst_page, int dst_offset,
+			     struct page *src_page, int src_offset, int size,
+			     unsigned char *iv);
+static int
+ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
+			     struct page *dst_page, int dst_offset,
+			     struct page *src_page, int src_offset, int size,
+			     unsigned char *iv);
+
 /**
  * ecryptfs_to_hex
  * @dst: Buffer to take hex character representation of contents of
@@ -43,7 +54,7 @@
  * @src: Buffer to be converted to a hex string respresentation
  * @src_size: number of bytes to convert
  */
-inline void ecryptfs_to_hex(char *dst, char *src, int src_size)
+void ecryptfs_to_hex(char *dst, char *src, int src_size)
 {
 	int x;
 
@@ -58,7 +69,7 @@ inline void ecryptfs_to_hex(char *dst, c
  * @src: Buffer to be converted from a hex string respresentation to raw value
  * @dst_size: size of dst buffer, or number of hex characters pairs to convert
  */
-inline void ecryptfs_from_hex(char *dst, char *src, int dst_size)
+void ecryptfs_from_hex(char *dst, char *src, int dst_size)
 {
 	int x;
 	char tmp[3] = { 0, };
@@ -80,8 +91,9 @@ inline void ecryptfs_from_hex(char *dst,
  * Uses the allocated crypto context that crypt_stat references to
  * generate the MD5 sum of the contents of src.
  */
-int ecryptfs_calculate_md5(char *dst, struct ecryptfs_crypt_stat *crypt_stat,
-			   char *src, int len)
+static int ecryptfs_calculate_md5(char *dst,
+				  struct ecryptfs_crypt_stat *crypt_stat,
+				  char *src, int len)
 {
 	int rc = 0;
 	struct scatterlist sg;
@@ -115,8 +127,8 @@ out:
  *
  * Returns zero on success; non-zero on error.
  */
-int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat,
-		       pgoff_t offset)
+static int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat,
+			      pgoff_t offset)
 {
 	int rc = 0;
 	char dst[MD5_DIGEST_SIZE];
@@ -269,7 +281,7 @@ out:
 	return rc;
 }
 
-void
+static void
 ecryptfs_extent_to_lwr_pg_idx_and_offset(unsigned long *lower_page_idx,
 					 int *byte_offset,
 					 struct ecryptfs_crypt_stat *crypt_stat,
@@ -311,9 +323,10 @@ ecryptfs_extent_to_lwr_pg_idx_and_offset
 			(*byte_offset));
 }
 
-int ecryptfs_write_out_page(struct ecryptfs_page_crypt_context *ctx,
-			    struct page *lower_page, struct inode *lower_inode,
-			    int byte_offset_in_page, int bytes_to_write)
+static int ecryptfs_write_out_page(struct ecryptfs_page_crypt_context *ctx,
+				   struct page *lower_page,
+				   struct inode *lower_inode,
+				   int byte_offset_in_page, int bytes_to_write)
 {
 	int rc = 0;
 
@@ -341,9 +354,11 @@ out:
 	return rc;
 }
 
-int ecryptfs_read_in_page(struct ecryptfs_page_crypt_context *ctx,
-			  struct page **lower_page, struct inode *lower_inode,
-			  unsigned long lower_page_idx, int byte_offset_in_page)
+static int ecryptfs_read_in_page(struct ecryptfs_page_crypt_context *ctx,
+				 struct page **lower_page,
+				 struct inode *lower_inode,
+				 unsigned long lower_page_idx,
+				 int byte_offset_in_page)
 {
 	int rc = 0;
 
@@ -672,7 +687,7 @@ out:
  *
  * Returns the number of bytes encrypted
  */
-int
+static int
 ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
 			     struct page *dst_page, int dst_offset,
 			     struct page *src_page, int src_offset, int size,
@@ -694,7 +709,7 @@ ecryptfs_encrypt_page_offset(struct ecry
  *
  * Returns the number of bytes decrypted
  */
-int
+static int
 ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
 			     struct page *dst_page, int dst_offset,
 			     struct page *src_page, int src_offset, int size,
@@ -1300,7 +1315,7 @@ static int parse_header_metadata(struct 
  * compatibility for files created with the prior versions of
  * eCryptfs.
  */
-inline void set_default_header_data(struct ecryptfs_crypt_stat *crypt_stat)
+static void set_default_header_data(struct ecryptfs_crypt_stat *crypt_stat)
 {
 	crypt_stat->header_extent_size = 4096;
 	crypt_stat->num_header_extents_at_front = 1;
@@ -1314,9 +1329,9 @@ inline void set_default_header_data(stru
  *
  * Returns zero on success
  */
-int ecryptfs_read_headers_virt(char *page_virt,
-			       struct ecryptfs_crypt_stat *crypt_stat,
-			       struct dentry *ecryptfs_dentry)
+static int ecryptfs_read_headers_virt(char *page_virt,
+				      struct ecryptfs_crypt_stat *crypt_stat,
+				      struct dentry *ecryptfs_dentry)
 {
 	int rc = 0;
 	int offset;
diff -puN fs/ecryptfs/ecryptfs_kernel.h~fs-ecryptfs-possible-cleanups fs/ecryptfs/ecryptfs_kernel.h
--- a/fs/ecryptfs/ecryptfs_kernel.h~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/ecryptfs_kernel.h
@@ -400,17 +400,12 @@ int ecryptfs_encode_filename(struct ecry
 			     const char *name, int length,
 			     char **encoded_name);
 struct dentry *ecryptfs_lower_dentry(struct dentry *this_dentry);
-void ecryptfs_copy_attr_times(struct inode *dest, const struct inode *src);
 void ecryptfs_copy_attr_atime(struct inode *dest, const struct inode *src);
 void ecryptfs_copy_attr_all(struct inode *dest, const struct inode *src);
 void ecryptfs_copy_inode_size(struct inode *dst, const struct inode *src);
 void ecryptfs_dump_hex(char *data, int bytes);
 int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
 			int sg_size);
-int ecryptfs_calculate_md5(char *dst, struct ecryptfs_crypt_stat *crypt_stat,
-			   char *src, int len);
-int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat,
-		       pgoff_t offset);
 int ecryptfs_compute_root_iv(struct ecryptfs_crypt_stat *crypt_stat);
 void ecryptfs_rotate_iv(unsigned char *iv);
 void ecryptfs_init_crypt_stat(struct ecryptfs_crypt_stat *crypt_stat);
@@ -439,17 +434,7 @@ int ecryptfs_writepage_and_release_lower
 					      struct inode *lower_inode,
 					      struct writeback_control *wbc);
 int ecryptfs_encrypt_page(struct ecryptfs_page_crypt_context *ctx);
-int
-ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
-			     struct page *dst_page, int dst_offset,
-			     struct page *src_page, int src_offset, int size,
-			     unsigned char *iv);
 int ecryptfs_decrypt_page(struct file *file, struct page *page);
-int
-ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
-			     struct page *dst_page, int dst_offset,
-			     struct page *src_page, int src_offset, int size,
-			     unsigned char *iv);
 int ecryptfs_write_headers(struct dentry *ecryptfs_dentry,
 			   struct file *lower_file);
 int ecryptfs_write_headers_virt(char *page_virt,
diff -puN fs/ecryptfs/inode.c~fs-ecryptfs-possible-cleanups fs/ecryptfs/inode.c
--- a/fs/ecryptfs/inode.c~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/inode.c
@@ -32,7 +32,7 @@
 #include <linux/crypto.h>
 #include "ecryptfs_kernel.h"
 
-static inline struct dentry *lock_parent(struct dentry *dentry)
+static struct dentry *lock_parent(struct dentry *dentry)
 {
 	struct dentry *dir;
 
@@ -41,13 +41,13 @@ static inline struct dentry *lock_parent
 	return dir;
 }
 
-static inline void unlock_parent(struct dentry *dentry)
+static void unlock_parent(struct dentry *dentry)
 {
 	mutex_unlock(&(dentry->d_parent->d_inode->i_mutex));
 	dput(dentry->d_parent);
 }
 
-static inline void unlock_dir(struct dentry *dir)
+static void unlock_dir(struct dentry *dir)
 {
 	mutex_unlock(&dir->d_inode->i_mutex);
 	dput(dir);
@@ -66,7 +66,8 @@ void ecryptfs_copy_attr_atime(struct ino
 	dest->i_atime = src->i_atime;
 }
 
-void ecryptfs_copy_attr_times(struct inode *dest, const struct inode *src)
+static void ecryptfs_copy_attr_times(struct inode *dest,
+				     const struct inode *src)
 {
 	ASSERT(dest != NULL);
 	ASSERT(src != NULL);
@@ -771,7 +772,7 @@ out:
 	return ERR_PTR(rc);
 }
 
-static inline void
+static void
 ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
 {
 	/* Free the char* */
diff -puN fs/ecryptfs/keystore.c~fs-ecryptfs-possible-cleanups fs/ecryptfs/keystore.c
--- a/fs/ecryptfs/keystore.c~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/keystore.c
@@ -724,7 +724,7 @@ out:
  *
  * Returns zero on success; non-zero on error.
  */
-int
+static int
 write_tag_11_packet(char *dest, int max, char *contents, int contents_length,
 		    int *packet_length)
 {
diff -puN fs/ecryptfs/main.c~fs-ecryptfs-possible-cleanups fs/ecryptfs/main.c
--- a/fs/ecryptfs/main.c~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/main.c
@@ -141,7 +141,7 @@ static match_table_t tokens = {
  *
  * Returns zero on good version; non-zero otherwise
  */
-int ecryptfs_verify_version(u16 version)
+static int ecryptfs_verify_version(u16 version)
 {
 	int rc = 0;
 	unsigned char major;
@@ -322,7 +322,7 @@ struct kmem_cache *ecryptfs_sb_info_cach
  *
  * Preform the cleanup for ecryptfs_read_super()
  */
-static inline void ecryptfs_cleanup_read_super(struct super_block *sb)
+static void ecryptfs_cleanup_read_super(struct super_block *sb)
 {
 	up_write(&sb->s_umount);
 	deactivate_super(sb);
diff -puN fs/ecryptfs/mmap.c~fs-ecryptfs-possible-cleanups fs/ecryptfs/mmap.c
--- a/fs/ecryptfs/mmap.c~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/mmap.c
@@ -396,7 +396,7 @@ out:
 	return rc;
 }
 
-void ecryptfs_unmap_and_release_lower_page(struct page *lower_page)
+static void ecryptfs_unmap_and_release_lower_page(struct page *lower_page)
 {
 	kunmap(lower_page);
 	ecryptfs_printk(KERN_DEBUG, "Unlocking lower page with index = "
diff -puN fs/ecryptfs/super.c~fs-ecryptfs-possible-cleanups fs/ecryptfs/super.c
--- a/fs/ecryptfs/super.c~fs-ecryptfs-possible-cleanups
+++ a/fs/ecryptfs/super.c
@@ -124,7 +124,7 @@ static void ecryptfs_put_super(struct su
  * Get the filesystem statistics. Currently, we let this pass right through
  * to the lower filesystem and take no action ourselves.
  */
-static inline int ecryptfs_statfs(struct dentry *dentry, struct kstatfs *buf)
+static int ecryptfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
 	return vfs_statfs(ecryptfs_dentry_to_lower(dentry), buf);
 }
@@ -139,7 +139,7 @@ static inline int ecryptfs_statfs(struct
  * on the inode free list. We use this to drop out reference to the
  * lower inode.
  */
-static inline void ecryptfs_clear_inode(struct inode *inode)
+static void ecryptfs_clear_inode(struct inode *inode)
 {
 	iput(ecryptfs_inode_to_lower(inode));
 }
_

Patches currently in -mm which might be from bunk@xxxxxxxxx are

origin.patch
fix-sgivwfb-compile.patch
git-acpi.patch
drivers-acpi-scanc-make-acpi_bus_type-static.patch
git-agpgart.patch
the-scheduled-unexport-of-insert_resource.patch
git-gfs2.patch
make-variables-static-after-klibc-merge.patch
git-libata-all.patch
fs-jffs2-make-2-functions-static.patch
ni5010-netcard-cleanup-fix.patch
drivers-dma-iovlockc-make-num_pages_spanned-static.patch
drivers-net-irda-mcs7780c-make-struct-mcs_driver-static.patch
git-ocfs2.patch
gregkh-pci-acpiphp-configure-_prt-v3-cleanup.patch
drivers-scsi-aic7xxx-possible-cleanups.patch
drivers-scsi-small-cleanups.patch
drivers-scsi-megaraidc-add-a-dummy-mega_create_proc_entry-for-proc_fs=y.patch
drivers-scsi-qla2xxx-make-some-functions-static.patch
drivers-scsi-qla2xxx-make-more-some-functions-static.patch
drivers-scsi-aic7xxx-aic79xx_corec-make-ahd_done_with_status-static.patch
drivers-scsi-aic7xxx-aic79xx_corec-make-ahd_match_scb-static.patch
drivers-scsi-aic7xxx-possible-cleanups-2.patch
drivers-scsi-arcmsr-cleanups.patch
drivers-scsi-advansysc-cleanups.patch
make-drivers-scsi-aic7xxx-aic79xx_coreahd_set_tags-static.patch
if-0-drivers-usb-input-hid-corechid_find_field_by_usage.patch
acx1xx-wireless-driver.patch
arch-i386-mach-visws-setupc-remove-dummy-function-calls.patch
fs-ecryptfs-possible-cleanups.patch
make-kernel-sysctlc_proc_do_string-static.patch
namespaces-utsname-implement-clone_newuts-flag-tidy.patch
task-watchers-register-semundo-task-watcher-cleanup.patch
fs-reiser4-possible-cleanups.patch
drivers-ide-legacy-ide-csc-make-2-functions-static.patch
drivers-md-raid5c-remove-an-unused-variable.patch
lockdep-core-cleanups.patch
srcu-add-srcu-operations-to-rcutorture-tidy-2.patch
slab-cache-shrinker-statistics.patch
i386-enable-4k-stacks-by-default.patch
mutex-subsystem-synchro-test-module.patch
re-add-config_sound_sscape.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux