summaryrefslogtreecommitdiffstats
path: root/include/linux/fscrypt_common.h
diff options
context:
space:
mode:
authorTahsin Erdogan2017-07-06 06:01:59 +0200
committerTheodore Ts'o2017-07-06 06:01:59 +0200
commitaf65207c76ce8e6263a3b097ea35365dde9913d0 (patch)
tree222298b2f179736a158d83341511cd9c7a81eca0 /include/linux/fscrypt_common.h
parentext4: skip ext4_init_security() and encryption on ea_inodes (diff)
downloadkernel-qcow2-linux-af65207c76ce8e6263a3b097ea35365dde9913d0.tar.gz
kernel-qcow2-linux-af65207c76ce8e6263a3b097ea35365dde9913d0.tar.xz
kernel-qcow2-linux-af65207c76ce8e6263a3b097ea35365dde9913d0.zip
ext4: fix __ext4_new_inode() journal credits calculation
ea_inode feature allows creating extended attributes that are up to 64k in size. Update __ext4_new_inode() to pick increased credit limits. To avoid overallocating too many journal credits, update __ext4_xattr_set_credits() to make a distinction between xattr create vs update. This helps __ext4_new_inode() because all attributes are known to be new, so we can save credits that are normally needed to delete old values. Also, have fscrypt specify its maximum context size so that we don't end up allocating credits for 64k size. Signed-off-by: Tahsin Erdogan <tahsin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/fscrypt_common.h')
-rw-r--r--include/linux/fscrypt_common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fscrypt_common.h b/include/linux/fscrypt_common.h
index 0a30c106c1e5..82beaf70e7e2 100644
--- a/include/linux/fscrypt_common.h
+++ b/include/linux/fscrypt_common.h
@@ -83,6 +83,9 @@ struct fscrypt_operations {
unsigned (*max_namelen)(struct inode *);
};
+/* Maximum value for the third parameter of fscrypt_operations.set_context(). */
+#define FSCRYPT_SET_CONTEXT_MAX_SIZE 28
+
static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
{
if (inode->i_sb->s_cop->dummy_context &&