X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fsec_lproc.c;h=bf1e961b811ae05967a6a70619b003191eaa7b6e;hb=d4a4c0795b3befb87d47a5bf441adeba3b1c36f8;hp=8260de5f941b84871f4ea6c11c227adf7aa2d417;hpb=294e507d34de0d7990ec507334f71ff1d1a7db01;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/sec_lproc.c b/lustre/ptlrpc/sec_lproc.c index 8260de5..bf1e961 100644 --- a/lustre/ptlrpc/sec_lproc.c +++ b/lustre/ptlrpc/sec_lproc.c @@ -26,6 +26,8 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -39,12 +41,7 @@ #define DEBUG_SUBSYSTEM S_SEC #include -#ifndef __KERNEL__ -#include -#include -#else #include -#endif #include #include @@ -56,12 +53,11 @@ #include "ptlrpc_internal.h" -#ifdef __KERNEL__ struct proc_dir_entry *sptlrpc_proc_root = NULL; EXPORT_SYMBOL(sptlrpc_proc_root); -char *sec_flags2str(unsigned long flags, char *buf, int bufsize) +static char *sec_flags2str(unsigned long flags, char *buf, int bufsize) { buf[0] = '\0'; @@ -86,9 +82,11 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v) struct ptlrpc_sec *sec = NULL; char str[32]; - LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0); + LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) == 0); if (cli->cl_import) sec = sptlrpc_import_sec_ref(cli->cl_import); @@ -124,9 +122,11 @@ static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v) struct client_obd *cli = &dev->u.cli; struct ptlrpc_sec *sec = NULL; - LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || - strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0); + LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) == 0 || + strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) == 0); if (cli->cl_import) sec = sptlrpc_import_sec_ref(cli->cl_import); @@ -146,13 +146,15 @@ int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) { int rc; - if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 && - strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 && - strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) != 0) { - CERROR("can't register lproc for obd type %s\n", - dev->obd_type->typ_name); - return -EINVAL; - } + if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 && + strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 && + strcmp(dev->obd_type->typ_name, LUSTRE_MGC_NAME) != 0 && + strcmp(dev->obd_type->typ_name, LUSTRE_LWP_NAME) != 0 && + strcmp(dev->obd_type->typ_name, LUSTRE_OSP_NAME) != 0) { + CERROR("can't register lproc for obd type %s\n", + dev->obd_type->typ_name); + return -EINVAL; + } rc = lprocfs_obd_seq_create(dev, "srpc_info", 0444, &sptlrpc_info_lprocfs_fops, dev); @@ -175,7 +177,7 @@ int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) EXPORT_SYMBOL(sptlrpc_lprocfs_cliobd_attach); LPROC_SEQ_FOPS_RO(sptlrpc_proc_enc_pool); -static struct lprocfs_seq_vars sptlrpc_lprocfs_vars[] = { +static struct lprocfs_vars sptlrpc_lprocfs_vars[] = { { .name = "encrypt_page_pools", .fops = &sptlrpc_proc_enc_pool_fops }, { NULL } @@ -187,8 +189,8 @@ int sptlrpc_lproc_init(void) LASSERT(sptlrpc_proc_root == NULL); - sptlrpc_proc_root = lprocfs_seq_register("sptlrpc", proc_lustre_root, - sptlrpc_lprocfs_vars, NULL); + sptlrpc_proc_root = lprocfs_register("sptlrpc", proc_lustre_root, + sptlrpc_lprocfs_vars, NULL); if (IS_ERR(sptlrpc_proc_root)) { rc = PTR_ERR(sptlrpc_proc_root); sptlrpc_proc_root = NULL; @@ -204,21 +206,3 @@ void sptlrpc_lproc_fini(void) sptlrpc_proc_root = NULL; } } - -#else /* !__KERNEL__ */ - -int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) -{ - return 0; -} - -int sptlrpc_lproc_init(void) -{ - return 0; -} - -void sptlrpc_lproc_fini(void) -{ -} - -#endif