18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * linux/fs/hfsplus/xattr_user.c 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Vyacheslav Dubeyko <slava@dubeyko.com> 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Handler for user extended attributes. 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <linux/nls.h> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include "hfsplus_fs.h" 138c2ecf20Sopenharmony_ci#include "xattr.h" 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistatic int hfsplus_user_getxattr(const struct xattr_handler *handler, 168c2ecf20Sopenharmony_ci struct dentry *unused, struct inode *inode, 178c2ecf20Sopenharmony_ci const char *name, void *buffer, size_t size) 188c2ecf20Sopenharmony_ci{ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci return hfsplus_getxattr(inode, name, buffer, size, 218c2ecf20Sopenharmony_ci XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); 228c2ecf20Sopenharmony_ci} 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_cistatic int hfsplus_user_setxattr(const struct xattr_handler *handler, 258c2ecf20Sopenharmony_ci struct dentry *unused, struct inode *inode, 268c2ecf20Sopenharmony_ci const char *name, const void *buffer, 278c2ecf20Sopenharmony_ci size_t size, int flags) 288c2ecf20Sopenharmony_ci{ 298c2ecf20Sopenharmony_ci return hfsplus_setxattr(inode, name, buffer, size, flags, 308c2ecf20Sopenharmony_ci XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); 318c2ecf20Sopenharmony_ci} 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciconst struct xattr_handler hfsplus_xattr_user_handler = { 348c2ecf20Sopenharmony_ci .prefix = XATTR_USER_PREFIX, 358c2ecf20Sopenharmony_ci .get = hfsplus_user_getxattr, 368c2ecf20Sopenharmony_ci .set = hfsplus_user_setxattr, 378c2ecf20Sopenharmony_ci}; 38