Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp820116lqh; Thu, 28 Mar 2024 18:55:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyIqjwF6Abz71gjnO/Uj/XQqkOV6tAVkzKzmXdjUlKdK0/Hp7OAh4fkhS6f7MynTpDWScakeYMEq9mMG3S6NGPAEhe1zHPDpot/2Xr0w== X-Google-Smtp-Source: AGHT+IFiRqpUDGITLxLyhP/XRMNVsA6Nyn7C9yxU43/N7jSv9C7sGe0Sg6rmyK1NA4vXEQ0EtDup X-Received: by 2002:a17:906:cb9a:b0:a49:452d:e722 with SMTP id mf26-20020a170906cb9a00b00a49452de722mr620211ejb.29.1711677324776; Thu, 28 Mar 2024 18:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711677324; cv=pass; d=google.com; s=arc-20160816; b=kRHCfSHyPScgpFie8HX2IkgZuo8WxM6xg4/hmXiN3yXK8hD5HbzEQIj+1OsvP/5TKa 05veZ19m8ikWagA6aZocfNtrnKw/nEdaFNoluO15UNpJpShsDRxIriNQCztUpZnae02S waaTEDjWZ5ofd/IAgHbjB7BTeqdYErZt0fz65wYJ5l0B8JDLsFAPXXUpUNSI6s39YS5y KDvHaJXTDILM/0O09L+iJvJ6/I3QoLRso76/dPNDRb8+dfE+IqT3mVT9dE5sahi+ix1h lqU4cu73wY39KLf0yrvLirJ/FW7S2BdfgHe3mDdYH3tEPjAMqINFRfPbh+WjeDppZEUL Hx8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=1TWHZ6CjfZzMP0P6lR3s6R//pEvlviDj7MeL1JlKB90=; fh=UE2Yk6Xk02Rdpvy2VLKsHZPFmuQVFPYVNxl5QRdPq0s=; b=VibaVXRpMadVZt0Kt67RLZyxIyDmtWIuViGh38I/aDKwYVoYqhFEL1zwAm7HjhdIf+ 2rpqatPWfx9cLc5Yt1hvLzRYWW9jTDmnO05i3Q+Yi9h6bKLigwfS4ld3jeqcf5fxoSGl SKnQV3fnbxPEbn98+nuTGkirk+plLnYjSoD29Dx3d2s4vtWyRLP8/ShYfvnDjYq+r++e 6SNG/fid45pW87/rGbqi3cvNJYOx8Gc25pImQ10HdGMovyu49U+0lVW7k9sNRYWjbsLf m9/Xg7fpQaq/HZaodCOfEuEp1NxxUM/JoRcgfoEYpXe1ifqPQKPv6SuhqJAX6bkEb/0C qflw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ohkuFqn0; arc=pass (i=1 spf=pass spfdomain=flex--drosen.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v21-20020a1709062f1500b00a4a20e9773asi1214473eji.763.2024.03.28.18.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 18:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ohkuFqn0; arc=pass (i=1 spf=pass spfdomain=flex--drosen.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 50BB01F235AD for ; Fri, 29 Mar 2024 01:55:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EF9233CC4; Fri, 29 Mar 2024 01:54:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ohkuFqn0" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 81C4E2C683 for ; Fri, 29 Mar 2024 01:54:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711677249; cv=none; b=E6uWhCe+2m1cAavk/89m67emWR6oUqcbLhAokkvmrFsRFBJjbMoimdW3McNVejjyACM0t6dHlYBja4zrNIxt71GxDLAmmkI3HsqqdSdljIvEmabWjh7YyVV1lZBW3XunBVhEl8W8mApZ83kgv2Keb/qA83EQUAKP+G92cacOPKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711677249; c=relaxed/simple; bh=WHF1cQ6wftLpEUkLh/arn81XtKeZBIuOooiwZcqzz24=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=l2Wg4Nr1FSEQQBeJ/dPVZqy07SvnPS3bNyjTgCluKgsiljrgFeYJfRHqHNjysfxRrtvxKYrHC3BWdBhFVupaDnXDR9+DI+T0iNFk1D0mrxK9X19OZ/woqRhb9t26ZZjqVWXWs7g+ZWexk4bxt9OKyUPEMSDyJ7kddY9GXfgwm3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--drosen.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ohkuFqn0; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--drosen.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dcbfe1a42a4so2835172276.2 for ; Thu, 28 Mar 2024 18:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711677246; x=1712282046; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1TWHZ6CjfZzMP0P6lR3s6R//pEvlviDj7MeL1JlKB90=; b=ohkuFqn0UVk+BjOZ6e/RSq+48ILEeFYpINfxRwudlqaBWyFbnkpPawUTBv2CuqMfD1 nKkruG6I9j8NGgSA9NVtg7HFFnTUqmFC29sod1XHXTCBRYdW3S2Ir/T+QbLZT3239gae E3pKZvFzV7WBF8aL/cfmUln6QiwAysATkK9SOwcL7Y/LT4r3vpzE+dtbvj3ImOHvxzcO p5GdAoDK2j2Pj/oOVRZ4bHmUl77HwudnBv7cMP6VYmH3vegQkSeCFVq3Buqg+0w5BDAN bBklfy6rYVEQEw1nKMN8V3/ButYEI+bfHgut2Ye4IsUsZ1OlhTZKMBSPur38HYhTtAv9 vutA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711677246; x=1712282046; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1TWHZ6CjfZzMP0P6lR3s6R//pEvlviDj7MeL1JlKB90=; b=Vc1J6D3pqo4jPRzTn37DE4yot6VakLJNMWFSYsYBdl1Hl2E6EvL2EM2yJXiZg0Ozmp TtHtb247lvRkddfsJqSf5TW+ye51c2HUjJ2mpiQtUY10IbicQJuiZiSSON3hwTZTtxh8 aGpi10FcaGmGobSIVrh0m6ux/FqTqUfJOnvrpZp8DQf3vKbIiSVXIckdMOG3neECCKE5 IIux1dirXh75qHmGLU55EYGAIU1iqp/2lQHikGug6Kxn+uC7RDGyV3pB2YWm+EwikerO 8E1NuBbBQ3tikyY2PFfOiJWx7f4fQdMzlHYPWOUiCwAFIu1PWtW8bxoBik5x5jvWXLmR CPqA== X-Forwarded-Encrypted: i=1; AJvYcCWRKjtw48x6Y8nidd3WK2sL0/U6UEI09jPQoe21zbeU7iTVxoiAEq1K0QSBMpQw78fDcyUp6zbS6zuM7QG56opljNUA8AE+JNtLaUFB X-Gm-Message-State: AOJu0YyOI0KogZKy1SZ/rUjZ67pqc7az6zVmS8yDH3Y534M+fdhhLJvK lFuNKQJ/oEknL5Pr66YMmmkXmYlIgGLKZEL+j4y8lTHZD1IcIW06ns6Tg1EDJyunxpARgyeKPR3 TEA== X-Received: from drosen.mtv.corp.google.com ([2620:15c:211:201:fcce:d6ab:804c:b94b]) (user=drosen job=sendgmr) by 2002:a05:6902:72c:b0:dc2:3441:897f with SMTP id l12-20020a056902072c00b00dc23441897fmr300435ybt.6.1711677246590; Thu, 28 Mar 2024 18:54:06 -0700 (PDT) Date: Thu, 28 Mar 2024 18:53:18 -0700 In-Reply-To: <20240329015351.624249-1-drosen@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240329015351.624249-1-drosen@google.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240329015351.624249-4-drosen@google.com> Subject: [RFC PATCH v4 03/36] fuse-bpf: Prepare for fuse-bpf patch From: Daniel Rosenberg To: Miklos Szeredi , bpf@vger.kernel.org, Alexei Starovoitov Cc: Amir Goldstein , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Eduard Zingerman , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Jonathan Corbet , Joanne Koong , Mykola Lysenko , Christian Brauner , kernel-team@android.com, Daniel Rosenberg , Paul Lawrence Content-Type: text/plain; charset="UTF-8" This moves some functions and structs around to make the following patch easier to read. Signed-off-by: Daniel Rosenberg Signed-off-by: Paul Lawrence --- fs/fuse/dir.c | 4 ---- fs/fuse/fuse_i.h | 8 ++++++++ fs/fuse/inode.c | 52 ++++++++++++++++++++++++------------------------ 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index d19cbf34c634..cd8d6b2f6d78 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -46,10 +46,6 @@ static inline u64 fuse_dentry_time(const struct dentry *entry) } #else -union fuse_dentry { - u64 time; - struct rcu_head rcu; -}; static inline void __fuse_dentry_settime(struct dentry *dentry, u64 time) { diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index bcbe34488862..797bcfd6fa06 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -76,6 +76,14 @@ struct fuse_submount_lookup { struct fuse_forget_link *forget; }; +/** FUSE specific dentry data */ +#if BITS_PER_LONG < 64 +union fuse_dentry { + u64 time; + struct rcu_head rcu; +}; +#endif + /** FUSE inode */ struct fuse_inode { /** Inode data */ diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 516ea2979a90..8eff618ac47b 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -197,6 +197,32 @@ static ino_t fuse_squash_ino(u64 ino64) return ino; } +static void fuse_fill_attr_from_inode(struct fuse_attr *attr, + const struct fuse_inode *fi) +{ + struct timespec64 atime = inode_get_atime(&fi->inode); + struct timespec64 mtime = inode_get_mtime(&fi->inode); + struct timespec64 ctime = inode_get_ctime(&fi->inode); + + *attr = (struct fuse_attr){ + .ino = fi->inode.i_ino, + .size = fi->inode.i_size, + .blocks = fi->inode.i_blocks, + .atime = atime.tv_sec, + .mtime = mtime.tv_sec, + .ctime = ctime.tv_sec, + .atimensec = atime.tv_nsec, + .mtimensec = mtime.tv_nsec, + .ctimensec = ctime.tv_nsec, + .mode = fi->inode.i_mode, + .nlink = fi->inode.i_nlink, + .uid = fi->inode.i_uid.val, + .gid = fi->inode.i_gid.val, + .rdev = fi->inode.i_rdev, + .blksize = 1u << fi->inode.i_blkbits, + }; +} + void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, struct fuse_statx *sx, u64 attr_valid, u32 cache_mask) @@ -1477,32 +1503,6 @@ void fuse_dev_free(struct fuse_dev *fud) } EXPORT_SYMBOL_GPL(fuse_dev_free); -static void fuse_fill_attr_from_inode(struct fuse_attr *attr, - const struct fuse_inode *fi) -{ - struct timespec64 atime = inode_get_atime(&fi->inode); - struct timespec64 mtime = inode_get_mtime(&fi->inode); - struct timespec64 ctime = inode_get_ctime(&fi->inode); - - *attr = (struct fuse_attr){ - .ino = fi->inode.i_ino, - .size = fi->inode.i_size, - .blocks = fi->inode.i_blocks, - .atime = atime.tv_sec, - .mtime = mtime.tv_sec, - .ctime = ctime.tv_sec, - .atimensec = atime.tv_nsec, - .mtimensec = mtime.tv_nsec, - .ctimensec = ctime.tv_nsec, - .mode = fi->inode.i_mode, - .nlink = fi->inode.i_nlink, - .uid = fi->inode.i_uid.val, - .gid = fi->inode.i_gid.val, - .rdev = fi->inode.i_rdev, - .blksize = 1u << fi->inode.i_blkbits, - }; -} - static void fuse_sb_defaults(struct super_block *sb) { sb->s_magic = FUSE_SUPER_MAGIC; -- 2.44.0.478.gd926399ef9-goog