|
434 | 434 | inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) |
435 | 435 | #endif |
436 | 436 |
|
| 437 | +/** |
| 438 | + @def mysql_file_delete_with_symlink(K, P1, P2, P3) |
| 439 | + Instrumented delete with symbolic link. |
| 440 | + @c mysql_file_delete_with_symlink is a replacement |
| 441 | + for @c my_handler_delete_with_symlink. |
| 442 | +*/ |
| 443 | +#ifdef HAVE_PSI_INTERFACE |
| 444 | + #define mysql_file_delete_with_symlink(K, P1, P2, P3) \ |
| 445 | + inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2, P3) |
| 446 | +#else |
| 447 | + #define mysql_file_delete_with_symlink(K, P1, P2, P3) \ |
| 448 | + inline_mysql_file_delete_with_symlink(P1, P2, P3) |
| 449 | +#endif |
| 450 | + |
437 | 451 | /** |
438 | 452 | @def mysql_file_rename_with_symlink(K, P1, P2, P3) |
439 | 453 | Instrumented rename with symbolic link. |
@@ -1305,6 +1319,7 @@ inline_mysql_file_rename( |
1305 | 1319 | return result; |
1306 | 1320 | } |
1307 | 1321 |
|
| 1322 | + |
1308 | 1323 | static inline File |
1309 | 1324 | inline_mysql_file_create_with_symlink( |
1310 | 1325 | #ifdef HAVE_PSI_INTERFACE |
@@ -1334,6 +1349,38 @@ inline_mysql_file_create_with_symlink( |
1334 | 1349 | return file; |
1335 | 1350 | } |
1336 | 1351 |
|
| 1352 | +static inline int |
| 1353 | +inline_mysql_file_delete_with_symlink( |
| 1354 | +#ifdef HAVE_PSI_INTERFACE |
| 1355 | + PSI_file_key key, const char *src_file, uint src_line, |
| 1356 | +#endif |
| 1357 | + const char *name, const char *ext, myf flags) |
| 1358 | +{ |
| 1359 | + int result; |
| 1360 | + char fullname[FN_REFLEN]; |
| 1361 | +#ifdef HAVE_PSI_INTERFACE |
| 1362 | + struct PSI_file_locker *locker= NULL; |
| 1363 | + PSI_file_locker_state state; |
| 1364 | +#endif |
| 1365 | + fn_format(fullname, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT); |
| 1366 | +#ifdef HAVE_PSI_INTERFACE |
| 1367 | + if (likely(PSI_server != NULL)) |
| 1368 | + { |
| 1369 | + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE, |
| 1370 | + fullname, &locker); |
| 1371 | + if (likely(locker != NULL)) |
| 1372 | + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); |
| 1373 | + } |
| 1374 | +#endif |
| 1375 | + result= my_handler_delete_with_symlink(fullname, flags); |
| 1376 | +#ifdef HAVE_PSI_INTERFACE |
| 1377 | + if (likely(locker != NULL)) |
| 1378 | + PSI_server->end_file_wait(locker, (size_t) 0); |
| 1379 | +#endif |
| 1380 | + return result; |
| 1381 | +} |
| 1382 | + |
| 1383 | + |
1337 | 1384 | static inline int |
1338 | 1385 | inline_mysql_file_rename_with_symlink( |
1339 | 1386 | #ifdef HAVE_PSI_INTERFACE |
|
0 commit comments