Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18933
b: refs/heads/master
c: a374a48
h: refs/heads/master
i:
  18931: 73f2b51
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Jan 19, 2006
1 parent 23488ae commit 9dff115
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 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: 4833aff757b747b51b878a13f3a6e2b1a2abb619
refs/heads/master: a374a48ffbd7d1ffd40d1d30d2751df159a1aca7
31 changes: 17 additions & 14 deletions trunk/arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,15 +1194,16 @@ int open_ubd_file(char *file, struct openflags *openflags,
int fd, err, sectorsize, asked_switch, mode = 0644;

fd = os_open_file(file, *openflags, mode);
if(fd < 0){
if((fd == -ENOENT) && (create_cow_out != NULL))
if (fd < 0) {
if ((fd == -ENOENT) && (create_cow_out != NULL))
*create_cow_out = 1;
if(!openflags->w ||
((fd != -EROFS) && (fd != -EACCES))) return(fd);
if (!openflags->w ||
((fd != -EROFS) && (fd != -EACCES)))
return fd;
openflags->w = 0;
fd = os_open_file(file, *openflags, mode);
if(fd < 0)
return(fd);
if (fd < 0)
return fd;
}

err = os_lock_file(fd, openflags->w);
Expand All @@ -1212,7 +1213,8 @@ int open_ubd_file(char *file, struct openflags *openflags,
}

/* Succesful return case! */
if(backing_file_out == NULL) return(fd);
if(backing_file_out == NULL)
return(fd);

err = read_cow_header(file_reader, &fd, &version, &backing_file, &mtime,
&size, &sectorsize, &align, bitmap_offset_out);
Expand All @@ -1221,7 +1223,8 @@ int open_ubd_file(char *file, struct openflags *openflags,
"errno = %d\n", file, -err);
goto out_close;
}
if(err) return(fd);
if(err)
return(fd);

asked_switch = path_requires_switch(*backing_file_out, backing_file, file);

Expand All @@ -1230,24 +1233,24 @@ int open_ubd_file(char *file, struct openflags *openflags,
printk("Switching backing file to '%s'\n", *backing_file_out);
err = write_cow_header(file, fd, *backing_file_out,
sectorsize, align, &size);
if(err){
if (err) {
printk("Switch failed, errno = %d\n", -err);
goto out_close;
}
}
else {
} else {
*backing_file_out = backing_file;
err = backing_file_mismatch(*backing_file_out, size, mtime);
if(err) goto out_close;
if (err)
goto out_close;
}

cow_sizes(version, size, sectorsize, align, *bitmap_offset_out,
bitmap_len_out, data_offset_out);

return(fd);
return fd;
out_close:
os_close_file(fd);
return(err);
return err;
}

int create_cow_file(char *cow_file, char *backing_file, struct openflags flags,
Expand Down

0 comments on commit 9dff115

Please sign in to comment.