From patchwork Mon Mar 23 23:34:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1260376 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ttIU1LZa; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48mW2Q23nDz9sP7 for ; Tue, 24 Mar 2020 10:35:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B288F85321; Mon, 23 Mar 2020 23:35:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q746F_CIcBVS; Mon, 23 Mar 2020 23:35:05 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 30B388512E; Mon, 23 Mar 2020 23:35:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E551EC1AE2; Mon, 23 Mar 2020 23:35:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 96F12C0177 for ; Mon, 23 Mar 2020 23:35:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8C88687C88 for ; Mon, 23 Mar 2020 23:35:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m0fPV35oEAPR for ; Mon, 23 Mar 2020 23:35:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id 68D4387BD9 for ; Mon, 23 Mar 2020 23:35:02 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id v23so2555955ply.10 for ; Mon, 23 Mar 2020 16:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=x1H7AGBODl0tODvoB3dlQO0Xtkjn2DROOGDRSUlsTqc=; b=ttIU1LZa1RLl4zI8u6GClXkARyvmwzkXzJOIb9HqjP4qbK/JgQ2qRrD2woCR6bTZxj yo5hihyp1/xqCYRyRCwSbHJmW+iQmM6CWjA18TT+uvyMi2C0rV9xWoenvZHBOGk3bo01 be1c7RGxHFRd+JnFhmcOYn5JMdffRCB6CzJrBJCjyff4tLwhmutw8h7W8+J9hTdxbk1v qR4HUsPr63/lI5E0KV6HlLH2EyvXc9dOLzoPrqJ2ACNTYFymoUwyx/ZpyvXR8lAtFkdd 5bSJHKKchbiT/7JuDdtzycjVucz6idqkepobw/XwkdZe0JgkioQ7MLWdvP5yIcWSEldk Pyqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=x1H7AGBODl0tODvoB3dlQO0Xtkjn2DROOGDRSUlsTqc=; b=umAUfEo2iUVxNt23+DBgdk/XGsZxuNrAsBdyUWnyLZqYEdjLhQ2HVQgqZMsuowaOvQ 8N3AIGbZxslNSCguivufNH37ndNDbiJRG8RBoAlReEiT/sH+Gumo/kO99jSDdFCa9wIO zShrUUKwwO7kb0njt1i2RUzTqUVY3n9N3NoKhz8AXQFb6PV57WsC2iOmog4YmO95UrRS 4RdO29NcimxdXyVHaIQAJV+6ZOqFjC/Q2DgRnImBpP10YIfMl8j2XtKyYdCbyICZd6CZ 69NjIXTOP6dwlU7AhV7H303EypqRAgTacU/0GuCbE4ndpO8mVvNfwZZHWowSkdyHqw78 v9UQ== X-Gm-Message-State: ANhLgQ2/xy3008zQIsF4ql5xZS61W93O+90HnJhUsdsiM3uVsSaHpCVL jCagkYhPU8ly4VKS/40r2bcYz26I X-Google-Smtp-Source: ADFU+vtCDM2g+PJQiWftC+VkP9BU6ZBJqHw8Y4HmhUdHzylSE5XyxzBBw5lG53eNTrdFo5q6nfo2zg== X-Received: by 2002:a17:90a:1b4f:: with SMTP id q73mr890363pjq.188.1585006501543; Mon, 23 Mar 2020 16:35:01 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id s24sm13206043pgk.14.2020.03.23.16.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2020 16:35:01 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Mon, 23 Mar 2020 16:34:37 -0700 Message-Id: <1585006477-15354-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] lockfile: Fix OVS_REQUIRES macro. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Pass lock objects, not their addresses, to the annotation macros. Fixes: f21fa45f3085 ("lockfile: Minor code cleanup.") Tested-at: https://travis-ci.org/github/williamtu/ovs-travis/builds/666098338 Signed-off-by: William Tu Acked-by: Ben Pfaff --- lib/lockfile.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/lockfile.c b/lib/lockfile.c index 36728ff912d9..42782d29e068 100644 --- a/lib/lockfile.c +++ b/lib/lockfile.c @@ -61,9 +61,9 @@ static struct hmap *const lock_table OVS_GUARDED_BY(lock_table_mutex) static void lockfile_unhash(struct lockfile *); static int lockfile_try_lock(const char *name, pid_t *pidp, struct lockfile **lockfilep) - OVS_REQUIRES(&lock_table_mutex); + OVS_REQUIRES(lock_table_mutex); static void lockfile_do_unlock(struct lockfile * lockfile) - OVS_REQUIRES(&lock_table_mutex); + OVS_REQUIRES(lock_table_mutex); /* Returns the name of the lockfile that would be created for locking a file * named 'filename_'. The caller is responsible for freeing the returned name, @@ -188,7 +188,7 @@ lockfile_hash(dev_t device, ino_t inode) } static struct lockfile * -lockfile_find(dev_t device, ino_t inode) OVS_REQUIRES(&lock_table_mutex) +lockfile_find(dev_t device, ino_t inode) OVS_REQUIRES(lock_table_mutex) { struct lockfile *lockfile; @@ -202,7 +202,7 @@ lockfile_find(dev_t device, ino_t inode) OVS_REQUIRES(&lock_table_mutex) } static void -lockfile_unhash(struct lockfile *lockfile) OVS_REQUIRES(&lock_table_mutex) +lockfile_unhash(struct lockfile *lockfile) OVS_REQUIRES(lock_table_mutex) { if (lockfile->fd >= 0) { close(lockfile->fd); @@ -213,7 +213,7 @@ lockfile_unhash(struct lockfile *lockfile) OVS_REQUIRES(&lock_table_mutex) static struct lockfile * lockfile_register(const char *name, dev_t device, ino_t inode, int fd) - OVS_REQUIRES(&lock_table_mutex) + OVS_REQUIRES(lock_table_mutex) { struct lockfile *lockfile; @@ -236,7 +236,7 @@ lockfile_register(const char *name, dev_t device, ino_t inode, int fd) #ifdef _WIN32 static void lockfile_do_unlock(struct lockfile *lockfile) - OVS_REQUIRES(&lock_table_mutex) + OVS_REQUIRES(lock_table_mutex) { if (lockfile->fd >= 0) { OVERLAPPED overl; @@ -252,7 +252,7 @@ lockfile_do_unlock(struct lockfile *lockfile) static int lockfile_try_lock(const char *name, pid_t *pidp, struct lockfile **lockfilep) - OVS_REQUIRES(&lock_table_mutex) + OVS_REQUIRES(lock_table_mutex) { HANDLE lock_handle; BOOL retval; @@ -306,7 +306,7 @@ lockfile_do_unlock(struct lockfile *lockfile) static int lockfile_try_lock(const char *name, pid_t *pidp, struct lockfile **lockfilep) - OVS_REQUIRES(&lock_table_mutex) + OVS_REQUIRES(lock_table_mutex) { struct flock l; struct stat s;