Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ecryptfs: cleanup ecryptfs_setattr

Initialize variables at declaration time where applicable and reformat
conditionals to match the kernel coding style.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Tyler Hicks <code@tyhicks.com>

authored by

Christoph Hellwig and committed by
Tyler Hicks
8f613643 cd3b3094

+10 -12
+10 -12
fs/ecryptfs/inode.c
··· 886 886 static int ecryptfs_setattr(struct mnt_idmap *idmap, 887 887 struct dentry *dentry, struct iattr *ia) 888 888 { 889 - int rc = 0; 890 - struct dentry *lower_dentry; 889 + struct inode *inode = d_inode(dentry); 890 + struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); 891 + struct inode *lower_inode = ecryptfs_inode_to_lower(inode); 891 892 struct iattr lower_ia; 892 - struct inode *inode; 893 - struct inode *lower_inode; 894 893 struct ecryptfs_crypt_stat *crypt_stat; 894 + int rc; 895 895 896 896 crypt_stat = &ecryptfs_inode_to_private(d_inode(dentry))->crypt_stat; 897 897 if (!(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED)) 898 898 ecryptfs_init_crypt_stat(crypt_stat); 899 - inode = d_inode(dentry); 900 - lower_inode = ecryptfs_inode_to_lower(inode); 901 - lower_dentry = ecryptfs_dentry_to_lower(dentry); 899 + 902 900 mutex_lock(&crypt_stat->cs_mutex); 903 901 if (d_is_dir(dentry)) 904 902 crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); 905 - else if (d_is_reg(dentry) 906 - && (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED) 907 - || !(crypt_stat->flags & ECRYPTFS_KEY_VALID))) { 903 + else if (d_is_reg(dentry) && 904 + (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED) || 905 + !(crypt_stat->flags & ECRYPTFS_KEY_VALID))) { 908 906 struct ecryptfs_mount_crypt_stat *mount_crypt_stat; 909 907 910 908 mount_crypt_stat = &ecryptfs_superblock_to_private( ··· 915 917 rc = ecryptfs_read_metadata(dentry); 916 918 ecryptfs_put_lower_file(inode); 917 919 if (rc) { 918 - if (!(mount_crypt_stat->flags 919 - & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) { 920 + if (!(mount_crypt_stat->flags & 921 + ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) { 920 922 rc = -EIO; 921 923 printk(KERN_WARNING "Either the lower file " 922 924 "is not in a valid eCryptfs format, "