diff options
author | Richard Weinberger <richard@nod.at> | 2016-10-20 16:47:56 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2016-12-12 23:07:38 +0100 |
commit | d475a507457b5cafa428871a473d0dcc828c5f68 (patch) | |
tree | 7f6608195cfc421e6d3d7975cc8b916a55e4a914 /fs/ubifs/super.c | |
parent | 6a5e98ab7d8665d2faddbd91a8a2bf9addb79aff (diff) | |
download | linux-d475a507457b5cafa428871a473d0dcc828c5f68.tar.gz linux-d475a507457b5cafa428871a473d0dcc828c5f68.tar.bz2 linux-d475a507457b5cafa428871a473d0dcc828c5f68.zip |
ubifs: Add skeleton for fscrypto
This is the first building block to provide file level
encryption on UBIFS.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r-- | fs/ubifs/super.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 4ec051089186..e85d5a47aeac 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -380,6 +380,9 @@ out: } done: clear_inode(inode); +#ifdef CONFIG_UBIFS_FS_ENCRYPTION + fscrypt_put_encryption_info(inode, NULL); +#endif } static void ubifs_dirty_inode(struct inode *inode, int flags) @@ -1995,6 +1998,12 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) return c; } +#ifndef CONFIG_UBIFS_FS_ENCRYPTION +struct fscrypt_operations ubifs_crypt_operations = { + .is_encrypted = ubifs_crypt_is_encrypted, +}; +#endif + static int ubifs_fill_super(struct super_block *sb, void *data, int silent) { struct ubifs_info *c = sb->s_fs_info; @@ -2041,6 +2050,7 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; sb->s_op = &ubifs_super_operations; sb->s_xattr = ubifs_xattr_handlers; + sb->s_cop = &ubifs_crypt_operations; mutex_lock(&c->umount_mutex); err = mount_ubifs(c); |