summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-01-05 16:51:18 -0500
committerTheodore Ts'o <tytso@mit.edu>2017-01-08 01:03:41 -0500
commita5d431eff2e0bb22156897435aa277ddc96074f7 (patch)
tree21fc94db3331336db3fd7bce15820907d6da5261 /fs/f2fs/super.c
parentf099d616dd689d27b08dec95d0b6f1f302cf8ec4 (diff)
fscrypt: make fscrypt_operations.key_prefix a string
There was an unnecessary amount of complexity around requesting the filesystem-specific key prefix. It was unclear why; perhaps it was envisioned that different instances of the same filesystem type could use different key prefixes, or that key prefixes could be binary. However, neither of those things were implemented or really make sense at all. So simplify the code by making key_prefix a const char *. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Richard Weinberger <richard@nod.at> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 702638e21c76..739192d95e71 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1156,12 +1156,6 @@ static int f2fs_get_context(struct inode *inode, void *ctx, size_t len)
1156 ctx, len, NULL); 1156 ctx, len, NULL);
1157} 1157}
1158 1158
1159static int f2fs_key_prefix(struct inode *inode, u8 **key)
1160{
1161 *key = F2FS_I_SB(inode)->key_prefix;
1162 return F2FS_I_SB(inode)->key_prefix_size;
1163}
1164
1165static int f2fs_set_context(struct inode *inode, const void *ctx, size_t len, 1159static int f2fs_set_context(struct inode *inode, const void *ctx, size_t len,
1166 void *fs_data) 1160 void *fs_data)
1167{ 1161{
@@ -1177,8 +1171,8 @@ static unsigned f2fs_max_namelen(struct inode *inode)
1177} 1171}
1178 1172
1179static struct fscrypt_operations f2fs_cryptops = { 1173static struct fscrypt_operations f2fs_cryptops = {
1174 .key_prefix = "f2fs:",
1180 .get_context = f2fs_get_context, 1175 .get_context = f2fs_get_context,
1181 .key_prefix = f2fs_key_prefix,
1182 .set_context = f2fs_set_context, 1176 .set_context = f2fs_set_context,
1183 .is_encrypted = f2fs_encrypted_inode, 1177 .is_encrypted = f2fs_encrypted_inode,
1184 .empty_dir = f2fs_empty_dir, 1178 .empty_dir = f2fs_empty_dir,
@@ -1518,12 +1512,6 @@ static void init_sb_info(struct f2fs_sb_info *sbi)
1518 mutex_init(&sbi->wio_mutex[NODE]); 1512 mutex_init(&sbi->wio_mutex[NODE]);
1519 mutex_init(&sbi->wio_mutex[DATA]); 1513 mutex_init(&sbi->wio_mutex[DATA]);
1520 spin_lock_init(&sbi->cp_lock); 1514 spin_lock_init(&sbi->cp_lock);
1521
1522#ifdef CONFIG_F2FS_FS_ENCRYPTION
1523 memcpy(sbi->key_prefix, F2FS_KEY_DESC_PREFIX,
1524 F2FS_KEY_DESC_PREFIX_SIZE);
1525 sbi->key_prefix_size = F2FS_KEY_DESC_PREFIX_SIZE;
1526#endif
1527} 1515}
1528 1516
1529static int init_percpu_info(struct f2fs_sb_info *sbi) 1517static int init_percpu_info(struct f2fs_sb_info *sbi)