Whamcloud - gitweb
resolve lots races and use after free.
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_internal.h
index a922afc..66afd61 100644 (file)
@@ -106,9 +106,9 @@ enum ptlrpc_gss_proc {
 };
 
 enum ptlrpc_gss_tgt {
-        LUSTRE_GSS_TGT_MDS              = 0,
-        LUSTRE_GSS_TGT_OSS              = 1,
-        LUSTRE_GSS_TGT_MGS              = 2,
+        LUSTRE_GSS_TGT_MGS              = 0,
+        LUSTRE_GSS_TGT_MDS              = 1,
+        LUSTRE_GSS_TGT_OSS              = 2,
 };
 
 enum ptlrpc_gss_header_flags {
@@ -121,6 +121,8 @@ __u32 import_to_gss_svc(struct obd_import *imp)
 {
         const char *name = imp->imp_obd->obd_type->typ_name;
 
+        if (!strcmp(name, LUSTRE_MGC_NAME))
+                return LUSTRE_GSS_TGT_MGS;
         if (!strcmp(name, LUSTRE_MDC_NAME))
                 return LUSTRE_GSS_TGT_MDS;
         if (!strcmp(name, LUSTRE_OSC_NAME))
@@ -431,12 +433,16 @@ int  __init gss_init_pipefs(void);
 void __exit gss_exit_pipefs(void);
 
 /* gss_bulk.c */
+int gss_cli_prep_bulk(struct ptlrpc_request *req,
+                      struct ptlrpc_bulk_desc *desc);
 int gss_cli_ctx_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
                           struct ptlrpc_request *req,
                           struct ptlrpc_bulk_desc *desc);
 int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                             struct ptlrpc_request *req,
                             struct ptlrpc_bulk_desc *desc);
+int gss_svc_prep_bulk(struct ptlrpc_request *req,
+                      struct ptlrpc_bulk_desc *desc);
 int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
                         struct ptlrpc_bulk_desc *desc);
 int gss_svc_wrap_bulk(struct ptlrpc_request *req,
@@ -504,14 +510,14 @@ void __dbg_memdump(char *name, void *ptr, int size)
 
         OBD_ALLOC(buf, bufsize);
         if (!buf) {
-                printk("DUMP ERROR: can't alloc %d bytes\n", bufsize);
+                CDEBUG(D_ERROR, "DUMP ERROR: can't alloc %d bytes\n", bufsize);
                 return;
         }
 
         for (i = 0; i < size; i++)
                 sprintf(&buf[i+i], "%02x", (__u8) p[i]);
         buf[size + size] = '\0';
-        printk("DUMP %s@%p(%d): %s\n", name, ptr, size, buf);
+        LCONSOLE_INFO("DUMP %s@%p(%d): %s\n", name, ptr, size, buf);
         OBD_FREE(buf, bufsize);
 }