Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * JFFS2 -- Journalling Flash File System, Version 2.
0003  *
0004  * Copyright © 2006  NEC Corporation
0005  *
0006  * Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
0007  *
0008  * For licensing information, see the file 'LICENCE' in this directory.
0009  *
0010  */
0011 
0012 #include <linux/kernel.h>
0013 #include <linux/fs.h>
0014 #include <linux/jffs2.h>
0015 #include <linux/xattr.h>
0016 #include <linux/mtd/mtd.h>
0017 #include "nodelist.h"
0018 
0019 static int jffs2_user_getxattr(const struct xattr_handler *handler,
0020                    struct dentry *unused, struct inode *inode,
0021                    const char *name, void *buffer, size_t size)
0022 {
0023     return do_jffs2_getxattr(inode, JFFS2_XPREFIX_USER,
0024                  name, buffer, size);
0025 }
0026 
0027 static int jffs2_user_setxattr(const struct xattr_handler *handler,
0028                    struct user_namespace *mnt_userns,
0029                    struct dentry *unused, struct inode *inode,
0030                    const char *name, const void *buffer,
0031                    size_t size, int flags)
0032 {
0033     return do_jffs2_setxattr(inode, JFFS2_XPREFIX_USER,
0034                  name, buffer, size, flags);
0035 }
0036 
0037 const struct xattr_handler jffs2_user_xattr_handler = {
0038     .prefix = XATTR_USER_PREFIX,
0039     .set = jffs2_user_setxattr,
0040     .get = jffs2_user_getxattr
0041 };