2012-03-17 06:16:43 +01:00
|
|
|
#include "reiserfs.h"
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/pagemap.h>
|
|
|
|
#include <linux/xattr.h>
|
2012-03-17 05:59:06 +01:00
|
|
|
#include "xattr.h"
|
2014-08-08 23:21:12 +02:00
|
|
|
#include <linux/uaccess.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
static int
|
2016-04-11 02:48:24 +02:00
|
|
|
user_get(const struct xattr_handler *handler, struct dentry *unused,
|
|
|
|
struct inode *inode, const char *name, void *buffer, size_t size)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2016-04-11 02:48:24 +02:00
|
|
|
if (!reiserfs_xattrs_user(inode->i_sb))
|
2005-07-13 05:21:28 +02:00
|
|
|
return -EOPNOTSUPP;
|
2016-04-11 02:48:24 +02:00
|
|
|
return reiserfs_xattr_get(inode, xattr_full_name(handler, name),
|
2016-04-11 00:50:48 +02:00
|
|
|
buffer, size);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2016-05-27 16:19:30 +02:00
|
|
|
user_set(const struct xattr_handler *handler, struct dentry *unused,
|
|
|
|
struct inode *inode, const char *name, const void *buffer,
|
|
|
|
size_t size, int flags)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2016-05-27 16:19:30 +02:00
|
|
|
if (!reiserfs_xattrs_user(inode->i_sb))
|
2005-07-13 05:21:28 +02:00
|
|
|
return -EOPNOTSUPP;
|
2016-05-27 16:19:30 +02:00
|
|
|
return reiserfs_xattr_set(inode,
|
2016-04-11 00:50:48 +02:00
|
|
|
xattr_full_name(handler, name),
|
|
|
|
buffer, size, flags);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2015-12-02 14:44:43 +01:00
|
|
|
static bool user_list(struct dentry *dentry)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2015-12-02 14:44:43 +01:00
|
|
|
return reiserfs_xattrs_user(dentry->d_sb);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2010-05-14 02:53:19 +02:00
|
|
|
const struct xattr_handler reiserfs_xattr_user_handler = {
|
2005-04-17 00:20:36 +02:00
|
|
|
.prefix = XATTR_USER_PREFIX,
|
|
|
|
.get = user_get,
|
|
|
|
.set = user_set,
|
|
|
|
.list = user_list,
|
|
|
|
};
|