projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean-up: common: uuid: uninitialized output parameter on error
[lttng-tools.git]
/
src
/
common
/
fd-tracker
/
inode.cpp
diff --git
a/src/common/fd-tracker/inode.cpp
b/src/common/fd-tracker/inode.cpp
index b5cdcf1b27b583dd3e67f004db62ba214057281d..c00f9d81ff1686e8ec16b30cc32095a53884f12c 100644
(file)
--- a/
src/common/fd-tracker/inode.cpp
+++ b/
src/common/fd-tracker/inode.cpp
@@
-23,10
+23,12
@@
#include "inode.hpp"
#include "inode.hpp"
+namespace {
struct inode_id {
dev_t device;
ino_t inode;
};
struct inode_id {
dev_t device;
ino_t inode;
};
+} /* namespace */
struct lttng_inode_registry {
/* Hashtable of inode_id to lttng_inode. */
struct lttng_inode_registry {
/* Hashtable of inode_id to lttng_inode. */
@@
-60,7
+62,8
@@
struct lttng_unlinked_file_pool {
unsigned int next_id;
};
unsigned int next_id;
};
-static struct {
+namespace {
+struct {
pthread_mutex_t lock;
bool initialized;
unsigned long value;
pthread_mutex_t lock;
bool initialized;
unsigned long value;
@@
-69,6
+72,7
@@
static struct {
.initialized = false,
.value = 0,
};
.initialized = false,
.value = 0,
};
+} /* namespace */
static unsigned long lttng_inode_id_hash(const struct inode_id *id)
{
static unsigned long lttng_inode_id_hash(const struct inode_id *id)
{
@@
-81,8
+85,8
@@
static unsigned long lttng_inode_id_hash(const struct inode_id *id)
static int lttng_inode_match(struct cds_lfht_node *node, const void *key)
{
const struct inode_id *id = (inode_id *) key;
static int lttng_inode_match(struct cds_lfht_node *node, const void *key)
{
const struct inode_id *id = (inode_id *) key;
- const struct lttng_inode *inode =
caa_
container_of(
- node,
struct lttng_inode,
registry_node);
+ const struct lttng_inode *inode =
lttng::utils::
container_of(
+ node,
<tng_inode::
registry_node);
return inode->id.device == id->device && inode->id.inode == id->inode;
}
return inode->id.device == id->device && inode->id.inode == id->inode;
}
@@
-90,7
+94,7
@@
static int lttng_inode_match(struct cds_lfht_node *node, const void *key)
static void lttng_inode_free(struct rcu_head *head)
{
struct lttng_inode *inode =
static void lttng_inode_free(struct rcu_head *head)
{
struct lttng_inode *inode =
-
caa_container_of(head, struct lttng_inode,
rcu_head);
+
lttng::utils::container_of(head, <tng_inode::
rcu_head);
free(inode);
}
free(inode);
}
@@
-239,7
+243,7
@@
static void lttng_inode_destroy(struct lttng_inode *inode)
static void lttng_inode_release(struct urcu_ref *ref)
{
static void lttng_inode_release(struct urcu_ref *ref)
{
- lttng_inode_destroy(
caa_container_of(ref, struct lttng_inode,
ref));
+ lttng_inode_destroy(
lttng::utils::container_of(ref, <tng_inode::
ref));
}
static void lttng_inode_get(struct lttng_inode *inode)
}
static void lttng_inode_get(struct lttng_inode *inode)
@@
-250,7
+254,7
@@
static void lttng_inode_get(struct lttng_inode *inode)
struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create(
const char *path)
{
struct lttng_unlinked_file_pool *lttng_unlinked_file_pool_create(
const char *path)
{
- struct lttng_unlinked_file_pool *pool =
(lttng_unlinked_file_pool *) zmalloc(sizeof(*pool)
);
+ struct lttng_unlinked_file_pool *pool =
zmalloc<lttng_unlinked_file_pool>(
);
if (!pool) {
goto error;
if (!pool) {
goto error;
@@
-434,7
+438,7
@@
static struct lttng_inode *lttng_inode_create(const struct inode_id *id,
reference_acquired = lttng_directory_handle_get(directory_handle);
LTTNG_ASSERT(reference_acquired);
reference_acquired = lttng_directory_handle_get(directory_handle);
LTTNG_ASSERT(reference_acquired);
- inode =
(lttng_inode *) zmalloc(sizeof(*inode)
);
+ inode =
zmalloc<lttng_inode>(
);
if (!inode) {
goto end;
}
if (!inode) {
goto end;
}
@@
-455,7
+459,7
@@
end:
struct lttng_inode_registry *lttng_inode_registry_create(void)
{
struct lttng_inode_registry *lttng_inode_registry_create(void)
{
- struct lttng_inode_registry *registry =
(lttng_inode_registry *) zmalloc(sizeof(*registry)
);
+ struct lttng_inode_registry *registry =
zmalloc<lttng_inode_registry>(
);
if (!registry) {
goto end;
if (!registry) {
goto end;
@@
-522,8
+526,8
@@
struct lttng_inode *lttng_inode_registry_get_inode(
lttng_inode_match, &id, &iter);
node = cds_lfht_iter_get_node(&iter);
if (node) {
lttng_inode_match, &id, &iter);
node = cds_lfht_iter_get_node(&iter);
if (node) {
- inode =
caa_
container_of(
- node,
struct lttng_inode,
registry_node);
+ inode =
lttng::utils::
container_of(
+ node,
<tng_inode::
registry_node);
lttng_inode_get(inode);
goto end_unlock;
}
lttng_inode_get(inode);
goto end_unlock;
}
This page took
0.024876 seconds
and
4
git commands to generate.