fd-tracker: add the unlink operation to fs handles
[deliverable/lttng-tools.git] / src / common / fd-tracker / fd-tracker.c
index e26ff2185f2f9ebe48a4a764299aa74e429401d9..3720e075cba9ef7e6a4dc56cf92b23f6e8dafa72 100644 (file)
@@ -15,7 +15,6 @@
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <urcu/ref.h>
 #include <urcu.h>
 #include <urcu/list.h>
 #include <urcu/rculfhash.h>
@@ -797,6 +796,18 @@ void fs_handle_put_fd(struct fs_handle *handle)
        pthread_mutex_unlock(&handle->lock);
 }
 
+int fs_handle_unlink(struct fs_handle *handle)
+{
+       int ret;
+
+       pthread_mutex_lock(&handle->tracker->lock);
+       pthread_mutex_lock(&handle->lock);
+       ret = lttng_inode_defer_unlink(handle->inode);
+       pthread_mutex_unlock(&handle->lock);
+       pthread_mutex_unlock(&handle->tracker->lock);
+       return ret;
+}
+
 int fs_handle_close(struct fs_handle *handle)
 {
        int ret = 0;
This page took 0.027149 seconds and 5 git commands to generate.