• M
    splice: add helpers for locking pipe inode · 61e0d47c
    Miklos Szeredi 提交于
    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: NMiklos Szeredi <mszeredi@suse.cz>
    Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
    61e0d47c
splice.c 39.6 KB