Whamcloud - gitweb
LU-13004 ptlrpc: Allow BULK_BUF_KIOV to accept a kvec
[fs/lustre-release.git] / lustre / ptlrpc / errno.c
index 91c6188..a3d31a8 100644 (file)
  */
 
 #include <libcfs/libcfs.h>
-#include <lustre/lustre_errno.h>
+#include <lustre_errno.h>
 
 #ifdef LUSTRE_TRANSLATE_ERRNOS
+#include <lustre_dlm.h>
 
 /*
  * 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)