Skip to content

Commit

Permalink
Merge pull request axboe#188 from grom72/librpma-common-prefix
Browse files Browse the repository at this point in the history
rpma: librpma_common_ prefix before all public names
  • Loading branch information
ldorau committed Jan 25, 2021
2 parents 5afa7fb + 0ad0311 commit 24c251e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions engines/librpma.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

#include "librpma_common.h"

#include <librpma.h>

/* client side implementation */

static inline int client_io_flush(struct thread_data *td,
Expand Down Expand Up @@ -70,7 +68,7 @@ static int client_init(struct thread_data *td)
* - B == ceil(iodepth / iodepth_batch)
* which is the number of batches for N writes
*/
sq_size = td->o.iodepth + LIBRPMA_CEIL(td->o.iodepth,
sq_size = td->o.iodepth + LIBRPMA_COMMON_CEIL(td->o.iodepth,
td->o.iodepth_batch);
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions engines/librpma_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,10 @@ int librpma_common_server_open_file(struct thread_data *td, struct fio_file *f,
}

/* verify size of the memory region's descriptor */
if (mr_desc_size > DESCRIPTOR_MAX_SIZE) {
if (mr_desc_size > LIBRPMA_COMMON_DESCRIPTOR_MAX_SIZE) {
log_err(
"size of the memory region's descriptor is too big (max=%i)\n",
DESCRIPTOR_MAX_SIZE);
LIBRPMA_COMMON_DESCRIPTOR_MAX_SIZE);
goto err_mr_dereg;
}

Expand Down
6 changes: 3 additions & 3 deletions engines/librpma_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
td_vmsg((td), (err), rpma_err_2str(err), (func))

/* ceil(a / b) = (a + b - 1) / b */
#define LIBRPMA_CEIL(a, b) (((a) + (b) - 1) / (b))
#define LIBRPMA_COMMON_CEIL(a, b) (((a) + (b) - 1) / (b))

/* common option structure for server and client */
struct librpma_common_options {
Expand All @@ -50,14 +50,14 @@ extern struct fio_option librpma_common_fio_options[];
* Limited by the maximum length of the private data
* for rdma_connect() in case of RDMA_PS_TCP (28 bytes).
*/
#define DESCRIPTOR_MAX_SIZE 24
#define LIBRPMA_COMMON_DESCRIPTOR_MAX_SIZE 24

struct librpma_common_workspace {
uint16_t max_msg_num; /* # of RQ slots */
uint8_t direct_write_to_pmem; /* Direct Write to PMem is possible */
uint8_t mr_desc_size; /* size of mr_desc in descriptor[] */
/* buffer containing mr_desc */
char descriptor[DESCRIPTOR_MAX_SIZE];
char descriptor[LIBRPMA_COMMON_DESCRIPTOR_MAX_SIZE];
};

#define LIBRPMA_COMMON_PORT_STR_LEN_MAX 12
Expand Down
3 changes: 1 addition & 2 deletions engines/librpma_gpspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "librpma_common.h"

#include <libpmem.h>
#include <librpma.h>

/* Generated by the protocol buffer compiler from: librpma_gpspm_flush.proto */
#include "librpma_gpspm_flush.pb-c.h"
Expand Down Expand Up @@ -108,7 +107,7 @@ static int client_init(struct thread_data *td)
* - B == ceil(iodepth / iodepth_batch)
* which is the number of batches for N writes
*/
cd->msg_num = LIBRPMA_CEIL(td->o.iodepth,
cd->msg_num = LIBRPMA_COMMON_CEIL(td->o.iodepth,
td->o.iodepth_batch);
}
}
Expand Down

0 comments on commit 24c251e

Please sign in to comment.