From 829ff6e9dd801c902bcf1abb00d18fa53003ff49 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 20 Dec 2012 14:59:40 -0500 Subject: [PATCH] --- yaml --- r: 347839 b: refs/heads/master c: b9d6ba94b875192ef5e2dab92d72beea33b83c3d h: refs/heads/master i: 347837: d38ddf79e7449514f0fa2eab8383dbf9608077de 347835: fad10d98600251930cbe65c8d335819ed87f4bf9 347831: 1bc5bd3185128926524a76e00d7872b862e54a8b 347823: 5c60ad8d8a91d4cc730f6ebfafc1a80f2bf1f0c3 347807: d0fe0ecc3a657913eaf54d809c4f64a5e56850fb 347775: 1992ce13aed0851923a6ebbd47612c6ae11a5cbc v: v3 --- [refs] | 2 +- trunk/include/linux/namei.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ba737ca69788..1c818e61658c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 21e89c0c48bb799beb09181740796fc80c9676e2 +refs/heads/master: b9d6ba94b875192ef5e2dab92d72beea33b83c3d diff --git a/trunk/include/linux/namei.h b/trunk/include/linux/namei.h index 4bf19d8174ed..66542b644804 100644 --- a/trunk/include/linux/namei.h +++ b/trunk/include/linux/namei.h @@ -98,4 +98,20 @@ static inline void nd_terminate_link(void *name, size_t len, size_t maxlen) ((char *) name)[min(len, maxlen)] = '\0'; } +/** + * retry_estale - determine whether the caller should retry an operation + * @error: the error that would currently be returned + * @flags: flags being used for next lookup attempt + * + * Check to see if the error code was -ESTALE, and then determine whether + * to retry the call based on whether "flags" already has LOOKUP_REVAL set. + * + * Returns true if the caller should try the operation again. + */ +static inline bool +retry_estale(const long error, const unsigned int flags) +{ + return error == -ESTALE && !(flags & LOOKUP_REVAL); +} + #endif /* _LINUX_NAMEI_H */