Add system call for setting inode/file write stream ID
authorJens Axboe <axboe@fb.com>
Wed, 2 Mar 2016 20:34:37 +0000 (13:34 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 7 Mar 2016 15:30:49 +0000 (08:30 -0700)
commit1374d75b3a9a797eec5dd76817e532a0d6257472
tree4f22b981d5122d3eda2f19102007161c4d1fa548
parent0c635897e901ae395c9bc4ea1d3cef868c88a235
Add system call for setting inode/file write stream ID

Single system call:

ssize_t streamid(int fd, int cmd, unsigned int flags, int streamid);

where 'fd' is a file descriptor to the file that we want to set the
write stream ID on. 'cmd' is one of the following:

STREAMID_OPEN Open/allocate a new stream ID
STREAMID_CLOSE Close/free a previously allocated stream ID
STREAMID_GET Return the currently assigned stream ID

'flags' is a mask of one or more of the following:

STREAMID_F_INODE Set stream ID on the inode
STREAMID_F_FILE Set stream ID on the file

'streamid' is either 0, which means that streamid() will return the
first available stream ID, or it's set to some integer value between 1
and STREAMID_MAX (both inclusive) to ask for a specific stream ID value.

streamid() returns the allocated stream ID on succes, or -1 and sets
errno appropriately. Possible error values:

-EINVAL cmd/flags isn't valid
-ESPIPE 'fd' refers to a pipe
-EBADF 'fd' isn't valid
-EBUSY 'streamid' is already allocated/assigned

Signed-off-by: Jens Axboe <axboe@fb.com>
fs/read_write.c
include/linux/streamid.h [new file with mode: 0644]
include/uapi/linux/Kbuild