From faa44e3d3e986f29579e0d0d07b7aef771184e8c Mon Sep 17 00:00:00 2001 From: "Venkateswararao Jujjuri (JV)" Date: Wed, 1 Jun 2011 12:35:14 +0530 Subject: [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 " --- hw/9pfs/virtio-9p.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/9pfs/virtio-9p.h') diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index 27f9970..2bfbe62 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -101,6 +101,11 @@ enum p9_proto_version { #define P9_NOTAG (u16)(~0) #define P9_NOFID (u32)(~0) #define P9_MAXWELEM 16 +static inline const char *rpath(FsContext *ctx, const char *path, char *buffer) +{ + snprintf(buffer, PATH_MAX, "%s/%s", ctx->fs_root, path); + return buffer; +} /* * ample room for Twrite/Rread header -- cgit v1.1