Add vitastor_c_inode_get_immediate_commit
This commit is contained in:
@@ -20,9 +20,11 @@
|
|||||||
#define MAX_DATA_BLOCK_SIZE 128*1024*1024
|
#define MAX_DATA_BLOCK_SIZE 128*1024*1024
|
||||||
#define DEFAULT_BITMAP_GRANULARITY 4096
|
#define DEFAULT_BITMAP_GRANULARITY 4096
|
||||||
|
|
||||||
|
#ifndef IMMEDIATE_NONE
|
||||||
#define IMMEDIATE_NONE 0
|
#define IMMEDIATE_NONE 0
|
||||||
#define IMMEDIATE_SMALL 1
|
#define IMMEDIATE_SMALL 1
|
||||||
#define IMMEDIATE_ALL 2
|
#define IMMEDIATE_ALL 2
|
||||||
|
#endif
|
||||||
|
|
||||||
struct etcd_kv_t
|
struct etcd_kv_t
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -384,4 +384,12 @@ int vitastor_c_inode_get_readonly(void *handle)
|
|||||||
return watch->cfg.readonly;
|
return watch->cfg.readonly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t vitastor_c_inode_get_immediate_commit(vitastor_c *client, uint64_t inode_num)
|
||||||
|
{
|
||||||
|
auto pool_it = client->cli->st_cli.pool_config.find(INODE_POOL(inode_num));
|
||||||
|
if (pool_it == client->cli->st_cli.pool_config.end())
|
||||||
|
return 0;
|
||||||
|
return pool_it->second.immediate_commit;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,13 @@
|
|||||||
#ifndef POOL_ID_BITS
|
#ifndef POOL_ID_BITS
|
||||||
#define POOL_ID_BITS 16
|
#define POOL_ID_BITS 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef IMMEDIATE_NONE
|
||||||
|
#define IMMEDIATE_NONE 0
|
||||||
|
#define IMMEDIATE_SMALL 1
|
||||||
|
#define IMMEDIATE_ALL 2
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
@@ -65,6 +72,8 @@ uint64_t vitastor_c_inode_get_num(void *handle);
|
|||||||
uint32_t vitastor_c_inode_get_block_size(vitastor_c *client, uint64_t inode_num);
|
uint32_t vitastor_c_inode_get_block_size(vitastor_c *client, uint64_t inode_num);
|
||||||
uint32_t vitastor_c_inode_get_bitmap_granularity(vitastor_c *client, uint64_t inode_num);
|
uint32_t vitastor_c_inode_get_bitmap_granularity(vitastor_c *client, uint64_t inode_num);
|
||||||
int vitastor_c_inode_get_readonly(void *handle);
|
int vitastor_c_inode_get_readonly(void *handle);
|
||||||
|
// Returns IMMEDIATE_ALL, IMMEDIATE_SMALL or IMMEDIATE_NONE
|
||||||
|
uint32_t vitastor_c_inode_get_immediate_commit(vitastor_c *client, uint64_t inode_num);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user