All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	osandov@osandov.com, kernel-team@fb.com
Cc: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Subject: [PATCH RFC v2 06/16] btrfs: add fscrypt operation table to superblock
Date: Sat, 23 Jul 2022 20:53:51 -0400	[thread overview]
Message-ID: <95482e35f5ea655d1d09172c24245fc416698463.1658623319.git.sweettea-kernel@dorminy.me> (raw)
In-Reply-To: <cover.1658623319.git.sweettea-kernel@dorminy.me>

From: Omar Sandoval <osandov@osandov.com>

To use fscrypt_prepare_new_inode(), the superblock must have fscrypt
operations registered.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
---
 fs/btrfs/fscrypt.c | 3 +++
 fs/btrfs/fscrypt.h | 1 +
 fs/btrfs/super.c   | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/fs/btrfs/fscrypt.c b/fs/btrfs/fscrypt.c
index 2ed844dd61d0..9829d280a6bc 100644
--- a/fs/btrfs/fscrypt.c
+++ b/fs/btrfs/fscrypt.c
@@ -30,3 +30,6 @@ bool btrfs_fscrypt_match_name(const struct fscrypt_name *fname,
 			     de_name_len - sizeof(nokey_name->bytes), digest);
 	return !memcmp(digest, nokey_name->sha256, sizeof(digest));
 }
+
+const struct fscrypt_operations btrfs_fscrypt_ops = {
+};
diff --git a/fs/btrfs/fscrypt.h b/fs/btrfs/fscrypt.h
index 7f24d12e6ee0..07884206c8a1 100644
--- a/fs/btrfs/fscrypt.h
+++ b/fs/btrfs/fscrypt.h
@@ -22,4 +22,5 @@ static bool btrfs_fscrypt_match_name(const struct fscrypt_name *fname,
 }
 #endif
 
+extern const struct fscrypt_operations btrfs_fscrypt_ops;
 #endif /* BTRFS_FSCRYPT_H */
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 55af04fae075..e017e976c679 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -47,6 +47,8 @@
 #include "tests/btrfs-tests.h"
 #include "block-group.h"
 #include "discard.h"
+#include "fscrypt.h"
+
 #include "qgroup.h"
 #include "raid56.h"
 #define CREATE_TRACE_POINTS
@@ -1443,6 +1445,7 @@ static int btrfs_fill_super(struct super_block *sb,
 	sb->s_vop = &btrfs_verityops;
 #endif
 	sb->s_xattr = btrfs_xattr_handlers;
+	fscrypt_set_ops(sb, &btrfs_fscrypt_ops);
 	sb->s_time_gran = 1;
 #ifdef CONFIG_BTRFS_FS_POSIX_ACL
 	sb->s_flags |= SB_POSIXACL;
-- 
2.35.1


  parent reply	other threads:[~2022-07-24  0:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  0:53 [PATCH RFC v2 00/16] btrfs: add fscrypt integration Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 01/16] btrfs: store directorys' encryption state Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 02/16] btrfs: use fscrypt_name's instead of name/len everywhere Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 03/16] btrfs: setup fscrypt_names from dentrys using helper Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 04/16] btrfs: factor a fscrypt_name matching method Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 05/16] btrfs: disable various operations on encrypted inodes Sweet Tea Dorminy
2022-07-24  0:53 ` Sweet Tea Dorminy [this message]
2022-07-24  0:53 ` [PATCH RFC v2 07/16] btrfs: start using fscrypt hooks Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 08/16] btrfs: add a subvolume flag for whole-volume encryption Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 09/16] btrfs: translate btrfs encryption flags and encrypted inode flag Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 10/16] btrfs: add iv generation function for fscrypt Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 11/16] btrfs: store an IV per encrypted normal file extent Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 12/16] btrfs: Add new FEATURE_INCOMPAT_FSCRYPT feature flag Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 13/16] btrfs: reuse encrypted filename hash when possible Sweet Tea Dorminy
2022-07-24  0:53 ` [PATCH RFC v2 14/16] btrfs: adapt directory read and lookup to potentially encrypted filenames Sweet Tea Dorminy
2022-07-24  0:54 ` [PATCH RFC v2 15/16] btrfs: encrypt normal file extent data if appropriate Sweet Tea Dorminy
2022-07-24  0:54 ` [PATCH RFC v2 16/16] btrfs: implement fscrypt ioctls Sweet Tea Dorminy
2022-10-13 12:14 ` [PATCH RFC v2 00/16] btrfs: add fscrypt integration Muhammad Usama Anjum
2022-10-14 10:54   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95482e35f5ea655d1d09172c24245fc416698463.1658623319.git.sweettea-kernel@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osandov@osandov.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.