OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f30536f
)
vfs: add path_put_init()
author
Miklos Szeredi
<mszeredi@redhat.com>
Thu, 9 Nov 2017 09:23:28 +0000
(10:23 +0100)
committer
Miklos Szeredi
<mszeredi@redhat.com>
Thu, 9 Nov 2017 09:23:28 +0000
(10:23 +0100)
This one initializes the struct path to all zeroes so that multiple
path_put_init() on the path is safe.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
include/linux/path.h
patch
|
blob
|
history
diff --git
a/include/linux/path.h
b/include/linux/path.h
index
81e65a5
..
475225a
100644
(file)
--- a/
include/linux/path.h
+++ b/
include/linux/path.h
@@
-18,4
+18,10
@@
static inline int path_equal(const struct path *path1, const struct path *path2)
return path1->mnt == path2->mnt && path1->dentry == path2->dentry;
}
+static inline void path_put_init(struct path *path)
+{
+ path_put(path);
+ *path = (struct path) { };
+}
+
#endif /* _LINUX_PATH_H */