[Groonga-commit] groonga/groonga at 9513a61 [master] Add "fileinfo_" as prefix

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Apr 18 15:13:58 JST 2015


Kouhei Sutou	2015-04-18 15:13:58 +0900 (Sat, 18 Apr 2015)

  New Revision: 9513a6169f531b35aad84dddf45035bcd07b6ce9
  https://github.com/groonga/groonga/commit/9513a6169f531b35aad84dddf45035bcd07b6ce9

  Message:
    Add "fileinfo_" as prefix

  Modified files:
    lib/io.c

  Modified: lib/io.c (+11 -11)
===================================================================
--- lib/io.c    2015-04-17 18:51:09 +0900 (d9d08be)
+++ lib/io.c    2015-04-18 15:13:58 +0900 (3820e4b)
@@ -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);
@@ -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) {
@@ -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) {
@@ -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);
@@ -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);
@@ -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;
@@ -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; }
@@ -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;
@@ -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 {\
@@ -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;
@@ -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) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index