summaryrefslogtreecommitdiff
path: root/include/linux/path.h
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2024-07-29 17:32:02 +0300
committerJerome Brunet <jbrunet@baylibre.com>2024-07-29 17:32:02 +0300
commit66e72a01b60ae6950ddbb3585fdc1424d303e14b (patch)
tree05789274ef25cb5d08b99d1797e7760047469685 /include/linux/path.h
parent3d0e8b6edd6b08f72e07e1230f371f6ca93531e4 (diff)
parent8400291e289ee6b2bf9779ff1c83a291501f017b (diff)
downloadlinux-66e72a01b60ae6950ddbb3585fdc1424d303e14b.tar.xz
Merge tag 'v6.11-rc1' into clk-meson-next
Linux 6.11-rc1
Diffstat (limited to 'include/linux/path.h')
-rw-r--r--include/linux/path.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/path.h b/include/linux/path.h
index 475225a03d0d..ca073e70decd 100644
--- a/include/linux/path.h
+++ b/include/linux/path.h
@@ -24,4 +24,13 @@ static inline void path_put_init(struct path *path)
*path = (struct path) { };
}
+/*
+ * Cleanup macro for use with __free(path_put). Avoids dereference and
+ * copying @path unlike DEFINE_FREE(). path_put() will handle the empty
+ * path correctly just ensure @path is initialized:
+ *
+ * struct path path __free(path_put) = {};
+ */
+#define __free_path_put path_put
+
#endif /* _LINUX_PATH_H */