mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
Move enum rw_hint into a new header file to prepare for using this data type in the block layer. Add the attribute __packed to reduce the space occupied by instances of this data type from four bytes to one byte. Change the data type of i_write_hint from u8 into enum rw_hint. Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Chao Yu <[email protected]> # for the F2FS part Cc: Alexander Viro <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Jan Kara <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
25 lines
702 B
C
25 lines
702 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_RW_HINT_H
|
|
#define _LINUX_RW_HINT_H
|
|
|
|
#include <linux/build_bug.h>
|
|
#include <linux/compiler_attributes.h>
|
|
#include <uapi/linux/fcntl.h>
|
|
|
|
/* Block storage write lifetime hint values. */
|
|
enum rw_hint {
|
|
WRITE_LIFE_NOT_SET = RWH_WRITE_LIFE_NOT_SET,
|
|
WRITE_LIFE_NONE = RWH_WRITE_LIFE_NONE,
|
|
WRITE_LIFE_SHORT = RWH_WRITE_LIFE_SHORT,
|
|
WRITE_LIFE_MEDIUM = RWH_WRITE_LIFE_MEDIUM,
|
|
WRITE_LIFE_LONG = RWH_WRITE_LIFE_LONG,
|
|
WRITE_LIFE_EXTREME = RWH_WRITE_LIFE_EXTREME,
|
|
} __packed;
|
|
|
|
/* Sparse ignores __packed annotations on enums, hence the #ifndef below. */
|
|
#ifndef __CHECKER__
|
|
static_assert(sizeof(enum rw_hint) == 1);
|
|
#endif
|
|
|
|
#endif /* _LINUX_RW_HINT_H */
|