diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-09-08 18:14:08 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:12 -0400 |
commit | a9a7bbab1469f0c427f90c309720c543e37ab110 (patch) | |
tree | ff7ad8b0ba1c3f17bc0c158d54f445971efccad3 /fs/bcachefs/xattr.c | |
parent | 197763a70b6a530d959659abb917166a2f193520 (diff) |
bcachefs: bch2_acl_to_text()
We can now print out acls from bch2_xattr_to_text(), when the xattr
contains an acl.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/xattr.c')
-rw-r--r-- | fs/bcachefs/xattr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/bcachefs/xattr.c b/fs/bcachefs/xattr.c index 6f6b3caf0607..637174b249a2 100644 --- a/fs/bcachefs/xattr.c +++ b/fs/bcachefs/xattr.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcachefs.h" +#include "acl.h" #include "bkey_methods.h" #include "btree_update.h" #include "extents.h" @@ -130,6 +131,13 @@ void bch2_xattr_to_text(struct printbuf *out, struct bch_fs *c, xattr.v->x_name, le16_to_cpu(xattr.v->x_val_len), (char *) xattr_val(xattr.v)); + + if (xattr.v->x_type == KEY_TYPE_XATTR_INDEX_POSIX_ACL_ACCESS || + xattr.v->x_type == KEY_TYPE_XATTR_INDEX_POSIX_ACL_DEFAULT) { + prt_char(out, ' '); + bch2_acl_to_text(out, xattr_val(xattr.v), + le16_to_cpu(xattr.v->x_val_len)); + } } static int bch2_xattr_get_trans(struct btree_trans *trans, struct bch_inode_info *inode, |