1652ecc20SKaiGai Kohei /*
2652ecc20SKaiGai Kohei * JFFS2 -- Journalling Flash File System, Version 2.
3aa98d7cfSKaiGai Kohei *
4c00c310eSDavid Woodhouse * Copyright © 2006 NEC Corporation
5aa98d7cfSKaiGai Kohei *
6652ecc20SKaiGai Kohei * Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
7652ecc20SKaiGai Kohei *
8652ecc20SKaiGai Kohei * For licensing information, see the file 'LICENCE' in this directory.
9652ecc20SKaiGai Kohei *
10652ecc20SKaiGai Kohei */
11c00c310eSDavid Woodhouse
12aa98d7cfSKaiGai Kohei #include <linux/kernel.h>
13aa98d7cfSKaiGai Kohei #include <linux/fs.h>
14aa98d7cfSKaiGai Kohei #include <linux/jffs2.h>
15aa98d7cfSKaiGai Kohei #include <linux/xattr.h>
16aa98d7cfSKaiGai Kohei #include <linux/mtd/mtd.h>
17aa98d7cfSKaiGai Kohei #include "nodelist.h"
18aa98d7cfSKaiGai Kohei
jffs2_user_getxattr(const struct xattr_handler * handler,struct dentry * unused,struct inode * inode,const char * name,void * buffer,size_t size)19d9a82a04SAndreas Gruenbacher static int jffs2_user_getxattr(const struct xattr_handler *handler,
20b296821aSAl Viro struct dentry *unused, struct inode *inode,
21b296821aSAl Viro const char *name, void *buffer, size_t size)
22aa98d7cfSKaiGai Kohei {
23b296821aSAl Viro return do_jffs2_getxattr(inode, JFFS2_XPREFIX_USER,
24431547b3SChristoph Hellwig name, buffer, size);
25aa98d7cfSKaiGai Kohei }
26aa98d7cfSKaiGai Kohei
jffs2_user_setxattr(const struct xattr_handler * handler,struct mnt_idmap * idmap,struct dentry * unused,struct inode * inode,const char * name,const void * buffer,size_t size,int flags)27d9a82a04SAndreas Gruenbacher static int jffs2_user_setxattr(const struct xattr_handler *handler,
28*39f60c1cSChristian Brauner struct mnt_idmap *idmap,
2959301226SAl Viro struct dentry *unused, struct inode *inode,
3059301226SAl Viro const char *name, const void *buffer,
3159301226SAl Viro size_t size, int flags)
32aa98d7cfSKaiGai Kohei {
3359301226SAl Viro return do_jffs2_setxattr(inode, JFFS2_XPREFIX_USER,
34431547b3SChristoph Hellwig name, buffer, size, flags);
35aa98d7cfSKaiGai Kohei }
36aa98d7cfSKaiGai Kohei
37365f0cb9SStephen Hemminger const struct xattr_handler jffs2_user_xattr_handler = {
38aa98d7cfSKaiGai Kohei .prefix = XATTR_USER_PREFIX,
39aa98d7cfSKaiGai Kohei .set = jffs2_user_setxattr,
40aa98d7cfSKaiGai Kohei .get = jffs2_user_getxattr
41aa98d7cfSKaiGai Kohei };
42