From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 40216408618 for ; Fri, 12 Jun 2026 16:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781283148; cv=none; b=WODii5iGwdCw185+Oe9ywVfu2YGOat5WyDKPSCHfn0zEXR9KVWkWJaer20w5cpWIOf9LCgkEHM2+TmBIS0GMZyjnCpYxcay7s0IYSCMduf2w94xOKX4Oyl5oALgahtj+r391pxpjVTqdwPC4hTBXywN46FF4WpgAv6oBKw37dHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781283148; c=relaxed/simple; bh=hX1o0/1X0IlAr+h2mvk5euMA+93fIB0+cOMIvEKYm+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZbbrRLxJlhS47w9gpqvfAX+anoQYs7Gyrtd0Jl5Qv0u+eUlbc0E00xQVXqAoju/3slxtJA4tsFD8RgcqSdkb/+FpV/2ASw7XdSD8oWuvgE1L16o/ZAaLAujY2nmXweE8/LdSmX+9/FpglfOhag3T6f8SrGZQjkU181O1WsvNIpE= 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=ajCt5Fg7; arc=none smtp.client-ip=209.85.128.48 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="ajCt5Fg7" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-490ac10e337so7986835e9.3 for ; Fri, 12 Jun 2026 09:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1781283144; x=1781887944; 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=ZnI2WOuzQhZjJmaMqnOcKFel7ALXR0Y3oSmXyakEYRg=; b=ajCt5Fg7ohhD+gd7qDJRspWcDMbdDd52B//zcw6M8Sk8YlcNnT4VLx5gdBiWN7b2lF 2T+iXJyzxtTnXtMq7eFKggjktuZ8Q/X1cQUV/95RcJIeop8wNVIecOMvgNMvSSbz+D3/ TPAXBbUTGnx6Ay7tdgvr/1ofudtHkoS/9+vdNwWXGHpmL79Npi072OSzCYev1r9SRBZZ XmVJd26npFsABtafRIMZFX058VChNclm7xVtrozVR5g79tgI6ZSRTqUZwJ6h3Ny+lLY4 wI0LTQ15MlV0VMZ72HuDIZWaXbsortwls4cG2zytV7yMcZXhzqJqe1eQuUdUzYeEj/iL I6LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781283144; x=1781887944; 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=ZnI2WOuzQhZjJmaMqnOcKFel7ALXR0Y3oSmXyakEYRg=; b=cPMjrTomhZxf+XnjWBy+CLDqAGIBFLaI1jYCAVSlECaeySJbyZBzUz4InJ4ieReiOb QeqeSXYM72mzfMXioOdKTIQNRlJeQTB5Hw6g7CqmKLeZQ+0/mGOFUb/t9E6BUFoto8u+ jpJTPhWkwthnLOwSstlaStI/A3dm331t1RNvHqTfvz089JwbZx2F+qO1E7bJyjZb6FtH FfvNG1sTv6hThq/72xCtT3gMlvx9dwyzNU7mA4Vtwq4Eazq/BVqreKWVjGvVVtI1edkN iXkpeg8an8shB9nVJCQJXInso0EQzVNpmSLn1WvfPgWgHwSPmHenghomqJEsdo5iyn+c Li8w== X-Forwarded-Encrypted: i=1; AFNElJ9SkhEotw4MrGnaD/PG9uXsOgQycAGYqgk9HE52eshBMiHi7ogB7bXHFtf8VBJONiE2c35FGDKWY/GgEUA=@vger.kernel.org X-Gm-Message-State: AOJu0YxIH3hTrLDTg33g+aZQgDjMlsb1pQpm0eFiFah8iY16jEhiJnue Pm/Uf2KLQfgLCvUGXK9Ocqb1IZmuGsGBPoKQmBrf5Sfo7MregDIOqyS1faQbblOrVq0= X-Gm-Gg: Acq92OFGJKaNIzXWNYPfLtPg8vuVJu2BJd0wXAoaWjzcXPIe4x4dYR7DEl1OxfuIo2j d8EXgyeouRTfLPsff6YbsIO8H1VhbBuyYHH4CTlJznbk7MybYYrDGanglOgo35DChdNCE0M7wLs 2Am7AJ4x78og6+YObD6HWI/bhCTAX7EdasiCU5T8JEc4E4zxewZbTXif6f2/YeWKQBqaImQG2kv RJ8lhO/tnOSQI+bPEZqmkvNzy0Gy/AWnlKJVbCE+5/rMCjgaXF+igtzO6CWdGbzPv9TFGned2/S QeGe6XiKHDIAV+dGPH0LWcw6i2IZSoVAHAFj72irpTfcBzvskM7Lc+JVadD2/ra6lmTX9xekcbe g0DDXGF4HcUUo24FCctC+s8DPTvI17V9RcXsAQTXNy+cs29KyLkPLhMQkYTbKr9ODH9FWJYGHvW EYt8+pR42uQMzj7BZEXCnLMdXu3As1Sx0Gaz2acefeSGfNCh3O9s1Mb948qA7w4PrwY34vEGHwG 0bFZPl6DXGyQp6DkZUOJWbyBOk= X-Received: by 2002:a05:600c:5252:b0:490:c6c2:bdc2 with SMTP id 5b1f17b1804b1-49220051650mr3908255e9.4.1781283144560; Fri, 12 Jun 2026 09:52:24 -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-4606f26f1cdsm7807377f8f.11.2026.06.12.09.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 09:52:24 -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 12/12] fs/ceph: remove redundant inode number from ceph_inode_info Date: Fri, 12 Jun 2026 18:52:04 +0200 Message-ID: <20260612165204.86137-13-max.kellermann@ionos.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260612165204.86137-1-max.kellermann@ionos.com> References: <20260612165204.86137-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 dcdbc24d1e21..c8ee7d735861 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 5e4addbfc0f2..5cb535b126eb 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -376,7 +376,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; @@ -563,7 +571,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) @@ -593,12 +608,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