Files
mirror_zfs/include/sys
Brian Behlendorf 71c9f0b003 Make kstat.ks_update() callback atomic
Move the kstat ks_update() callback under the ks_lock.  This
enables dynamically sized kstats without modification to the
kstat API.

  * Create a kstat with the KSTAT_FLAG_VIRTUAL flag.
  * Register a ->ks_update() callback which does:
    o Frees any existing ks_data buffer.
    o Set ks_data_size to the kstat array size.
    o Set ks_data to an allocated buffer of size ks_data_size
    o Populate the array of buffers with the required data.

The buffer allocated in the ks_update() callback is guaranteed
to remain allocated and valid while the proc sequence handler
iterates over the buffer.  The lock will not be dropped until
kstat_seq_stop() function is run making it safe for concurrent
access.  To allow the ks_update() callback to perform memory
allocations the lock was changed to a mutex.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2012-10-23 09:36:19 -07:00
..
2012-08-27 11:46:23 -07:00
2012-08-27 11:46:23 -07:00
2012-08-27 11:46:23 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2012-04-06 12:06:19 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-06-11 15:57:25 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2011-03-22 12:18:44 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2012-09-02 14:22:01 -07:00
2010-05-17 15:18:00 -07:00
2011-04-06 20:06:03 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2011-01-27 16:06:09 -08:00
2011-02-23 14:32:15 -08:00
2011-01-27 16:06:09 -08:00
2011-01-27 16:06:09 -08:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2012-05-03 09:56:15 -07:00
2011-01-27 16:06:09 -08:00
2012-09-07 14:27:03 -07:00
2010-05-17 15:18:00 -07:00
2012-10-23 09:36:19 -07:00
2010-08-27 14:23:48 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2012-08-27 12:00:55 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2011-04-29 13:58:45 -07:00
2010-05-17 15:18:00 -07:00
2011-01-27 16:06:09 -08:00
2010-06-11 15:57:25 -07:00
2010-05-17 15:18:00 -07:00
2010-06-11 15:57:25 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2011-01-27 16:06:09 -08:00
2010-07-20 13:29:35 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2012-05-18 13:57:44 -07:00
2010-05-17 15:18:00 -07:00
2010-06-11 15:57:25 -07:00
2010-05-17 15:18:00 -07:00
2012-07-02 09:33:09 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2012-09-12 11:41:42 -07:00
2012-07-02 09:33:09 -07:00
2011-11-11 09:18:28 -08:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-06-11 15:57:25 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2010-05-17 15:18:00 -07:00
2011-04-29 12:10:54 -07:00
2010-05-17 15:18:00 -07:00
2012-10-04 16:22:07 -07:00
2011-11-11 09:18:28 -08:00
2010-05-17 15:18:00 -07:00