fs: add support for an inode to carry write hint related data
authorJens Axboe <axboe@kernel.dk>
Fri, 16 Jun 2017 17:11:00 +0000 (11:11 -0600)
committerJens Axboe <axboe@fb.com>
Sat, 17 Jun 2017 19:54:14 +0000 (13:54 -0600)
commit8cf10acc243994d6a734f5e22666d1629294292b
tree9b5b15af24535d35f20bd67927ccfdff53076ae0
parentadc311034c356e884d180df25deb046cef3e8c75
fs: add support for an inode to carry write hint related data

No functional changes in this patch, just in preparation for
allowing applications to pass in hints about data life times
for writes. Set aside 3 bits for carrying hint information
in the inode flags.

Adds the public hints as well, which are:

WRITE_LIFE_NONE No hints about write life time
WRITE_LIFE_SHORT Data written has a short life time
WRITE_LIFE_MEDIUM Data written has a medium life time
WRITE_LIFE_LONG Data written has a long life time
WRITE_LIFE_EXTREME Data written has an extremely long life tim

Helpers are defined to store these values in flags, by passing in
the shift that's appropriate for the given use case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/inode.c
include/linux/fs.h
include/uapi/linux/fs.h