Revision 1: 2.4 backport, compiles Revision 2: kgdb Revision 3: Fix bugs Revision 4: change dd->dev to a kdev_t Revision 5: Correct devfs_register call. Revision 6: The dm_get_device in the linear constructor was wrong. Revision 7: Change a couple of GFP_KERNEL allocations to GFP_NOIO Revision 8: The locking when leaving __request was broken. Split off __deferring() Revision 9: s->table wasn't being set in the snapshot contructor Revision 10: I don't know why dm-ioctl.c was including rather than Revision 11: Four constants: DM_DIR, DM_MAX_TYPE_NAME, DM_NAME_LEN, DM_UUID_LEN Were being declared in device-mapper.h, these are all specific to the ioctl interface, so they've been moved to dm-ioctl.h. Nobody in userland should ever include so remove ifdef __KERNEL guards. Revision 12: No need to validate the parameters if we are doing a REMOVE_ALL command. Revision 13: Fluff Revision 14: Mempool version by Christoph Hellwig that holds the free objects in an array rather than a list. This prevents the objects getting dirtied, eg, people maybe expecting them to come out of a slab with a particular state. Revision 15: Return -ENOTBLK if lookup_device() finds the inode, but it is not a block device. [Cristoph Hellwig] Revision 16: get_kdev() was locking _minor_lock rather than &_minor_lock. [Heinz Mauelshagen] Revision 17: minor change for dm-strip.c. Tests for correct chunksize before it allocates the stripe context. [Heinz Mauelshagen] Revision 18: There's a bug in the dm-stripe.c constructor failing top check if enough destinations are handed in. [Heinz Mauelshagen] Revision 19: Give each device its own io mempool to avoid a potential deadlock with stacked devices. [HM + EJT] Revision 20: Let the persistent/non persistent arg to the snapshot constructor be case insensitive. [Heinz Mauelshagen] Revision 21: queue_io() was checking the DMF_SUSPENDED flag rather than the new DMF_BLOCK_IO flag. This meant suspend could deadlock under load. Revision 22: dm_suspend(): Stop holding the read lock around the while loop that waits for pending io to complete. Revision 23: Add a run_task_queue(&tq_disk) to encourage pending io to flush when we're doing a dm_suspend(). Revision 24: Don't hook the io until after the target->map function has been called. Revision 25: Lift the dm_io allocation out of __map_buffer so that it is outside of the read lock. Hook all io, not just simple mappings. Revision 26: change (struct target_type).use to be an atomic_t. Revision 27: forgot to initialise the atomic_t Revision 28: Use a rw_semaphore in dm_target.c rather than a rwlock_t, just to keep in line with dm.c Revision 29: Add an endio method to targets. Revision 30: import dm-iostats.c Revision 31: Update Config.in and Makefile to get dm-iostats building. Revision 32: Typedef a suitable jiffies_t rather than using typeof everywhere. Revision 33: Rename variables that have the word 'jiffies' in them. No hungarian please. Revision 34: Get rid of global _io_lock spinlock. Revision 35: Fluff Revision 36: Fluff Revision 37: Fluff Revision 38: We can't have 2 target types in the same module without breaking the automatic loading of target modules. eg, if 'iostat_avg' is requested and not registered the kernel will try and load a module called 'dm-iostat_avg'. So this changes the code back to a single target, with an extra parameter which states whether we want latency info or not. Revision 39: Changes ic->reads and ic->writes to be atomic_t. Revision 40: Change the target->end_io function to take the rw param. Use target->end_io rather than hooking in dm-iostats.c Instead of taking the average of the individual io latencies calculate the 'average end_io time' - 'average start time'. This removes the need for passing context (ie. start time) between the map function and the end_io function. Revision 41: No longer any need for jiffies_t target->end_io was only being called when there were zero pending ios. ti->private wasn't being set. Revision 42: Remove divide by zero possibility from calc_latency(). Revision 43: Convert to using uint64_t's for everything. (doesn't yet work). Revision 44: uint64_t -> unsigned long long Revision 45: Return the correct value from calc_latency() Some stray sector_t's -> unsigned long long Revision 46: Don't let the ioctl interface drop a suspended device. Revision 47: Call dm_put_target_type() *after* calling the destructor. Revision 48: In dm_put_target_type(): There's no need for the lock around the atomic_dec_and_test(). Revision 49: Fluff Revision 50: printk tgt->error if dm_table_add_target() fails. Revision 51: Just return an error from the error targets map function, rather than erroring the buffer_head. Revision 52: Export dm_table_get_mode() Revision 53: Include total io stats. variable 'i' should be an 'unsigned long long' in dev64. Revision 54: div64 would loop forever if a was > 2^63. Revision 55: Last patch was bogus, this is the correct fix (I hope). Revision 56: spin lock when using the stats for the status. Revision 57: Keep track of the number of ios that have completed, and add in a fudge factor that assumes all in flight ios finished *now*. This gives nice stable results. Revision 58: inline rw_to_index()