Whamcloud - gitweb
LU-14111 obdclass: count eviction per obd_device
[fs/lustre-release.git] / lustre / lov / lov_pool.c
index 76eb210..afccd05 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lov/lov_pool.c
  *
@@ -42,6 +41,7 @@
 
 #include <libcfs/libcfs.h>
 #include <libcfs/linux/linux-hash.h>
+#include <libcfs/linux/linux-fs.h>
 
 #include <obd.h>
 #include "lov_internal.h"
@@ -86,7 +86,7 @@ void lov_pool_putref(struct pool_desc *pool)
        if (atomic_dec_and_test(&pool->pool_refcount)) {
                LASSERT(list_empty(&pool->pool_list));
                LASSERT(pool->pool_proc_entry == NULL);
-               tgt_pool_free(&(pool->pool_obds));
+               lu_tgt_pool_free(&(pool->pool_obds));
                kfree_rcu(pool, pool_rcu);
                EXIT;
        }
@@ -218,16 +218,16 @@ static int pool_proc_open(struct inode *inode, struct file *file)
         rc = seq_open(file, &pool_proc_ops);
         if (!rc) {
                 struct seq_file *s = file->private_data;
-               s->private = PDE_DATA(inode);
+               s->private = pde_data(inode);
         }
         return rc;
 }
 
-const static struct file_operations pool_proc_operations = {
-       .open           = pool_proc_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = seq_release,
+const static struct proc_ops pool_proc_operations = {
+       .proc_open      = pool_proc_open,
+       .proc_read      = seq_read,
+       .proc_lseek     = seq_lseek,
+       .proc_release   = seq_release,
 };
 #endif /* CONFIG_PROC_FS */
 
@@ -271,9 +271,9 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
         * up to deletion
         */
        atomic_set(&new_pool->pool_refcount, 1);
-       rc = tgt_pool_init(&new_pool->pool_obds, 0);
+       rc = lu_tgt_pool_init(&new_pool->pool_obds, 0);
        if (rc)
-               GOTO(out_err, rc);
+               GOTO(out_free_pool, rc);
 
 #ifdef CONFIG_PROC_FS
        /* get ref for /proc file */
@@ -320,7 +320,8 @@ out_err:
        lov->lov_pool_count--;
        spin_unlock(&obd->obd_dev_lock);
         lprocfs_remove(&new_pool->pool_proc_entry);
-       tgt_pool_free(&new_pool->pool_obds);
+       lu_tgt_pool_free(&new_pool->pool_obds);
+out_free_pool:
        OBD_FREE_PTR(new_pool);
 
        return rc;
@@ -416,7 +417,7 @@ int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname)
         if (lov_idx == lov->desc.ld_tgt_count)
                 GOTO(out, rc = -EINVAL);
 
-       rc = tgt_pool_add(&pool->pool_obds, lov_idx, lov->lov_tgt_size);
+       rc = lu_tgt_pool_add(&pool->pool_obds, lov_idx, lov->lov_tgt_size);
         if (rc)
                 GOTO(out, rc);
 
@@ -469,7 +470,7 @@ int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname)
         if (lov_idx == lov->desc.ld_tgt_count)
                 GOTO(out, rc = -EINVAL);
 
-       tgt_pool_remove(&pool->pool_obds, lov_idx);
+       lu_tgt_pool_remove(&pool->pool_obds, lov_idx);
 
         CDEBUG(D_CONFIG, "%s removed from "LOV_POOLNAMEF"\n", ostname,
                poolname);