MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / inline_mysql_file_pwrite

Function inline_mysql_file_pwrite

include/mysql/psi/mysql_file.h:1220–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1218}
1219
1220static inline size_t
1221inline_mysql_file_pwrite(
1222#ifdef HAVE_PSI_FILE_INTERFACE
1223 const char *src_file, uint src_line,
1224#endif
1225 File file, const uchar *buffer, size_t count, my_off_t offset, myf flags)
1226{
1227 size_t result;
1228#ifdef HAVE_PSI_FILE_INTERFACE
1229 struct PSI_file_locker *locker;
1230 PSI_file_locker_state state;
1231 size_t bytes_written;
1232 locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
1233 (&state, file, PSI_FILE_WRITE);
1234 if (likely(locker != NULL))
1235 {
1236 PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
1237 result= my_pwrite(file, buffer, count, offset, flags);
1238 if (flags & (MY_NABP | MY_FNABP))
1239 bytes_written= (result == 0) ? count : 0;
1240 else
1241 bytes_written= (result != MY_FILE_ERROR) ? result : 0;
1242 PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
1243 return result;
1244 }
1245#endif
1246
1247 result= my_pwrite(file, buffer, count, offset, flags);
1248 return result;
1249}
1250
1251static inline my_off_t
1252inline_mysql_file_seek(

Callers

nothing calls this directly

Calls 1

my_pwriteFunction · 0.85

Tested by

no test coverage detected