From patchwork Sat Nov 9 00:12:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joanne Koong X-Patchwork-Id: 13869102 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (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 56B8E8836 for ; Sat, 9 Nov 2024 00:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731111232; cv=none; b=O5kmSAeC0ijLdDO/Yvq8ri8xLyNDJmhza5yf90Kui4EvW3IDAD+QtHqm96Wjeq0Rgd/qDCLbw82/rFrKzJq3/bhuLwJXvySP86rQzOGvV76D/MGkYH+/Eq/utoQuNeiNXIg1q5ruoiTacqv5ps3M1cB1Uze9Ken5L9d5V5FN20M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731111232; c=relaxed/simple; bh=EfvJz6dAtZPmu+joMXDpM3F6Jmc3RbJ0pN7c68vk1tM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B8t+VP+VrRzg8ZNeAh7Ey8O9j7HfOeX3d915VphobAH2fMBs4EXRtBOpWOHXQGsEZX7GyxPALQSe2hYf6iGYgNgPryZl6+fxRrODLgN9rG8+durwdDLlZfc1LC13x3IVgMNVV7lpO34ki4GPRjJFumATd5p4q6YyLJfTfppWlBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Iws2+8w5; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Iws2+8w5" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-6ea7c26e195so30809657b3.0 for ; Fri, 08 Nov 2024 16:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731111230; x=1731716030; 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=yuvUotWx8eISAi8drzhpx6GLm3Zs1eFnPNa5j8GNQb8=; b=Iws2+8w5nC8XczhvUVdK+O+n1SvTh6u76KT3Vjhz6MrP5vTrvGc6v2Bygxk/Fp/7Mx ojlx6qTxY2jwaVH0YL11ZRBubYQogyjx+m0E9KwTQ1HgEx0SQcflh3mbmJxz6ISI1r6U /V/7IKO0Sj/Z3+Wr719NrU+sMsqHmR5TCjW5bsHIeOJxAque4lAAUy2P3CiKk+gzS6Ci gjgYDa98ToJxH+fQC9QuNya6hRRELUwt+SjB0bwpSyCtrvWQZulza+aRj3a8UBKuN5hC lM8TDORHUPZuzVuOTk4o2hhh+aSSCn3vowVD6Z/VN91Q7Vg9MZU+6WMskvWMisE1hLs/ tocQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731111230; x=1731716030; 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=yuvUotWx8eISAi8drzhpx6GLm3Zs1eFnPNa5j8GNQb8=; b=AZhUR+XwsPDdHhuzX5UHRKa6BqEyWvkiYqNcAd3Pc6UJlvzsrGHpc4eMQ/65X5U0qc Kn/8y1zdcnJrwkQYAT3gcNxtcvLhWtEihauqfWvSvfHaWeteTNfmB/f7tGL98CEpLQJH gT2UvT+y1L/3unXaG3YcpdMT2NFyatM2TlWDlbsNbr2mT3yjRud99oY2cfW0U/5klz3e DOAnRdQAhBmwLdrNfU0ye1vQ1+f01dsvlIiLRbtIdZcaltizWyuoZeBl5oj3LjXwTm5h 3atUc1FIOSIVylPDLN18l6r+DqWAOhf8QiWctlf6TLCH8O52wMvHHyP6P0tmLqiGDJpt PMbA== X-Forwarded-Encrypted: i=1; AJvYcCV76s8KfxbAt6hiknk7P8mS7pffTylAjuVY8Uc76OyYO41A4OE7PeJykiAsaITWBiVfEqEHmlj9Vnn5A0VL@vger.kernel.org X-Gm-Message-State: AOJu0Yzfoq3RSYZQDbqa620RP5HuOxKR9i05Irz+utjVBaDRf1PvSrYd tKNtrSEZjSq0ca3hFHu5eLuVVcN/sed+UzFT3YukVDo1qVw8KBTR X-Google-Smtp-Source: AGHT+IFlcpc0RTuF8gHufS9jIfzQrmIZwZmuEVr4kHl8oFTWESceAkpLUHK9N9e74WhMUWmbtXeA4g== X-Received: by 2002:a0d:c304:0:b0:6ea:ef9d:fcba with SMTP id 00721157ae682-6eaef9dfe5cmr9885037b3.6.1731111230352; Fri, 08 Nov 2024 16:13:50 -0800 (PST) Received: from localhost (fwdproxy-nha-114.fbsv.net. [2a03:2880:25ff:72::face:b00c]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6eace8ef3ebsm9417777b3.34.2024.11.08.16.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 16:13:50 -0800 (PST) From: Joanne Koong To: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org Cc: josef@toxicpanda.com, bernd.schubert@fastmail.fm, jefflexu@linux.alibaba.com, willy@infradead.org, shakeel.butt@linux.dev, kernel-team@meta.com Subject: [PATCH 08/12] fuse: support large folios for queued writes Date: Fri, 8 Nov 2024 16:12:54 -0800 Message-ID: <20241109001258.2216604-9-joannelkoong@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241109001258.2216604-1-joannelkoong@gmail.com> References: <20241109001258.2216604-1-joannelkoong@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for folios larger than one page size for queued writes. Signed-off-by: Joanne Koong --- fs/fuse/file.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 399bc8898cc4..44a65bdfe8fb 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1793,11 +1793,14 @@ __releases(fi->lock) __acquires(fi->lock) { struct fuse_inode *fi = get_fuse_inode(wpa->inode); + struct fuse_args_pages *ap = &wpa->ia.ap; struct fuse_write_in *inarg = &wpa->ia.write.in; - struct fuse_args *args = &wpa->ia.ap.args; - /* Currently, all folios in FUSE are one page */ - __u64 data_size = wpa->ia.ap.num_folios * PAGE_SIZE; - int err; + struct fuse_args *args = &ap->args; + __u64 data_size = 0; + int err, i; + + for (i = 0; i < ap->num_folios; i++) + data_size += ap->descs[i].length; fi->writectr++; if (inarg->offset + data_size <= size) {