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

Function inline_mysql_file_read

include/mysql/psi/mysql_file.h:1127–1156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127static inline size_t
1128inline_mysql_file_read(
1129#ifdef HAVE_PSI_FILE_INTERFACE
1130 const char *src_file, uint src_line,
1131#endif
1132 File file, uchar *buffer, size_t count, myf flags)
1133{
1134 size_t result;
1135#ifdef HAVE_PSI_FILE_INTERFACE
1136 struct PSI_file_locker *locker;
1137 PSI_file_locker_state state;
1138 size_t bytes_read;
1139 locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
1140 (&state, file, PSI_FILE_READ);
1141 if (likely(locker != NULL))
1142 {
1143 PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
1144 result= my_read(file, buffer, count, flags);
1145 if (flags & (MY_NABP | MY_FNABP))
1146 bytes_read= (result == 0) ? count : 0;
1147 else
1148 bytes_read= (result != MY_FILE_ERROR) ? result : 0;
1149 PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
1150 return result;
1151 }
1152#endif
1153
1154 result= my_read(file, buffer, count, flags);
1155 return result;
1156}
1157
1158static inline size_t
1159inline_mysql_file_write(

Callers

nothing calls this directly

Calls 1

my_readFunction · 0.85

Tested by

no test coverage detected