[PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-02-22 Thread Nikolay Borisov
Currently this function handles both the READ and WRITE dio cases. This is facilitated by a bunch of 'if' statements, a goto short-circuit statement and a very perverse aliasing of "!created"(READ) case by setting lockstart = lockend and checking for lockstart < lockend for detecting the write. Let

Re: [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-10 Thread David Sterba
On Thu, Feb 22, 2018 at 06:12:13PM +0200, Nikolay Borisov wrote: > Currently this function handles both the READ and WRITE dio cases. This > is facilitated by a bunch of 'if' statements, a goto short-circuit > statement and a very perverse aliasing of "!created"(READ) case > by setting lockstart =

Re: [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-11 Thread Nikolay Borisov
On 10.04.2018 18:49, David Sterba wrote: > On Thu, Feb 22, 2018 at 06:12:13PM +0200, Nikolay Borisov wrote: >> Currently this function handles both the READ and WRITE dio cases. This >> is facilitated by a bunch of 'if' statements, a goto short-circuit >> statement and a very perverse aliasing of

Re: [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct

2018-04-19 Thread David Sterba
On Wed, Apr 11, 2018 at 10:22:58AM +0300, Nikolay Borisov wrote: > >> + free_extent_map(em); > >> + goto unlock_err; > >> + } > >> + /* > >> + * We need to unlock only the end area that we aren't using > >> + * if there is any