Patchwork sheepdog: implement direct write semantics

login
register
mail settings
Submitter namei.unix@gmail.com
Date Jan. 9, 2013, 12:10 p.m.
Message ID <50ED5E19.8020902@gmail.com>
Download mbox | patch
Permalink /patch/210705/
State New
Headers show

Comments

namei.unix@gmail.com - Jan. 9, 2013, 12:10 p.m.
On 01/09/2013 08:07 PM, Liu Yuan wrote:
> $ qemu-system-x86_64 --enable-kvm -drive
> file=~/images/test1,if=virtio,cache=writeback -smp 2 -cpu host -m 1024
> -drive file=sheepdog:test,if=virtio,cache=writeback

To emulate old impl, I modified the sheepdog block driver as following:

     if (s->flush_fd < 0) {
@@ -1125,6 +1126,7 @@ static int sd_open(BlockDriverState *bs, const
char *filename, int flags)
         ret = s->flush_fd;
         goto out;
     }
+    }

     if (snapid || tag[0] != '\0') {
         dprintf("%" PRIx32 " snapshot inode was open.\n", vid);

Patch

diff --git a/block/sheepdog.c b/block/sheepdog.c
index e821746..321a426 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1118,6 +1118,7 @@  static int sd_open(BlockDriverState *bs, const
char *filename, int flags)
         goto out;
     }

+    if (0) {
     s->cache_enabled = true;
     s->flush_fd = connect_to_sdog(s->addr, s->port);