Commit 26c9952a authored by Jeff Dike's avatar Jeff Dike

Updated initializers in the block driver.

Fixed a process exit bug.
parent f234e508
...@@ -56,10 +56,10 @@ static int ubd_revalidate(kdev_t rdev); ...@@ -56,10 +56,10 @@ static int ubd_revalidate(kdev_t rdev);
#define DEVICE_NR(n) (minor(n) >> UBD_SHIFT) #define DEVICE_NR(n) (minor(n) >> UBD_SHIFT)
static struct block_device_operations ubd_blops = { static struct block_device_operations ubd_blops = {
open: ubd_open, .open = ubd_open,
release: ubd_release, .release = ubd_release,
ioctl: ubd_ioctl, .ioctl = ubd_ioctl,
revalidate: ubd_revalidate, .revalidate = ubd_revalidate,
}; };
static request_queue_t *ubd_queue; static request_queue_t *ubd_queue;
...@@ -69,9 +69,9 @@ static struct gendisk *ubd_gendisk[MAX_DEV]; ...@@ -69,9 +69,9 @@ static struct gendisk *ubd_gendisk[MAX_DEV];
static struct gendisk *fake_gendisk[MAX_DEV]; static struct gendisk *fake_gendisk[MAX_DEV];
#ifdef CONFIG_BLK_DEV_UBD_SYNC #ifdef CONFIG_BLK_DEV_UBD_SYNC
#define OPEN_FLAGS ((struct openflags) { r : 1, w : 1, s : 1, c : 0 }) #define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0 })
#else #else
#define OPEN_FLAGS ((struct openflags) { r : 1, w : 1, s : 0, c : 0 }) #define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0 })
#endif #endif
static struct openflags global_openflags = OPEN_FLAGS; static struct openflags global_openflags = OPEN_FLAGS;
...@@ -99,24 +99,24 @@ struct ubd { ...@@ -99,24 +99,24 @@ struct ubd {
}; };
#define DEFAULT_COW { \ #define DEFAULT_COW { \
file: NULL, \ .file = NULL, \
fd: -1, \ .fd = -1, \
bitmap: NULL, \ .bitmap = NULL, \
bitmap_offset: 0, \ .bitmap_offset = 0, \
data_offset: 0, \ .data_offset = 0, \
} }
#define DEFAULT_UBD { \ #define DEFAULT_UBD { \
file: NULL, \ .file = NULL, \
is_dir: 0, \ .is_dir = 0, \
count: 0, \ .count = 0, \
fd: -1, \ .fd = -1, \
size: -1, \ .size = -1, \
boot_openflags: OPEN_FLAGS, \ .boot_openflags = OPEN_FLAGS, \
openflags: OPEN_FLAGS, \ .openflags = OPEN_FLAGS, \
real: NULL, \ .real = NULL, \
fake: NULL, \ .fake = NULL, \
cow: DEFAULT_COW, \ .cow = DEFAULT_COW, \
} }
struct ubd ubd_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD }; struct ubd ubd_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD };
...@@ -131,9 +131,9 @@ static int ubd0_init(void) ...@@ -131,9 +131,9 @@ static int ubd0_init(void)
__initcall(ubd0_init); __initcall(ubd0_init);
static struct hd_driveid ubd_id = { static struct hd_driveid ubd_id = {
cyls: 0, .cyls = 0,
heads: 128, .heads = 128,
sectors: 32, .sectors = 32,
}; };
static int fake_ide = 0; static int fake_ide = 0;
...@@ -199,7 +199,7 @@ static int ubd_setup_common(char *str, int *index_out) ...@@ -199,7 +199,7 @@ static int ubd_setup_common(char *str, int *index_out)
{ {
struct openflags flags = global_openflags; struct openflags flags = global_openflags;
char *backing_file; char *backing_file;
int i, n; int n;
if(index_out) *index_out = -1; if(index_out) *index_out = -1;
n = *str++; n = *str++;
...@@ -886,7 +886,7 @@ static int ubd_ioctl(struct inode * inode, struct file * file, ...@@ -886,7 +886,7 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
static int ubd_revalidate(kdev_t rdev) static int ubd_revalidate(kdev_t rdev)
{ {
__u64 size; __u64 size;
int n, offset, err; int n, err;
struct ubd *dev; struct ubd *dev;
n = minor(rdev) >> UBD_SHIFT; n = minor(rdev) >> UBD_SHIFT;
......
...@@ -234,7 +234,8 @@ void *switch_to(void *prev, void *next, void *last) ...@@ -234,7 +234,8 @@ void *switch_to(void *prev, void *next, void *last)
panic("write of switch_pipe failed, errno = %d", -err); panic("write of switch_pipe failed, errno = %d", -err);
reading = 1; reading = 1;
if(from->state == TASK_ZOMBIE) os_kill_process(os_getpid()); if((from->state == TASK_ZOMBIE) || (from->state == TASK_DEAD))
os_kill_process(os_getpid());
err = user_read(from->thread.switch_pipe[0], &c, sizeof(c)); err = user_read(from->thread.switch_pipe[0], &c, sizeof(c));
if(err != sizeof(c)) if(err != sizeof(c))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment