From patchwork Wed Mar 3 19:01:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 46862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5014CB6EEB for ; Thu, 4 Mar 2010 06:19:11 +1100 (EST) Received: from localhost ([127.0.0.1]:49615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmu68-0005fv-GW for incoming@patchwork.ozlabs.org; Wed, 03 Mar 2010 14:19:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmtpL-0007O3-Ej for qemu-devel@nongnu.org; Wed, 03 Mar 2010 14:01:47 -0500 Received: from [199.232.76.173] (port=60460 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmtpK-0007N9-N2 for qemu-devel@nongnu.org; Wed, 03 Mar 2010 14:01:46 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmtpJ-0001aO-Uo for qemu-devel@nongnu.org; Wed, 03 Mar 2010 14:01:46 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:46116) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NmtpJ-0001aG-Fq for qemu-devel@nongnu.org; Wed, 03 Mar 2010 14:01:45 -0500 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e36.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o23IwpBc009992 for ; Wed, 3 Mar 2010 11:58:51 -0700 Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id o23J1ZTZ252912 for ; Wed, 3 Mar 2010 12:01:40 -0700 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o23J3m8B010473 for ; Wed, 3 Mar 2010 12:03:48 -0700 Received: from localhost.localdomain (sig-9-76-214-227.mts.ibm.com [9.76.214.227]) by d03av06.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o23J3daP009640; Wed, 3 Mar 2010 12:03:48 -0700 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Wed, 3 Mar 2010 13:01:13 -0600 Message-Id: <1267642874-15001-18-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.5.2 In-Reply-To: <1267642874-15001-1-git-send-email-aliguori@us.ibm.com> References: <1267642874-15001-1-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH 16/17] virtio-9p: Add support for hardlink X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: 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 65f5827..8a96645 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -676,6 +676,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); } }