*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*/
/*
* lustre/lod/lod_pool.c
#include <libcfs/libcfs.h>
#include <libcfs/linux/linux-hash.h>
+#include <libcfs/linux/linux-fs.h>
#include <obd.h>
#include "lod_internal.h"
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_rr.lqr_pool));
- tgt_pool_free(&(pool->pool_obds));
+ lu_tgt_pool_free(&(pool->pool_rr.lqr_pool));
+ lu_tgt_pool_free(&(pool->pool_obds));
kfree_rcu(pool, pool_rcu);
EXIT;
}
LASSERTF(iter->lpi_magic == POOL_IT_MAGIC, "%08X\n", iter->lpi_magic);
+ (*pos)++;
/* test if end of file */
- if (*pos >= pool_tgt_count(iter->lpi_pool))
+ if (*pos > pool_tgt_count(iter->lpi_pool))
return NULL;
OBD_FAIL_TIMEOUT(OBD_FAIL_OST_LIST_ASSERT, cfs_fail_val);
iter->lpi_idx = prev_idx; /* we stay on the last entry */
return NULL;
}
- (*pos)++;
+
/* return != NULL to continue */
return iter;
}
return rc;
}
-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,
};
/**
strlcpy(new_pool->pool_name, poolname, sizeof(new_pool->pool_name));
new_pool->pool_lobd = obd;
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);
lu_qos_rr_init(&new_pool->pool_rr);
- rc = tgt_pool_init(&new_pool->pool_rr.lqr_pool, 0);
+ rc = lu_tgt_pool_init(&new_pool->pool_rr.lqr_pool, 0);
if (rc)
GOTO(out_free_pool_obds, rc);
lprocfs_remove(&new_pool->pool_proc_entry);
- tgt_pool_free(&new_pool->pool_rr.lqr_pool);
+ lu_tgt_pool_free(&new_pool->pool_rr.lqr_pool);
out_free_pool_obds:
- tgt_pool_free(&new_pool->pool_obds);
+ lu_tgt_pool_free(&new_pool->pool_obds);
OBD_FREE_PTR(new_pool);
return rc;
}
if (rc)
GOTO(out, rc);
- rc = tgt_pool_add(&pool->pool_obds, tgt->ltd_index,
- lod->lod_ost_count);
+ rc = lu_tgt_pool_add(&pool->pool_obds, tgt->ltd_index,
+ lod->lod_ost_count);
if (rc)
GOTO(out, rc);
- pool->pool_rr.lqr_dirty = 1;
+ set_bit(LQ_DIRTY, &pool->pool_rr.lqr_flags);
CDEBUG(D_CONFIG, "Added %s to "LOV_POOLNAMEF" as member %d\n",
ostname, poolname, pool_tgt_count(pool));
if (rc)
GOTO(out, rc);
- tgt_pool_remove(&pool->pool_obds, ost->ltd_index);
- pool->pool_rr.lqr_dirty = 1;
+ lu_tgt_pool_remove(&pool->pool_obds, ost->ltd_index);
+ set_bit(LQ_DIRTY, &pool->pool_rr.lqr_flags);
CDEBUG(D_CONFIG, "%s removed from "LOV_POOLNAMEF"\n", ostname,
poolname);
int rc;
pool_getref(pool);
- rc = tgt_check_index(idx, &pool->pool_obds);
+ rc = lu_tgt_check_index(idx, &pool->pool_obds);
lod_pool_putref(pool);
return rc;
}