aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/inode.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2007-10-16 04:28:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:12 -0400
commit5dda6992a3138f3839dcaecbcd2fbea4dd514c7c (patch)
treec9ca012364edc18a2baed74721052b7da9d39f53 /fs/ecryptfs/inode.c
parent45eaab79678b9e27e08f0cf250eb2df9d6a48df0 (diff)
eCryptfs: remove assignments in if-statements
Remove assignments in if-statements. Signed-off-by: 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/ecryptfs/inode.c')
-rw-r--r--fs/ecryptfs/inode.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index abac91c58bfb..d70f5994ba51 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -202,8 +202,9 @@ static int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry)
202 lower_flags = ((O_CREAT | O_TRUNC) & O_ACCMODE) | O_RDWR; 202 lower_flags = ((O_CREAT | O_TRUNC) & O_ACCMODE) | O_RDWR;
203 lower_mnt = ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry); 203 lower_mnt = ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry);
204 /* Corresponding fput() at end of this function */ 204 /* Corresponding fput() at end of this function */
205 if ((rc = ecryptfs_open_lower_file(&lower_file, lower_dentry, lower_mnt, 205 rc = ecryptfs_open_lower_file(&lower_file, lower_dentry, lower_mnt,
206 lower_flags))) { 206 lower_flags);
207 if (rc) {
207 ecryptfs_printk(KERN_ERR, 208 ecryptfs_printk(KERN_ERR,
208 "Error opening dentry; rc = [%i]\n", rc); 209 "Error opening dentry; rc = [%i]\n", rc);
209 goto out; 210 goto out;
@@ -229,7 +230,8 @@ static int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry)
229 } 230 }
230 rc = grow_file(ecryptfs_dentry, lower_file, inode, lower_inode); 231 rc = grow_file(ecryptfs_dentry, lower_file, inode, lower_inode);
231out_fput: 232out_fput:
232 if ((rc = ecryptfs_close_lower_file(lower_file))) 233 rc = ecryptfs_close_lower_file(lower_file);
234 if (rc)
233 printk(KERN_ERR "Error closing lower_file\n"); 235 printk(KERN_ERR "Error closing lower_file\n");
234out: 236out:
235 return rc; 237 return rc;
@@ -779,8 +781,9 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length)
779 lower_dentry = ecryptfs_dentry_to_lower(dentry); 781 lower_dentry = ecryptfs_dentry_to_lower(dentry);
780 /* This dget & mntget is released through fput at out_fput: */ 782 /* This dget & mntget is released through fput at out_fput: */
781 lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); 783 lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
782 if ((rc = ecryptfs_open_lower_file(&lower_file, lower_dentry, lower_mnt, 784 rc = ecryptfs_open_lower_file(&lower_file, lower_dentry, lower_mnt,
783 O_RDWR))) { 785 O_RDWR);
786 if (rc) {
784 ecryptfs_printk(KERN_ERR, 787 ecryptfs_printk(KERN_ERR,
785 "Error opening dentry; rc = [%i]\n", rc); 788 "Error opening dentry; rc = [%i]\n", rc);
786 goto out_free; 789 goto out_free;
@@ -813,11 +816,12 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length)
813 end_pos_in_page = ((new_length - 1) & ~PAGE_CACHE_MASK); 816 end_pos_in_page = ((new_length - 1) & ~PAGE_CACHE_MASK);
814 } 817 }
815 if (end_pos_in_page != (PAGE_CACHE_SIZE - 1)) { 818 if (end_pos_in_page != (PAGE_CACHE_SIZE - 1)) {
816 if ((rc = ecryptfs_write_zeros(&fake_ecryptfs_file, 819 rc = ecryptfs_write_zeros(&fake_ecryptfs_file,
817 index, 820 index,
818 (end_pos_in_page + 1), 821 (end_pos_in_page + 1),
819 ((PAGE_CACHE_SIZE - 1) 822 ((PAGE_CACHE_SIZE - 1)
820 - end_pos_in_page)))) { 823 - end_pos_in_page));
824 if (rc) {
821 printk(KERN_ERR "Error attempting to zero out " 825 printk(KERN_ERR "Error attempting to zero out "
822 "the remainder of the end page on " 826 "the remainder of the end page on "
823 "reducing truncate; rc = [%d]\n", rc); 827 "reducing truncate; rc = [%d]\n", rc);
@@ -849,7 +853,8 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length)
849 = CURRENT_TIME; 853 = CURRENT_TIME;
850 mark_inode_dirty_sync(inode); 854 mark_inode_dirty_sync(inode);
851out_fput: 855out_fput:
852 if ((rc = ecryptfs_close_lower_file(lower_file))) 856 rc = ecryptfs_close_lower_file(lower_file);
857 if (rc)
853 printk(KERN_ERR "Error closing lower_file\n"); 858 printk(KERN_ERR "Error closing lower_file\n");
854out_free: 859out_free:
855 if (ecryptfs_file_to_private(&fake_ecryptfs_file)) 860 if (ecryptfs_file_to_private(&fake_ecryptfs_file))
@@ -917,8 +922,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
917 922
918 lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); 923 lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
919 lower_flags = O_RDONLY; 924 lower_flags = O_RDONLY;
920 if ((rc = ecryptfs_open_lower_file(&lower_file, lower_dentry, 925 rc = ecryptfs_open_lower_file(&lower_file, lower_dentry,
921 lower_mnt, lower_flags))) { 926 lower_mnt, lower_flags);
927 if (rc) {
922 printk(KERN_ERR 928 printk(KERN_ERR
923 "Error opening lower file; rc = [%d]\n", rc); 929 "Error opening lower file; rc = [%d]\n", rc);
924 mutex_unlock(&crypt_stat->cs_mutex); 930 mutex_unlock(&crypt_stat->cs_mutex);
@@ -926,7 +932,8 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
926 } 932 }
927 mount_crypt_stat = &ecryptfs_superblock_to_private( 933 mount_crypt_stat = &ecryptfs_superblock_to_private(
928 dentry->d_sb)->mount_crypt_stat; 934 dentry->d_sb)->mount_crypt_stat;
929 if ((rc = ecryptfs_read_metadata(dentry, lower_file))) { 935 rc = ecryptfs_read_metadata(dentry, lower_file);
936 if (rc) {
930 if (!(mount_crypt_stat->flags 937 if (!(mount_crypt_stat->flags
931 & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) { 938 & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) {
932 rc = -EIO; 939 rc = -EIO;