[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240221-idmap-fscap-refactor-v2-8-3039364623bd@kernel.org>
Date: Wed, 21 Feb 2024 15:24:39 -0600
From: "Seth Forshee (DigitalOcean)" <sforshee@...nel.org>
To: Christian Brauner <brauner@...nel.org>,
Seth Forshee <sforshee@...nel.org>, Serge Hallyn <serge@...lyn.com>,
Paul Moore <paul@...l-moore.com>, Eric Paris <eparis@...hat.com>,
James Morris <jmorris@...ei.org>, Alexander Viro <viro@...iv.linux.org.uk>,
Jan Kara <jack@...e.cz>, Stephen Smalley <stephen.smalley.work@...il.com>,
Ondrej Mosnacek <omosnace@...hat.com>,
Casey Schaufler <casey@...aufler-ca.com>, Mimi Zohar <zohar@...ux.ibm.com>,
Roberto Sassu <roberto.sassu@...wei.com>,
Dmitry Kasatkin <dmitry.kasatkin@...il.com>,
Eric Snowberg <eric.snowberg@...cle.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Jonathan Corbet <corbet@....net>, Miklos Szeredi <miklos@...redi.hu>,
Amir Goldstein <amir73il@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-security-module@...r.kernel.org, audit@...r.kernel.org,
selinux@...r.kernel.org, linux-integrity@...r.kernel.org,
linux-doc@...r.kernel.org, linux-unionfs@...r.kernel.org
Subject: [PATCH v2 08/25] xattr: add is_fscaps_xattr() helper
Add a helper to determine if an xattr time is XATTR_NAME_CAPS instead of
open-coding a string comparision.
Suggested-by: Amir Goldstein <amir73il@...il.com>
Signed-off-by: Seth Forshee (DigitalOcean) <sforshee@...nel.org>
---
include/linux/xattr.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index d20051865800..cbacfb4d74fa 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -28,6 +28,11 @@ static inline bool is_posix_acl_xattr(const char *name)
(strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0);
}
+static inline bool is_fscaps_xattr(const char *name)
+{
+ return strcmp(name, XATTR_NAME_CAPS) == 0;
+}
+
/*
* struct xattr_handler: When @name is set, match attributes with exactly that
* name. When @prefix is set instead, match attributes with that prefix and
--
2.43.0
Powered by blists - more mailing lists