--- zzzz-none-000/linux-2.6.32.61/fs/ecryptfs/crypto.c 2013-06-10 09:43:48.000000000 +0000 +++ ar10-7272-687/linux-2.6.32.61/fs/ecryptfs/crypto.c 2010-04-08 11:00:21.000000000 +0000 @@ -1455,25 +1455,6 @@ ECRYPTFS_MINIMUM_HEADER_EXTENT_SIZE; } -void ecryptfs_i_size_init(const char *page_virt, struct inode *inode) -{ - struct ecryptfs_mount_crypt_stat *mount_crypt_stat; - struct ecryptfs_crypt_stat *crypt_stat; - u64 file_size; - - crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; - mount_crypt_stat = - &ecryptfs_superblock_to_private(inode->i_sb)->mount_crypt_stat; - if (mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) { - file_size = i_size_read(ecryptfs_inode_to_lower(inode)); - if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) - file_size += crypt_stat->num_header_bytes_at_front; - } else - file_size = get_unaligned_be64(page_virt); - i_size_write(inode, (loff_t)file_size); - crypt_stat->flags |= ECRYPTFS_I_SIZE_INITIALIZED; -} - /** * ecryptfs_read_headers_virt * @page_virt: The virtual address into which to read the headers @@ -1504,8 +1485,6 @@ rc = -EINVAL; goto out; } - if (!(crypt_stat->flags & ECRYPTFS_I_SIZE_INITIALIZED)) - ecryptfs_i_size_init(page_virt, ecryptfs_dentry->d_inode); offset += MAGIC_ECRYPTFS_MARKER_SIZE_BYTES; rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset), &bytes_read); @@ -1630,8 +1609,7 @@ rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode); if (rc) { printk(KERN_DEBUG "Valid eCryptfs headers not found in " - "file header region or xattr region, inode %lu\n", - ecryptfs_inode->i_ino); + "file header region or xattr region\n"); rc = -EINVAL; goto out; } @@ -1640,8 +1618,7 @@ ECRYPTFS_DONT_VALIDATE_HEADER_SIZE); if (rc) { printk(KERN_DEBUG "Valid eCryptfs headers not found in " - "file xattr region either, inode %lu\n", - ecryptfs_inode->i_ino); + "file xattr region either\n"); rc = -EINVAL; } if (crypt_stat->mount_crypt_stat->flags @@ -1652,8 +1629,7 @@ "crypto metadata only in the extended attribute " "region, but eCryptfs was mounted without " "xattr support enabled. eCryptfs will not treat " - "this like an encrypted file, inode %lu\n", - ecryptfs_inode->i_ino); + "this like an encrypted file.\n"); rc = -EINVAL; } } @@ -1958,7 +1934,7 @@ /* We could either offset on every reverse map or just pad some 0x00's * at the front here */ -static const unsigned char filename_rev_map[256] = { +static const unsigned char filename_rev_map[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 15 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 23 */ @@ -1974,7 +1950,7 @@ 0x00, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, /* 103 */ 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, /* 111 */ 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, /* 119 */ - 0x3D, 0x3E, 0x3F /* 123 - 255 initialized to 0x00 */ + 0x3D, 0x3E, 0x3F }; /**