Whamcloud - gitweb
LU-5814 llite: remove ll_objects_destroy()
[fs/lustre-release.git] / lustre / lov / lov_pool.c
index 88cf76a..37be01e 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LOV
 
-#ifdef __KERNEL__
 #include <libcfs/libcfs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include "lov_internal.h"
@@ -180,7 +176,7 @@ static void *pool_proc_next(struct seq_file *s, void *v, loff_t *pos)
         struct pool_iterator *iter = (struct pool_iterator *)s->private;
         int prev_idx;
 
-        LASSERTF(iter->magic == POOL_IT_MAGIC, "%08X", iter->magic);
+       LASSERTF(iter->magic == POOL_IT_MAGIC, "%08X\n", iter->magic);
 
         /* test if end of file */
         if (*pos >= pool_tgt_count(iter->pool))
@@ -261,9 +257,9 @@ static int pool_proc_show(struct seq_file *s, void *v)
         struct pool_iterator *iter = (struct pool_iterator *)v;
         struct lov_tgt_desc *tgt;
 
-        LASSERTF(iter->magic == POOL_IT_MAGIC, "%08X", iter->magic);
-        LASSERT(iter->pool != NULL);
-        LASSERT(iter->idx <= pool_tgt_count(iter->pool));
+       LASSERTF(iter->magic == POOL_IT_MAGIC, "%08X\n", iter->magic);
+       LASSERT(iter->pool != NULL);
+       LASSERT(iter->idx <= pool_tgt_count(iter->pool));
 
        down_read(&pool_tgt_rw_sem(iter->pool));
         tgt = pool_tgt(iter->pool, iter->idx);
@@ -449,8 +445,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
         if (new_pool == NULL)
                 RETURN(-ENOMEM);
 
-       strncpy(new_pool->pool_name, poolname, LOV_MAXPOOLNAME);
-       new_pool->pool_name[LOV_MAXPOOLNAME] = '\0';
+       strlcpy(new_pool->pool_name, poolname, sizeof(new_pool->pool_name));
        new_pool->pool_lobd = obd;
        /* ref count init to 1 because when created a pool is always used
         * up to deletion
@@ -467,11 +462,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
         /* get ref for /proc file */
         lov_pool_getref(new_pool);
         new_pool->pool_proc_entry = lprocfs_add_simple(lov->lov_pool_proc_entry,
-                                                       poolname,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                                       NULL, NULL,
-#endif
-                                                       new_pool,
+                                                       poolname, new_pool,
                                                        &pool_proc_operations);
         if (IS_ERR(new_pool->pool_proc_entry)) {
                 CWARN("Cannot add proc pool entry "LOV_POOLNAMEF"\n", poolname);