diff options
Diffstat (limited to 'include/linux/namei.h')
-rw-r--r-- | include/linux/namei.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/namei.h b/include/linux/namei.h index 4bf19d8174ed..e998c030061d 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -65,8 +65,8 @@ extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, | |||
65 | 65 | ||
66 | extern int kern_path(const char *, unsigned, struct path *); | 66 | extern int kern_path(const char *, unsigned, struct path *); |
67 | 67 | ||
68 | extern struct dentry *kern_path_create(int, const char *, struct path *, int); | 68 | extern struct dentry *kern_path_create(int, const char *, struct path *, unsigned int); |
69 | extern struct dentry *user_path_create(int, const char __user *, struct path *, int); | 69 | extern struct dentry *user_path_create(int, const char __user *, struct path *, unsigned int); |
70 | extern void done_path_create(struct path *, struct dentry *); | 70 | extern void done_path_create(struct path *, struct dentry *); |
71 | extern struct dentry *kern_path_locked(const char *, struct path *); | 71 | extern struct dentry *kern_path_locked(const char *, struct path *); |
72 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | 72 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
@@ -98,4 +98,20 @@ static inline void nd_terminate_link(void *name, size_t len, size_t maxlen) | |||
98 | ((char *) name)[min(len, maxlen)] = '\0'; | 98 | ((char *) name)[min(len, maxlen)] = '\0'; |
99 | } | 99 | } |
100 | 100 | ||
101 | /** | ||
102 | * retry_estale - determine whether the caller should retry an operation | ||
103 | * @error: the error that would currently be returned | ||
104 | * @flags: flags being used for next lookup attempt | ||
105 | * | ||
106 | * Check to see if the error code was -ESTALE, and then determine whether | ||
107 | * to retry the call based on whether "flags" already has LOOKUP_REVAL set. | ||
108 | * | ||
109 | * Returns true if the caller should try the operation again. | ||
110 | */ | ||
111 | static inline bool | ||
112 | retry_estale(const long error, const unsigned int flags) | ||
113 | { | ||
114 | return error == -ESTALE && !(flags & LOOKUP_REVAL); | ||
115 | } | ||
116 | |||
101 | #endif /* _LINUX_NAMEI_H */ | 117 | #endif /* _LINUX_NAMEI_H */ |