string: factorize skip_spaces and export it to be generally available
[safe/jmp/linux-2.6] / drivers / md / dm-exception-store.h
index 023a707..8a223a4 100644 (file)
@@ -79,8 +79,9 @@ struct dm_exception_store_type {
         */
        void (*drop_snapshot) (struct dm_exception_store *store);
 
-       int (*status) (struct dm_exception_store *store, status_type_t status,
-                      char *result, unsigned int maxlen);
+       unsigned (*status) (struct dm_exception_store *store,
+                           status_type_t status, char *result,
+                           unsigned maxlen);
 
        /*
         * Return how full the snapshot is.
@@ -100,9 +101,9 @@ struct dm_exception_store {
        struct dm_dev *cow;
 
        /* Size of data blocks saved - must be a power of 2 */
-       chunk_t chunk_size;
-       chunk_t chunk_mask;
-       chunk_t chunk_shift;
+       unsigned chunk_size;
+       unsigned chunk_mask;
+       unsigned chunk_shift;
 
        void *context;
 };
@@ -110,7 +111,7 @@ struct dm_exception_store {
 /*
  * Funtions to manipulate consecutive chunks
  */
-#  if defined(CONFIG_LBD) || (BITS_PER_LONG == 64)
+#  if defined(CONFIG_LBDAF) || (BITS_PER_LONG == 64)
 #    define DM_CHUNK_CONSECUTIVE_BITS 8
 #    define DM_CHUNK_NUMBER_BITS 56
 
@@ -155,7 +156,7 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e)
  */
 static inline sector_t get_dev_size(struct block_device *bdev)
 {
-       return bdev->bd_inode->i_size >> SECTOR_SHIFT;
+       return i_size_read(bdev->bd_inode) >> SECTOR_SHIFT;
 }
 
 static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
@@ -167,6 +168,10 @@ static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
 int dm_exception_store_type_register(struct dm_exception_store_type *type);
 int dm_exception_store_type_unregister(struct dm_exception_store_type *type);
 
+int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
+                                     unsigned chunk_size,
+                                     char **error);
+
 int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
                              unsigned *args_used,
                              struct dm_exception_store **store);