Fri, 28 Jan 2022 16:01:05 +0100
add support for vfsclass parameter in nametrans safs
275
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * Copyright 2022 Olaf Wintermann. All rights reserved. |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #include "vfs.h" |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | static VFS pg_vfs_class = { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | pg_vfs_open, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | pg_vfs_stat, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | pg_vfs_fstat, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | pg_vfs_opendir, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | pg_vfs_fdopendir, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | pg_vfs_mkdir, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | pg_vfs_unlink, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | pg_vfs_rmdir |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | }; |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | static VFS_IO pg_vfs_io_class = { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | pg_vfs_io_read, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | pg_vfs_io_write, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | pg_vfs_io_pread, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | pg_vfs_io_pwrite, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | pg_vfs_io_seek, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | pg_vfs_io_close, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | NULL, // no pg aio implementation yet |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | NULL |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | }; |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | static VFS_DIRIO pg_vfs_dirio_class = { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | pg_vfs_dirio_readdir, |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | pg_vfs_dirio_close |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56 | }; |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | |
276
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
58 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
59 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
60 | VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb) { |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
61 | // resourcepool is required |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
62 | char *resource_pool = pblock_find("resourcepool", pb); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
63 | if(!resource_pool) { |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
64 | log_ereport(LOG_MISCONFIG, "pg_vfs_create: missing resourcepool parameter"); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
65 | return NULL; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
66 | } |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
67 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
68 | // get the resource first (most likely to fail due to misconfig) |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
69 | ResourceData *resdata = resourcepool_lookup(sn, rq, resource_pool, 0); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
70 | if(!resdata) { |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
71 | log_ereport(LOG_MISCONFIG, "postgresql vfs: resource pool %s not found", resource_pool); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
72 | return NULL; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
73 | } |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
74 | // resdata will be freed automatically when the request is finished |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
75 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
76 | // Create a new VFS object and a separate instance object |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
77 | // VFS contains fptrs that can be copied from pg_vfs_class |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
78 | // instance contains request specific data (PGconn) |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
79 | VFS *vfs = pool_malloc(sn->pool, sizeof(VFS)); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
80 | if(!vfs) { |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
81 | return NULL; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
82 | } |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
83 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
84 | PgVFS *vfs_priv = pool_malloc(sn->pool, sizeof(PgVFS)); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
85 | if(!vfs_priv) { |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
86 | pool_free(sn->pool, vfs); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
87 | return NULL; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
88 | } |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
89 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
90 | memcpy(vfs, &pg_vfs_class, sizeof(VFS)); |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
91 | vfs->flags = 0; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
92 | vfs->instance = vfs_priv; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
93 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
94 | return vfs; |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
95 | } |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
96 | |
0cb4eda146c4
add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
275
diff
changeset
|
97 | |
275
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | /* -------------------------- VFS functions -------------------------- */ |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | SYS_FILE pg_vfs_open(VFSContext *ctx, const char *path, int oflags) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | int pg_vfs_stat(VFSContext *ctx, const char *path, struct stat *buf) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | int pg_vfs_fstat(VFSContext *ctx, SYS_FILE fd, struct stat *buf) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | VFS_DIR pg_vfs_opendir(VFSContext *ctx, const char *path) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | VFS_DIR pg_vfs_fdopendir(VFSContext *ctx, SYS_FILE fd) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | int pg_vfs_mkdir(VFSContext *ctx, const char *path) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | int pg_vfs_unlink(VFSContext *ctx, const char *path) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | int pg_vfs_rmdir(VFSContext *Ctx, const char *path) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | /* -------------------------- VFS_IO functions -------------------------- */ |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | ssize_t pg_vfs_io_read(SYS_FILE fd, void *buf, size_t nbyte) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | ssize_t pg_vfs_io_write(SYS_FILE fd, const void *buf, size_t nbyte) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | ssize_t pg_vfs_io_pread(SYS_FILE fd, void *buf, size_t nbyte, off_t offset) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | ssize_t pg_vfs_io_pwrite(SYS_FILE fd, const void *buf, size_t nbyte, off_t offset) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | off_t pg_vfs_io_seek(SYS_FILE fd, off_t offset, int whence) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | void pg_vfs_io_close(SYS_FILE fd) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | /* -------------------------- VFS_DIRIO functions -------------------------- */ |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | int pg_vfs_dirio_readdir(VFS_DIR dir, VFS_ENTRY *entry, int getstat) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | } |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166 | void pg_vfs_dirio_close(VFS_DIR dir) { |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | |
535004faa1a5
add empty postgresql VFS functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | } |