* conn_src->owner_meta, and we only attach the connection's name and
* currently owned names on top of that.
*/
- mutex_lock(&conn_dst->lock);
- attach_flags = conn_dst->attach_flags;
- mutex_unlock(&conn_dst->lock);
+ attach_flags = atomic64_read(&conn_dst->attach_flags);
if (conn_src->owner_meta)
attach_flags &= KDBUS_ATTACH_NAMES | KDBUS_ATTACH_CONN_NAME;
return ret;
}
- if (flags_provided) {
- mutex_lock(&conn->lock);
- conn->attach_flags = attach_flags;
- mutex_unlock(&conn->lock);
- }
+ if (flags_provided)
+ atomic64_set(&conn->attach_flags, attach_flags);
return 0;
}
memcpy(hello->id128, bus->id128, sizeof(hello->id128));
conn->flags = hello->conn_flags;
- conn->attach_flags = hello->attach_flags;
+ atomic64_set(&conn->attach_flags, hello->attach_flags);
if (is_activator) {
u64 flags = KDBUS_NAME_ACTIVATOR;
#ifndef __KDBUS_CONNECTION_H
#define __KDBUS_CONNECTION_H
+#include <linux/atomic.h>
#include <linux/lockdep.h>
#include "limits.h"
#include "metadata.h"
#endif
u64 id;
u64 flags;
- u64 attach_flags;
+ atomic64_t attach_flags;
const char *name;
struct kdbus_bus *bus;
struct kdbus_ep *ep;