mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Saout <christophe@saout.de>
To: dm-devel@sistina.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] File backed target for device-mapper
Date: 22 Jul 2003 23:39:09 +0200	[thread overview]
Message-ID: <1058909948.17049.12.camel@chtephan.cs.pocnet.net> (raw)
In-Reply-To: <1058908659.17049.9.camel@chtephan.cs.pocnet.net>

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


  reply	other threads:[~2003-07-22 21:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-22 21:17 Christophe Saout
2003-07-22 21:39 ` Christophe Saout [this message]
2003-07-22 21:58 ` [dm-devel] " Alasdair G Kergon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1058909948.17049.12.camel@chtephan.cs.pocnet.net \
    --to=christophe@saout.de \
    --cc=dm-devel@sistina.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®