From nobody Wed Dec 17 10:48:05 2025 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30B6B86352 for ; Wed, 19 Mar 2025 00:15:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742343342; cv=none; b=MK8arH4tuyVFiJRT8ghKrGm+0gzurrf1+Ld4gQ0Qv2gab/hNIuTn2yWmJxtwsGgOzy/4dc552o5lZoz7Hv062obL62HEhcLvFJvDk8YDHLS+XPPvCaSfW8wHXBSpdTDyiSlZNDbVQqUQKEDzYQdbCnssjCmK5b6hz3gbcCkVH2g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742343342; c=relaxed/simple; bh=zDwqRePv1ZFUDi9FjMPQDVKfJ1n1RRe7hhmBOVzyCME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EzcWg8nyIcqtQDUlAH43sHg7WMEpNHXYSA3as7yVV+V18OLR3E9p2hd7OoQ5jRIii3rbORFJrnggcyJRzJb9gd+HlB9vG/RY+X34CJRKujUv6r1w2QHIGmASe5XAEQXNUt2C2VscbWKf8QDIgjsNTTYqRORT9AtiQ5JVus/nPHs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=gMn0Gk81; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="gMn0Gk81" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2f9d3d0f55dso7213669a91.1 for ; Tue, 18 Mar 2025 17:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1742343339; x=1742948139; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jx2MMZGi/yQrztop394w65c9xYaCiVDt+AK5Yt9ywsM=; b=gMn0Gk81p6q/vZ4LGycCtV8PrWqmKL2X2+1X7JUYuAk7MxmnWIJuOfblGJYKzH1qHS NHGtmlgyX/4nIO0x+NDViqz93DL2F52q8hztCpCwajF3yIzTdhN8LJJc8uSXOkRRSbyx r8JDzvsMP8tNb3e/DiHLdTjOx59RF5ciEg/mU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742343339; x=1742948139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jx2MMZGi/yQrztop394w65c9xYaCiVDt+AK5Yt9ywsM=; b=cwMwf/4qS00JMaNhA1KTwJis+hpD/4UPnDD6MBfNUQfADlfds8ZyEi7XrwK3hVP1+S ZnpuX3AYCh2OV+uWCobUVWX3xbzXiNNAWf6D3hFYZPv6i9jMjc+DNGY+VQUzdQUOULqk YA56+Myr2ardSr5c2tgQmFJT4n7p1Lg/DvLzAJLNxdCoKTYCG0OisxT/lgLKBEqUGqT/ niZRDswMN8a1dJyEx41YjJZz++wBi267fmjhBS2ulMAg39QdXJJ+WjSn8+wdlX4Oq+yy Yr0b82wzO6AABGJLO3XQBJlAbx4Zk5r4wXtKBqU5ff77hmpL8ZhKsZhKXWR/+Q7JNL3P L82Q== X-Gm-Message-State: AOJu0YwGLlFnnb/c9qpgnOWDLAZeJY+hLcrDKrHmbffneXaLJLCquAWn 6eNxmyfEmqdWEaRusb8Shm0nw/IC3HUA2YqZFLOhYyQidMi3kw6fBDtYUEOKarTEHt09+yuGIWX 1 X-Gm-Gg: ASbGncsiW7YxJdKxxTMY9TQir6Mj+YNI9+U/NKafOosRIkQbcP8FECMiPSmE9T1BTub WhucZYThTceUnWISoEXOfiGIdzWw/PhQ3FEW7lff4UZRwHOt3EfVV0dN6R365CQC5bTaWm0lhP8 xTRb6d3PlRKIAF0IqOoXv+cT10gFZHyJwqFIErWsllEPVE//i/40zdbFwLfL28snJjhGc1O08uy EVmqrlJrGiBetqfir3b8Y9Eg4DeJuIxbWD3A9upDe4H7DhDYWmfReoXSQt/684g4dLgPdfkEQOB wsxynUOiopc5Pb5jFANryCZS0ehKX2JbOqV44qQ6E999Nyd5+cVUXr9FoDp/tRg= X-Google-Smtp-Source: AGHT+IEnc6PYsekT6MewbYE2xz5zbksEbwPRypdKB1fVzKJg+O8NyDF3d1M1ZZ7rEg687HtSnDkx0Q== X-Received: by 2002:a17:90b:2f44:b0:2ff:5357:1c7f with SMTP id 98e67ed59e1d1-301be204e8dmr956493a91.30.1742343339529; Tue, 18 Mar 2025 17:15:39 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-225c68a4876sm101281375ad.70.2025.03.18.17.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Mar 2025 17:15:39 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, asml.silence@gmail.com, linux-fsdevel@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, horms@kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, kuba@kernel.org, shuah@kernel.org, sdf@fomichev.me, mingo@redhat.com, arnd@arndb.de, brauner@kernel.org, akpm@linux-foundation.org, tglx@linutronix.de, jolsa@kernel.org, linux-kselftest@vger.kernel.org, Joe Damato Subject: [RFC -next 02/10] splice: Add helper that passes through splice_desc Date: Wed, 19 Mar 2025 00:15:13 +0000 Message-ID: <20250319001521.53249-3-jdamato@fastly.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319001521.53249-1-jdamato@fastly.com> References: <20250319001521.53249-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add do_splice_from_sd which takes splice_desc as an argument. This helper is just a wrapper around splice_write but will be extended. Use the helper from existing splice code. Signed-off-by: Joe Damato --- fs/splice.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index 2898fa1e9e63..9575074a1296 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -941,6 +941,15 @@ static ssize_t do_splice_from(struct pipe_inode_info *= pipe, struct file *out, return out->f_op->splice_write(pipe, out, ppos, len, flags); } =20 +static ssize_t do_splice_from_sd(struct pipe_inode_info *pipe, struct file= *out, + struct splice_desc *sd) +{ + if (unlikely(!out->f_op->splice_write)) + return warn_unsupported(out, "write"); + return out->f_op->splice_write(pipe, out, sd->opos, sd->total_len, + sd->flags); +} + /* * Indicate to the caller that there was a premature EOF when reading from= the * source and the caller didn't indicate they would be sending more data a= fter @@ -1161,7 +1170,7 @@ static int direct_splice_actor(struct pipe_inode_info= *pipe, long ret; =20 file_start_write(file); - ret =3D do_splice_from(pipe, file, sd->opos, sd->total_len, sd->flags); + ret =3D do_splice_from_sd(pipe, file, sd); file_end_write(file); return ret; } @@ -1171,7 +1180,7 @@ static int splice_file_range_actor(struct pipe_inode_= info *pipe, { struct file *file =3D sd->u.file; =20 - return do_splice_from(pipe, file, sd->opos, sd->total_len, sd->flags); + return do_splice_from_sd(pipe, file, sd); } =20 static void direct_file_splice_eof(struct splice_desc *sd) --=20 2.43.0