Index: test/arch/um/drivers/ubd_kern.c =================================================================== --- test.orig/arch/um/drivers/ubd_kern.c 2005-09-27 12:03:00.000000000 -0400 +++ test/arch/um/drivers/ubd_kern.c 2005-09-27 12:03:15.000000000 -0400 @@ -136,10 +136,10 @@ #ifdef CONFIG_BLK_DEV_UBD_SYNC #define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \ - .cl = 1 }) + .cl = 1, .d = 1 }) #else #define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0, \ - .cl = 1 }) + .cl = 1, .d = 1 }) #endif /* Not protected - changed only in ubd_setup_common and then only to @@ -809,6 +809,8 @@ goto out_close; blk_queue_max_hw_segments(dev->queue, MAX_SG); + blk_queue_hardsect_size(dev->queue, PAGE_SIZE); + dev->queue->queuedata = dev; err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); @@ -1094,11 +1096,8 @@ while(dev->start_sg < dev->end_sg){ struct scatterlist *sg = &dev->sg[dev->start_sg]; - err = prepare_request(req, &io_req, req->sector << 9, - sg->offset, sg->length, - sg->page); - if(err) - continue; + prepare_request(req, &io_req, req->sector << 9, + sg->offset, sg->length, sg->page); if(do_io(&io_req, req, dev->cow.bitmap) == -EAGAIN){ if(list_empty(&dev->restart)) Index: test/arch/um/include/os.h =================================================================== --- test.orig/arch/um/include/os.h 2005-09-27 11:33:43.000000000 -0400 +++ test/arch/um/include/os.h 2005-09-27 12:19:15.000000000 -0400 @@ -52,10 +52,12 @@ unsigned int a : 1; /* O_APPEND */ unsigned int e : 1; /* O_EXCL */ unsigned int cl : 1; /* FD_CLOEXEC */ + unsigned int d : 1; /* O_DIRECT */ }; #define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \ - .t = 0, .a = 0, .e = 0, .cl = 0 }) + .t = 0, .a = 0, .e = 0, .cl = 0, \ + .d = 0 }) static inline struct openflags of_read(struct openflags flags) { @@ -117,6 +119,12 @@ return(flags); } +static inline struct openflags of_direct(struct openflags flags) +{ + flags.d = 1; + return(flags); +} + extern int os_stat_file(const char *file_name, struct uml_stat *buf); extern int os_stat_fd(const int fd, struct uml_stat *buf); extern int os_access(const char *file, int mode); Index: test/arch/um/os-Linux/file.c =================================================================== --- test.orig/arch/um/os-Linux/file.c 2005-09-27 11:33:43.000000000 -0400 +++ test/arch/um/os-Linux/file.c 2005-09-27 12:03:15.000000000 -0400 @@ -249,6 +249,7 @@ if(flags.c) f |= O_CREAT; if(flags.t) f |= O_TRUNC; if(flags.e) f |= O_EXCL; + if(flags.d) f |= O_DIRECT; fd = open64(file, f, mode); if(fd < 0)