Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273068
b: refs/heads/master
c: 8535639
h: refs/heads/master
v: v3
  • Loading branch information
Richard Weinberger committed Nov 2, 2011
1 parent c2e62e8 commit f5ee009
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d65ede0a605d6252acc5c8a9c536c4cd0211f3c
refs/heads/master: 8535639810e578960233ad39def3ac2157b0c3ec
31 changes: 30 additions & 1 deletion trunk/arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,37 @@ __uml_exitcall(kill_io_thread);
static inline int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out)
{
char *file;
int fd;
int err;

__u32 version;
__u32 align;
char *backing_file;
time_t mtime;
unsigned long long size;
int sector_size;
int bitmap_offset;

if (ubd_dev->file && ubd_dev->cow.file) {
file = ubd_dev->cow.file;

goto out;
}

file = ubd_dev->cow.file ? ubd_dev->cow.file : ubd_dev->file;
fd = os_open_file(ubd_dev->file, global_openflags, 0);
if (fd < 0)
return fd;

err = read_cow_header(file_reader, &fd, &version, &backing_file, \
&mtime, &size, &sector_size, &align, &bitmap_offset);
os_close_file(fd);

if(err == -EINVAL)
file = ubd_dev->file;
else
file = backing_file;

out:
return os_file_size(file, size_out);
}

Expand Down

0 comments on commit f5ee009

Please sign in to comment.