linux/drivers/md/dm-stats.h
<<
>>
Prefs
   1#ifndef DM_STATS_H
   2#define DM_STATS_H
   3
   4#include <linux/types.h>
   5#include <linux/mutex.h>
   6#include <linux/list.h>
   7
   8int dm_statistics_init(void);
   9void dm_statistics_exit(void);
  10
  11struct dm_stats {
  12        struct mutex mutex;
  13        struct list_head list;  /* list of struct dm_stat */
  14        struct dm_stats_last_position __percpu *last;
  15        sector_t last_sector;
  16        unsigned last_rw;
  17};
  18
  19struct dm_stats_aux {
  20        bool merged;
  21};
  22
  23void dm_stats_init(struct dm_stats *st);
  24void dm_stats_cleanup(struct dm_stats *st);
  25
  26struct mapped_device;
  27
  28int dm_stats_message(struct mapped_device *md, unsigned argc, char **argv,
  29                     char *result, unsigned maxlen);
  30
  31void dm_stats_account_io(struct dm_stats *stats, unsigned long bi_rw,
  32                         sector_t bi_sector, unsigned bi_sectors, bool end,
  33                         unsigned long duration, struct dm_stats_aux *aux);
  34
  35static inline bool dm_stats_used(struct dm_stats *st)
  36{
  37        return !list_empty(&st->list);
  38}
  39
  40#endif
  41
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.