diff mbox series

[5/7] aio: Fix fallback I/O priority value

Message ID 20181119035131.11255-6-damien.lemoal@wdc.com (mailing list archive)
State New, archived
Headers show
Series Improve I/O priority handling | expand

Commit Message

Damien Le Moal Nov. 19, 2018, 3:51 a.m. UTC
For cases when the application does not specify aio_reqprio for an aio,
fallback to use get_current_ioprio() to obtain the task I/O priority
last set using ioprio_set() rather than the hardcoded IOPRIO_CLASS_NONE
value.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Nov. 19, 2018, 8:18 a.m. UTC | #1
On Mon, Nov 19, 2018 at 12:51:29PM +0900, Damien Le Moal wrote:
> For cases when the application does not specify aio_reqprio for an aio,
> fallback to use get_current_ioprio() to obtain the task I/O priority
> last set using ioprio_set() rather than the hardcoded IOPRIO_CLASS_NONE
> value.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Johannes Thumshirn Nov. 19, 2018, 8:27 a.m. UTC | #2
Looks good,
Reiewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Adam Manzanares Nov. 19, 2018, 7:08 p.m. UTC | #3
On Mon, 2018-11-19 at 12:51 +0900, Damien Le Moal wrote:
> For cases when the application does not specify aio_reqprio for an
> aio,
> fallback to use get_current_ioprio() to obtain the task I/O priority
> last set using ioprio_set() rather than the hardcoded
> IOPRIO_CLASS_NONE
> value.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Looks good,

Reviewed-by: Adam Manzanares <adam.manzanares@wdc.com>

> ---
>  fs/aio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/aio.c b/fs/aio.c
> index 301e6314183b..b984918be4b7 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -1441,7 +1441,7 @@ static int aio_prep_rw(struct kiocb *req,
> struct iocb *iocb)
>  
>  		req->ki_ioprio = iocb->aio_reqprio;
>  	} else
> -		req->ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE,
> 0);
> +		req->ki_ioprio = get_current_ioprio();
>  
>  	ret = kiocb_set_rw_flags(req, iocb->aio_rw_flags);
>  	if (unlikely(ret))
diff mbox series

Patch

diff --git a/fs/aio.c b/fs/aio.c
index 301e6314183b..b984918be4b7 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1441,7 +1441,7 @@  static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
 
 		req->ki_ioprio = iocb->aio_reqprio;
 	} else
-		req->ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
+		req->ki_ioprio = get_current_ioprio();
 
 	ret = kiocb_set_rw_flags(req, iocb->aio_rw_flags);
 	if (unlikely(ret))