Clean-up: apply clang-format to the newly added fd-tracker
[lttng-tools.git] / src / common / fd-tracker / fd-tracker.h
index ff5f49a1b8d2afc62e731e04e2ce66ab36457b78..d321181ae9f2a3a9f40189944b3bfaae6cfcbde1 100644 (file)
@@ -81,7 +81,9 @@ int fd_tracker_destroy(struct fd_tracker *tracker);
  * open.
  */
 struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker,
-               const char *path, int flags, mode_t *mode);
+               const char *path,
+               int flags,
+               mode_t *mode);
 
 /*
  * Open a tracked unsuspendable file descriptor.
@@ -106,8 +108,11 @@ struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker,
  *             accomodate the request for a new unsuspendable entry.
  */
 int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker,
-               int *out_fds, const char **names, unsigned int fd_count,
-               fd_open_cb open, void *data);
+               int *out_fds,
+               const char **names,
+               unsigned int fd_count,
+               fd_open_cb open,
+               void *data);
 
 /*
  * Close a tracked unsuspendable file descriptor.
@@ -125,7 +130,9 @@ int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker,
  * allows the user to know which file descriptors are no longer being tracked.
  */
 int fd_tracker_close_unsuspendable_fd(struct fd_tracker *tracker,
-               int *fds, unsigned int fd_count, fd_close_cb close,
+               int *fds,
+               unsigned int fd_count,
+               fd_close_cb close,
                void *data);
 
 /*
@@ -156,6 +163,20 @@ int fs_handle_get_fd(struct fs_handle *handle);
  */
 void fs_handle_put_fd(struct fs_handle *handle);
 
+/*
+ * Unlink the file associated to an fs_handle. Note that the unlink
+ * operation will not be performed immediately. It will only be performed
+ * once all references to the underlying file (through other fs_handle objects)
+ * have been released.
+ *
+ * However, note that the file will be renamed so as to provide the observable
+ * effect of an unlink(), that is removing a name from the filesystem.
+ *
+ * Returns 0 on success, otherwise a negative value will be returned
+ * if the operation failed.
+ */
+int fs_handle_unlink(struct fs_handle *handle);
+
 /*
  * Frees the handle and discards the underlying fd.
  */
This page took 0.024574 seconds and 4 git commands to generate.