-/*----------------------------------------------------------------
- * Bits IO
- *--------------------------------------------------------------*/
-static inline void bits_to_core(uint32_t *core, uint32_t *disk, unsigned count)
-{
- unsigned i;
-
- for (i = 0; i < count; i++)
- core[i] = le32_to_cpu(disk[i]);
-}
-
-static inline void bits_to_disk(uint32_t *core, uint32_t *disk, unsigned count)
-{
- unsigned i;
-
- /* copy across the clean/dirty bitset */
- for (i = 0; i < count; i++)
- disk[i] = cpu_to_le32(core[i]);
-}
-
-static int read_bits(struct log_c *log)
-{
- int r;
- unsigned long ebits;
-
- r = dm_io_sync_vm(1, &log->bits_location, READ,
- log->disk_bits, &ebits);
- if (r)
- return r;
-
- bits_to_core(log->clean_bits, log->disk_bits,
- log->bitset_uint32_count);
- return 0;
-}
-
-static int write_bits(struct log_c *log)
-{
- unsigned long ebits;
- bits_to_disk(log->clean_bits, log->disk_bits,
- log->bitset_uint32_count);
- return dm_io_sync_vm(1, &log->bits_location, WRITE,
- log->disk_bits, &ebits);
-}
-