summaryrefslogtreecommitdiff
path: root/include/mysql/psi
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-04-18 12:35:05 +0200
committerSergei Golubchik <serg@mariadb.org>2017-04-20 16:36:23 +0200
commit4fe65ca33a6012ec60c665f6eeb5ff08969fb267 (patch)
treea5ef5444f1fb770f46883b42073eeaa0fd9fa29a /include/mysql/psi
parent0001049be0af0d5386cbf6009aeb2101243b311a (diff)
downloadmariadb-git-4fe65ca33a6012ec60c665f6eeb5ff08969fb267.tar.gz
MDEV-12230 include/my_sys.h:600:43: error: unknown type name ‘PSI_file_key’" when -DWITHOUT_SERVER=1
cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
Diffstat (limited to 'include/mysql/psi')
-rw-r--r--include/mysql/psi/mysql_file.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index 4a0f3fdd68b..aa3ed7e901d 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -435,6 +435,20 @@
#endif
/**
+ @def mysql_file_delete_with_symlink(K, P1, P2, P3)
+ Instrumented delete with symbolic link.
+ @c mysql_file_delete_with_symlink is a replacement
+ for @c my_handler_delete_with_symlink.
+*/
+#ifdef HAVE_PSI_INTERFACE
+ #define mysql_file_delete_with_symlink(K, P1, P2, P3) \
+ inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
+#else
+ #define mysql_file_delete_with_symlink(K, P1, P2, P3) \
+ inline_mysql_file_delete_with_symlink(P1, P2, P3)
+#endif
+
+/**
@def mysql_file_rename_with_symlink(K, P1, P2, P3)
Instrumented rename with symbolic link.
@c mysql_file_rename_with_symlink is a replacement
@@ -1305,6 +1319,7 @@ inline_mysql_file_rename(
return result;
}
+
static inline File
inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_INTERFACE
@@ -1335,6 +1350,38 @@ inline_mysql_file_create_with_symlink(
}
static inline int
+inline_mysql_file_delete_with_symlink(
+#ifdef HAVE_PSI_INTERFACE
+ PSI_file_key key, const char *src_file, uint src_line,
+#endif
+ const char *name, const char *ext, myf flags)
+{
+ int result;
+ char fullname[FN_REFLEN];
+#ifdef HAVE_PSI_INTERFACE
+ struct PSI_file_locker *locker= NULL;
+ PSI_file_locker_state state;
+#endif
+ fn_format(fullname, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT);
+#ifdef HAVE_PSI_INTERFACE
+ if (likely(PSI_server != NULL))
+ {
+ locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE,
+ fullname, &locker);
+ if (likely(locker != NULL))
+ PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+ }
+#endif
+ result= my_handler_delete_with_symlink(fullname, flags);
+#ifdef HAVE_PSI_INTERFACE
+ if (likely(locker != NULL))
+ PSI_server->end_file_wait(locker, (size_t) 0);
+#endif
+ return result;
+}
+
+
+static inline int
inline_mysql_file_rename_with_symlink(
#ifdef HAVE_PSI_INTERFACE
PSI_file_key key, const char *src_file, uint src_line,