Whamcloud - gitweb
LU-9073 gss: remove newer kernel support
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_internal.h
index 5558176..65fc5f8 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __PTLRPC_GSS_GSS_INTERNAL_H_
 #define __PTLRPC_GSS_GSS_INTERNAL_H_
 
-#include <crypto/hash.h>
+#include <linux/crypto.h>
 #include <lustre_sec.h>
 
 /*
@@ -124,24 +124,18 @@ enum ptlrpc_gss_header_flags {
 static inline
 __u32 import_to_gss_svc(struct obd_import *imp)
 {
-       int cl_sp_to = LUSTRE_SP_ANY;
+       const char *name = imp->imp_obd->obd_type->typ_name;
 
-       if (imp->imp_obd)
-               cl_sp_to = imp->imp_obd->u.cli.cl_sp_to;
-
-       switch (cl_sp_to) {
-       case LUSTRE_SP_MDT:
+       if (!strcmp(name, LUSTRE_MGC_NAME))
+               return LUSTRE_GSS_TGT_MGS;
+       if (!strcmp(name, LUSTRE_MDC_NAME) ||
+           !strcmp(name, LUSTRE_LWP_NAME))
                return LUSTRE_GSS_TGT_MDS;
-       case LUSTRE_SP_OST:
+       if (!strcmp(name, LUSTRE_OSC_NAME) ||
+           !strcmp(name, LUSTRE_OSP_NAME))
                return LUSTRE_GSS_TGT_OSS;
-       case LUSTRE_SP_MGC:
-       case LUSTRE_SP_MGS:
-               return LUSTRE_GSS_TGT_MGS;
-       case LUSTRE_SP_CLI:
-       case LUSTRE_SP_ANY:
-       default:
-               return 0;
-       }
+
+       return 0;
 }
 
 /*