Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[sfrench/cifs-2.6.git] / fs / ecryptfs / inode.c
index 5a719180983cb36ebf3e264dc45c1559ebc209c0..edd1e44e9d474bdb46a5b7820192cef29c95cf92 100644 (file)
@@ -365,8 +365,7 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
                dentry->d_sb)->mount_crypt_stat;
        if (mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) {
                if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR)
-                       file_size = ((crypt_stat->extent_size
-                                     * crypt_stat->num_header_extents_at_front)
+                       file_size = (crypt_stat->num_header_bytes_at_front
                                     + i_size_read(lower_dentry->d_inode));
                else
                        file_size = i_size_read(lower_dentry->d_inode);
@@ -685,7 +684,7 @@ ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
  * @crypt_stat: Crypt_stat associated with file
  * @upper_size: Size of the upper file
  *
- * Calculate the requried size of the lower file based on the
+ * Calculate the required size of the lower file based on the
  * specified size of the upper file. This calculation is based on the
  * number of headers in the underlying file and the extent size.
  *
@@ -697,8 +696,7 @@ upper_size_to_lower_size(struct ecryptfs_crypt_stat *crypt_stat,
 {
        loff_t lower_size;
 
-       lower_size = (crypt_stat->extent_size
-                     * crypt_stat->num_header_extents_at_front);
+       lower_size = crypt_stat->num_header_bytes_at_front;
        if (upper_size != 0) {
                loff_t num_extents;
 
@@ -875,11 +873,11 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
                        if (!(mount_crypt_stat->flags
                              & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) {
                                rc = -EIO;
-                               printk(KERN_WARNING "Attempt to read file that "
+                               printk(KERN_WARNING "Either the lower file "
                                       "is not in a valid eCryptfs format, "
-                                      "and plaintext passthrough mode is not "
+                                      "or the key could not be retrieved. "
+                                      "Plaintext passthrough mode is not "
                                       "enabled; returning -EIO\n");
-
                                mutex_unlock(&crypt_stat->cs_mutex);
                                goto out;
                        }
@@ -954,7 +952,7 @@ out:
        return rc;
 }
 
-ssize_t
+static ssize_t
 ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value,
                  size_t size)
 {