[ovs-dev] lockfile: Fix OVS_REQUIRES macro.
diff mbox series

Message ID 1585006477-15354-1-git-send-email-u9012063@gmail.com
State New
Headers show
Series
  • [ovs-dev] lockfile: Fix OVS_REQUIRES macro.
Related show

Commit Message

William Tu March 23, 2020, 11:34 p.m. UTC
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 <u9012063@gmail.com>
---
 lib/lockfile.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Ben Pfaff March 23, 2020, 11:48 p.m. UTC | #1
On Mon, Mar 23, 2020 at 04:34:37PM -0700, William Tu wrote:
> 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 <u9012063@gmail.com>

Assuming it compiles, this is good.

Acked-by: Ben Pfaff <blp@ovn.org>
William Tu March 24, 2020, 2:37 p.m. UTC | #2
On Mon, Mar 23, 2020 at 04:48:42PM -0700, Ben Pfaff wrote:
> On Mon, Mar 23, 2020 at 04:34:37PM -0700, William Tu wrote:
> > 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 <u9012063@gmail.com>
> 
> Assuming it compiles, this is good.
> 
> Acked-by: Ben Pfaff <blp@ovn.org>
Applied to master, thanks.
William

Patch
diff mbox series

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;