lkml.org 
[lkml]   [2003]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC] File backed target for device-mapper
From
Date
Am Di, 2003-07-22 um 23.17 schrieb Christophe Saout:

> I just wrote a dm target uses a file as backend instead of another block
> device.
>
> It's heavily based on the linux 2.5 loop device (so it uses the inode
> operation sendfile for read operations and the address space operations
> prepare_write and commit_write for write operations).

Umm... lalala... (a cleanup and a *fix*) :D

--- dm-file.c.orig 2003-07-22 23:36:57.639746368 +0200
+++ dm-file.c 2003-07-22 23:37:26.203404032 +0200
@@ -87,17 +87,16 @@
{
char *src;
char *dst = (char *)desc->buf;
- unsigned long count = desc->count;

- if (size > count)
- size = count;
+ if (size > desc->count)
+ size = desc->count;

src = kmap(page) + offset;
if (src != dst) /* FIXME: is src == dst possible? */
memcpy(dst, src, size);
kunmap(page);

- desc->count = count - size;
+ desc->count -= size;
desc->written += size;
(char *)desc->buf += size;

@@ -127,8 +126,6 @@

if (r < 0)
break;
-
- pos += bv->bv_len;
}

return 0;

--
Christophe Saout <christophe@saout.de>
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site