Re: [PATCH] fs/open.c: micro-optimization by avoiding branch on common path

2020-09-18 Thread Al Viro
On Sat, Sep 19, 2020 at 02:10:21AM +0200, mateusznos...@gmail.com wrote: > From: Mateusz Nosek > > If file is a directory it is surely not regular. Therefore, if 'S_ISREG' > check returns false one can be sure that vfs_truncate must returns with > error. Introduced patch refactors code to avoid o

[PATCH] fs/open.c: micro-optimization by avoiding branch on common path

2020-09-18 Thread mateusznosek0
From: Mateusz Nosek If file is a directory it is surely not regular. Therefore, if 'S_ISREG' check returns false one can be sure that vfs_truncate must returns with error. Introduced patch refactors code to avoid one branch in 'likely' control flow path. Moreover, it marks the proper check with '