diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-06-01 12:35:14 +0530 |
---|---|---|
committer | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-06-01 10:25:17 -0700 |
commit | faa44e3d3e986f29579e0d0d07b7aef771184e8c (patch) | |
tree | eed23e2305a7d683f6f10ce6e68ee87a312fc27d /hw/9pfs/virtio-9p-xattr.h | |
parent | 873c32139354caef3cc1013f00963cc740a6a727 (diff) |
[virtio-9p] Make rpath thread safe
Current rpath inline function is heavily used in all system calls.
This function has a static buffer making it a non-thread safe function.
This patch introduces new thread-safe routine and makes use of it.
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/virtio-9p-xattr.h')
-rw-r--r-- | hw/9pfs/virtio-9p-xattr.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/9pfs/virtio-9p-xattr.h b/hw/9pfs/virtio-9p-xattr.h index 2bbae2dcb5..247e414ebd 100644 --- a/hw/9pfs/virtio-9p-xattr.h +++ b/hw/9pfs/virtio-9p-xattr.h @@ -54,20 +54,23 @@ ssize_t pt_listxattr(FsContext *ctx, const char *path, char *name, void *value, static inline ssize_t pt_getxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size) { - return lgetxattr(rpath(ctx, path), name, value, size); + char buffer[PATH_MAX]; + return lgetxattr(rpath(ctx, path, buffer), name, value, size); } static inline int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size, int flags) { - return lsetxattr(rpath(ctx, path), name, value, size, flags); + char buffer[PATH_MAX]; + return lsetxattr(rpath(ctx, path, buffer), name, value, size, flags); } static inline int pt_removexattr(FsContext *ctx, const char *path, const char *name) { - return lremovexattr(rpath(ctx, path), name); + char buffer[PATH_MAX]; + return lremovexattr(rpath(ctx, path, buffer), name); } static inline ssize_t notsup_getxattr(FsContext *ctx, const char *path, |