9p-xattr.h (3035B)
1/* 2 * 9p 3 * 4 * Copyright IBM, Corp. 2010 5 * 6 * Authors: 7 * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> 8 * 9 * This work is licensed under the terms of the GNU GPL, version 2. See 10 * the COPYING file in the top-level directory. 11 * 12 */ 13 14#ifndef QEMU_9P_XATTR_H 15#define QEMU_9P_XATTR_H 16 17#include "qemu/xattr.h" 18 19struct XattrOperations { 20 const char *name; 21 ssize_t (*getxattr)(FsContext *ctx, const char *path, 22 const char *name, void *value, size_t size); 23 ssize_t (*listxattr)(FsContext *ctx, const char *path, 24 char *name, void *value, size_t size); 25 int (*setxattr)(FsContext *ctx, const char *path, const char *name, 26 void *value, size_t size, int flags); 27 int (*removexattr)(FsContext *ctx, 28 const char *path, const char *name); 29}; 30 31ssize_t local_getxattr_nofollow(FsContext *ctx, const char *path, 32 const char *name, void *value, size_t size); 33ssize_t local_setxattr_nofollow(FsContext *ctx, const char *path, 34 const char *name, void *value, size_t size, 35 int flags); 36ssize_t local_removexattr_nofollow(FsContext *ctx, const char *path, 37 const char *name); 38 39extern XattrOperations mapped_user_xattr; 40extern XattrOperations passthrough_user_xattr; 41 42extern XattrOperations mapped_pacl_xattr; 43extern XattrOperations mapped_dacl_xattr; 44extern XattrOperations passthrough_acl_xattr; 45extern XattrOperations none_acl_xattr; 46 47extern XattrOperations *mapped_xattr_ops[]; 48extern XattrOperations *passthrough_xattr_ops[]; 49extern XattrOperations *none_xattr_ops[]; 50 51ssize_t v9fs_get_xattr(FsContext *ctx, const char *path, const char *name, 52 void *value, size_t size); 53ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, void *value, 54 size_t vsize); 55int v9fs_set_xattr(FsContext *ctx, const char *path, const char *name, 56 void *value, size_t size, int flags); 57int v9fs_remove_xattr(FsContext *ctx, const char *path, const char *name); 58 59ssize_t pt_listxattr(FsContext *ctx, const char *path, char *name, void *value, 60 size_t size); 61ssize_t pt_getxattr(FsContext *ctx, const char *path, const char *name, 62 void *value, size_t size); 63int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value, 64 size_t size, int flags); 65int pt_removexattr(FsContext *ctx, const char *path, const char *name); 66 67ssize_t notsup_getxattr(FsContext *ctx, const char *path, const char *name, 68 void *value, size_t size); 69int notsup_setxattr(FsContext *ctx, const char *path, const char *name, 70 void *value, size_t size, int flags); 71ssize_t notsup_listxattr(FsContext *ctx, const char *path, char *name, 72 void *value, size_t size); 73int notsup_removexattr(FsContext *ctx, const char *path, const char *name); 74 75#endif