Staging: fix assorted typos all over the place
[safe/jmp/linux-2.6] / drivers / md / dm-snap-transient.c
index 51bc4a7..cde5aa5 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include "dm-exception-store.h"
-#include "dm-snap.h"
 
 #include <linux/mm.h>
 #include <linux/pagemap.h>
@@ -40,13 +39,13 @@ static int transient_prepare_exception(struct dm_exception_store *store,
                                       struct dm_snap_exception *e)
 {
        struct transient_c *tc = store->context;
-       sector_t size = get_dev_size(store->snap->cow->bdev);
+       sector_t size = get_dev_size(store->cow->bdev);
 
-       if (size < (tc->next_free + store->snap->chunk_size))
+       if (size < (tc->next_free + store->chunk_size))
                return -1;
 
-       e->new_chunk = sector_to_chunk(store->snap, tc->next_free);
-       tc->next_free += store->snap->chunk_size;
+       e->new_chunk = sector_to_chunk(store, tc->next_free);
+       tc->next_free += store->chunk_size;
 
        return 0;
 }
@@ -64,7 +63,7 @@ static void transient_fraction_full(struct dm_exception_store *store,
                                    sector_t *numerator, sector_t *denominator)
 {
        *numerator = ((struct transient_c *) store->context)->next_free;
-       *denominator = get_dev_size(store->snap->cow->bdev);
+       *denominator = get_dev_size(store->cow->bdev);
 }
 
 static int transient_ctr(struct dm_exception_store *store,
@@ -82,11 +81,19 @@ static int transient_ctr(struct dm_exception_store *store,
        return 0;
 }
 
-static int transient_status(struct dm_exception_store *store,
-                           status_type_t status, char *result,
-                           unsigned maxlen)
+static unsigned transient_status(struct dm_exception_store *store,
+                                status_type_t status, char *result,
+                                unsigned maxlen)
 {
-       int sz = 0;
+       unsigned sz = 0;
+
+       switch (status) {
+       case STATUSTYPE_INFO:
+               break;
+       case STATUSTYPE_TABLE:
+               DMEMIT(" %s N %llu", store->cow->name,
+                      (unsigned long long)store->chunk_size);
+       }
 
        return sz;
 }