static int ll_blksize_seq_show(struct seq_file *m, void *v) { struct super_block *sb = m->private; struct obd_statfs osfs; int rc; LASSERT(sb != NULL); rc = ll_statfs_internal(sb, &osfs, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) rc = seq_printf(m, "%u\n", osfs.os_bsize); return rc; }
static ssize_t blocksize_show(struct kobject *kobj, struct attribute *attr, char *buf) { struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, ll_kobj); struct obd_statfs osfs; int rc; rc = ll_statfs_internal(sbi->ll_sb, &osfs, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) return sprintf(buf, "%u\n", osfs.os_bsize); return rc; }
static int ll_rd_blksize(char *page, char **start, off_t off, int count, int *eof, void *data) { struct super_block *sb = (struct super_block *)data; struct obd_statfs osfs; int rc; LASSERT(sb != NULL); rc = ll_statfs_internal(sb, &osfs, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) { *eof = 1; rc = snprintf(page, count, "%u\n", osfs.os_bsize); } return rc; }
static int ll_kbytestotal_seq_show(struct seq_file *m, void *v) { struct super_block *sb = (struct super_block *)m->private; struct obd_statfs osfs; int rc; LASSERT(sb != NULL); rc = ll_statfs_internal(sb, &osfs, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) { __u32 blk_size = osfs.os_bsize >> 10; __u64 result = osfs.os_blocks; while (blk_size >>= 1) result <<= 1; rc = seq_printf(m, "%llu\n", result); }
static ssize_t kbytestotal_show(struct kobject *kobj, struct attribute *attr, char *buf) { struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, ll_kobj); struct obd_statfs osfs; int rc; rc = ll_statfs_internal(sbi->ll_sb, &osfs, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) { __u32 blk_size = osfs.os_bsize >> 10; __u64 result = osfs.os_blocks; while (blk_size >>= 1) result <<= 1; rc = sprintf(buf, "%llu\n", result); }
static int ll_rd_kbytestotal(char *page, char **start, off_t off, int count, int *eof, void *data) { struct super_block *sb = (struct super_block *)data; struct obd_statfs osfs; int rc; LASSERT(sb != NULL); rc = ll_statfs_internal(sb, &osfs, cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) { __u32 blk_size = osfs.os_bsize >> 10; __u64 result = osfs.os_blocks; while (blk_size >>= 1) result <<= 1; *eof = 1; rc = snprintf(page, count, LPU64"\n", result); }