From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuqAc-0007DM-Be for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:44:34 -0400 Received: from [140.186.70.92] (port=50584 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuqAV-0007AV-TX for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:44:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuqAP-00059R-QV for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:44:27 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:45323) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuqAO-000594-Kx for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:44:21 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp08.au.ibm.com (8.14.3/8.13.1) with ESMTP id o2PGiJ2C003966 for ; Fri, 26 Mar 2010 03:44:19 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2PGcHtC1667094 for ; Fri, 26 Mar 2010 03:38:17 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2PGiIvl031491 for ; Fri, 26 Mar 2010 03:44:19 +1100 From: "Aneesh Kumar K.V" Date: Thu, 25 Mar 2010 22:13:24 +0530 Message-Id: <1269535420-31206-17-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V3 16/32] virtio-9p: Add support for hardlink List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ericvh@gmail.com, aliguori@us.ibm.com, "Aneesh Kumar K.V" link count for files and directories are encoded as a tagged string in the extension field for a .u protocol extension. Signed-off-by: Aneesh Kumar K.V --- hw/virtio-9p.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index e8a9eeb..3ddf2b9 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -674,6 +674,9 @@ static void stat_to_v9stat(V9fsState *s, V9fsString *name, v9fs_string_sprintf(&v9stat->extension, "%c %u %u", S_ISCHR(stbuf->st_mode) ? 'c' : 'b', major(stbuf->st_rdev), minor(stbuf->st_rdev)); + } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) { + v9fs_string_sprintf(&v9stat->extension, "%s %u", + "HARDLINKCOUNT", stbuf->st_nlink); } } -- 1.7.0.2.323.g0d092