From: David van Moolenbroek Date: Mon, 29 Sep 2014 15:11:01 +0000 (+0000) Subject: IOCTL requests are unsigned longs now X-Git-Url: http://zhaoyanbai.com/repos/%22http:/static/doc/zpipe.c?a=commitdiff_plain;h=63ce03db6646a88deff65bad27b873bbfe71a4e1;p=minix.git IOCTL requests are unsigned longs now Issue reported by JD Begin. Change-Id: I0306d9dc43c36107897c8b73ed340d86a8dcef27 --- diff --git a/minix/drivers/storage/fbd/rule.c b/minix/drivers/storage/fbd/rule.c index 2eb12ae51..a4a258bf5 100644 --- a/minix/drivers/storage/fbd/rule.c +++ b/minix/drivers/storage/fbd/rule.c @@ -12,7 +12,7 @@ static int nr_matches; /*===========================================================================* * rule_ctl * *===========================================================================*/ -int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) +int rule_ctl(unsigned long request, endpoint_t endpt, cp_grant_id_t grant) { /* Handle an I/O control request regarding rules. */ fbd_rulenum_t i; diff --git a/minix/drivers/storage/fbd/rule.h b/minix/drivers/storage/fbd/rule.h index bf3e6dfc6..1f081c15b 100644 --- a/minix/drivers/storage/fbd/rule.h +++ b/minix/drivers/storage/fbd/rule.h @@ -3,7 +3,8 @@ #define MAX_RULES 16 -extern int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant); +extern int rule_ctl(unsigned long request, endpoint_t endpt, + cp_grant_id_t grant); extern int rule_find(u64_t pos, size_t size, int flag); diff --git a/minix/include/minix/bdev.h b/minix/include/minix/bdev.h index 0aca2887a..7446e5509 100644 --- a/minix/include/minix/bdev.h +++ b/minix/include/minix/bdev.h @@ -16,7 +16,7 @@ extern ssize_t bdev_gather(dev_t dev, u64_t pos, iovec_t *vec, int count, int flags); extern ssize_t bdev_scatter(dev_t dev, u64_t pos, iovec_t *vec, int count, int flags); -extern int bdev_ioctl(dev_t dev, int request, void *buf, +extern int bdev_ioctl(dev_t dev, unsigned long request, void *buf, endpoint_t user_endpt); /* Asynchronous API. */ @@ -36,7 +36,7 @@ extern bdev_id_t bdev_gather_asyn(dev_t dev, u64_t pos, iovec_t *vec, int count, int flags, bdev_callback_t callback, bdev_param_t param); extern bdev_id_t bdev_scatter_asyn(dev_t dev, u64_t pos, iovec_t *vec, int count, int flags, bdev_callback_t callback, bdev_param_t param); -extern bdev_id_t bdev_ioctl_asyn(dev_t dev, int request, void *buf, +extern bdev_id_t bdev_ioctl_asyn(dev_t dev, unsigned long request, void *buf, endpoint_t user_endpt, bdev_callback_t callback, bdev_param_t param); extern int bdev_wait_asyn(bdev_id_t id); diff --git a/minix/include/minix/ipc.h b/minix/include/minix/ipc.h index 622c40daf..fa8221d5d 100644 --- a/minix/include/minix/ipc.h +++ b/minix/include/minix/ipc.h @@ -345,7 +345,7 @@ typedef struct { int flags; endpoint_t user; - int request; + unsigned long request; uint8_t padding[16]; } mess_lbdev_lblockdriver_msg; @@ -1958,7 +1958,7 @@ typedef struct { off_t pos; cp_grant_id_t grant; size_t count; - int request; + unsigned long request; int flags; endpoint_t id; endpoint_t user; diff --git a/minix/lib/libbdev/bdev.c b/minix/lib/libbdev/bdev.c index 61f1fdfe2..0a5e51304 100644 --- a/minix/lib/libbdev/bdev.c +++ b/minix/lib/libbdev/bdev.c @@ -303,7 +303,7 @@ ssize_t bdev_scatter(dev_t dev, u64_t pos, iovec_t *vec, int count, int flags) return bdev_vrdwt(BDEV_SCATTER, dev, pos, vec, count, flags); } -static int bdev_ioctl_setup(dev_t dev, int request, void *buf, +static int bdev_ioctl_setup(dev_t dev, unsigned long request, void *buf, endpoint_t user_endpt, message *m) { /* Set up an I/O control request. @@ -351,7 +351,8 @@ static void bdev_ioctl_cleanup(const message *m) cpf_revoke(m->m_lbdev_lblockdriver_msg.grant); } -int bdev_ioctl(dev_t dev, int request, void *buf, endpoint_t user_endpt) +int bdev_ioctl(dev_t dev, unsigned long request, void *buf, + endpoint_t user_endpt) { /* Perform a synchronous I/O control request. */ @@ -495,7 +496,7 @@ bdev_id_t bdev_scatter_asyn(dev_t dev, u64_t pos, iovec_t *vec, int count, param); } -bdev_id_t bdev_ioctl_asyn(dev_t dev, int request, void *buf, +bdev_id_t bdev_ioctl_asyn(dev_t dev, unsigned long request, void *buf, endpoint_t user_endpt, bdev_callback_t callback, bdev_param_t param) { /* Perform an asynchronous I/O control request. diff --git a/minix/tests/blocktest/blocktest.c b/minix/tests/blocktest/blocktest.c index 60ec18fe8..986a4ee77 100644 --- a/minix/tests/blocktest/blocktest.c +++ b/minix/tests/blocktest/blocktest.c @@ -1152,7 +1152,7 @@ static void close_device(dev_t minor) "closing a subpartition"); } -static int vir_ioctl(dev_t minor, int req, void *ptr, ssize_t exp, +static int vir_ioctl(dev_t minor, unsigned long req, void *ptr, ssize_t exp, result_t *res) { /* Perform an I/O control request, using a local buffer.