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>
Fri, 16 Jun 2017 17:19:38 +0000 (11:19 -0600)
commit05f3e8cedcbfb91998e1a5316ed5ec3f14c60981
tree61a2806b72df7592b3eb68de1e1045b83e48d0e1
parentab2789b72df3cf7a01e30636ea86cbbf44ba2e99
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