From: blaisorblade_spam@yahoo.it
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, jdike@addtoit.com,
user-mode-linux-devel@lists.sourceforge.net,
blaisorblade_spam@yahoo.it
Subject: [patch 08/11] uml: fix and cleanup code in ubd_kern.c coming from ubd_user.c
Date: Thu, 13 Jan 2005 22:01:06 +0100 [thread overview]
Message-ID: <20050113210106.38C071FEF6@zion> (raw)
* Fix the use of errno: it refers to the __errno_location glibc definition
when in ubd_user.c, and hence works; but in ubd_kern.c it refers to
kernel_errno, which is different. So use the return value of os_* functions,
as we should always have done.
* Remove {read,write}_ubd_fs(), which are just silly.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---
linux-2.6.11-paolo/arch/um/drivers/ubd_kern.c | 21 ++++-----------------
1 files changed, 4 insertions(+), 17 deletions(-)
diff -puN arch/um/drivers/ubd_kern.c~uml-start-fixing-ubd arch/um/drivers/ubd_kern.c
--- linux-2.6.11/arch/um/drivers/ubd_kern.c~uml-start-fixing-ubd 2005-01-13 05:53:42.073259584 +0100
+++ linux-2.6.11-paolo/arch/um/drivers/ubd_kern.c 2005-01-13 05:53:42.076259128 +0100
@@ -83,8 +83,6 @@ extern int create_cow_file(char *cow_fil
unsigned long *bitmap_len_out,
int *data_offset_out);
extern int read_cow_bitmap(int fd, void *buf, int offset, int len);
-extern int read_ubd_fs(int fd, void *buffer, int len);
-extern int write_ubd_fs(int fd, char *buffer, int len);
extern void do_io(struct io_thread_req *req);
static inline int ubd_test_bit(__u64 bit, unsigned char *data)
@@ -323,7 +321,7 @@ static int ubd_setup_common(char *str, i
}
if(!strcmp(str, "sync")){
- global_openflags.s = 1;
+ global_openflags = of_sync(global_openflags);
return(0);
}
major = simple_strtoul(str, &end, 0);
@@ -513,7 +511,7 @@ static void ubd_handler(void)
do_ubd = NULL;
intr_count++;
- n = read_ubd_fs(thread_fd, &req, sizeof(req));
+ n = os_read_file(thread_fd, &req, sizeof(req));
if(n != sizeof(req)){
printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, "
"err = %d\n", os_getpid(), -n);
@@ -1155,7 +1153,7 @@ static void do_ubd_request(request_queue
err = prepare_request(req, &io_req);
if(!err){
do_ubd = ubd_handler;
- n = write_ubd_fs(thread_fd, (char *) &io_req,
+ n = os_write_file(thread_fd, (char *) &io_req,
sizeof(io_req));
if(n != sizeof(io_req))
printk("write to io thread failed, "
@@ -1436,7 +1434,7 @@ int open_ubd_file(char *file, struct ope
if((fd == -ENOENT) && (create_cow_out != NULL))
*create_cow_out = 1;
if(!openflags->w ||
- ((errno != EROFS) && (errno != EACCES))) return(-errno);
+ ((fd != -EROFS) && (fd != -EACCES))) return(fd);
openflags->w = 0;
fd = os_open_file(file, *openflags, mode);
if(fd < 0)
@@ -1513,17 +1511,6 @@ int create_cow_file(char *cow_file, char
return(err);
}
-/* XXX Just trivial wrappers around os_read_file and os_write_file */
-int read_ubd_fs(int fd, void *buffer, int len)
-{
- return(os_read_file(fd, buffer, len));
-}
-
-int write_ubd_fs(int fd, char *buffer, int len)
-{
- return(os_write_file(fd, buffer, len));
-}
-
static int update_bitmap(struct io_thread_req *req)
{
int n;
_
reply other threads:[~2005-01-13 22:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050113210106.38C071FEF6@zion \
--to=blaisorblade_spam@yahoo.it \
--cc=akpm@osdl.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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®