[PATCH 09/12] staging/lustre/obdclass: remove llog_test.ko

2014-08-30 Thread Oleg Drokin
From: "John L. Hammond" 

The llog_test module requires server support (it needs a local MGS to
function) and should not have been included.

Signed-off-by: John L. Hammond 
---
 drivers/staging/lustre/lustre/obdclass/Makefile|2 +-
 drivers/staging/lustre/lustre/obdclass/llog_test.c | 1072 
 2 files changed, 1 insertion(+), 1073 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/llog_test.c

diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index f1dcf8e..9a2b83f 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -1,4 +1,4 @@
-obj-$(CONFIG_LUSTRE_FS) += obdclass.o llog_test.o
+obj-$(CONFIG_LUSTRE_FS) += obdclass.o
 
 obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
  llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o debug.o \
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_test.c 
b/drivers/staging/lustre/lustre/obdclass/llog_test.c
deleted file mode 100644
index ef008ab..000
--- a/drivers/staging/lustre/lustre/obdclass/llog_test.c
+++ /dev/null
@@ -1,1072 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/obdclass/llog_test.c
- *
- * Author: Phil Schwan 
- * Author: Mikhail Pershin 
- */
-
-#define DEBUG_SUBSYSTEM S_CLASS
-
-#include 
-#include 
-
-#include "../include/obd_class.h"
-#include "../include/lustre_fid.h"
-#include "../include/lustre_log.h"
-
-/* This is slightly more than the number of records that can fit into a
- * single llog file, because the llog_log_header takes up some of the
- * space in the first block that cannot be used for the bitmap. */
-#define LLOG_TEST_RECNUM  (LLOG_CHUNK_SIZE * 8)
-
-static int llog_test_rand;
-static struct obd_uuid uuid = { .uuid = "test_uuid" };
-static struct llog_logid cat_logid;
-
-struct llog_mini_rec {
-   struct llog_rec_hdr lmr_hdr;
-   struct llog_rec_taillmr_tail;
-} __attribute__((packed));
-
-static int verify_handle(char *test, struct llog_handle *llh, int num_recs)
-{
-   int i;
-   int last_idx = 0;
-   int active_recs = 0;
-
-   for (i = 0; i < LLOG_BITMAP_BYTES * 8; i++) {
-   if (ext2_test_bit(i, llh->lgh_hdr->llh_bitmap)) {
-   last_idx = i;
-   active_recs++;
-   }
-   }
-
-   if (active_recs != num_recs) {
-   CERROR("%s: expected %d active recs after write, found %d\n",
-  test, num_recs, active_recs);
-   return -ERANGE;
-   }
-
-   if (llh->lgh_hdr->llh_count != num_recs) {
-   CERROR("%s: handle->count is %d, expected %d after write\n",
-  test, llh->lgh_hdr->llh_count, num_recs);
-   return -ERANGE;
-   }
-
-   if (llh->lgh_last_idx < last_idx) {
-   CERROR("%s: handle->last_idx is %d, expected %d after write\n",
-  test, llh->lgh_last_idx, last_idx);
-   return -ERANGE;
-   }
-
-   return 0;
-}
-
-/* Test named-log create/open, close */
-static int llog_test_1(const struct lu_env *env,
-  struct obd_device *obd, char *name)
-{
-   struct llog_handle  *llh;
-   struct llog_ctxt*ctxt;
-   int rc;
-   int rc2;
-
-   CWARN("1a: create a log with name: %s\n", name);
-   ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT);
-   LASSERT(ctxt);
-
-   rc = llog_open_create(env, ctxt, , NULL, name);
-   if (rc) {
-   CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
-   GOTO(out, rc);
-   }

[PATCH 09/12] staging/lustre/obdclass: remove llog_test.ko

2014-08-30 Thread Oleg Drokin
From: John L. Hammond john.hamm...@intel.com

The llog_test module requires server support (it needs a local MGS to
function) and should not have been included.

Signed-off-by: John L. Hammond john.hamm...@intel.com
---
 drivers/staging/lustre/lustre/obdclass/Makefile|2 +-
 drivers/staging/lustre/lustre/obdclass/llog_test.c | 1072 
 2 files changed, 1 insertion(+), 1073 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/llog_test.c

diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index f1dcf8e..9a2b83f 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -1,4 +1,4 @@
-obj-$(CONFIG_LUSTRE_FS) += obdclass.o llog_test.o
+obj-$(CONFIG_LUSTRE_FS) += obdclass.o
 
 obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
  llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o debug.o \
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_test.c 
b/drivers/staging/lustre/lustre/obdclass/llog_test.c
deleted file mode 100644
index ef008ab..000
--- a/drivers/staging/lustre/lustre/obdclass/llog_test.c
+++ /dev/null
@@ -1,1072 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/obdclass/llog_test.c
- *
- * Author: Phil Schwan p...@clusterfs.com
- * Author: Mikhail Pershin mike.pers...@intel.com
- */
-
-#define DEBUG_SUBSYSTEM S_CLASS
-
-#include linux/module.h
-#include linux/init.h
-
-#include ../include/obd_class.h
-#include ../include/lustre_fid.h
-#include ../include/lustre_log.h
-
-/* This is slightly more than the number of records that can fit into a
- * single llog file, because the llog_log_header takes up some of the
- * space in the first block that cannot be used for the bitmap. */
-#define LLOG_TEST_RECNUM  (LLOG_CHUNK_SIZE * 8)
-
-static int llog_test_rand;
-static struct obd_uuid uuid = { .uuid = test_uuid };
-static struct llog_logid cat_logid;
-
-struct llog_mini_rec {
-   struct llog_rec_hdr lmr_hdr;
-   struct llog_rec_taillmr_tail;
-} __attribute__((packed));
-
-static int verify_handle(char *test, struct llog_handle *llh, int num_recs)
-{
-   int i;
-   int last_idx = 0;
-   int active_recs = 0;
-
-   for (i = 0; i  LLOG_BITMAP_BYTES * 8; i++) {
-   if (ext2_test_bit(i, llh-lgh_hdr-llh_bitmap)) {
-   last_idx = i;
-   active_recs++;
-   }
-   }
-
-   if (active_recs != num_recs) {
-   CERROR(%s: expected %d active recs after write, found %d\n,
-  test, num_recs, active_recs);
-   return -ERANGE;
-   }
-
-   if (llh-lgh_hdr-llh_count != num_recs) {
-   CERROR(%s: handle-count is %d, expected %d after write\n,
-  test, llh-lgh_hdr-llh_count, num_recs);
-   return -ERANGE;
-   }
-
-   if (llh-lgh_last_idx  last_idx) {
-   CERROR(%s: handle-last_idx is %d, expected %d after write\n,
-  test, llh-lgh_last_idx, last_idx);
-   return -ERANGE;
-   }
-
-   return 0;
-}
-
-/* Test named-log create/open, close */
-static int llog_test_1(const struct lu_env *env,
-  struct obd_device *obd, char *name)
-{
-   struct llog_handle  *llh;
-   struct llog_ctxt*ctxt;
-   int rc;
-   int rc2;
-
-   CWARN(1a: create a log with name: %s\n, name);
-   ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT);
-   LASSERT(ctxt);
-
-   rc = llog_open_create(env, ctxt, llh, NULL, name);
-   if (rc) {
-   CERROR(1a: