mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
Merge branch 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull aio iopriority support from Al Viro: "The rest of aio stuff for this cycle - Adam's aio ioprio series" * 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: aio ioprio use ioprio_check_cap ret val fs: aio ioprio add explicit block layer dependence fs: iomap dio set bio prio from kiocb prio fs: blkdev set bio prio from kiocb prio fs: Add aio iopriority support fs: Convert kiocb rw_hint from enum to u16 block: add ioprio_check_cap function
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <linux/delayed_call.h>
|
||||
#include <linux/uuid.h>
|
||||
#include <linux/errseq.h>
|
||||
#include <linux/ioprio.h>
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <uapi/linux/fs.h>
|
||||
@@ -299,7 +300,8 @@ struct kiocb {
|
||||
void (*ki_complete)(struct kiocb *iocb, long ret, long ret2);
|
||||
void *private;
|
||||
int ki_flags;
|
||||
enum rw_hint ki_hint;
|
||||
u16 ki_hint;
|
||||
u16 ki_ioprio; /* See linux/ioprio.h */
|
||||
} __randomize_layout;
|
||||
|
||||
static inline bool is_sync_kiocb(struct kiocb *kiocb)
|
||||
@@ -1934,12 +1936,22 @@ static inline enum rw_hint file_write_hint(struct file *file)
|
||||
|
||||
static inline int iocb_flags(struct file *file);
|
||||
|
||||
static inline u16 ki_hint_validate(enum rw_hint hint)
|
||||
{
|
||||
typeof(((struct kiocb *)0)->ki_hint) max_hint = -1;
|
||||
|
||||
if (hint <= max_hint)
|
||||
return hint;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
|
||||
{
|
||||
*kiocb = (struct kiocb) {
|
||||
.ki_filp = filp,
|
||||
.ki_flags = iocb_flags(filp),
|
||||
.ki_hint = file_write_hint(filp),
|
||||
.ki_hint = ki_hint_validate(file_write_hint(filp)),
|
||||
.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user