From patchwork Wed Sep 18 04:15:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 11149599 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 466FA912 for ; Wed, 18 Sep 2019 04:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 257AC2189D for ; Wed, 18 Sep 2019 04:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbfIREQF (ORCPT ); Wed, 18 Sep 2019 00:16:05 -0400 Received: from mga11.intel.com ([192.55.52.93]:18664 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbfIREQF (ORCPT ); Wed, 18 Sep 2019 00:16:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 21:16:05 -0700 X-IronPort-AV: E=Sophos;i="5.64,519,1559545200"; d="scan'208";a="186352844" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 21:16:05 -0700 From: ira.weiny@intel.com To: fstests@vger.kernel.org, Eryu Guan Cc: john.hubbard@gmail.com, Dave Chinner , Jason Gunthorpe , Jan Kara , dan.j.williams@intel.com, Jeff Layton , Ira Weiny Subject: [PATCH 02/13] src/locktest: Remove OPEN macro Date: Tue, 17 Sep 2019 21:15:47 -0700 Message-Id: <20190918041558.2621-3-ira.weiny@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190918041558.2621-1-ira.weiny@intel.com> References: <20190918041558.2621-1-ira.weiny@intel.com> MIME-Version: 1.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Ira Weiny The code is much cleaner without this macro. While here add extra debug output as well. Signed-off-by: Ira Weiny --- src/locktest.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/locktest.c b/src/locktest.c index 29e914febdf9..b5e1cf7669d8 100644 --- a/src/locktest.c +++ b/src/locktest.c @@ -61,7 +61,6 @@ extern int h_errno; #define HANDLE int #define INVALID_HANDLE -1 -#define OPEN(N,F) (open(N, F|O_CREAT|O_BINARY, 0644)) #define SEEK(H, O) (lseek(H, O, SEEK_SET)) #define READ(H, B, L) (read(H, B, L)) #define WRITE(H, B, L) (write(H, B, L)) @@ -598,12 +597,16 @@ initialize(HANDLE fd) int do_open(int flag) { - if ((f_fd = OPEN(filename, flag)) == INVALID_HANDLE) { + int flags = flag|O_CREAT|O_BINARY; + + if(debug > 1) + fprintf(stderr, "do_open %s 0x%x\n", filename, flags); + + if ((f_fd = open(filename, flags, 0666)) == INVALID_HANDLE) { perror("shared file create"); return FAIL; /*NOTREACHED*/ } - return PASS; }