* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#ifdef LPROCFS
-static int lprocfs_ofd_rd_groups(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int lprocfs_ofd_rd_seqs(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
- return snprintf(page, count, "%u\n", ofd->ofd_max_group);
+ return snprintf(page, count, "%u\n", ofd->ofd_seq_count);
}
static int lprocfs_ofd_rd_tot_dirty(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, LPU64"\n", ofd->ofd_tot_dirty);
}
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, LPU64"\n", ofd->ofd_tot_granted);
}
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, LPU64"\n", ofd->ofd_tot_pending);
}
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, "%d%%\n",
(int) ofd_grant_reserved(ofd, 100));
"a huge part of the free space is now reserved for "
"grants\n", obd->obd_name);
- cfs_spin_lock(&ofd->ofd_grant_lock);
+ spin_lock(&ofd->ofd_grant_lock);
ofd->ofd_grant_ratio = ofd_grant_ratio_conv(val);
- cfs_spin_unlock(&ofd->ofd_grant_lock);
+ spin_unlock(&ofd->ofd_grant_lock);
return count;
}
if (val < 1)
return -EINVAL;
- cfs_spin_lock(&ofd->ofd_objid_lock);
+ spin_lock(&ofd->ofd_batch_lock);
ofd->ofd_precreate_batch = val;
- cfs_spin_unlock(&ofd->ofd_objid_lock);
+ spin_unlock(&ofd->ofd_batch_lock);
return count;
}
int count, int *eof, void *data)
{
struct obd_device *obd = data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int retval = 0, rc, i;
+ struct ofd_device *ofd;
+ struct ofd_seq *oseq = NULL;
+ int retval = 0, rc;
if (obd == NULL)
return 0;
- for (i = FID_SEQ_OST_MDT0; i <= ofd->ofd_max_group; i++) {
- rc = snprintf(page, count, LPU64"\n", ofd_last_id(ofd, i));
+ ofd = ofd_dev(obd->obd_lu_dev);
+
+ read_lock(&ofd->ofd_seq_list_lock);
+ cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
+ rc = snprintf(page, count, LPX64": "LPX64"\n",
+ oseq->os_seq, ofd_seq_last_oid(oseq));
if (rc < 0) {
retval = rc;
break;
count -= rc;
retval += rc;
}
+ read_unlock(&ofd->ofd_seq_list_lock);
return retval;
}
if (rc)
return rc;
- cfs_spin_lock(&ofd->ofd_flags_lock);
+ spin_lock(&ofd->ofd_flags_lock);
ofd->ofd_raid_degraded = !!val;
- cfs_spin_unlock(&ofd->ofd_flags_lock);
+ spin_unlock(&ofd->ofd_flags_lock);
return count;
}
if (val < 0)
return -EINVAL;
- cfs_spin_lock(&ofd->ofd_flags_lock);
+ spin_lock(&ofd->ofd_flags_lock);
ofd->ofd_syncjournal = !!val;
ofd_slc_set(ofd);
- cfs_spin_unlock(&ofd->ofd_flags_lock);
+ spin_unlock(&ofd->ofd_flags_lock);
return count;
}
if (val < 0 || val > 2)
return -EINVAL;
- cfs_spin_lock(&ofd->ofd_flags_lock);
+ spin_lock(&ofd->ofd_flags_lock);
ofd->ofd_sync_lock_cancel = val;
- cfs_spin_unlock(&ofd->ofd_flags_lock);
+ spin_unlock(&ofd->ofd_flags_lock);
return count;
}
if (val < 0)
return -EINVAL;
- cfs_spin_lock(&ofd->ofd_flags_lock);
+ spin_lock(&ofd->ofd_flags_lock);
ofd->ofd_grant_compat_disable = !!val;
- cfs_spin_unlock(&ofd->ofd_flags_lock);
+ spin_unlock(&ofd->ofd_flags_lock);
return count;
}
{ "kbytesavail", lprocfs_rd_kbytesavail, 0, 0 },
{ "filestotal", lprocfs_rd_filestotal, 0, 0 },
{ "filesfree", lprocfs_rd_filesfree, 0, 0 },
- { "filegroups", lprocfs_ofd_rd_groups, 0, 0 },
+ { "seqs_allocated", lprocfs_ofd_rd_seqs, 0, 0 },
{ "fstype", lprocfs_ofd_rd_fstype, 0, 0 },
{ "last_id", lprocfs_ofd_rd_last_id, 0, 0 },
{ "tot_dirty", lprocfs_ofd_rd_tot_dirty, 0, 0 },
int lproc_ofd_attach_seqstat(struct obd_device *dev)
{
- return lprocfs_obd_seq_create(dev, "brw_stats", 0444,
+ return lprocfs_obd_seq_create(dev, "brw_stats", 0644,
&ofd_brw_stats_fops, dev);
}