lockfile: Fix OVS_REQUIRES macro.
Pass lock objects, not their addresses, to the annotation macros.
Fixes: ("lockfile: Minor code cleanup.")
Tested-at:
Acked-by: Ben Pfaff
@@ -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;
