*
*/
#define DEBUG_SUBSYSTEM S_LLITE
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
+
#include <linux/lustre_lite.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/fs.h>
-#include <linux/lustre_lib.h>
+#include <linux/lprocfs_status.h>
+
int rd_path(char* page, char **start, off_t off,
(sb->s_op->statfs)(sb, &mystats);
blk_size=mystats.f_bsize;
- len+=snprintf(page, count, LPU64"\n", \
+ len+=snprintf(page, count, LPU64"\n",
(__u64)((mystats.f_bfree)/(blk_size*1024)));
return len;
}
-int rd_numobjects(char* page, char **start, off_t off,
+int rd_filestotal(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return len;
}
-int rd_objfree(char* page, char **start, off_t off,
+int rd_filesfree(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return len;
}
-int rd_objgroups(char* page, char **start, off_t off,
+int rd_filegroups(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return 0;
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/mntpt_path", rd_path, 0},
- {"snmp/fs_type", rd_fstype, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_objects", rd_numobjects, 0},
- {"snmp/f_objectsfree", rd_objfree, 0},
- {"snmp/f_objectgroups", rd_objgroups, 0},
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/mntpt_path", rd_path, 0},
+ {"status/fs_type", rd_fstype, 0},
+ {"status/blocksize",rd_blksize, 0},
+ {"status/blockstotal",rd_blktotal, 0},
+ {"status/blocksfree",rd_blkfree, 0},
+ {"status/kbytesfree", rd_kbfree, 0},
+ {"status/filestotal", rd_filestotal, 0},
+ {"status/filesfree", rd_filesfree, 0},
+ {"status/filegroups", rd_filegroups, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
/*
- * Common SNMP namespace
+ * Common STATUS namespace
*/
int rd_uuid(char* page, char **start, off_t off,
struct obd_device* dev=(struct obd_device*)data;
int len=0;
struct lov_obd* lov=&dev->u.lov;
- len+=snprintf(page, count, LPU64"\n", \
- (__u64)(lov->desc.ld_default_stripe_count));
+ len+=snprintf(page, count, LPU64"\n",
+ (__u64)(lov->desc.ld_default_stripe_size));
return len;
}
-int rd_stripedepth(char* page, char **start, off_t off,
+int rd_stripeoffset(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device* dev=(struct obd_device*)data;
int len=0;
struct lov_obd* lov=&dev->u.lov;
- len+=snprintf(page, count, LPU64"\n", \
- lov->desc.ld_default_stripe_size);
+ len+=snprintf(page, count, LPU64"\n",
+ lov->desc.ld_default_stripe_offset);
return len;
}
-int rd_stripefactor(char* page, char **start, off_t off,
+
+int rd_stripetype(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device* dev=(struct obd_device*)data;
int len=0;
struct lov_obd* lov=&dev->u.lov;
- len+=snprintf(page, count, LPU64"\n", \
- lov->desc.ld_default_stripe_offset);
+ len+=snprintf(page, count, LPU64"\n",
+ (__u64)(lov->desc.ld_pattern));
return len;
}
+int rd_stripecount(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_device* dev=(struct obd_device*)data;
+ int len=0;
+ struct lov_obd* lov=&dev->u.lov;
+ len+=snprintf(page, count, LPU64"\n",
+ (__u64)(lov->desc.ld_default_stripe_count));
+ return len;
-int rd_stripetype(char* page, char **start, off_t off,
+}
+int rd_numobd(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device* dev=(struct obd_device*)data;
int len=0;
struct lov_obd* lov=&dev->u.lov;
- len+=snprintf(page, count, LPU64"\n", \
- (__u64)(lov->desc.ld_pattern));
+ len+=snprintf(page, count, LPU64"\n",
+ (__u64)(lov->desc.ld_tgt_count));
+ return len;
+
+}
+
+int rd_activeobd(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_device* dev=(struct obd_device*)data;
+ int len=0;
+ struct lov_obd* lov=&dev->u.lov;
+ len+=snprintf(page, count, LPU64"\n",
+ (__u64)(lov->desc.ld_active_tgt_count));
return len;
}
struct lov_obd* lov=&dev->u.lov;
struct lov_tgt_desc* tgts=lov->tgts;
while(i<lov->desc.ld_tgt_count){
- len+=snprintf(page, count, \
- "OBD Device [%d] UUID: %s\n", \
- i, tgts->uuid);
-
+ len+=snprintf(page, count, "%d: %s\n", i, tgts->uuid);
i++;
tgts++;
}
struct obd_device* dev=(struct obd_device*)data;
int len=0;
struct lov_obd* lov=&dev->u.lov;
- len+=snprintf(page, count, \
- "%s\n", \
- lov->mdcobd->obd_uuid);
+ len+=snprintf(page, count, "%s\n", lov->mdcobd->obd_uuid);
+ return len;
+}
+
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/stripesize",rd_stripesize, 0},
+ {"status/stripeoffset",rd_stripeoffset, 0},
+ {"status/stripecount",rd_stripecount, 0},
+ {"status/stripetype", rd_stripetype, 0},
+ {"status/numobd",rd_numobd, 0},
+ {"status/activeobd", rd_activeobd, 0},
+ {"status/objects", rd_numobjects, 0},
+ {"status/objectsfree", rd_objfree, 0},
+ {"status/objectgroups", rd_objgroups, 0},
+ {"status/blocksize", rd_blksize, 0},
+ {"status/blockstotal", rd_blktotal, 0},
+ {"status/kbytesfree", rd_kbfree, 0},
+ {"status/blocksfree", rd_blkfree, 0},
+ {"status/target_obd", rd_target, 0},
+ {"status/target_mdc", rd_mdc, 0},
+
+ {0}
+};
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
return len;
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/lov_stripesize",rd_stripesize, 0},
- {"snmp/lov_stripedepth",rd_stripedepth, 0},
- {"snmp/lov_stripefactor",rd_stripefactor, 0},
- {"snmp/lov_stripetype", rd_stripetype, 0},
- {"snmp/f_objects", rd_numobjects, 0},
- {"snmp/f_objectsfree", rd_objfree, 0},
- {"snmp/f_objectgroups", rd_objgroups, 0},
- {"snmp/f_blocksize", rd_blksize, 0},
- {"snmp/f_blockstotal", rd_blktotal, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_blocksfree", rd_blkfree, 0},
- {"snmp/target_obd", rd_target, 0},
- {"snmp/target_mdc", rd_mdc, 0},
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
+
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
+
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
int rd_blksize(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
- return 0;
-}
-int rd_blktotal(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
return 0;
-}
-int rd_blkfree(char* page, char **start, off_t off,
+}
+int rd_kbtotal(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return 0;
return 0;
}
-int rd_numobjects(char* page, char **start, off_t off,
+
+int rd_files(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return 0;
}
-int rd_objfree(char* page, char **start, off_t off,
+int rd_filesfree(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return 0;
}
-int rd_objgroups(char* page, char **start, off_t off,
+int rd_filegroups(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
return 0;
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_objects", rd_numobjects, 0},
- {"snmp/f_objectsfree", rd_objfree, 0},
- {"snmp/f_objectgroups", rd_objgroups, 0},
- {"snmp/server_uuid", rd_server_uuid, 0},
- {"snmp/conn_uuid", rd_conn_uuid, 0},
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/blocksize",rd_blksize, 0},
+ {"status/kbytestotal",rd_kbtotal, 0},
+ {"status/kbytesfree", rd_kbfree, 0},
+ {"status/files", rd_files, 0},
+ {"status/filesfree", rd_filesfree, 0},
+ {"status/filegroups", rd_filegroups, 0},
+ {"status/server_uuid", rd_server_uuid, 0},
+ {"status/conn_uuid", rd_conn_uuid, 0},
+ {0}
+};
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
+}
+
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
+
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
+
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
return 0;
}
blk_size=mystats.f_bsize;
- len+=snprintf(page, count, LPU64"\n", \
+ len+=snprintf(page, count, LPU64"\n",
(__u64)((mystats.f_bfree)/(blk_size*1024)));
return len;
return 0;
}
- len+=snprintf(page, count, LPU64"\n", \
- (__u64)(mystats.f_files));
+ len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.f_files));
return len;
return 0;
}
- len+=snprintf(page, count, LPU64"\n", \
- (__u64)(mystats.f_ffree));
+ len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.f_ffree));
return len;
}
{
return 0;
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_fstype", rd_fstype, 0},
- {"snmp/f_files", rd_ffiles, 0},
- {"snmp/f_inodesfree", rd_inodesfree, 0},
- {"snmp/f_filesets", rd_filesets, 0},
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/f_blocksize",rd_blksize, 0},
+ {"status/f_blockstotal",rd_blktotal, 0},
+ {"status/f_blocksfree",rd_blkfree, 0},
+ {"status/f_kbytesfree", rd_kbfree, 0},
+ {"status/f_fstype", rd_fstype, 0},
+ {"status/f_files", rd_ffiles, 0},
+ {"status/f_inodesfree", rd_inodesfree, 0},
+ {"status/f_filesets", rd_filesets, 0},
+ {0}
+};
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
+}
+
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
-#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
+#define DEBUG_SUBSYSTEM S_ECHO
+
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
+
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/fstype", rd_fstype, 0},
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/fstype", rd_fstype, 0},
+ {0}
+};
+
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
+}
+
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
+
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
+
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
struct obd_device* temp=(struct obd_device*)data;
struct statfs mystats;
- int rc, len=0;
+ int len=0;
- rc = vfs_statfs(temp->u.filter.fo_sb, &mystats);
- if (rc) {
- CERROR("obdfilter: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.f_bsize));
+ vfs_statfs(temp->u.filter.fo_sb, &mystats);
+
+ len+=snprintf(page, count, "%ld\n", mystats.f_bsize);
return len;
}
-int rd_blktotal(char* page, char **start, off_t off,
+int rd_kbtotal(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device* temp=(struct obd_device*)data;
struct statfs mystats;
+ int len=0;
+ __u64 result;
- int rc, len=0;
+ vfs_statfs(temp->u.filter.fo_sb, &mystats);
+
+ result=((__u64)(mystats.f_blocks*mystats.f_bsize))>>10;
+
+ len+=snprintf(page, count, LPU64"\n", result);
- rc = vfs_statfs(temp->u.filter.fo_sb, &mystats);
- if (rc) {
- CERROR("obdfilter: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.f_blocks));
return len;
}
-int rd_blkfree(char* page, char **start, off_t off,
+int rd_kbfree(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device* temp=(struct obd_device*)data;
struct statfs mystats;
- int rc, len=0;
+ int len=0;
+ __u64 result;
+
+ vfs_statfs(temp->u.filter.fo_sb, &mystats);
+ result=((__u64)(mystats.f_bfree*mystats.f_bsize))>>10;
- rc = vfs_statfs(temp->u.filter.fo_sb, &mystats);
- if (rc) {
- CERROR("obdfilter: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.f_bfree));
+ len+=snprintf(page, count, LPU64"\n", result);
return len;
}
-int rd_kbfree(char* page, char **start, off_t off,
+int rd_fstype(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+
+ struct obd_device* temp=(struct obd_device*)data;
+ int len=0;
+
+ len+=snprintf(page, count, "%s\n", temp->u.filter.fo_fstype);
+ return len;
+
+}
+int rd_files(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
+
struct obd_device* temp=(struct obd_device*)data;
struct statfs mystats;
- int rc, len=0, blk_size=0;
+ int len=0;
- rc = vfs_statfs(temp->u.filter.fo_sb, &mystats);
- if (rc) {
- CERROR("obdfilter: statfs failed: rc %d\n", rc);
- return 0;
- }
- blk_size=mystats.f_bsize;
+ vfs_statfs(temp->u.filter.fo_sb, &mystats);
- len+=snprintf(page, count, LPU64"\n", \
- (__u64)((mystats.f_bfree)/(blk_size*1024)));
+ len+=snprintf(page, count, "%ld\n", mystats.f_files);
return len;
-
}
-int rd_fstype(char* page, char **start, off_t off,
+int rd_filesfree(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
-
struct obd_device* temp=(struct obd_device*)data;
+ struct statfs mystats;
+
int len=0;
- len+=snprintf(page, count, "%s\n", temp->u.filter.fo_fstype);
+ vfs_statfs(temp->u.filter.fo_sb, &mystats);
+
+ len+=snprintf(page, count, "%ld\n", mystats.f_ffree);
return len;
+
+}
+
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/blocksize",rd_blksize, 0},
+ {"status/kbytestotal",rd_kbtotal, 0},
+ {"status/kbytesfree", rd_kbfree, 0},
+ {"status/files", rd_files, 0},
+ {"status/filesfree", rd_filesfree, 0},
+ {"status/fstype", rd_fstype, 0},
+ {0}
+};
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_fstype", rd_fstype, 0},
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
+
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_objects", rd_numobjects, 0},
- {"snmp/f_objectsfree", rd_objfree, 0},
- {"snmp/f_objectgroups", rd_objgroups, 0},
- {"snmp/ost_server_uuid", rd_server_uuid, 0},
- {"snmp/ost_conn_uuid", rd_conn_uuid, 0},
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/f_blocksize",rd_blksize, 0},
+ {"status/f_blockstotal",rd_blktotal, 0},
+ {"status/f_blocksfree",rd_blkfree, 0},
+ {"status/f_kbytesfree", rd_kbfree, 0},
+ {"status/f_objects", rd_numobjects, 0},
+ {"status/f_objectsfree", rd_objfree, 0},
+ {"status/f_objectgroups", rd_objgroups, 0},
+ {"status/ost_server_uuid", rd_server_uuid, 0},
+ {"status/ost_conn_uuid", rd_conn_uuid, 0},
+ {0}
+};
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
+}
+
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_OST
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
-/* Required for 64 bit division */
-#include <asm/div64.h>
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
+
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
struct ost_obd *ost=&temp->u.ost;
struct lustre_handle *conn=&ost->ost_conn;
struct obd_statfs mystats;
- int rc, len=0;
+ int len=0;
- rc = obd_statfs(conn, &mystats);
- if (rc) {
- CERROR("ost: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.os_bsize));
+ obd_statfs(conn, &mystats);
+ len+=snprintf(page, count, "%d\n", mystats.os_bsize);
return len;
}
-int rd_blktotal(char* page, char **start, off_t off,
+int rd_kbtotal(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
-
struct obd_device* temp=(struct obd_device*)data;
struct ost_obd *ost=&temp->u.ost;
struct lustre_handle *conn=&ost->ost_conn;
struct obd_statfs mystats;
- int rc, len=0;
+ int len=0;
+ __u32 blk_size;
+ __u64 result;
- rc = obd_statfs(conn, &mystats);
- if (rc) {
- CERROR("ost: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.os_blocks));
- return len;
-}
+ obd_statfs(conn, &mystats);
-int rd_blkfree(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
+ blk_size=mystats.os_bsize;
+ blk_size>>=10;
- struct obd_device* temp=(struct obd_device*)data;
- struct ost_obd *ost=&temp->u.ost;
- struct lustre_handle *conn=&ost->ost_conn;
- struct obd_statfs mystats;
- int rc, len=0;
+ result=mystats.os_blocks;
- rc = obd_statfs(conn, &mystats);
- if (rc) {
- CERROR("ost: statfs failed: rc %d\n", rc);
- return 0;
+ while(blk_size>>=1){
+ result<<=1;
}
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.os_bfree));
+
+ len+=snprintf(page, count, LPU64"\n", result);
return len;
+
}
+
int rd_kbfree(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct ost_obd *ost=&temp->u.ost;
struct lustre_handle *conn=&ost->ost_conn;
struct obd_statfs mystats;
- int rc, len=0;
+ int len=0;
__u32 blk_size;
__u64 result;
- __u32 remainder;
- rc = obd_statfs(conn, &mystats);
- if (rc) {
- CERROR("ost: statfs failed: rc %d\n", rc);
- return 0;
- }
+ obd_statfs(conn, &mystats);
+
blk_size=mystats.os_bsize;
- blk_size*=1024;
+ blk_size>>=10;
+
result=mystats.os_bfree;
- remainder=do_div(result, blk_size);
- len+=snprintf(page, count, LPU64"\n", \
- result);
+ while(blk_size>>=1){
+ result<<=1;
+ }
+ len+=snprintf(page, count, LPU64"\n", result);
return len;
-
}
-int rd_numobjects(char* page, char **start, off_t off,
+int rd_files(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct ost_obd *ost=&temp->u.ost;
struct lustre_handle *conn=&ost->ost_conn;
struct obd_statfs mystats;
- int rc, len=0;
+ int len=0;
- rc = obd_statfs(conn, &mystats);
- if (rc) {
- CERROR("ost: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.os_files));
+ obd_statfs(conn, &mystats);
+
+ len+=snprintf(page, count, LPU64"\n",mystats.os_files);
return len;
}
-int rd_objfree(char* page, char **start, off_t off,
+int rd_filesfree(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
struct ost_obd *ost=&temp->u.ost;
struct lustre_handle *conn=&ost->ost_conn;
struct obd_statfs mystats;
- int rc, len=0;
+ int len=0;
- rc = obd_statfs(conn, &mystats);
- if (rc) {
- CERROR("ost: statfs failed: rc %d\n", rc);
- return 0;
- }
- len+=snprintf(page, count, LPU64"\n", (__u64)(mystats.os_ffree));
+ obd_statfs(conn, &mystats);
+ len+=snprintf(page, count, LPU64"\n", mystats.os_ffree);
return len;
}
return 0;
}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_objects", rd_numobjects, 0},
- {"snmp/f_objectsfree", rd_objfree, 0},
- {"snmp/f_objectgroups", rd_objgroups, 0},
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {"status/blocksize",rd_blksize, 0},
+ {"status/kbytesfree", rd_kbfree, 0},
+ {"status/kbytestotal", rd_kbtotal, 0},
+ {"status/files", rd_files, 0},
+ {"status/filesfree", rd_filesfree, 0},
+ {"status/objectgroups", rd_objgroups, 0},
+ {0}
+};
+
+int rd_numdevices(char* page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
+}
+
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
*
*/
#define DEBUG_SUBSYSTEM S_CLASS
-#include <linux/obd_support.h>
-#include <linux/obd_class.h>
-#include <linux/lprocfs.h>
-#include <linux/string.h>
-#include <linux/lustre_lib.h>
-
-
+#include <linux/lustre_lite.h>
+#include <linux/lprocfs_status.h>
int rd_uuid(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
int len=0;
- len+=snprintf(page, count, "%s\n", \
+ len+=snprintf(page, count, "%s\n",
((struct obd_device*)data)->obd_uuid);
return len;
}
-int rd_blksize(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-
-}
-int rd_blktotal(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-}
-
-int rd_blkfree(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-}
-
-int rd_kbfree(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-}
-
-int rd_numobjects(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-}
-
-int rd_objfree(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-}
-
-int rd_objgroups(char* page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return 0;
-}
-
-
-int rd_fs_type(char* page, char **start, off_t off,
+lprocfs_vars_t status_var_nm_1[]={
+ {"status/uuid", rd_uuid, 0},
+ {0}
+};
+int rd_numdevices(char* page, char **start, off_t off,
int count, int *eof, void *data)
{
- return 0;
-}
-
-int rd_other(char* page, char **start, off_t off, int count, int *eof,
- void *data)
-{
- return 0;
-}
-
-int rd_string(char* page, char **start, off_t off, int count, int *eof,
- void *data)
-{
- printk("Hello string");
- return 0;
-}
-
-int lprocfs_ll_wr(struct file* file, const char *buffer, unsigned long count,
- void *data)
-{
- return 0;
-}
-
-int wr_other(struct file* file, const char *buffer, unsigned long count,
- void *data)
-{
- return 0;
+ struct obd_type* class=(struct obd_type*)data;
+ int len=0;
+ len+=snprintf(page, count, "%d\n", class->typ_refcnt);
+ return len;
}
-int wr_string(struct file* file, const char *buffer, unsigned long count,
- void *data)
-{
- return 0;
-}
-lprocfs_vars_t snmp_var_nm_1[]={
- {"snmp/uuid", rd_uuid, 0},
- {"snmp/f_blocksize",rd_blksize, 0},
- {"snmp/f_blockstotal",rd_blktotal, 0},
- {"snmp/f_blocksfree",rd_blkfree, 0},
- {"snmp/f_kbytesfree", rd_kbfree, 0},
- {"snmp/f_objects", rd_numobjects, 0},
- {"snmp/f_objectsfree", rd_objfree, 0},
- {"snmp/f_objectgroups", rd_objgroups, 0},
+lprocfs_vars_t status_class_var[]={
+ {"status/num_devices", rd_numdevices, 0},
{0}
};
-!/bin/sh
+!/bin/bash
echo '=============================== test 1'
mkdir /mnt/lustre/d1
mkdir /mnt/lustre/d1/d2
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '=============================== test 2'
mkdir /mnt/lustre/d1
touch /mnt/lustre/d1/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 3
mkdir /mnt/lustre/d1
umount /mnt/lustre
-sh ../utils/lconf --start 70 local.xml
+../utils/lconf --start 70 local.xml
touch /mnt/lustre/d1/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 4
mkdir /mnt/lustre/d1
umount /mnt/lustre
../utils/lconf --start 70 local.xml
mkdir /mnt/lustre/d1/d2
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 5
mkdir /mnt/lustre/d1
mkdir /mnt/lustre/d1/d2
chmod 0666 /mnt/lustre/d1/d2
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 6
touch /mnt/lustre/f
chmod 0666 /mnt/lustre/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 7
mkdir /mnt/lustre/d
./mcreate /mnt/lustre/d/f
chmod 0666 /mnt/lustre/d/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 8
mkdir /mnt/lustre/d
touch /mnt/lustre/d/f
chmod 0666 /mnt/lustre/d/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 9
mkdir /mnt/lustre/d
mkdir /mnt/lustre/d/d2
mkdir /mnt/lustre/d/d2/d3
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 10
mkdir /mnt/lustre/d
mkdir /mnt/lustre/d/d2
touch /mnt/lustre/d/d2/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 11
mkdir /mnt/lustre/d
mkdir /mnt/lustre/d/d2
chmod 0666 /mnt/lustre/d/d2
chmod 0555 /mnt/lustre/d/d2
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml
echo '===============================' test 12
mkdir /mnt/lustre/d
touch /mnt/lustre/d/f
chmod 0666 /mnt/lustre/d/f
chmod 0555 /mnt/lustre/d/f
-sh llmountcleanup.sh
+umount /mnt/lustre
dmesg | grep -i destruct
-sh llmount.sh
+../utils/lconf --start 70 local.xml