mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
xattr: add listxattr helper
Add a tiny helper to determine whether an xattr handler given a specific dentry supports listing the requested xattr. We will use this helper in various filesystems in later commits. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
This commit is contained in:
parent
f2620f166e
commit
2db8a94804
@ -47,6 +47,22 @@ struct xattr_handler {
|
||||
size_t size, int flags);
|
||||
};
|
||||
|
||||
/**
|
||||
* xattr_handler_can_list - check whether xattr can be listed
|
||||
* @handler: handler for this type of xattr
|
||||
* @dentry: dentry whose inode xattr to list
|
||||
*
|
||||
* Determine whether the xattr associated with @dentry can be listed given
|
||||
* @handler.
|
||||
*
|
||||
* Return: true if xattr can be listed, false if not.
|
||||
*/
|
||||
static inline bool xattr_handler_can_list(const struct xattr_handler *handler,
|
||||
struct dentry *dentry)
|
||||
{
|
||||
return handler && (!handler->list || handler->list(dentry));
|
||||
}
|
||||
|
||||
const char *xattr_full_name(const struct xattr_handler *, const char *);
|
||||
|
||||
struct xattr {
|
||||
|
Loading…
Reference in New Issue
Block a user