Navigation Menu

Skip to content

Commit

Permalink
Add "fileinfo_" as prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 18, 2015
1 parent a8ff4ca commit 9513a61
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/io.c
Expand Up @@ -65,7 +65,7 @@ typedef struct _grn_io_fileinfo {

static uint32_t grn_io_version_default = GRN_IO_VERSION_DEFAULT;

inline static grn_rc grn_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags);
inline static grn_rc grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags);
inline static void grn_fileinfo_init(fileinfo *fis, int nfis);
inline static int grn_opened(fileinfo *fi);
inline static grn_rc grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi);
Expand Down Expand Up @@ -285,7 +285,7 @@ grn_io_create(grn_ctx *ctx, const char *path, uint32_t header_size, uint32_t seg
bs, file_size);
if ((fis = GRN_GMALLOCN(fileinfo, max_nfiles))) {
grn_fileinfo_init(fis, max_nfiles);
if (!grn_open(ctx, fis, path, O_RDWR|O_CREAT|O_EXCL)) {
if (!grn_fileinfo_open(ctx, fis, path, O_RDWR|O_CREAT|O_EXCL)) {
header = (struct _grn_io_header *)GRN_MMAP(&grn_gctx, NULL,
&fis->fmo, fis, 0, b);
if (header) {
Expand Down Expand Up @@ -532,7 +532,7 @@ grn_io_open(grn_ctx *ctx, const char *path, grn_io_mode mode)
b = grn_io_compute_base(header_size);
bs = grn_io_compute_base_segment(b, segment_size);
grn_fileinfo_init(&fi, 1);
if (!grn_open(ctx, &fi, path, O_RDWR)) {
if (!grn_fileinfo_open(ctx, &fi, path, O_RDWR)) {
struct _grn_io_header *header;
header = GRN_MMAP(&grn_gctx, NULL, &(fi.fmo), &fi, 0, b);
if (header) {
Expand Down Expand Up @@ -798,7 +798,7 @@ grn_io_read_ja(grn_io *io, grn_ctx *ctx, grn_io_ja_einfo *einfo, uint32_t epos,
if (!grn_opened(fi)) {
char path[PATH_MAX];
gen_pathname(io->path, path, fno);
if (grn_open(ctx, fi, path, O_RDWR|O_CREAT)) {
if (grn_fileinfo_open(ctx, fi, path, O_RDWR|O_CREAT)) {
*value = NULL;
*value_len = 0;
GRN_FREE(v);
Expand Down Expand Up @@ -846,7 +846,7 @@ grn_io_read_ja(grn_io *io, grn_ctx *ctx, grn_io_ja_einfo *einfo, uint32_t epos,
if (!grn_opened(fi)) {
char path[PATH_MAX];
gen_pathname(io->path, path, fno);
if (grn_open(ctx, fi, path, O_RDWR|O_CREAT)) {
if (grn_fileinfo_open(ctx, fi, path, O_RDWR|O_CREAT)) {
*value = NULL;
*value_len = 0;
GRN_FREE(v);
Expand Down Expand Up @@ -889,7 +889,7 @@ grn_io_write_ja(grn_io *io, grn_ctx *ctx, uint32_t key,
if (!grn_opened(fi)) {
char path[PATH_MAX];
gen_pathname(io->path, path, fno);
if ((rc = grn_open(ctx, fi, path, O_RDWR|O_CREAT))) { return rc; }
if ((rc = grn_fileinfo_open(ctx, fi, path, O_RDWR|O_CREAT))) { return rc; }
}
if (value_len <= 256) {
ja_element je;
Expand All @@ -913,7 +913,7 @@ grn_io_write_ja(grn_io *io, grn_ctx *ctx, uint32_t key,
if (!grn_opened(fi)) {
char path[PATH_MAX];
gen_pathname(io->path, path, fno);
if ((rc = grn_open(ctx, fi, path, O_RDWR|O_CREAT))) { return rc; }
if ((rc = grn_fileinfo_open(ctx, fi, path, O_RDWR|O_CREAT))) { return rc; }
}
size = rest > file_size ? file_size : rest;
if ((rc = grn_pwrite(ctx, fi, vr, size, 0))) { return rc; }
Expand All @@ -940,7 +940,7 @@ grn_io_write_ja_ehead(grn_io *io, grn_ctx *ctx, uint32_t key,
if (!grn_opened(fi)) {
char path[PATH_MAX];
gen_pathname(io->path, path, fno);
if ((rc = grn_open(ctx, fi, path, O_RDWR|O_CREAT))) { return rc; }
if ((rc = grn_fileinfo_open(ctx, fi, path, O_RDWR|O_CREAT))) { return rc; }
}
{
grn_io_ja_ehead eh;
Expand Down Expand Up @@ -1071,7 +1071,7 @@ grn_io_win_unmap(grn_io_win *iw)
if (!grn_opened(fi)) {\
char path[PATH_MAX];\
gen_pathname(io->path, path, fno);\
if (!grn_open(ctx, fi, path, O_RDWR|O_CREAT)) { \
if (!grn_fileinfo_open(ctx, fi, path, O_RDWR|O_CREAT)) { \
DO_MAP(io, &info->fmo, fi, pos, segment_size, segno, info->map);\
}\
} else {\
Expand Down Expand Up @@ -1525,7 +1525,7 @@ exit :
}

inline static grn_rc
grn_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags)
grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags)
{
grn_rc rc;
struct _grn_io_header io_header;
Expand Down Expand Up @@ -1686,7 +1686,7 @@ grn_pwrite(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset)
#else /* WIN32 */

inline static grn_rc
grn_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags)
grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags)
{
struct stat st;
if ((fi->fd = GRN_OPEN(path, flags, GRN_IO_FILE_CREATE_MODE)) == -1) {
Expand Down

0 comments on commit 9513a61

Please sign in to comment.