xattr.c 789 B

123456789101112131415161718192021222324252627282930
  1. #include <linux/file.h>
  2. #include <linux/fs.h>
  3. #include <linux/xattr.h>
  4. #include <linux/dcache.h>
  5. #include "fat.h"
  6. #ifndef CONFIG_FAT_VIRTUAL_XATTR_SELINUX_LABEL
  7. #define CONFIG_FAT_VIRTUAL_XATTR_SELINUX_LABEL ("undefined")
  8. #endif
  9. static const char default_xattr[] = CONFIG_FAT_VIRTUAL_XATTR_SELINUX_LABEL;
  10. int fat_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags) {
  11. return 0;
  12. }
  13. ssize_t fat_getxattr(struct dentry *dentry, const char *name, void *value, size_t size) {
  14. if (size > strlen(default_xattr)+1 && value)
  15. strcpy(value, default_xattr);
  16. return strlen(default_xattr);
  17. }
  18. ssize_t fat_listxattr(struct dentry *dentry, char *list, size_t size) {
  19. return 0;
  20. }
  21. int fat_removexattr(struct dentry *dentry, const char *name) {
  22. return 0;
  23. }