1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see [sun.com URL with a
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 #define DEBUG_SUBSYSTEM S_LLITE
38 #include <linux/version.h>
39 #include <lustre_lite.h>
40 #include <lprocfs_status.h>
41 #include <linux/seq_file.h>
42 #include <obd_support.h>
44 #include "llite_internal.h"
46 struct proc_dir_entry *proc_lustre_fs_root;
49 /* /proc/lustre/llite mount point registration */
50 struct file_operations llite_dump_pgcache_fops;
51 struct file_operations ll_ra_stats_fops;
52 struct file_operations ll_rw_extents_stats_fops;
53 struct file_operations ll_rw_extents_stats_pp_fops;
54 struct file_operations ll_rw_offset_stats_fops;
56 static int ll_rd_blksize(char *page, char **start, off_t off, int count,
59 struct super_block *sb = (struct super_block *)data;
60 struct obd_statfs osfs;
64 rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - HZ,
68 rc = snprintf(page, count, "%u\n", osfs.os_bsize);
74 static int ll_rd_kbytestotal(char *page, char **start, off_t off, int count,
77 struct super_block *sb = (struct super_block *)data;
78 struct obd_statfs osfs;
82 rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - HZ,
85 __u32 blk_size = osfs.os_bsize >> 10;
86 __u64 result = osfs.os_blocks;
88 while (blk_size >>= 1)
92 rc = snprintf(page, count, LPU64"\n", result);
98 static int ll_rd_kbytesfree(char *page, char **start, off_t off, int count,
101 struct super_block *sb = (struct super_block *)data;
102 struct obd_statfs osfs;
106 rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - HZ,
109 __u32 blk_size = osfs.os_bsize >> 10;
110 __u64 result = osfs.os_bfree;
112 while (blk_size >>= 1)
116 rc = snprintf(page, count, LPU64"\n", result);
121 static int ll_rd_kbytesavail(char *page, char **start, off_t off, int count,
122 int *eof, void *data)
124 struct super_block *sb = (struct super_block *)data;
125 struct obd_statfs osfs;
129 rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - HZ,
132 __u32 blk_size = osfs.os_bsize >> 10;
133 __u64 result = osfs.os_bavail;
135 while (blk_size >>= 1)
139 rc = snprintf(page, count, LPU64"\n", result);
144 static int ll_rd_filestotal(char *page, char **start, off_t off, int count,
145 int *eof, void *data)
147 struct super_block *sb = (struct super_block *)data;
148 struct obd_statfs osfs;
152 rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - HZ,
156 rc = snprintf(page, count, LPU64"\n", osfs.os_files);
161 static int ll_rd_filesfree(char *page, char **start, off_t off, int count,
162 int *eof, void *data)
164 struct super_block *sb = (struct super_block *)data;
165 struct obd_statfs osfs;
169 rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - HZ,
173 rc = snprintf(page, count, LPU64"\n", osfs.os_ffree);
179 static int ll_rd_client_type(char *page, char **start, off_t off, int count,
180 int *eof, void *data)
182 struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)data);
185 LASSERT(sbi != NULL);
188 if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
189 rc = snprintf(page, count, "remote client\n");
191 rc = snprintf(page, count, "local client\n");
196 static int ll_rd_fstype(char *page, char **start, off_t off, int count,
197 int *eof, void *data)
199 struct super_block *sb = (struct super_block*)data;
203 return snprintf(page, count, "%s\n", sb->s_type->name);
206 static int ll_rd_sb_uuid(char *page, char **start, off_t off, int count,
207 int *eof, void *data)
209 struct super_block *sb = (struct super_block *)data;
213 return snprintf(page, count, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
216 static int ll_rd_max_readahead_mb(char *page, char **start, off_t off,
217 int count, int *eof, void *data)
219 struct super_block *sb = data;
220 struct ll_sb_info *sbi = ll_s2sbi(sb);
224 spin_lock(&sbi->ll_lock);
225 pages_number = sbi->ll_ra_info.ra_max_pages;
226 spin_unlock(&sbi->ll_lock);
228 mult = 1 << (20 - PAGE_CACHE_SHIFT);
229 return lprocfs_read_frac_helper(page, count, pages_number, mult);
232 static int ll_wr_max_readahead_mb(struct file *file, const char *buffer,
233 unsigned long count, void *data)
235 struct super_block *sb = data;
236 struct ll_sb_info *sbi = ll_s2sbi(sb);
237 int mult, rc, pages_number;
239 mult = 1 << (20 - CFS_PAGE_SHIFT);
240 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
244 if (pages_number < 0 || pages_number > num_physpages / 2) {
245 CERROR("can't set file readahead more than %lu MB\n",
246 num_physpages >> (20 - CFS_PAGE_SHIFT + 1)); /*1/2 of RAM*/
250 spin_lock(&sbi->ll_lock);
251 sbi->ll_ra_info.ra_max_pages = pages_number;
252 spin_unlock(&sbi->ll_lock);
257 static int ll_rd_max_read_ahead_whole_mb(char *page, char **start, off_t off,
258 int count, int *eof, void *data)
260 struct super_block *sb = data;
261 struct ll_sb_info *sbi = ll_s2sbi(sb);
265 spin_lock(&sbi->ll_lock);
266 pages_number = sbi->ll_ra_info.ra_max_read_ahead_whole_pages;
267 spin_unlock(&sbi->ll_lock);
269 mult = 1 << (20 - CFS_PAGE_SHIFT);
270 return lprocfs_read_frac_helper(page, count, pages_number, mult);
273 static int ll_wr_max_read_ahead_whole_mb(struct file *file, const char *buffer,
274 unsigned long count, void *data)
276 struct super_block *sb = data;
277 struct ll_sb_info *sbi = ll_s2sbi(sb);
278 int mult, rc, pages_number;
280 mult = 1 << (20 - CFS_PAGE_SHIFT);
281 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
285 /* Cap this at the current max readahead window size, the readahead
286 * algorithm does this anyway so it's pointless to set it larger. */
287 if (pages_number < 0 || pages_number > sbi->ll_ra_info.ra_max_pages) {
288 CERROR("can't set max_read_ahead_whole_mb more than "
289 "max_read_ahead_mb: %lu\n",
290 sbi->ll_ra_info.ra_max_pages >> (20 - CFS_PAGE_SHIFT));
294 spin_lock(&sbi->ll_lock);
295 sbi->ll_ra_info.ra_max_read_ahead_whole_pages = pages_number;
296 spin_unlock(&sbi->ll_lock);
301 static int ll_rd_max_cached_mb(char *page, char **start, off_t off,
302 int count, int *eof, void *data)
304 struct super_block *sb = data;
305 struct ll_sb_info *sbi = ll_s2sbi(sb);
309 spin_lock(&sbi->ll_lock);
310 pages_number = sbi->ll_async_page_max;
311 spin_unlock(&sbi->ll_lock);
313 mult = 1 << (20 - CFS_PAGE_SHIFT);
314 return lprocfs_read_frac_helper(page, count, pages_number, mult);;
317 static int ll_wr_max_cached_mb(struct file *file, const char *buffer,
318 unsigned long count, void *data)
320 struct super_block *sb = data;
321 struct ll_sb_info *sbi = ll_s2sbi(sb);
322 int mult, rc, pages_number;
324 mult = 1 << (20 - CFS_PAGE_SHIFT);
325 rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
329 if (pages_number < 0 || pages_number > num_physpages) {
330 CERROR("can't set max cache more than %lu MB\n",
331 num_physpages >> (20 - CFS_PAGE_SHIFT));
335 spin_lock(&sbi->ll_lock);
336 sbi->ll_async_page_max = pages_number ;
337 spin_unlock(&sbi->ll_lock);
340 /* Not set up yet, don't call llap_shrink_cache */
343 if (sbi->ll_async_page_count >= sbi->ll_async_page_max)
344 llap_shrink_cache(sbi, 0);
349 static int ll_rd_checksum(char *page, char **start, off_t off,
350 int count, int *eof, void *data)
352 struct super_block *sb = data;
353 struct ll_sb_info *sbi = ll_s2sbi(sb);
355 return snprintf(page, count, "%u\n",
356 (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
359 static int ll_wr_checksum(struct file *file, const char *buffer,
360 unsigned long count, void *data)
362 struct super_block *sb = data;
363 struct ll_sb_info *sbi = ll_s2sbi(sb);
370 rc = lprocfs_write_helper(buffer, count, &val);
374 sbi->ll_flags |= LL_SBI_CHECKSUM;
376 sbi->ll_flags &= ~LL_SBI_CHECKSUM;
378 rc = obd_set_info_async(sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
379 KEY_CHECKSUM, sizeof(val), &val, NULL);
381 CWARN("Failed to set OSC checksum flags: %d\n", rc);
386 static int ll_rd_max_rw_chunk(char *page, char **start, off_t off,
387 int count, int *eof, void *data)
389 struct super_block *sb = data;
391 return snprintf(page, count, "%lu\n", ll_s2sbi(sb)->ll_max_rw_chunk);
394 static int ll_wr_max_rw_chunk(struct file *file, const char *buffer,
395 unsigned long count, void *data)
397 struct super_block *sb = data;
400 rc = lprocfs_write_helper(buffer, count, &val);
403 ll_s2sbi(sb)->ll_max_rw_chunk = val;
407 static int ll_rd_track_id(char *page, int count, void *data,
408 enum stats_track_type type)
410 struct super_block *sb = data;
412 if (ll_s2sbi(sb)->ll_stats_track_type == type) {
413 return snprintf(page, count, "%d\n",
414 ll_s2sbi(sb)->ll_stats_track_id);
416 } else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL) {
417 return snprintf(page, count, "0 (all)\n");
419 return snprintf(page, count, "untracked\n");
423 static int ll_wr_track_id(const char *buffer, unsigned long count, void *data,
424 enum stats_track_type type)
426 struct super_block *sb = data;
429 rc = lprocfs_write_helper(buffer, count, &pid);
432 ll_s2sbi(sb)->ll_stats_track_id = pid;
434 ll_s2sbi(sb)->ll_stats_track_type = STATS_TRACK_ALL;
436 ll_s2sbi(sb)->ll_stats_track_type = type;
437 lprocfs_clear_stats(ll_s2sbi(sb)->ll_stats);
441 static int ll_rd_track_pid(char *page, char **start, off_t off,
442 int count, int *eof, void *data)
444 return (ll_rd_track_id(page, count, data, STATS_TRACK_PID));
447 static int ll_wr_track_pid(struct file *file, const char *buffer,
448 unsigned long count, void *data)
450 return (ll_wr_track_id(buffer, count, data, STATS_TRACK_PID));
453 static int ll_rd_track_ppid(char *page, char **start, off_t off,
454 int count, int *eof, void *data)
456 return (ll_rd_track_id(page, count, data, STATS_TRACK_PPID));
459 static int ll_wr_track_ppid(struct file *file, const char *buffer,
460 unsigned long count, void *data)
462 return (ll_wr_track_id(buffer, count, data, STATS_TRACK_PPID));
465 static int ll_rd_track_gid(char *page, char **start, off_t off,
466 int count, int *eof, void *data)
468 return (ll_rd_track_id(page, count, data, STATS_TRACK_GID));
471 static int ll_wr_track_gid(struct file *file, const char *buffer,
472 unsigned long count, void *data)
474 return (ll_wr_track_id(buffer, count, data, STATS_TRACK_GID));
477 static int ll_rd_statahead_max(char *page, char **start, off_t off,
478 int count, int *eof, void *data)
480 struct super_block *sb = data;
481 struct ll_sb_info *sbi = ll_s2sbi(sb);
483 return snprintf(page, count, "%u\n", sbi->ll_sa_max);
486 static int ll_wr_statahead_max(struct file *file, const char *buffer,
487 unsigned long count, void *data)
489 struct super_block *sb = data;
490 struct ll_sb_info *sbi = ll_s2sbi(sb);
493 rc = lprocfs_write_helper(buffer, count, &val);
497 if (val >= 0 && val <= LL_SA_RPC_MAX)
498 sbi->ll_sa_max = val;
500 CERROR("Bad statahead_max value %d. Valid values are in the "
501 "range [0, %d]\n", val, LL_SA_RPC_MAX);
506 static int ll_rd_statahead_stats(char *page, char **start, off_t off,
507 int count, int *eof, void *data)
509 struct super_block *sb = data;
510 struct ll_sb_info *sbi = ll_s2sbi(sb);
512 return snprintf(page, count,
513 "statahead wrong: %u\n"
514 "statahead total: %u\n"
518 "miss count: %llu\n",
527 static int ll_rd_contention_time(char *page, char **start, off_t off,
528 int count, int *eof, void *data)
530 struct super_block *sb = data;
533 return snprintf(page, count, "%u\n", ll_s2sbi(sb)->ll_contention_time);
537 static int ll_wr_contention_time(struct file *file, const char *buffer,
538 unsigned long count, void *data)
540 struct super_block *sb = data;
541 struct ll_sb_info *sbi = ll_s2sbi(sb);
543 return lprocfs_write_helper(buffer, count,&sbi->ll_contention_time) ?:
547 static int ll_rd_lockless_truncate(char *page, char **start, off_t off,
548 int count, int *eof, void *data)
550 struct super_block *sb = data;
553 return snprintf(page, count, "%u\n",
554 ll_s2sbi(sb)->ll_lockless_truncate_enable);
557 static int ll_wr_lockless_truncate(struct file *file, const char *buffer,
558 unsigned long count, void *data)
560 struct super_block *sb = data;
561 struct ll_sb_info *sbi = ll_s2sbi(sb);
563 return lprocfs_write_helper(buffer, count,
564 &sbi->ll_lockless_truncate_enable)
568 static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
569 { "uuid", ll_rd_sb_uuid, 0, 0 },
570 //{ "mntpt_path", ll_rd_path, 0, 0 },
571 { "fstype", ll_rd_fstype, 0, 0 },
572 { "blocksize", ll_rd_blksize, 0, 0 },
573 { "kbytestotal", ll_rd_kbytestotal, 0, 0 },
574 { "kbytesfree", ll_rd_kbytesfree, 0, 0 },
575 { "kbytesavail", ll_rd_kbytesavail, 0, 0 },
576 { "filestotal", ll_rd_filestotal, 0, 0 },
577 { "filesfree", ll_rd_filesfree, 0, 0 },
578 { "client_type", ll_rd_client_type, 0, 0 },
579 //{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
580 { "max_read_ahead_mb", ll_rd_max_readahead_mb,
581 ll_wr_max_readahead_mb, 0 },
582 { "max_read_ahead_whole_mb", ll_rd_max_read_ahead_whole_mb,
583 ll_wr_max_read_ahead_whole_mb, 0 },
584 { "max_cached_mb", ll_rd_max_cached_mb, ll_wr_max_cached_mb, 0 },
585 { "checksum_pages", ll_rd_checksum, ll_wr_checksum, 0 },
586 { "max_rw_chunk", ll_rd_max_rw_chunk, ll_wr_max_rw_chunk, 0 },
587 { "stats_track_pid", ll_rd_track_pid, ll_wr_track_pid, 0 },
588 { "stats_track_ppid", ll_rd_track_ppid, ll_wr_track_ppid, 0 },
589 { "stats_track_gid", ll_rd_track_gid, ll_wr_track_gid, 0 },
590 { "statahead_max", ll_rd_statahead_max, ll_wr_statahead_max, 0 },
591 { "statahead_stats", ll_rd_statahead_stats, 0, 0 },
592 { "contention_seconds", ll_rd_contention_time, ll_wr_contention_time, 0},
593 { "lockless_truncate", ll_rd_lockless_truncate,
594 ll_wr_lockless_truncate, 0},
598 #define MAX_STRING_SIZE 128
600 struct llite_file_opcode {
604 } llite_opcode_table[LPROC_LL_FILE_OPCODES] = {
606 { LPROC_LL_DIRTY_HITS, LPROCFS_TYPE_REGS, "dirty_pages_hits" },
607 { LPROC_LL_DIRTY_MISSES, LPROCFS_TYPE_REGS, "dirty_pages_misses" },
608 { LPROC_LL_WB_WRITEPAGE, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
609 "writeback_from_writepage" },
610 { LPROC_LL_WB_PRESSURE, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
611 "writeback_from_pressure" },
612 { LPROC_LL_WB_OK, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
613 "writeback_ok_pages" },
614 { LPROC_LL_WB_FAIL, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
615 "writeback_failed_pages" },
616 { LPROC_LL_READ_BYTES, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_BYTES,
618 { LPROC_LL_WRITE_BYTES, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_BYTES,
620 { LPROC_LL_BRW_READ, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
622 { LPROC_LL_BRW_WRITE, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
625 { LPROC_LL_IOCTL, LPROCFS_TYPE_REGS, "ioctl" },
626 { LPROC_LL_OPEN, LPROCFS_TYPE_REGS, "open" },
627 { LPROC_LL_RELEASE, LPROCFS_TYPE_REGS, "close" },
628 { LPROC_LL_MAP, LPROCFS_TYPE_REGS, "mmap" },
629 { LPROC_LL_LLSEEK, LPROCFS_TYPE_REGS, "seek" },
630 { LPROC_LL_FSYNC, LPROCFS_TYPE_REGS, "fsync" },
631 /* inode operation */
632 { LPROC_LL_SETATTR, LPROCFS_TYPE_REGS, "setattr" },
633 { LPROC_LL_TRUNC, LPROCFS_TYPE_REGS, "truncate" },
634 { LPROC_LL_LOCKLESS_TRUNC, LPROCFS_TYPE_REGS, "lockless_truncate"},
635 { LPROC_LL_FLOCK, LPROCFS_TYPE_REGS, "flock" },
636 { LPROC_LL_GETATTR, LPROCFS_TYPE_REGS, "getattr" },
637 /* special inode operation */
638 { LPROC_LL_STAFS, LPROCFS_TYPE_REGS, "statfs" },
639 { LPROC_LL_ALLOC_INODE, LPROCFS_TYPE_REGS, "alloc_inode" },
640 { LPROC_LL_SETXATTR, LPROCFS_TYPE_REGS, "setxattr" },
641 { LPROC_LL_GETXATTR, LPROCFS_TYPE_REGS, "getxattr" },
642 { LPROC_LL_LISTXATTR, LPROCFS_TYPE_REGS, "listxattr" },
643 { LPROC_LL_REMOVEXATTR, LPROCFS_TYPE_REGS, "removexattr" },
644 { LPROC_LL_INODE_PERM, LPROCFS_TYPE_REGS, "inode_permission" },
645 { LPROC_LL_DIRECT_READ, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
647 { LPROC_LL_DIRECT_WRITE, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_PAGES,
649 { LPROC_LL_LOCKLESS_READ, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_BYTES,
650 "lockless_read_bytes" },
651 { LPROC_LL_LOCKLESS_WRITE, LPROCFS_CNTR_AVGMINMAX|LPROCFS_TYPE_BYTES,
652 "lockless_write_bytes" },
656 void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count)
660 if (sbi->ll_stats_track_type == STATS_TRACK_ALL)
661 lprocfs_counter_add(sbi->ll_stats, op, count);
662 else if (sbi->ll_stats_track_type == STATS_TRACK_PID &&
663 sbi->ll_stats_track_id == current->pid)
664 lprocfs_counter_add(sbi->ll_stats, op, count);
665 else if (sbi->ll_stats_track_type == STATS_TRACK_PPID &&
666 sbi->ll_stats_track_id == current->p_pptr->pid)
667 lprocfs_counter_add(sbi->ll_stats, op, count);
668 else if (sbi->ll_stats_track_type == STATS_TRACK_GID &&
669 sbi->ll_stats_track_id == current->gid)
670 lprocfs_counter_add(sbi->ll_stats, op, count);
672 EXPORT_SYMBOL(ll_stats_ops_tally);
674 int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
675 struct super_block *sb, char *osc, char *mdc)
677 struct lprocfs_vars lvars[2];
678 struct lustre_sb_info *lsi = s2lsi(sb);
679 struct ll_sb_info *sbi = ll_s2sbi(sb);
680 struct obd_device *obd;
681 char name[MAX_STRING_SIZE + 1], *ptr;
682 int err, id, len, rc;
685 memset(lvars, 0, sizeof(lvars));
687 name[MAX_STRING_SIZE] = '\0';
688 lvars[0].name = name;
690 LASSERT(sbi != NULL);
691 LASSERT(mdc != NULL);
692 LASSERT(osc != NULL);
695 len = strlen(lsi->lsi_lmd->lmd_profile);
696 ptr = strrchr(lsi->lsi_lmd->lmd_profile, '-');
697 if (ptr && (strcmp(ptr, "-client") == 0))
701 snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
702 lsi->lsi_lmd->lmd_profile, sb);
704 sbi->ll_proc_root = lprocfs_register(name, parent, NULL, NULL);
705 if (IS_ERR(sbi->ll_proc_root)) {
706 err = PTR_ERR(sbi->ll_proc_root);
707 sbi->ll_proc_root = NULL;
712 rc = lprocfs_seq_create(sbi->ll_proc_root, "dump_page_cache", 0444,
713 &llite_dump_pgcache_fops, sbi);
715 CWARN("Error adding the dump_page_cache file\n");
717 rc = lprocfs_seq_create(sbi->ll_proc_root, "read_ahead_stats", 0644,
718 &ll_ra_stats_fops, sbi);
720 CWARN("Error adding the read_ahead_stats file\n");
722 rc = lprocfs_seq_create(sbi->ll_proc_root, "extents_stats", 0644,
723 &ll_rw_extents_stats_fops, sbi);
725 CWARN("Error adding the extent_stats file\n");
727 rc = lprocfs_seq_create(sbi->ll_proc_root, "extents_stats_per_process",
728 0644, &ll_rw_extents_stats_pp_fops, sbi);
730 CWARN("Error adding the extents_stats_per_process file\n");
732 rc = lprocfs_seq_create(sbi->ll_proc_root, "offset_stats", 0644,
733 &ll_rw_offset_stats_fops, sbi);
735 CWARN("Error adding the offset_stats file\n");
737 /* File operations stats */
738 sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
739 LPROCFS_STATS_FLAG_PERCPU);
740 if (sbi->ll_stats == NULL)
741 GOTO(out, err = -ENOMEM);
742 /* do counter init */
743 for (id = 0; id < LPROC_LL_FILE_OPCODES; id++) {
744 __u32 type = llite_opcode_table[id].type;
746 if (type & LPROCFS_TYPE_REGS)
748 else if (type & LPROCFS_TYPE_BYTES)
750 else if (type & LPROCFS_TYPE_PAGES)
752 lprocfs_counter_init(sbi->ll_stats,
753 llite_opcode_table[id].opcode,
754 (type & LPROCFS_CNTR_AVGMINMAX),
755 llite_opcode_table[id].opname, ptr);
757 err = lprocfs_register_stats(sbi->ll_proc_root, "stats", sbi->ll_stats);
761 err = lprocfs_add_vars(sbi->ll_proc_root, lprocfs_llite_obd_vars, sb);
766 obd = class_name2obd(mdc);
768 LASSERT(obd != NULL);
769 LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
770 LASSERT(obd->obd_type->typ_name != NULL);
772 snprintf(name, MAX_STRING_SIZE, "%s/common_name",
773 obd->obd_type->typ_name);
774 lvars[0].read_fptr = lprocfs_rd_name;
775 err = lprocfs_add_vars(sbi->ll_proc_root, lvars, obd);
779 snprintf(name, MAX_STRING_SIZE, "%s/uuid", obd->obd_type->typ_name);
780 lvars[0].read_fptr = lprocfs_rd_uuid;
781 err = lprocfs_add_vars(sbi->ll_proc_root, lvars, obd);
786 obd = class_name2obd(osc);
788 LASSERT(obd != NULL);
789 LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
790 LASSERT(obd->obd_type->typ_name != NULL);
792 snprintf(name, MAX_STRING_SIZE, "%s/common_name",
793 obd->obd_type->typ_name);
794 lvars[0].read_fptr = lprocfs_rd_name;
795 err = lprocfs_add_vars(sbi->ll_proc_root, lvars, obd);
799 snprintf(name, MAX_STRING_SIZE, "%s/uuid", obd->obd_type->typ_name);
800 lvars[0].read_fptr = lprocfs_rd_uuid;
801 err = lprocfs_add_vars(sbi->ll_proc_root, lvars, obd);
804 lprocfs_remove(&sbi->ll_proc_root);
805 lprocfs_free_stats(&sbi->ll_stats);
810 void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi)
812 if (sbi->ll_proc_root) {
813 lprocfs_remove(&sbi->ll_proc_root);
814 lprocfs_free_stats(&sbi->ll_stats);
817 #undef MAX_STRING_SIZE
819 #define seq_page_flag(seq, page, flag, has_flags) do { \
820 if (test_bit(PG_##flag, &(page)->flags)) { \
824 seq_putc(seq, '|'); \
825 seq_puts(seq, #flag); \
829 static void *llite_dump_pgcache_seq_start(struct seq_file *seq, loff_t *pos)
831 struct ll_async_page *dummy_llap = seq->private;
833 if (dummy_llap->llap_magic == 2)
839 static int llite_dump_pgcache_seq_show(struct seq_file *seq, void *v)
841 struct ll_async_page *llap, *dummy_llap = seq->private;
842 struct ll_sb_info *sbi = dummy_llap->llap_cookie;
844 /* 2.4 doesn't seem to have SEQ_START_TOKEN, so we implement
845 * it in our own state */
846 if (dummy_llap->llap_magic == 0) {
847 seq_printf(seq, "gener | llap cookie origin wq du wb | page "
848 "inode index count [ page flags ]\n");
852 spin_lock(&sbi->ll_lock);
854 llap = llite_pglist_next_llap(sbi, &dummy_llap->llap_pglist_item);
857 struct page *page = llap->llap_page;
859 LASSERTF(llap->llap_origin < LLAP__ORIGIN_MAX, "%u\n",
862 seq_printf(seq," %5lu | %p %p %s %s %s %s | %p %lu/%u(%p) "
865 llap, llap->llap_cookie,
866 llap_origins[llap->llap_origin],
867 llap->llap_write_queued ? "wq" : "- ",
868 llap->llap_defer_uptodate ? "du" : "- ",
869 PageWriteback(page) ? "wb" : "-",
870 page, page->mapping->host->i_ino,
871 page->mapping->host->i_generation,
872 page->mapping->host, page->index,
874 seq_page_flag(seq, page, locked, has_flags);
875 seq_page_flag(seq, page, error, has_flags);
876 seq_page_flag(seq, page, referenced, has_flags);
877 seq_page_flag(seq, page, uptodate, has_flags);
878 seq_page_flag(seq, page, dirty, has_flags);
879 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12))
880 seq_page_flag(seq, page, highmem, has_flags);
882 seq_page_flag(seq, page, writeback, has_flags);
884 seq_puts(seq, "-]\n");
886 seq_puts(seq, "]\n");
889 spin_unlock(&sbi->ll_lock);
894 static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
897 struct ll_async_page *llap, *dummy_llap = seq->private;
898 struct ll_sb_info *sbi = dummy_llap->llap_cookie;
900 /* bail if we just displayed the banner */
901 if (dummy_llap->llap_magic == 0) {
902 dummy_llap->llap_magic = 1;
906 /* we've just displayed the llap that is after us in the list.
907 * we advance to a position beyond it, returning null if there
908 * isn't another llap in the list beyond that new position. */
909 spin_lock(&sbi->ll_lock);
910 llap = llite_pglist_next_llap(sbi, &dummy_llap->llap_pglist_item);
911 list_del_init(&dummy_llap->llap_pglist_item);
913 list_add(&dummy_llap->llap_pglist_item,&llap->llap_pglist_item);
914 llap =llite_pglist_next_llap(sbi,&dummy_llap->llap_pglist_item);
916 spin_unlock(&sbi->ll_lock);
920 dummy_llap->llap_magic = 2;
926 static void null_stop(struct seq_file *seq, void *v)
930 struct seq_operations llite_dump_pgcache_seq_sops = {
931 .start = llite_dump_pgcache_seq_start,
933 .next = llite_dump_pgcache_seq_next,
934 .show = llite_dump_pgcache_seq_show,
937 /* we're displaying llaps in a list_head list. we don't want to hold a lock
938 * while we walk the entire list, and we don't want to have to seek into
939 * the right position in the list as an app advances with many syscalls. we
940 * allocate a dummy llap and hang it off file->private. its position in
941 * the list records where the app is currently displaying. this way our
942 * seq .start and .stop don't actually do anything. .next returns null
943 * when the dummy hits the end of the list which eventually leads to .release
944 * where we tear down. this kind of displaying is super-racey, so we put
945 * a generation counter on the list so the output shows when the list
946 * changes between reads.
948 static int llite_dump_pgcache_seq_open(struct inode *inode, struct file *file)
950 struct proc_dir_entry *dp = PDE(inode);
951 struct ll_async_page *dummy_llap;
952 struct seq_file *seq;
953 struct ll_sb_info *sbi = dp->data;
956 LPROCFS_ENTRY_AND_CHECK(dp);
958 OBD_ALLOC_PTR_WAIT(dummy_llap);
959 if (dummy_llap == NULL)
961 dummy_llap->llap_page = NULL;
962 dummy_llap->llap_cookie = sbi;
963 dummy_llap->llap_magic = 0;
965 rc = seq_open(file, &llite_dump_pgcache_seq_sops);
967 OBD_FREE(dummy_llap, sizeof(*dummy_llap));
970 seq = file->private_data;
971 seq->private = dummy_llap;
973 spin_lock(&sbi->ll_lock);
974 list_add(&dummy_llap->llap_pglist_item, &sbi->ll_pglist);
975 spin_unlock(&sbi->ll_lock);
983 static int llite_dump_pgcache_seq_release(struct inode *inode,
986 struct seq_file *seq = file->private_data;
987 struct ll_async_page *dummy_llap = seq->private;
988 struct ll_sb_info *sbi = dummy_llap->llap_cookie;
990 spin_lock(&sbi->ll_lock);
991 if (!list_empty(&dummy_llap->llap_pglist_item))
992 list_del_init(&dummy_llap->llap_pglist_item);
993 spin_unlock(&sbi->ll_lock);
994 OBD_FREE(dummy_llap, sizeof(*dummy_llap));
996 return lprocfs_seq_release(inode, file);
999 struct file_operations llite_dump_pgcache_fops = {
1000 .owner = THIS_MODULE,
1001 .open = llite_dump_pgcache_seq_open,
1003 .release = llite_dump_pgcache_seq_release,
1006 static int ll_ra_stats_seq_show(struct seq_file *seq, void *v)
1009 struct ll_sb_info *sbi = seq->private;
1010 struct ll_ra_info *ra = &sbi->ll_ra_info;
1012 static char *ra_stat_strings[] = {
1013 [RA_STAT_HIT] = "hits",
1014 [RA_STAT_MISS] = "misses",
1015 [RA_STAT_DISTANT_READPAGE] = "readpage not consecutive",
1016 [RA_STAT_MISS_IN_WINDOW] = "miss inside window",
1017 [RA_STAT_FAILED_GRAB_PAGE] = "failed grab_cache_page",
1018 [RA_STAT_FAILED_MATCH] = "failed lock match",
1019 [RA_STAT_DISCARDED] = "read but discarded",
1020 [RA_STAT_ZERO_LEN] = "zero length file",
1021 [RA_STAT_ZERO_WINDOW] = "zero size window",
1022 [RA_STAT_EOF] = "read-ahead to EOF",
1023 [RA_STAT_MAX_IN_FLIGHT] = "hit max r-a issue",
1024 [RA_STAT_WRONG_GRAB_PAGE] = "wrong page from grab_cache_page",
1027 do_gettimeofday(&now);
1029 spin_lock(&sbi->ll_lock);
1031 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
1032 now.tv_sec, now.tv_usec);
1033 seq_printf(seq, "pending issued pages: %lu\n",
1036 for(i = 0; i < _NR_RA_STAT; i++)
1037 seq_printf(seq, "%-25s %lu\n", ra_stat_strings[i],
1040 spin_unlock(&sbi->ll_lock);
1045 static ssize_t ll_ra_stats_seq_write(struct file *file, const char *buf,
1046 size_t len, loff_t *off)
1048 struct seq_file *seq = file->private_data;
1049 struct ll_sb_info *sbi = seq->private;
1050 struct ll_ra_info *ra = &sbi->ll_ra_info;
1052 spin_lock(&sbi->ll_lock);
1053 memset(ra->ra_stats, 0, sizeof(ra->ra_stats));
1054 spin_unlock(&sbi->ll_lock);
1059 LPROC_SEQ_FOPS(ll_ra_stats);
1061 #define pct(a,b) (b ? a * 100 / b : 0)
1063 static void ll_display_extents_info(struct ll_rw_extents_info *io_extents,
1064 struct seq_file *seq, int which)
1066 unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
1067 unsigned long start, end, r, w;
1068 char *unitp = "KMGTPEZY";
1070 struct per_process_info *pp_info = &io_extents->pp_extents[which];
1076 for(i = 0; i < LL_HIST_MAX; i++) {
1077 read_tot += pp_info->pp_r_hist.oh_buckets[i];
1078 write_tot += pp_info->pp_w_hist.oh_buckets[i];
1081 for(i = 0; i < LL_HIST_MAX; i++) {
1082 r = pp_info->pp_r_hist.oh_buckets[i];
1083 w = pp_info->pp_w_hist.oh_buckets[i];
1086 end = 1 << (i + LL_HIST_START - units);
1087 seq_printf(seq, "%4lu%c - %4lu%c%c: %14lu %4lu %4lu | "
1088 "%14lu %4lu %4lu\n", start, *unitp, end, *unitp,
1089 (i == LL_HIST_MAX - 1) ? '+' : ' ',
1090 r, pct(r, read_tot), pct(read_cum, read_tot),
1091 w, pct(w, write_tot), pct(write_cum, write_tot));
1093 if (start == 1<<10) {
1098 if (read_cum == read_tot && write_cum == write_tot)
1103 static int ll_rw_extents_stats_pp_seq_show(struct seq_file *seq, void *v)
1106 struct ll_sb_info *sbi = seq->private;
1107 struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
1110 do_gettimeofday(&now);
1112 if (!sbi->ll_rw_stats_on) {
1113 seq_printf(seq, "Disabled\n"
1114 "Write anything in this file to activate\n");
1117 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
1118 now.tv_sec, now.tv_usec);
1119 seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
1120 seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
1121 "extents", "calls", "%", "cum%",
1122 "calls", "%", "cum%");
1123 spin_lock(&sbi->ll_pp_extent_lock);
1124 for(k = 0; k < LL_PROCESS_HIST_MAX; k++) {
1125 if(io_extents->pp_extents[k].pid != 0) {
1126 seq_printf(seq, "\nPID: %d\n",
1127 io_extents->pp_extents[k].pid);
1128 ll_display_extents_info(io_extents, seq, k);
1131 spin_unlock(&sbi->ll_pp_extent_lock);
1135 static ssize_t ll_rw_extents_stats_pp_seq_write(struct file *file,
1136 const char *buf, size_t len,
1139 struct seq_file *seq = file->private_data;
1140 struct ll_sb_info *sbi = seq->private;
1141 struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
1144 sbi->ll_rw_stats_on = 1;
1145 spin_lock(&sbi->ll_pp_extent_lock);
1146 for(i = 0; i < LL_PROCESS_HIST_MAX; i++) {
1147 io_extents->pp_extents[i].pid = 0;
1148 lprocfs_oh_clear(&io_extents->pp_extents[i].pp_r_hist);
1149 lprocfs_oh_clear(&io_extents->pp_extents[i].pp_w_hist);
1151 spin_unlock(&sbi->ll_pp_extent_lock);
1155 LPROC_SEQ_FOPS(ll_rw_extents_stats_pp);
1157 static int ll_rw_extents_stats_seq_show(struct seq_file *seq, void *v)
1160 struct ll_sb_info *sbi = seq->private;
1161 struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
1163 do_gettimeofday(&now);
1165 if (!sbi->ll_rw_stats_on) {
1166 seq_printf(seq, "Disabled\n"
1167 "Write anything in this file to activate\n");
1170 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
1171 now.tv_sec, now.tv_usec);
1173 seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
1174 seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
1175 "extents", "calls", "%", "cum%",
1176 "calls", "%", "cum%");
1177 spin_lock(&sbi->ll_lock);
1178 ll_display_extents_info(io_extents, seq, LL_PROCESS_HIST_MAX);
1179 spin_unlock(&sbi->ll_lock);
1184 static ssize_t ll_rw_extents_stats_seq_write(struct file *file, const char *buf,
1185 size_t len, loff_t *off)
1187 struct seq_file *seq = file->private_data;
1188 struct ll_sb_info *sbi = seq->private;
1189 struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
1192 sbi->ll_rw_stats_on = 1;
1193 spin_lock(&sbi->ll_pp_extent_lock);
1194 for(i = 0; i <= LL_PROCESS_HIST_MAX; i++)
1196 io_extents->pp_extents[i].pid = 0;
1197 lprocfs_oh_clear(&io_extents->pp_extents[i].pp_r_hist);
1198 lprocfs_oh_clear(&io_extents->pp_extents[i].pp_w_hist);
1200 spin_unlock(&sbi->ll_pp_extent_lock);
1205 LPROC_SEQ_FOPS(ll_rw_extents_stats);
1207 void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid, struct file
1208 *file, size_t count, int rw)
1211 struct ll_rw_process_info *process;
1212 struct ll_rw_process_info *offset;
1213 int *off_count = &sbi->ll_rw_offset_entry_count;
1214 int *process_count = &sbi->ll_offset_process_count;
1215 struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
1217 if(!sbi->ll_rw_stats_on)
1219 process = sbi->ll_rw_process_info;
1220 offset = sbi->ll_rw_offset_info;
1222 spin_lock(&sbi->ll_pp_extent_lock);
1223 /* Extent statistics */
1224 for(i = 0; i < LL_PROCESS_HIST_MAX; i++) {
1225 if(io_extents->pp_extents[i].pid == pid) {
1233 sbi->ll_extent_process_count =
1234 (sbi->ll_extent_process_count + 1) % LL_PROCESS_HIST_MAX;
1235 cur = sbi->ll_extent_process_count;
1236 io_extents->pp_extents[cur].pid = pid;
1237 lprocfs_oh_clear(&io_extents->pp_extents[cur].pp_r_hist);
1238 lprocfs_oh_clear(&io_extents->pp_extents[cur].pp_w_hist);
1241 for(i = 0; (count >= (1 << LL_HIST_START << i)) &&
1242 (i < (LL_HIST_MAX - 1)); i++);
1244 io_extents->pp_extents[cur].pp_r_hist.oh_buckets[i]++;
1245 io_extents->pp_extents[LL_PROCESS_HIST_MAX].pp_r_hist.oh_buckets[i]++;
1247 io_extents->pp_extents[cur].pp_w_hist.oh_buckets[i]++;
1248 io_extents->pp_extents[LL_PROCESS_HIST_MAX].pp_w_hist.oh_buckets[i]++;
1250 spin_unlock(&sbi->ll_pp_extent_lock);
1252 spin_lock(&sbi->ll_process_lock);
1253 /* Offset statistics */
1254 for (i = 0; i < LL_PROCESS_HIST_MAX; i++) {
1255 if (process[i].rw_pid == pid) {
1256 if (process[i].rw_last_file != file) {
1257 process[i].rw_range_start = file->f_pos;
1258 process[i].rw_last_file_pos =
1259 file->f_pos + count;
1260 process[i].rw_smallest_extent = count;
1261 process[i].rw_largest_extent = count;
1262 process[i].rw_offset = 0;
1263 process[i].rw_last_file = file;
1264 spin_unlock(&sbi->ll_process_lock);
1267 if (process[i].rw_last_file_pos != file->f_pos) {
1269 (*off_count + 1) % LL_OFFSET_HIST_MAX;
1270 offset[*off_count].rw_op = process[i].rw_op;
1271 offset[*off_count].rw_pid = pid;
1272 offset[*off_count].rw_range_start =
1273 process[i].rw_range_start;
1274 offset[*off_count].rw_range_end =
1275 process[i].rw_last_file_pos;
1276 offset[*off_count].rw_smallest_extent =
1277 process[i].rw_smallest_extent;
1278 offset[*off_count].rw_largest_extent =
1279 process[i].rw_largest_extent;
1280 offset[*off_count].rw_offset =
1281 process[i].rw_offset;
1282 process[i].rw_op = rw;
1283 process[i].rw_range_start = file->f_pos;
1284 process[i].rw_smallest_extent = count;
1285 process[i].rw_largest_extent = count;
1286 process[i].rw_offset = file->f_pos -
1287 process[i].rw_last_file_pos;
1289 if(process[i].rw_smallest_extent > count)
1290 process[i].rw_smallest_extent = count;
1291 if(process[i].rw_largest_extent < count)
1292 process[i].rw_largest_extent = count;
1293 process[i].rw_last_file_pos = file->f_pos + count;
1294 spin_unlock(&sbi->ll_process_lock);
1298 *process_count = (*process_count + 1) % LL_PROCESS_HIST_MAX;
1299 process[*process_count].rw_pid = pid;
1300 process[*process_count].rw_op = rw;
1301 process[*process_count].rw_range_start = file->f_pos;
1302 process[*process_count].rw_last_file_pos = file->f_pos + count;
1303 process[*process_count].rw_smallest_extent = count;
1304 process[*process_count].rw_largest_extent = count;
1305 process[*process_count].rw_offset = 0;
1306 process[*process_count].rw_last_file = file;
1307 spin_unlock(&sbi->ll_process_lock);
1310 char lpszt[] = LPSZ;
1312 static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
1315 struct ll_sb_info *sbi = seq->private;
1316 struct ll_rw_process_info *offset = sbi->ll_rw_offset_info;
1317 struct ll_rw_process_info *process = sbi->ll_rw_process_info;
1321 do_gettimeofday(&now);
1323 if (!sbi->ll_rw_stats_on) {
1324 seq_printf(seq, "Disabled\n"
1325 "Write anything in this file to activate\n");
1328 spin_lock(&sbi->ll_process_lock);
1330 seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
1331 now.tv_sec, now.tv_usec);
1332 seq_printf(seq, "%3s %10s %14s %14s %17s %17s %14s\n",
1333 "R/W", "PID", "RANGE START", "RANGE END",
1334 "SMALLEST EXTENT", "LARGEST EXTENT", "OFFSET");
1335 sprintf(format, "%s%s%s%s%s\n",
1336 "%3c %10d %14Lu %14Lu %17", lpszt+1, " %17", lpszt+1, " %14Ld");
1337 /* We stored the discontiguous offsets here; print them first */
1338 for(i = 0; i < LL_OFFSET_HIST_MAX; i++) {
1339 if (offset[i].rw_pid != 0)
1340 /* Is there a way to snip the '%' off of LPSZ? */
1341 seq_printf(seq, format,
1342 offset[i].rw_op ? 'W' : 'R',
1344 offset[i].rw_range_start,
1345 offset[i].rw_range_end,
1346 offset[i].rw_smallest_extent,
1347 offset[i].rw_largest_extent,
1348 offset[i].rw_offset);
1350 /* Then print the current offsets for each process */
1351 for(i = 0; i < LL_PROCESS_HIST_MAX; i++) {
1352 if (process[i].rw_pid != 0)
1353 seq_printf(seq, format,
1354 process[i].rw_op ? 'W' : 'R',
1356 process[i].rw_range_start,
1357 process[i].rw_last_file_pos,
1358 process[i].rw_smallest_extent,
1359 process[i].rw_largest_extent,
1360 process[i].rw_offset);
1362 spin_unlock(&sbi->ll_process_lock);
1367 static ssize_t ll_rw_offset_stats_seq_write(struct file *file, const char *buf,
1368 size_t len, loff_t *off)
1370 struct seq_file *seq = file->private_data;
1371 struct ll_sb_info *sbi = seq->private;
1372 struct ll_rw_process_info *process_info = sbi->ll_rw_process_info;
1373 struct ll_rw_process_info *offset_info = sbi->ll_rw_offset_info;
1375 sbi->ll_rw_stats_on = 1;
1377 spin_lock(&sbi->ll_process_lock);
1378 sbi->ll_offset_process_count = 0;
1379 sbi->ll_rw_offset_entry_count = 0;
1380 memset(process_info, 0, sizeof(struct ll_rw_process_info) *
1381 LL_PROCESS_HIST_MAX);
1382 memset(offset_info, 0, sizeof(struct ll_rw_process_info) *
1383 LL_OFFSET_HIST_MAX);
1384 spin_unlock(&sbi->ll_process_lock);
1389 LPROC_SEQ_FOPS(ll_rw_offset_stats);
1391 void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
1393 lvars->module_vars = NULL;
1394 lvars->obd_vars = lprocfs_llite_obd_vars;
1396 #endif /* LPROCFS */