]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/dm-snap.c
dm snapshot: reduce default memory allocation
[karo-tx-linux.git] / drivers / md / dm-snap.c
index ae24eab8cd811c573b619b4e226244ff372f4119..08047fb1cac9fdc4d06fbd7d113b13a1fb99447c 100644 (file)
@@ -36,9 +36,9 @@
 #define SNAPSHOT_COPY_PRIORITY 2
 
 /*
- * Each snapshot reserves this many pages for io
+ * Reserve 1MB for each snapshot initially (with minimum of 1 page).
  */
-#define SNAPSHOT_PAGES 256
+#define SNAPSHOT_PAGES (((1UL << 20) >> PAGE_SHIFT) ? : 1)
 
 static struct workqueue_struct *ksnapd;
 static void flush_queued_bios(struct work_struct *work);
@@ -804,7 +804,7 @@ static void commit_callback(void *context, int success)
  * Called when the copy I/O has finished.  kcopyd actually runs
  * this code so don't block.
  */
-static void copy_callback(int read_err, unsigned int write_err, void *context)
+static void copy_callback(int read_err, unsigned long write_err, void *context)
 {
        struct dm_snap_pending_exception *pe = context;
        struct dm_snapshot *s = pe->snap;