From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753837Ab0E2B7W (ORCPT ); Fri, 28 May 2010 21:59:22 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:60104 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921Ab0E2B7U convert rfc822-to-8bit (ORCPT ); Fri, 28 May 2010 21:59:20 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=QbPXRyPPIHtjs2/HNNHHmJ7/STg1VgztZ/i8geUcOALdzq154r7RMKiQXrgelgV3lF FMGL0N88daYvGizjYQo6zFASiGAYbvMVjp2/9cwnBDJdNyiBiDsLi5ZfryXAYbBjUke8 yD+KFkusxVO+nLKMOLuv84oaLYJ7jOwGAL0Oo= MIME-Version: 1.0 In-Reply-To: References: <1274885054-15698-1-git-send-email-xiaosuo@gmail.com> From: Changli Gao Date: Sat, 29 May 2010 09:59:00 +0800 Message-ID: Subject: Re: [PATCH v2 3/4]: sendfile: remove flags paramter of do_splice_direct() To: Miklos Szeredi Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, matthew@wil.cx, mszeredi@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Eric Dumazet , Steven Rostedt , Frederic Weisbecker , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2010 at 6:06 PM, Changli Gao wrote: > On Fri, May 28, 2010 at 5:40 PM, Miklos Szeredi wrote: >> On Wed, 26 May 2010, Changli Gao wrote: >>> remove flags paramter of do_splice_direct(). >>> >>> the flags parameter of do_splice_direct() doesn't mean non-block read of >>> in file, >> >> Actually, it does.  Look at the SPLICE_F_NONBLOCK usage in >> __generic_splice_file_read(). >> > > Oh, I checked the code again. You're right. However, why don't we > check the flags of in file instead in __generic_file_splice_read()? > I am afraid that __generic_file_splice_read() should not use SPLICE_F_NONBLOCK. Here is the comment from the commit 42324c62704365d6a3e89138dea55909d2f26afe : <flags & SPLICE_F_NONBLOCK) { fs/splice.c: if (flags & SPLICE_F_NONBLOCK) { fs/splice.c: if (sd->flags & SPLICE_F_NONBLOCK) fs/splice.c: if (flags & SPLICE_F_NONBLOCK) { fs/splice.c: if (flags & SPLICE_F_NONBLOCK) { fs/splice.c: if (flags & SPLICE_F_NONBLOCK) { fs/splice.c: if (!ret && ipipe->waiting_writers && (flags & SPLICE_F_NONBLOCK)) fs/splice.c: * applicable one is SPLICE_F_NONBLOCK. include/linux/splice.h:#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ kernel/relay.c: if (flags & SPLICE_F_NONBLOCK) kernel/trace/trace.c: if (flags & SPLICE_F_NONBLOCK) besides the __generic_file_splice_read(), there are two users: relay and trace. I believe they all misuse this flag. -- Regards, Changli Gao(xiaosuo@gmail.com)