|
441 | 441 | inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) |
442 | 442 | #endif |
443 | 443 |
|
| 444 | +/** |
| 445 | + @def mysql_file_delete_with_symlink(K, P1, P2, P3) |
| 446 | + Instrumented delete with symbolic link. |
| 447 | + @c mysql_file_delete_with_symlink is a replacement |
| 448 | + for @c my_handler_delete_with_symlink. |
| 449 | +*/ |
| 450 | +#ifdef HAVE_PSI_FILE_INTERFACE |
| 451 | + #define mysql_file_delete_with_symlink(K, P1, P2, P3) \ |
| 452 | + inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2, P3) |
| 453 | +#else |
| 454 | + #define mysql_file_delete_with_symlink(K, P1, P2, P3) \ |
| 455 | + inline_mysql_file_delete_with_symlink(P1, P2, P3) |
| 456 | +#endif |
| 457 | + |
444 | 458 | /** |
445 | 459 | @def mysql_file_rename_with_symlink(K, P1, P2, P3) |
446 | 460 | Instrumented rename with symbolic link. |
@@ -1294,6 +1308,7 @@ inline_mysql_file_rename( |
1294 | 1308 | return result; |
1295 | 1309 | } |
1296 | 1310 |
|
| 1311 | + |
1297 | 1312 | static inline File |
1298 | 1313 | inline_mysql_file_create_with_symlink( |
1299 | 1314 | #ifdef HAVE_PSI_FILE_INTERFACE |
@@ -1324,6 +1339,35 @@ inline_mysql_file_create_with_symlink( |
1324 | 1339 | } |
1325 | 1340 |
|
1326 | 1341 |
|
| 1342 | +static inline int |
| 1343 | +inline_mysql_file_delete_with_symlink( |
| 1344 | +#ifdef HAVE_PSI_FILE_INTERFACE |
| 1345 | + PSI_file_key key, const char *src_file, uint src_line, |
| 1346 | +#endif |
| 1347 | + const char *name, const char *ext, myf flags) |
| 1348 | +{ |
| 1349 | + int result; |
| 1350 | + char fullname[FN_REFLEN]; |
| 1351 | + fn_format(fullname, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT); |
| 1352 | +#ifdef HAVE_PSI_FILE_INTERFACE |
| 1353 | + struct PSI_file_locker *locker; |
| 1354 | + PSI_file_locker_state state; |
| 1355 | + locker= PSI_FILE_CALL(get_thread_file_name_locker) |
| 1356 | + (&state, key, PSI_FILE_DELETE, fullname, &locker); |
| 1357 | + if (likely(locker != NULL)) |
| 1358 | + { |
| 1359 | + PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); |
| 1360 | + result= my_handler_delete_with_symlink(fullname, flags); |
| 1361 | + PSI_FILE_CALL(end_file_close_wait)(locker, result); |
| 1362 | + return result; |
| 1363 | + } |
| 1364 | +#endif |
| 1365 | + |
| 1366 | + result= my_handler_delete_with_symlink(fullname, flags); |
| 1367 | + return result; |
| 1368 | +} |
| 1369 | + |
| 1370 | + |
1327 | 1371 | static inline int |
1328 | 1372 | inline_mysql_file_rename_with_symlink( |
1329 | 1373 | #ifdef HAVE_PSI_FILE_INTERFACE |
|
0 commit comments