From patchwork Mon Jun 27 09:41:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 9200195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7CDAF60B16 for ; Mon, 27 Jun 2016 09:42:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B0A028564 for ; Mon, 27 Jun 2016 09:42:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FB972856D; Mon, 27 Jun 2016 09:42:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEEF928564 for ; Mon, 27 Jun 2016 09:42:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bHT3H-000163-Vw; Mon, 27 Jun 2016 09:41:59 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bHT3H-00015w-1b for v9fs-developer@lists.sourceforge.net; Mon, 27 Jun 2016 09:41:59 +0000 Received-SPF: softfail (sog-mx-1.v43.ch3.sourceforge.com: transitioning domain of kaod.org does not designate 148.163.158.5 as permitted sender) client-ip=148.163.158.5; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com; Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1bHT3G-0002DT-9e for v9fs-developer@lists.sourceforge.net; Mon, 27 Jun 2016 09:41:59 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5R9dJpm097133 for ; Mon, 27 Jun 2016 05:41:53 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0b-001b2d01.pphosted.com with ESMTP id 23sp3gnj4v-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Jun 2016 05:41:52 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Jun 2016 03:41:52 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 27 Jun 2016 03:41:49 -0600 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: groug@kaod.org Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 972773E40044; Mon, 27 Jun 2016 03:41:48 -0600 (MDT) Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5R9fmU365994834; Mon, 27 Jun 2016 02:41:48 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71C55BE040; Mon, 27 Jun 2016 03:41:48 -0600 (MDT) Received: from bahia.lan (unknown [9.164.189.130]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 0A6DBBE038; Mon, 27 Jun 2016 03:41:46 -0600 (MDT) From: Greg Kurz To: qemu-devel@nongnu.org Date: Mon, 27 Jun 2016 11:41:45 +0200 In-Reply-To: <146702045511.5764.17551224268217330628.stgit@bahia.lan> References: <146702045511.5764.17551224268217330628.stgit@bahia.lan> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062709-0004-0000-0000-00000FC71426 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062709-0005-0000-0000-000076897CE3 Message-Id: <146702050570.5764.13291536303403737397.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-27_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606270110 X-Headers-End: 1bHT3G-0002DT-9e Cc: Eric Van Hensbergen , v9fs-developer@lists.sourceforge.net, "Aneesh Kumar K.V" , Greg Kurz Subject: [V9fs-developer] [PATCH 06/13] oslib: support futimens() if available X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Greg Kurz --- hw/9pfs/9p-handle.c | 7 +------ include/sysemu/os-posix.h | 1 + util/oslib-posix.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 6 deletions(-) ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c index e48e48a7145d..197c2c7efbb5 100644 --- a/hw/9pfs/9p-handle.c +++ b/hw/9pfs/9p-handle.c @@ -388,7 +388,6 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path, const struct timespec *buf) { int ret; -#ifdef CONFIG_UTIMENSAT int fd; struct handle_data *data = (struct handle_data *)ctx->private; @@ -396,12 +395,8 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path, if (fd < 0) { return fd; } - ret = futimens(fd, buf); + ret = qemu_futimens(fd, buf); close(fd); -#else - ret = -1; - errno = ENOSYS; -#endif return ret; } diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 9c7dfdfbec69..c2b2288bb3bf 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -57,6 +57,7 @@ typedef struct timeval qemu_timeval; #endif typedef struct timespec qemu_timespec; int qemu_utimens(const char *path, const qemu_timespec *times); +int qemu_futimens(int fd, const qemu_timespec *times); bool is_daemonized(void); diff --git a/util/oslib-posix.c b/util/oslib-posix.c index e2e1d4d39f59..3c9de4ad1d71 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -187,6 +187,16 @@ int qemu_pipe(int pipefd[2]) return ret; } +int qemu_futimens(int fd, const struct timespec *times) +{ +#ifdef CONFIG_UTIMENSAT + return futimens(fd, times); +#else + errno = ENOSYS; + return -1; +#endif +} + int qemu_utimens(const char *path, const struct timespec *times) { struct timeval tv[2], tv_now;