26 #include <linux/module.h>
28 #include <asm/uaccess.h>
43 .open = drbd_proc_open,
46 .release = drbd_proc_release,
56 seq_printf(seq,
"%03ld,%03ld", v/1000, v % 1000);
57 }
else if (
likely(v >= 1000))
58 seq_printf(seq,
"%ld,%03ld", v/1000, v % 1000);
71 unsigned long db, dt, dbdt, rt, rs_left;
76 drbd_get_syncer_progress(mdev, &rs_left, &res);
81 for (i = 1; i <
x; i++)
84 for (i = 0; i <
y; i++)
92 seq_printf(seq,
"%3u.%u%% ", res / 10, res % 10);
97 (
unsigned long)
Bit2KB(rs_left >> 10),
101 (
unsigned long)
Bit2KB(rs_left),
125 rt = (dt * (rs_left / (db/100+1)))/100;
128 rt / 3600, (rt % 3600) / 60, rt % 60);
137 i = (mdev->
rs_last_mark + DRBD_SYNC_MARKS-1) % DRBD_SYNC_MARKS;
163 seq_printf(seq,
" K/sec%s\n", stalled ?
" (stalled)" :
"");
169 unsigned long bit_pos;
172 bit_pos = bm_bits - mdev->
ov_left;
178 "\t%3d%% sector pos: %llu/%llu\n",
179 (
int)(bit_pos / (bm_bits/100+1)),
181 (
unsigned long long)bm_bits * BM_SECT_PER_BIT);
195 static int drbd_seq_show(
struct seq_file *seq,
void *
v)
201 static char write_ordering_chars[] = {
231 mdev = minor_to_mdev(i);
249 bdi_rw_congested(&mdev->
rq_queue->backing_dev_info);
252 "%2d: cs:%s ro:%s/%s ds:%s/%s %c %c%c%c%c%c%c\n"
253 " ns:%u nr:%u dw:%u dr:%u al:%u bm:%u "
254 "lo:%d pe:%d ua:%d ap:%d ep:%d wo:%c",
262 is_susp(mdev->
state) ?
's' :
'r',
283 Bit2KB((
unsigned long long)
290 drbd_syncer_progress(mdev, seq);
316 static int drbd_proc_release(
struct inode *inode,
struct file *file)