xattr_user.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 *dentry, const char *name,
  19. void *buffer, size_t size)
  20. {
  21. return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_USER,
  22. name, buffer, size);
  23. }
  24. static int jffs2_user_setxattr(const struct xattr_handler *handler,
  25. struct dentry *dentry, const char *name,
  26. const void *buffer, size_t size, int flags)
  27. {
  28. return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_USER,
  29. name, buffer, size, flags);
  30. }
  31. const struct xattr_handler jffs2_user_xattr_handler = {
  32. .prefix = XATTR_USER_PREFIX,
  33. .set = jffs2_user_setxattr,
  34. .get = jffs2_user_getxattr
  35. };