From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 C7BA93EDE76 for ; Mon, 6 Jul 2026 07:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783322737; cv=none; b=qsLYss/3Z3V2l66iwRrL3GAhJmEuJWNCt5kzzUCWvdlt3cOQym2763crSiGht0CPuqOi4iAGlHCEkjLHf3tF43MWCIsj00lVvMsB/ANdejYoIgwtXwXYXjEKWDdnrY4YZ4MpBzwNp+RvEIczQJfCqRST1TjqH/1/gG21c/U8llQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783322737; c=relaxed/simple; bh=ItMu+kPTmFZnDgkl0OWkN0vhR8c+L6Q5g3sYeFtqIxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f4+0tCioN13od+7k8TauqDn2vX9aNWgDguTLi89dhXVHoJGfWJwofEJJJ17ymgzD66OBIisQ7gUiB14L+LC1DVfzbdRlM0llXrVSK/sRSDyG546QFKpPWFBMJOthUzeWymXsJtzxgG2MqooN4Xhfm/rztyne0QTi4xK1DdGLu3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=AOnM+uA5; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="AOnM+uA5" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-474303f3c72so1522088f8f.0 for ; Mon, 06 Jul 2026 00:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1783322704; x=1783927504; 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=XrwzJCwKgkiHPJrVYexM5E0v3kPPNtTc3vEMJzL4u4Y=; b=AOnM+uA5o2jI5/AbOx4fp2pRzJTfeSKdHk5YxduQ6gv+6K4oTKnQGdZgecHRol2jdl LzHuuOwesoUwcJl0X7B355yRCgPBozRmSOAiteKsqXwmLLKWoE77OiTL8NlL2DtmQSQ+ m+zduBRtwqbEgER0iDnO9cDE4wNiL6kilhXc981+KmO++JAozj5IrbAOAKFwJk6HfMa6 OjAAZRGbRQgar8LR9L8vr9d5He2pGpGrf1608GIVC8SMKMFVCJ3YndL27qN4kCdlcSvl JrOSXz0tY1Ktmsge2OeAzfC205SwWHOmqoCi7iJJHAfeKLIP6dkUqsyUtO4AqdTXGQyX v/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783322704; x=1783927504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XrwzJCwKgkiHPJrVYexM5E0v3kPPNtTc3vEMJzL4u4Y=; b=d58F89RENxkmzibLgWe9ATRGykx3zp5D/DH8xY1T5Jp5dd+R5QVQpsCMuPXxfzGHW5 5Yn8+lodoVw0+edyYq2iv7js8tRT7BlpzL5xf5bk4+4gpVgoFma60o9LIzt1owhQXCjx rK9HFtimKlFQd4IP85gB63k9HfTjQmT/orXrtmAqXOogJolVAUxE17pOMrTqOGoYbOYL ygjU0cOUSEHdqcNkdFcT1Ed3dcDzK13pD6O3Dz5GHhQrZSLEYjeD6qMyW0FqSTRc8hPA yGoiTCUePrC5qCym3OWkK3hM1YvhAhXtsI7hSBzk78c1Oa8lkmsIL0DgzjQmmXV0h5n/ PaAw== X-Forwarded-Encrypted: i=1; AHgh+Rqe7KrKXlMGI1idLzkrKoKexVb4k2iseMXC5kJ+WRckVc3kmIo1dCj3v4SQWTu8E/il6io0LdxghxaZ0cE=@vger.kernel.org X-Gm-Message-State: AOJu0YxZBn5n/Q9BLaw/SW9QJ/T0qWd+qEOVjvygKdSRcuryW4KpBi23 u2xt7uclfxcI0od2YJcEXWOLGI+hy3rOUl1U8rqasbdoY9gd1xy9Arau/Uq4oVUPMkQ= X-Gm-Gg: AfdE7clg4wb+yr/2uN+dPzpaD6mjSyI2FdaKC2fCxBuKbhzRDLrSfij/vK4gQqSoF5U NvSaU2n3A45PC6+3jm3glHzsUd85yg/6JB9r2bhLqlC5KFXJTt/ZZJl0itjfU7qIufG+KPMyW8a 1TRIqpZKOZadthtPPvYAhUGoMjMfseBoy4p7T9rO3QzwoMaVBrryzIN/nlIW1gkPKX0bv+d3txL ELiuXeGPs1IqMg98TusLOa4d1bzEyY431BKHXKKwlYsrABPV4QOu2Qa2y33uP37ha7LHzgWKca6 POhPr9hnXtnlXcALw5qfilxfU8KzwAbdHkdMwppf3400ibdelKgTiYc9lvg8gIzpzxTix6KD8L6 P5cUMhh6FPX0ZQ1wRx59qJqnqeD/0sNONKbPgbir5mARLVw5WagrtA3NpksCMzef5uMfD/xVyHY 5mGSJW6Y4zmYB6sKOmFYg/eRVg7hmKAP3PyXvNnsUqis/C80BtcY5kuFOKy0fMSBBb4pIaN65Sx tzFSGG5uBVD7JM8 X-Received: by 2002:a05:6000:41d4:b0:46f:9d18:bd3c with SMTP id ffacd0b85a97d-47aa92c079cmr10668025f8f.12.1783322703952; Mon, 06 Jul 2026 00:25:03 -0700 (PDT) Received: from raven.intern.cm-ag (p200300dc6f45eb00023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f45:eb00:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9de1d905sm22324916f8f.2.2026.07.06.00.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 00:25:03 -0700 (PDT) From: Max Kellermann To: idryomov@gmail.com, amarkuze@redhat.com, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v2 12/18] fs/ceph: remove redundant inode number from ceph_inode_info Date: Mon, 6 Jul 2026 09:24:43 +0200 Message-ID: <20260706072450.3920010-13-max.kellermann@ionos.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260706072450.3920010-1-max.kellermann@ionos.com> References: <20260706072450.3920010-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On 64 bit systems, ceph_vino_to_ino_t() is a no-op, and inode.i_ino is the same as ceph_vino.ino. This reduces the size of `struct ceph_inode_info` by 8 bytes. Signed-off-by: Max Kellermann --- fs/ceph/cache.c | 4 +++- fs/ceph/inode.c | 7 +++++++ fs/ceph/super.h | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index f678bab189d8..289615e58196 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c @@ -16,6 +16,7 @@ void ceph_fscache_register_inode_cookie(struct inode *inode) { struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); + struct ceph_vino vino; /* No caching for filesystem? */ if (!fsc->fscache) @@ -31,9 +32,10 @@ void ceph_fscache_register_inode_cookie(struct inode *inode) WARN_ON_ONCE(ci->netfs.cache); + vino = ceph_vino(inode); ci->netfs.cache = fscache_acquire_cookie(fsc->fscache, 0, - &ci->i_vino, sizeof(ci->i_vino), + &vino, sizeof(vino), &ci->i_version, sizeof(ci->i_version), i_size_read(inode)); if (ci->netfs.cache) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index aba98975a8a3..e82877782601 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -44,11 +44,18 @@ static void ceph_inode_work(struct work_struct *work); */ static int ceph_set_ino_cb(struct inode *inode, void *data) { + const struct ceph_vino *vino = data; struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); +#if BITS_PER_LONG >= 64 + inode->i_ino = vino->ino; + ci->i_snap = vino->snap; +#else ci->i_vino = *(struct ceph_vino *)data; inode->i_ino = ceph_vino_to_ino_t(ci->i_vino); +#endif + inode_set_iversion_raw(inode, 0); percpu_counter_inc(&mdsc->metric.total_inodes); diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 660125d94f8e..e5ab1b83a84d 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -378,7 +378,15 @@ struct ceph_inode_xattrs_info { */ struct ceph_inode_info { struct netfs_inode netfs; /* Netfslib context and vfs inode */ + +#if BITS_PER_LONG >= 64 + /* on 64 bit systems, the full Ceph inode number is stored in + * netfs.inode.i_ino + */ + u64 i_snap; +#else struct ceph_vino i_vino; /* ceph ino + snap */ +#endif spinlock_t i_ceph_lock; @@ -570,7 +578,14 @@ ceph_inode_to_client(const struct inode *inode) static inline struct ceph_vino ceph_vino(const struct inode *inode) { +#if BITS_PER_LONG >= 64 + return (struct ceph_vino){ + .ino = inode->i_ino, + .snap = ceph_inode(inode)->i_snap, + }; +#else return ceph_inode(inode)->i_vino; +#endif } static inline u32 ceph_ino_to_ino32(u64 vino) @@ -600,12 +615,20 @@ static inline ino_t ceph_vino_to_ino_t(const struct ceph_vino vino) static inline u64 ceph_ino(const struct inode *inode) { +#if BITS_PER_LONG >= 64 + return inode->i_ino; +#else return ceph_inode(inode)->i_vino.ino; +#endif } static inline u64 ceph_snap(const struct inode *inode) { +#if BITS_PER_LONG >= 64 + return ceph_inode(inode)->i_snap; +#else return ceph_inode(inode)->i_vino.snap; +#endif } /** -- 2.47.3