X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Ferrno.c;h=a3d31a853244cc6fe354a11d9a3ba56b496605be;hb=6030d0cfb15bfa4cfd7aaee4e3c2a34746424dd2;hp=50b89aa82ba720883b3b2465fb0bc9adad106ca8;hpb=2b294992edce5af7b79d4300ed3aa1ea6a8db850;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/errno.c b/lustre/ptlrpc/errno.c index 50b89aa..a3d31a8 100644 --- a/lustre/ptlrpc/errno.c +++ b/lustre/ptlrpc/errno.c @@ -22,13 +22,14 @@ /* * Copyright (C) 2011 FUJITSU LIMITED. All rights reserved. * - * Copyright (c) 2013, 2014, Intel Corporation. + * Copyright (c) 2013, Intel Corporation. */ #include -#include +#include #ifdef LUSTRE_TRANSLATE_ERRNOS +#include /* * The two translation tables below must define a one-to-one mapping between @@ -186,7 +187,19 @@ static int lustre_errno_hton_mapping[] = { [EBADTYPE] = LUSTRE_EBADTYPE, [EJUKEBOX] = LUSTRE_EJUKEBOX, [EIOCBQUEUED] = LUSTRE_EIOCBQUEUED, - [EIOCBRETRY] = LUSTRE_EIOCBRETRY + + /* + * The ELDLM errors are Lustre specific errors whose ranges + * lie in the middle of the above system errors. The ELDLM + * numbers must be preserved to avoid LU-9793. + */ + [ELDLM_LOCK_CHANGED] = ELDLM_LOCK_CHANGED, + [ELDLM_LOCK_ABORTED] = ELDLM_LOCK_ABORTED, + [ELDLM_LOCK_REPLACED] = ELDLM_LOCK_REPLACED, + [ELDLM_NO_LOCK_DATA] = ELDLM_NO_LOCK_DATA, + [ELDLM_LOCK_WOULDBLOCK] = ELDLM_LOCK_WOULDBLOCK, + [ELDLM_NAMESPACE_EXISTS]= ELDLM_NAMESPACE_EXISTS, + [ELDLM_BAD_NAMESPACE] = ELDLM_BAD_NAMESPACE }; static int lustre_errno_ntoh_mapping[] = { @@ -333,7 +346,19 @@ static int lustre_errno_ntoh_mapping[] = { [LUSTRE_EBADTYPE] = EBADTYPE, [LUSTRE_EJUKEBOX] = EJUKEBOX, [LUSTRE_EIOCBQUEUED] = EIOCBQUEUED, - [LUSTRE_EIOCBRETRY] = EIOCBRETRY + + /* + * The ELDLM errors are Lustre specific errors whose ranges + * lie in the middle of the above system errors. The ELDLM + * numbers must be preserved to avoid LU-9793. + */ + [ELDLM_LOCK_CHANGED] = ELDLM_LOCK_CHANGED, + [ELDLM_LOCK_ABORTED] = ELDLM_LOCK_ABORTED, + [ELDLM_LOCK_REPLACED] = ELDLM_LOCK_REPLACED, + [ELDLM_NO_LOCK_DATA] = ELDLM_NO_LOCK_DATA, + [ELDLM_LOCK_WOULDBLOCK] = ELDLM_LOCK_WOULDBLOCK, + [ELDLM_NAMESPACE_EXISTS] = ELDLM_NAMESPACE_EXISTS, + [ELDLM_BAD_NAMESPACE] = ELDLM_BAD_NAMESPACE }; unsigned int lustre_errno_hton(unsigned int h)