PostgreSQL Source Code: src/include/storage/aio.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18#ifndef AIO_H

19#define AIO_H

20

23

24

25

26#if defined(USE_LIBURING) && !defined(EXEC_BACKEND)

27#define IOMETHOD_IO_URING_ENABLED

28#endif

29

30

31

33{

36#ifdef IOMETHOD_IO_URING_ENABLED

37 IOMETHOD_IO_URING,

38#endif

40

41

42#define DEFAULT_IO_METHOD IOMETHOD_WORKER

43

44

45

46

47

49{

50

51

52

53

54

55

56

57

58

59

61

62

63

64

65

66

67

68

69

71

72

73

74

75

76

79

80

81

82

83

84

85

86

88{

89

91

94

106

107#define PGAIO_OP_COUNT (PGAIO_OP_WRITEV + 1)

108

109

110

111

112

113

114

115

117{

118

122

123#define PGAIO_TID_COUNT (PGAIO_TID_SMGR + 1)

124

125

126

127

128

129

130

131

132

133

134typedef union

135{

136 struct

137 {

142

143 struct

144 {

145 int fd;

150

151

152

153

154

155

156

157

159{

160

161

162

163

165

166

168

169

171};

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

193{

195

197

199

202

203#define PGAIO_HCB_MAX PGAIO_HCB_LOCAL_BUFFER_READV

205 "PGAIO_HCB_MAX is too big for PGAIO_RESULT_ID_BITS");

206

207

211

212

214{

215

216

217

218

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

240

241

242

243

244

245

246

247

248

249

250

252

253

254

255

256

257

259};

260

261

262

263

264

265

266

267#define PGAIO_HANDLE_MAX_CALLBACKS 4

268

269

270

271

272

273

274

275

276

280

284

286

289

291

292

293struct iovec;

295

298

300 int fd, int iovcnt, uint64 offset);

302 int fd, int iovcnt, uint64 offset);

303

304

309

310

316

317

318

319

320

321

322

323

327

330

331

332

333

334

335

336

337

339 int elevel);

340

341

342

343

344

345

346

347

352

353

354

355

356

357

358

359

361

362

363

364

367

368

369#endif

void(* PgAioHandleCallbackReport)(PgAioResult result, const PgAioTargetData *target_data, int elevel)

PgAioTargetData * pgaio_io_get_target_data(PgAioHandle *ioh)

PGDLLIMPORT int io_max_concurrency

@ PGAIO_HCB_LOCAL_BUFFER_READV

@ PGAIO_HCB_SHARED_BUFFER_READV

bool pgaio_wref_valid(PgAioWaitRef *iow)

int pgaio_io_get_id(PgAioHandle *ioh)

PgAioHandle * pgaio_io_acquire(struct ResourceOwnerData *resowner, PgAioReturn *ret)

void pgaio_wref_clear(PgAioWaitRef *iow)

void pgaio_io_set_handle_data_32(PgAioHandle *ioh, uint32 *data, uint8 len)

StaticAssertDecl(PGAIO_HCB_MAX<=(1<< PGAIO_RESULT_ID_BITS), "PGAIO_HCB_MAX is too big for PGAIO_RESULT_ID_BITS")

void pgaio_io_start_readv(PgAioHandle *ioh, int fd, int iovcnt, uint64 offset)

void(* PgAioHandleCallbackStage)(PgAioHandle *ioh, uint8 cb_flags)

PgAioOpData * pgaio_io_get_op_data(PgAioHandle *ioh)

void pgaio_io_get_wref(PgAioHandle *ioh, PgAioWaitRef *iow)

void pgaio_io_register_callbacks(PgAioHandle *ioh, PgAioHandleCallbackID cb_id, uint8 cb_data)

void pgaio_closing_fd(int fd)

void pgaio_io_set_flag(PgAioHandle *ioh, PgAioHandleFlags flag)

bool pgaio_have_staged(void)

PgAioOp pgaio_io_get_op(PgAioHandle *ioh)

@ PGAIO_HF_REFERENCES_LOCAL

PgAioResult(* PgAioHandleCallbackComplete)(PgAioHandle *ioh, PgAioResult prior_result, uint8 cb_flags)

bool pgaio_io_has_target(PgAioHandle *ioh)

uint64 * pgaio_io_get_handle_data(PgAioHandle *ioh, uint8 *len)

void pgaio_io_start_writev(PgAioHandle *ioh, int fd, int iovcnt, uint64 offset)

void pgaio_io_set_handle_data_64(PgAioHandle *ioh, uint64 *data, uint8 len)

bool pgaio_wref_check_done(PgAioWaitRef *iow)

PGDLLIMPORT int io_method

ProcNumber pgaio_io_get_owner(PgAioHandle *ioh)

void pgaio_enter_batchmode(void)

void pgaio_io_release_resowner(struct dlist_node *ioh_node, bool on_error)

void pgaio_submit_staged(void)

char * pgaio_io_get_target_description(PgAioHandle *ioh)

void pgaio_wref_wait(PgAioWaitRef *iow)

void pgaio_io_release(PgAioHandle *ioh)

int pgaio_wref_get_id(PgAioWaitRef *iow)

void pgaio_io_set_target(PgAioHandle *ioh, PgAioTargetID targetid)

int pgaio_io_get_iovec(PgAioHandle *ioh, struct iovec **iov)

void pgaio_result_report(PgAioResult result, const PgAioTargetData *target_data, int elevel)

void pgaio_exit_batchmode(void)

PgAioHandle * pgaio_io_acquire_nb(struct ResourceOwnerData *resowner, PgAioReturn *ret)

#define PGAIO_RESULT_ID_BITS

struct PgAioResult PgAioResult

static int fd(const char *x, int i)

PgAioHandleCallbackComplete complete_shared

PgAioHandleCallbackStage stage

PgAioHandleCallbackReport report

PgAioHandleCallbackComplete complete_local

void(* reopen)(PgAioHandle *ioh)