• Miklos Szeredi's avatar
    splice: add helpers for locking pipe inode · 61e0d47c
    Miklos Szeredi authored
    There are lots of sequences like this, especially in splice code:
    
    	if (pipe->inode)
    		mutex_lock(&pipe->inode->i_mutex);
    	/* do something */
    	if (pipe->inode)
    		mutex_unlock(&pipe->inode->i_mutex);
    
    so introduce helpers which do the conditional locking and unlocking.
    Also replace the inode_double_lock() call with a pipe_double_lock()
    helper to avoid spreading the use of this functionality beyond the
    pipe code.
    
    This patch is just a cleanup, and should cause no behavioral changes.
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    61e0d47c
pipe_fs_i.h 5.31 KB