From nobody Mon Feb 9 16:33:30 2026 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 068FE3933E9 for ; Wed, 7 Jan 2026 15:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800056; cv=none; b=toukd70rertQQ2+1LVSY+hwFzyCENtUQupL+3tn190oXLNBIIKGlVbSJ63i7hJ1dHvhZzkXXifEGD91zBEns9vqsBpfLAYCHAVvwFcSeBhRzaDXeI3SPo9FDwTKONxKXzA7AzSk33xjdRxREQy1gNI95ZNghbCqMM6T66HTYjiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800056; c=relaxed/simple; bh=KDdIsA9D92H7U82UXu8uRfeAr/a85ssGj/h8ss0xZlY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IkgEF3WoThmNmm47NHoZniWZwBrU0KNpUlTAI8nj7QPKRd4EBVOr2lx9ApstbFVAEhi7AeAUwgNIrvPvrr/un860RZh8PCIlfI1VmeOAHFpZ7oVjx/iA7RfTpBQHkXzHUVURyJGSMv+wuYdsjGY7EK48U+UdSYOvEoZXxnMkPIk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=Groves.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UTSrqzPz; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=Groves.net 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="UTSrqzPz" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-459993ff4fcso917192b6e.1 for ; Wed, 07 Jan 2026 07:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800053; x=1768404853; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=TBLWubQyI6xZVEp0jqdiIeZ2GXSmn2JLxEmTFZ45eqM=; b=UTSrqzPzZsLJoa+3EZGSx8ckaD7su+jBeOoFOF6p14d2SgZ5RoXejUYiX6UK0mSaJB 67y2EbucQNS8YGAsyOrB308ZXNrS4hkgBz/HAoKqPau76rbZDNzjbN4L9A+jub+zhAiX 6exFP0DGunPk+pHyobmuMzRkvCDhmjOThpqlxpYrrdvUYonF88ZKCAQXgakwxWCU9B6E ellAT2m+voJ+F9tET8rfwhDG78Ut/+yr+zqrhZUP02bakLr9c68Zakv8YFoRCJYVMe1h 1hwix+Hmn9E3LlLWHwbTjCP6e3CKMCL3zv0AvtUvJyGyUijG5APTE+q9HE8qtPSKSRJz x2QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800053; x=1768404853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TBLWubQyI6xZVEp0jqdiIeZ2GXSmn2JLxEmTFZ45eqM=; b=tkeeTvoMD0aLFpRO3hmKj/1j6/kB4XiCPfhkEQNAbM7k6FwXuZB1pMlHeu5a0uM57Y 9nvrSbEkXsax/SpawiF00w0QHD5g6HNPv/gWJfTQ8sunem8QlfHk7G1TywLYVJCvHyim EiPztFAAFHQDsnLoyk4LNMTJDnGdpvFHWMVbOEY2zTYmkqkffU9HvICSEfAyHWEQKurJ lWXfQpJLHP50/SHbnMQdgqiEc1qxuzuMrdrfprxi+7h4Si0TPfunNNIqsgYcNeYRwoVU k1DwePjtRUPQqV1Bw8b1P2zLuhN43U1eLdcy/uCvT+I3TWZXUI4tpnvUYRCaNU9wYU6G wdDA== X-Forwarded-Encrypted: i=1; AJvYcCUeCVx++468/2zLoLplMC8KWqYA9GsHQ97LWaXMC7HnQbbxJNC5gvhglc1tHP0XEb4clKgXfijZo6zw18s=@vger.kernel.org X-Gm-Message-State: AOJu0YynoG7CGgaNgYYGS8+TLftK5tPg3Bg/wBN7yQi+xmCAG0BpFI+R HJFiV+Nb93N7Qkgdk/kyk0ip+1OHA+g9I3LGW6YmRRFpqwWTq+APZt2n X-Gm-Gg: AY/fxX6LRUcCKWgA0CB+79A+XiF4t/dulOt7F0IIzyTZqjc+is1zMFhEckVnhjFyl/c 9Punuwb0UJm+QDS11eHYSQqzIBElsILtJ4hF8PuuH6ZsjNMQqoPqxVgdWFvsBVAJjhiXlczYKAs RcdI+MwyIGw02WWBKhTs4McJCvCDutmJCAlflq7oecLawlypdzWl2Pueb/vMyRPfsE1AW+CSAmQ EaH8wivhh6OPkTWnUy5BwQIcgh8bwVYVsWcOOADdJpUjCqSGiAocElVY6zfb3DpDnSqARg8hn3Q rBCY24tEVY0gByzUxY7blWb4EFgnnoeMG4c4vjssk42/xGgRWrRws1uAy1fmGH5sfuTQBKSJC14 iQHASP07DHGA6r8p3yhMK9xmC/1mD7ARsbwk7KMnDz7i9q1lLn3WbSfaD7bazY4gVDczrjIKiaS 39+ycA43kuO11WAmRYq9YZXvAleX5Ga4n8PsJzeaJE3FIy X-Google-Smtp-Source: AGHT+IFOd8s1wzfv2HGwBLfy7yoEMT8R9K3YpHqc6qg9LqPf5eknmZBY0Kt5yrjbMWCqtHbEQ9YNXw== X-Received: by 2002:a05:6808:3206:b0:450:c6af:7c25 with SMTP id 5614622812f47-45a6bd8b7a2mr1331578b6e.21.1767800052873; Wed, 07 Jan 2026 07:34:12 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e2f1de5sm2398106b6e.22.2026.01.07.07.34.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:12 -0800 (PST) Sender: John Groves From: John Groves X-Google-Original-From: John Groves To: John Groves , Miklos Szeredi , Dan Williams , Bernd Schubert , Alison Schofield Cc: John Groves , Jonathan Corbet , Vishal Verma , Dave Jiang , Matthew Wilcox , Jan Kara , Alexander Viro , David Hildenbrand , Christian Brauner , "Darrick J . Wong" , Randy Dunlap , Jeff Layton , Amir Goldstein , Jonathan Cameron , Stefan Hajnoczi , Joanne Koong , Josef Bacik , Bagas Sanjaya , Chen Linxuan , James Morse , Fuad Tabba , Sean Christopherson , Shivank Garg , Ackerley Tng , Gregory Price , Aravind Ramesh , Ajay Joshi , venkataravis@micron.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, John Groves Subject: [PATCH V3 11/21] famfs_fuse: Update macro s/FUSE_IS_DAX/FUSE_IS_VIRTIO_DAX/ Date: Wed, 7 Jan 2026 09:33:20 -0600 Message-ID: <20260107153332.64727-12-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153332.64727-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153332.64727-1-john@groves.net> 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" Virtio_fs now needs to determine if an inode is DAX && not famfs. Signed-off-by: John Groves Reviewed-by: Joanne Koong --- fs/fuse/dir.c | 2 +- fs/fuse/file.c | 13 ++++++++----- fs/fuse/fuse_i.h | 6 +++++- fs/fuse/inode.c | 4 ++-- fs/fuse/iomode.c | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 4b6b3d2758ff..1400c9d733ba 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -2153,7 +2153,7 @@ int fuse_do_setattr(struct mnt_idmap *idmap, struct d= entry *dentry, is_truncate =3D true; } =20 - if (FUSE_IS_DAX(inode) && is_truncate) { + if (FUSE_IS_VIRTIO_DAX(fi) && is_truncate) { filemap_invalidate_lock(mapping); fault_blocked =3D true; err =3D fuse_dax_break_layouts(inode, 0, -1); diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 01bc894e9c2b..093569033ed1 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -252,7 +252,7 @@ static int fuse_open(struct inode *inode, struct file *= file) int err; bool is_truncate =3D (file->f_flags & O_TRUNC) && fc->atomic_o_trunc; bool is_wb_truncate =3D is_truncate && fc->writeback_cache; - bool dax_truncate =3D is_truncate && FUSE_IS_DAX(inode); + bool dax_truncate =3D is_truncate && FUSE_IS_VIRTIO_DAX(fi); =20 if (fuse_is_bad(inode)) return -EIO; @@ -1812,11 +1812,12 @@ static ssize_t fuse_file_read_iter(struct kiocb *io= cb, struct iov_iter *to) struct file *file =3D iocb->ki_filp; struct fuse_file *ff =3D file->private_data; struct inode *inode =3D file_inode(file); + struct fuse_inode *fi =3D get_fuse_inode(inode); =20 if (fuse_is_bad(inode)) return -EIO; =20 - if (FUSE_IS_DAX(inode)) + if (FUSE_IS_VIRTIO_DAX(fi)) return fuse_dax_read_iter(iocb, to); =20 /* FOPEN_DIRECT_IO overrides FOPEN_PASSTHROUGH */ @@ -1833,11 +1834,12 @@ static ssize_t fuse_file_write_iter(struct kiocb *i= ocb, struct iov_iter *from) struct file *file =3D iocb->ki_filp; struct fuse_file *ff =3D file->private_data; struct inode *inode =3D file_inode(file); + struct fuse_inode *fi =3D get_fuse_inode(inode); =20 if (fuse_is_bad(inode)) return -EIO; =20 - if (FUSE_IS_DAX(inode)) + if (FUSE_IS_VIRTIO_DAX(fi)) return fuse_dax_write_iter(iocb, from); =20 /* FOPEN_DIRECT_IO overrides FOPEN_PASSTHROUGH */ @@ -2370,10 +2372,11 @@ static int fuse_file_mmap(struct file *file, struct= vm_area_struct *vma) struct fuse_file *ff =3D file->private_data; struct fuse_conn *fc =3D ff->fm->fc; struct inode *inode =3D file_inode(file); + struct fuse_inode *fi =3D get_fuse_inode(inode); int rc; =20 /* DAX mmap is superior to direct_io mmap */ - if (FUSE_IS_DAX(inode)) + if (FUSE_IS_VIRTIO_DAX(fi)) return fuse_dax_mmap(file, vma); =20 /* @@ -2934,7 +2937,7 @@ static long fuse_file_fallocate(struct file *file, in= t mode, loff_t offset, .mode =3D mode }; int err; - bool block_faults =3D FUSE_IS_DAX(inode) && + bool block_faults =3D FUSE_IS_VIRTIO_DAX(fi) && (!(mode & FALLOC_FL_KEEP_SIZE) || (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_ZERO_RANGE))); =20 diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 7f16049387d1..17736c0a6d2f 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -1508,7 +1508,11 @@ void fuse_free_conn(struct fuse_conn *fc); =20 /* dax.c */ =20 -#define FUSE_IS_DAX(inode) (IS_ENABLED(CONFIG_FUSE_DAX) && IS_DAX(inode)) +/* This macro is used by virtio_fs, but now it also needs to filter for + * "not famfs" + */ +#define FUSE_IS_VIRTIO_DAX(fuse_inode) (IS_ENABLED(CONFIG_FUSE_DAX) \ + && IS_DAX(&fuse_inode->inode)) =20 ssize_t fuse_dax_read_iter(struct kiocb *iocb, struct iov_iter *to); ssize_t fuse_dax_write_iter(struct kiocb *iocb, struct iov_iter *from); diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 819e50d66622..ed667920997f 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -162,7 +162,7 @@ static void fuse_evict_inode(struct inode *inode) /* Will write inode on close/munmap and in all other dirtiers */ WARN_ON(inode_state_read_once(inode) & I_DIRTY_INODE); =20 - if (FUSE_IS_DAX(inode)) + if (FUSE_IS_VIRTIO_DAX(fi)) dax_break_layout_final(inode); =20 truncate_inode_pages_final(&inode->i_data); @@ -170,7 +170,7 @@ static void fuse_evict_inode(struct inode *inode) if (inode->i_sb->s_flags & SB_ACTIVE) { struct fuse_conn *fc =3D get_fuse_conn(inode); =20 - if (FUSE_IS_DAX(inode)) + if (FUSE_IS_VIRTIO_DAX(fi)) fuse_dax_inode_cleanup(inode); if (fi->nlookup) { fuse_queue_forget(fc, fi->forget, fi->nodeid, diff --git a/fs/fuse/iomode.c b/fs/fuse/iomode.c index 3728933188f3..31ee7f3304c6 100644 --- a/fs/fuse/iomode.c +++ b/fs/fuse/iomode.c @@ -203,7 +203,7 @@ int fuse_file_io_open(struct file *file, struct inode *= inode) * io modes are not relevant with DAX and with server that does not * implement open. */ - if (FUSE_IS_DAX(inode) || !ff->args) + if (FUSE_IS_VIRTIO_DAX(fi) || !ff->args) return 0; =20 /* --=20 2.49.0