Merge osd_id.h into object_id.h

This commit is contained in:
Vitaliy Filippov
2026-03-02 01:46:17 +03:00
parent a8dd8bf06c
commit 93cf69f89f
8 changed files with 25 additions and 36 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
#include <set>
#include "json11/json11.hpp"
#include "osd_id.h"
#include "object_id.h"
#include "timerfd_manager.h"
#define ETCD_CONFIG_WATCH_ID 1
+24
View File
@@ -20,6 +20,15 @@ typedef uint64_t inode_t;
// Pool ID is 16 bits long
typedef uint32_t pool_id_t;
typedef uint64_t osd_num_t;
typedef uint32_t pg_num_t;
struct pool_pg_num_t
{
pool_id_t pool_id;
pg_num_t pg_num;
};
// 16 bytes per object/stripe id
// stripe = (start of the parity stripe + peer role)
// i.e. for example (256KB + one of 0,1,2)
@@ -61,6 +70,21 @@ inline bool operator < (const obj_ver_id & a, const obj_ver_id & b)
return a.oid < b.oid || a.oid == b.oid && a.version < b.version;
}
inline bool operator < (const pool_pg_num_t & a, const pool_pg_num_t & b)
{
return a.pool_id < b.pool_id || a.pool_id == b.pool_id && a.pg_num < b.pg_num;
}
inline bool operator == (const pool_pg_num_t & a, const pool_pg_num_t & b)
{
return a.pool_id == b.pool_id && a.pg_num == b.pg_num;
}
inline bool operator != (const pool_pg_num_t & a, const pool_pg_num_t & b)
{
return a.pool_id != b.pool_id || a.pg_num != b.pg_num;
}
namespace std
{
template<> struct hash<object_id>
-1
View File
@@ -4,7 +4,6 @@
#pragma once
#include "object_id.h"
#include "osd_id.h"
// Magic numbers
#define SECONDARY_OSD_OP_MAGIC 0x2bd7b10325434553l
-1
View File
@@ -7,7 +7,6 @@
#include "json11/json11.hpp"
#include "object_id.h"
#include "osd_id.h"
#include "ringloop.h"
#include <functional>
-1
View File
@@ -3,7 +3,6 @@
#include "disk_tool.h"
#include "rw_blocking.h"
#include "osd_id.h"
#include "json_util.h"
#include "malloc_or_die.h"
-1
View File
@@ -4,7 +4,6 @@
#include "disk_tool.h"
#include "str_util.h"
#include "json_util.h"
#include "osd_id.h"
void disk_tool_t::parse_meta_reserve()
{
-30
View File
@@ -1,30 +0,0 @@
// Copyright (c) Vitaliy Filippov, 2019+
// License: VNPL-1.1 or GNU GPL-2.0+ (see README.md for details)
#pragma once
#include "object_id.h"
typedef uint64_t osd_num_t;
typedef uint32_t pg_num_t;
struct pool_pg_num_t
{
pool_id_t pool_id;
pg_num_t pg_num;
};
inline bool operator < (const pool_pg_num_t & a, const pool_pg_num_t & b)
{
return a.pool_id < b.pool_id || a.pool_id == b.pool_id && a.pg_num < b.pg_num;
}
inline bool operator == (const pool_pg_num_t & a, const pool_pg_num_t & b)
{
return a.pool_id == b.pool_id && a.pg_num == b.pg_num;
}
inline bool operator != (const pool_pg_num_t & a, const pool_pg_num_t & b)
{
return a.pool_id != b.pool_id || a.pg_num != b.pg_num;
}
-1
View File
@@ -6,7 +6,6 @@
#include <stdint.h>
#include <vector>
#include "object_id.h"
#include "osd_id.h"
struct buf_len_t
{