fs: Simplify new position calculation in lseek()
All these checks are really testing is that resulting position is
within [0; f->size] interval. Convert all of the custom checks into a
signle one done after the switch statement to simplify the code.

Note this change also disables the validity check for f->size ==
FILE_SIZE_STREAM and whence == SEEK_END, but lseek(stream_fd, offset,
SEEK_END) wasn't a meaningful operation to begin with, so this
shouldn't be a problem.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 71cd983 commit d7c2384940bbeff6529e42d81a7f314c69833654
@Andrey Smirnov Andrey Smirnov authored on 29 Jan 2019
Sascha Hauer committed on 4 Feb 2019
Showing 1 changed file
View
fs/fs.c