xattr_user.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * JFFS2 -- Journalling Flash File System, Version 2.
  3. *
  4. * Copyright © 2006 NEC Corporation
  5. *
  6. * Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
  7. *
  8. * For licensing information, see the file 'LICENCE' in this directory.
  9. *
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/fs.h>
  13. #include <linux/jffs2.h>
  14. #include <linux/xattr.h>
  15. #include <linux/mtd/mtd.h>
  16. #include "nodelist.h"
  17. static int jffs2_user_getxattr(const struct xattr_handler *handler,
  18. struct dentry *unused, struct inode *inode,
  19. const char *name, void *buffer, size_t size)
  20. {
  21. return do_jffs2_getxattr(inode, JFFS2_XPREFIX_USER,
  22. name, buffer, size);
  23. }
  24. static int jffs2_user_setxattr(const struct xattr_handler *handler,
  25. struct dentry *unused, struct inode *inode,
  26. const char *name, const void *buffer,
  27. size_t size, int flags)
  28. {
  29. return do_jffs2_setxattr(inode, JFFS2_XPREFIX_USER,
  30. name, buffer, size, flags);
  31. }
  32. const struct xattr_handler jffs2_user_xattr_handler = {
  33. .prefix = XATTR_USER_PREFIX,
  34. .set = jffs2_user_setxattr,
  35. .get = jffs2_user_getxattr
  36. };