Commit 0d343717 authored by Philip Carns's avatar Philip Carns
Browse files

remove mode argument from fn to create targets

parent 0b4f92de
......@@ -28,10 +28,9 @@ typedef struct bake_provider* bake_provider_t;
*
* @param[in] pool_name path to PMEM backend file
* @param[in] pool_size size of the created pool
* @param[in] pool_mode mode of the created pool
* @returns 0 on success, -1 otherwise
*/
int bake_makepool(const char* pool_name, size_t pool_size, mode_t pool_mode);
int bake_makepool(const char* pool_name, size_t pool_size);
/**
* The bake_provider_init_info structure can be passed in to the
......
......@@ -113,15 +113,13 @@ static int transfer_data(bake_file_entry_t* entry,
static void xfer_ult(void* _args);
/* TODO: reorganize this later into the "admin library" model */
int bake_file_makepool(const char* file_name,
size_t file_size,
mode_t file_mode)
int bake_file_makepool(const char* file_name, size_t file_size)
{
int fd = -1;
bake_root_t* root;
int ret;
fd = open(file_name, O_EXCL | O_WRONLY | O_CREAT | O_DIRECT, file_mode);
fd = open(file_name, O_EXCL | O_WRONLY | O_CREAT | O_DIRECT, 0644);
if (fd < 0) {
int save_errno = errno;
perror("open");
......
......@@ -16,7 +16,6 @@
struct options {
char* pmem_pool;
size_t pool_size;
mode_t pool_mode;
};
void usage(int argc, char* argv[])
......@@ -68,7 +67,6 @@ void parse_args(int argc, char* argv[], struct options* opts)
/* set default options */
memset(opts, 0, sizeof(*opts));
opts->pool_mode = 0664;
/* get options */
while ((opt = getopt(argc, argv, "s:")) != -1) {
......@@ -99,8 +97,7 @@ void parse_args(int argc, char* argv[], struct options* opts)
/* TODO: this is temporary until we have a more complete solution for admin
* functions.
*/
extern int
bake_file_makepool(const char* file_name, size_t file_size, mode_t file_mode);
extern int bake_file_makepool(const char* file_name, size_t file_size);
int main(int argc, char* argv[])
{
......@@ -121,10 +118,9 @@ int main(int argc, char* argv[])
}
if (strcmp(backend_type, "pmem") == 0) {
ret = bake_makepool(opts.pmem_pool, opts.pool_size, opts.pool_mode);
ret = bake_makepool(opts.pmem_pool, opts.pool_size);
} else if (strcmp(backend_type, "file") == 0) {
ret = bake_file_makepool(opts.pmem_pool, opts.pool_size,
opts.pool_mode);
ret = bake_file_makepool(opts.pmem_pool, opts.pool_size);
} else {
fprintf(stderr, "ERROR: unknown backend type \"%s\"\n", backend_type);
free(backend_type);
......
......@@ -53,13 +53,13 @@ typedef struct xfer_args {
static void xfer_ult(void* _args);
int bake_makepool(const char* pool_name, size_t pool_size, mode_t pool_mode)
int bake_makepool(const char* pool_name, size_t pool_size)
{
PMEMobjpool* pool;
PMEMoid root_oid;
bake_root_t* root;
pool = pmemobj_create(pool_name, NULL, pool_size, pool_mode);
pool = pmemobj_create(pool_name, NULL, pool_size, 0644);
if (!pool) {
fprintf(stderr, "pmemobj_create: %s\n", pmemobj_errormsg());
return BAKE_ERR_PMEM;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment