Skip to contentSkip to conversation

nilfs2: standardize the inode number type to u64

PATCH Applied Ryusuke Konishi 2 participants 2 messages Aug 10 NILFS2 filesystem

lore
Share & tools
lore

Ryusuke Konishi

author maintainer
#0 lore raw

PATCH 1/1 nilfs2: standardize the inode number type to u64

Variables handling inode numbers - such as the 'i_ino' member of the inode structure - have been converted to 'u64' within the kernel to ensure consistency. However, some parts of the nilfs2 implementation still use 'ino_t' or 'unsigned long' - both of which are architecture-dependent types - to handle inode numbers.

Replace those remaining instances of 'ino_t' or 'unsigned long' with 'u64'.

---
Hi Viacheslav,

Please apply this for the next cycle.

Following the treewide conversion of inode numbers to 64-bit, this cleans up the remaining architecture-dependent types in the nilfs2 implementation, standardizing them to 'u64'.

Thanks,
Ryusuke Konishi

 fs/nilfs2/dir.c      | 11 +++++------
 fs/nilfs2/ifile.c    | 13 ++++++-------
 fs/nilfs2/ifile.h    | 10 ++++++----
 fs/nilfs2/inode.c    | 24 +++++++++++-------------
 fs/nilfs2/ioctl.c    |  2 +-
 fs/nilfs2/namei.c    |  6 +++---
 fs/nilfs2/nilfs.h    | 15 +++++++--------
 fs/nilfs2/page.c     |  9 ++++-----
 fs/nilfs2/recovery.c |  4 ++--
 fs/nilfs2/segment.c  |  2 +-
 10 files changed, 46 insertions(+), 50 deletions(-)
fs/nilfs2/dir.c +5 -6
index 3653db5cdb65..8b53802b6ebd 100644
@@ -169,17 +169,16 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
 	error = "disallowed inode number";
 bad_entry:
 	nilfs_error(sb,
-		    "bad entry in directory #%llu: %s - offset=%lu, inode=%lu, rec_len=%zd, name_len=%d",
+		    "bad entry in directory #%llu: %s - offset=%lu, inode=%llu, rec_len=%zd, name_len=%d",
 		    dir->i_ino, error, (folio->index << PAGE_SHIFT) + offs,
-		    (unsigned long)le64_to_cpu(p->inode),
-		    rec_len, p->name_len);
+		    le64_to_cpu(p->inode), rec_len, p->name_len);
 	goto fail;
 Eend:
 	p = (struct nilfs_dir_entry *)(kaddr + offs);
 	nilfs_error(sb,
-		    "entry in directory #%llu spans the page boundary offset=%lu, inode=%lu",
+		    "entry in directory #%llu spans the page boundary offset=%lu, inode=%llu",
 		    dir->i_ino, (folio->index << PAGE_SHIFT) + offs,
-		    (unsigned long)le64_to_cpu(p->inode));
+		    le64_to_cpu(p->inode));
 fail:
 	return false;
 }
@@ -387,7 +386,7 @@ struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct folio **foliop)
 	return NULL;
 }
 
-int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, ino_t *ino)
+int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, u64 *ino)
 {
 	struct nilfs_dir_entry *de;
 	struct folio *folio;
fs/nilfs2/ifile.c +6 -7
index 99eb8a59009e..c99e1e6356ae 100644
@@ -49,7 +49,7 @@ static inline struct nilfs_ifile_info *NILFS_IFILE_I(struct inode *ifile)
  * * %-ENOMEM	- Insufficient memory available.
  * * %-ENOSPC	- No inode left.
  */
-int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
+int nilfs_ifile_create_inode(struct inode *ifile, u64 *out_ino,
 			     struct buffer_head **out_bh)
 {
 	struct nilfs_palloc_req req;
@@ -72,7 +72,7 @@ int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
 	nilfs_palloc_commit_alloc_entry(ifile, &req);
 	mark_buffer_dirty(req.pr_entry_bh);
 	nilfs_mdt_mark_dirty(ifile);
-	*out_ino = (ino_t)req.pr_entry_nr;
+	*out_ino = req.pr_entry_nr;
 	*out_bh = req.pr_entry_bh;
 	return 0;
 }
@@ -88,7 +88,7 @@ int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
  * * %-ENOENT	- Inode number unallocated.
  * * %-ENOMEM	- Insufficient memory available.
  */
-int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
+int nilfs_ifile_delete_inode(struct inode *ifile, u64 ino)
 {
 	struct nilfs_palloc_req req = {
 		.pr_entry_nr = ino, .pr_entry_bh = NULL
@@ -123,21 +123,20 @@ int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
 	return 0;
 }
 
-int nilfs_ifile_get_inode_block(struct inode *ifile, ino_t ino,
+int nilfs_ifile_get_inode_block(struct inode *ifile, u64 ino,
 				struct buffer_head **out_bh)
 {
 	struct super_block *sb = ifile->i_sb;
 	int err;
 
 	if (unlikely(!NILFS_VALID_INODE(sb, ino))) {
-		nilfs_error(sb, "bad inode number: %lu", (unsigned long)ino);
+		nilfs_error(sb, "bad inode number: %llu", ino);
 		return -EINVAL;
 	}
 
 	err = nilfs_palloc_get_entry_block(ifile, ino, 0, out_bh);
 	if (unlikely(err))
-		nilfs_warn(sb, "error %d reading inode: ino=%lu",
-			   err, (unsigned long)ino);
+		nilfs_warn(sb, "error %d reading inode: ino=%llu", err, ino);
 	return err;
 }
 
fs/nilfs2/ifile.h +6 -4
index 5d116a566d9e..d38a46f5ae41 100644
@@ -19,7 +19,7 @@
 
 
 static inline struct nilfs_inode *
-nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)
+nilfs_ifile_map_inode(struct inode *ifile, u64 ino, struct buffer_head *ibh)
 {
 	size_t __offset_in_folio = nilfs_palloc_entry_offset(ifile, ino, ibh);
 
@@ -31,9 +31,11 @@ static inline void nilfs_ifile_unmap_inode(struct nilfs_inode *raw_inode)
 	kunmap_local(raw_inode);
 }
 
-int nilfs_ifile_create_inode(struct inode *, ino_t *, struct buffer_head **);
-int nilfs_ifile_delete_inode(struct inode *, ino_t);
-int nilfs_ifile_get_inode_block(struct inode *, ino_t, struct buffer_head **);
+int nilfs_ifile_create_inode(struct inode *ifile, u64 *out_ino,
+			struct buffer_head **out_bh);
+int nilfs_ifile_delete_inode(struct inode *ifile, u64 ino);
+int nilfs_ifile_get_inode_block(struct inode *ifile, u64 ino,
+				struct buffer_head **out_bh);
 
 int nilfs_ifile_count_free_inodes(struct inode *, u64 *, u64 *);
 
fs/nilfs2/inode.c +11 -13
index 51f7e125a311..34e6096069ad 100644
@@ -287,8 +287,7 @@ const struct address_space_operations nilfs_buffer_cache_aops = {
 };
 
 static int nilfs_insert_inode_locked(struct inode *inode,
-				     struct nilfs_root *root,
-				     unsigned long ino)
+				struct nilfs_root *root, u64 ino)
 {
 	struct nilfs_iget_args args = {
 		.ino = ino, .root = root, .cno = 0, .type = NILFS_I_TYPE_NORMAL
@@ -305,7 +304,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode)
 	struct nilfs_root *root;
 	struct buffer_head *bh;
 	int err = -ENOMEM;
-	ino_t ino;
+	u64 ino;
 
 	inode = new_inode(sb);
 	if (unlikely(!inode))
@@ -443,7 +442,7 @@ int nilfs_read_inode_common(struct inode *inode,
 }
 
 static int __nilfs_read_inode(struct super_block *sb,
-			      struct nilfs_root *root, unsigned long ino,
+			      struct nilfs_root *root, u64 ino,
 			      struct inode *inode)
 {
 	struct the_nilfs *nilfs = sb->s_fs_info;
@@ -482,8 +481,8 @@ static int __nilfs_read_inode(struct super_block *sb,
 			huge_decode_dev(le64_to_cpu(raw_inode->i_device_code)));
 	} else {
 		nilfs_error(sb,
-			    "invalid file type bits in mode 0%o for inode %lu",
-			    inode->i_mode, ino);
+			"invalid file type bits in mode 0%o for inode %llu",
+			inode->i_mode, ino);
 		err = -EIO;
 		goto failed_unmap;
 	}
@@ -533,7 +532,7 @@ static int nilfs_iget_set(struct inode *inode, void *opaque)
 }
 
 struct inode *nilfs_ilookup(struct super_block *sb, struct nilfs_root *root,
-			    unsigned long ino)
+			    u64 ino)
 {
 	struct nilfs_iget_args args = {
 		.ino = ino, .root = root, .cno = 0, .type = NILFS_I_TYPE_NORMAL
@@ -542,8 +541,8 @@ struct inode *nilfs_ilookup(struct super_block *sb, struct nilfs_root *root,
 	return ilookup5(sb, ino, nilfs_iget_test, &args);
 }
 
-struct inode *nilfs_iget_locked(struct super_block *sb, struct nilfs_root *root,
-				unsigned long ino)
+struct inode *nilfs_iget_locked(struct super_block *sb,
+				struct nilfs_root *root, u64 ino)
 {
 	struct nilfs_iget_args args = {
 		.ino = ino, .root = root, .cno = 0, .type = NILFS_I_TYPE_NORMAL
@@ -553,7 +552,7 @@ struct inode *nilfs_iget_locked(struct super_block *sb, struct nilfs_root *root,
 }
 
 struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root,
-			 unsigned long ino)
+			 u64 ino)
 {
 	struct inode *inode;
 	int err;
@@ -579,8 +578,7 @@ struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root,
 	return inode;
 }
 
-struct inode *nilfs_iget_for_gc(struct super_block *sb, unsigned long ino,
-				__u64 cno)
+struct inode *nilfs_iget_for_gc(struct super_block *sb, u64 ino, __u64 cno)
 {
 	struct nilfs_iget_args args = {
 		.ino = ino, .root = NULL, .cno = cno, .type = NILFS_I_TYPE_GC
@@ -740,7 +738,7 @@ void nilfs_write_inode_common(struct inode *inode,
 
 void nilfs_update_inode(struct inode *inode, struct buffer_head *ibh, int flags)
 {
-	ino_t ino = inode->i_ino;
+	u64 ino = inode->i_ino;
 	struct nilfs_inode_info *ii = NILFS_I(inode);
 	struct inode *ifile = ii->i_root->ifile;
 	struct nilfs_inode *raw_inode;
fs/nilfs2/ioctl.c +1 -1
index 0957316e58b8..01a04080ef70 100644
@@ -612,7 +612,7 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
 	struct nilfs_vdesc *vdesc;
 	struct buffer_head *bh, *n;
 	LIST_HEAD(buffers);
-	ino_t ino;
+	u64 ino;
 	__u64 cno;
 	int i, ret;
 
fs/nilfs2/namei.c +3 -3
index e2fe95de3d71..6a482da7c682 100644
@@ -54,7 +54,7 @@ static struct dentry *
 nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
 {
 	struct inode *inode;
-	ino_t ino;
+	u64 ino;
 	int res;
 
 	if (dentry->d_name.len > NILFS_NAME_LEN)
@@ -69,7 +69,7 @@ nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
 		inode = nilfs_iget(dir->i_sb, NILFS_I(dir)->i_root, ino);
 		if (inode == ERR_PTR(-ESTALE)) {
 			nilfs_error(dir->i_sb,
-					"deleted inode referenced: %lu", ino);
+				"deleted inode referenced: %llu", ino);
 			return ERR_PTR(-EIO);
 		}
 	}
@@ -463,7 +463,7 @@ static int nilfs_rename(struct mnt_idmap *idmap,
  */
 static struct dentry *nilfs_get_parent(struct dentry *child)
 {
-	ino_t ino;
+	u64 ino;
 	int res;
 	struct nilfs_root *root;
 
fs/nilfs2/nilfs.h +7 -8
index b7e3d91b6243..4fc42d3787a4 100644
@@ -144,7 +144,7 @@ enum {
 	 ((ino) < NILFS_USER_INO && (NILFS_SYS_INO_BITS & BIT(ino))))
 
 #define NILFS_PRIVATE_INODE(ino) ({					\
-	ino_t __ino = (ino);						\
+	u64 __ino = (ino);						\
 	((__ino) < NILFS_USER_INO && (__ino) != NILFS_ROOT_INO &&	\
 	 (__ino) != NILFS_SKETCH_INO); })
 
@@ -255,7 +255,7 @@ static inline __u32 nilfs_mask_flags(umode_t mode, __u32 flags)
 
 /* dir.c */
 int nilfs_add_link(struct dentry *, struct inode *);
-int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, ino_t *ino);
+int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, u64 *ino);
 int nilfs_make_empty(struct inode *, struct inode *);
 struct nilfs_dir_entry *nilfs_find_entry(struct inode *, const struct qstr *,
 		struct folio **);
@@ -287,13 +287,12 @@ extern int nilfs_read_inode_common(struct inode *, struct nilfs_inode *);
 void nilfs_write_inode_common(struct inode *inode,
 			      struct nilfs_inode *raw_inode);
 struct inode *nilfs_ilookup(struct super_block *sb, struct nilfs_root *root,
-			    unsigned long ino);
-struct inode *nilfs_iget_locked(struct super_block *sb, struct nilfs_root *root,
-				unsigned long ino);
+			    u64 ino);
+struct inode *nilfs_iget_locked(struct super_block *sb,
+				struct nilfs_root *root, u64 ino);
 struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root,
-			 unsigned long ino);
-extern struct inode *nilfs_iget_for_gc(struct super_block *sb,
-				       unsigned long ino, __u64 cno);
+			 u64 ino);
+struct inode *nilfs_iget_for_gc(struct super_block *sb, u64 ino, __u64 cno);
 int nilfs_attach_btree_node_cache(struct inode *inode);
 void nilfs_detach_btree_node_cache(struct inode *inode);
 struct inode *nilfs_iget_for_shadow(struct inode *inode);
fs/nilfs2/page.c +4 -5
index 1d00bce21c37..cf4f1c6798f5 100644
@@ -154,7 +154,7 @@ void nilfs_folio_bug(struct folio *folio)
 {
 	struct buffer_head *bh, *head;
 	struct address_space *m;
-	unsigned long ino;
+	u64 ino;
 
 	if (unlikely(!folio)) {
 		printk(KERN_CRIT "NILFS_FOLIO_BUG(NULL)\n");
@@ -164,10 +164,9 @@ void nilfs_folio_bug(struct folio *folio)
 	m = folio->mapping;
 	ino = m ? m->host->i_ino : 0;
 
-	printk(KERN_CRIT "NILFS_FOLIO_BUG(%p): cnt=%d index#=%llu flags=0x%lx "
-	       "mapping=%p ino=%lu\n",
-	       folio, folio_ref_count(folio),
-	       (unsigned long long)folio->index, folio->flags.f, m, ino);
+	printk(KERN_CRIT "NILFS_FOLIO_BUG(%p): cnt=%d index#=%lu flags=0x%lx  mapping=%p ino=%llu\n",
+		folio, folio_ref_count(folio), folio->index, folio->flags.f,
+		m, ino);
 
 	head = folio_buffers(folio);
 	if (head) {
fs/nilfs2/recovery.c +2 -2
index 4d5a6aa5214c..45fb37215669 100644
@@ -34,7 +34,7 @@ enum {
 
 /* work structure for recovery */
 struct nilfs_recovery_block {
-	ino_t ino;		/*
+	u64 ino;		/*
 				 * Inode number of the file that this block
 				 * belongs to
 				 */
@@ -333,7 +333,7 @@ static int nilfs_scan_dsync_log(struct the_nilfs *nilfs, sector_t start_blocknr,
 	unsigned int offset;
 	u32 nfinfo, sumbytes;
 	sector_t blocknr;
-	ino_t ino;
+	u64 ino;
 	int err = -EIO;
 
 	nfinfo = le32_to_cpu(sum->ss_nfinfo);
fs/nilfs2/segment.c +1 -1
index 5896fdae5669..829573cb6131 100644
@@ -1610,7 +1610,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
 	struct nilfs_finfo *finfo = NULL;
 	union nilfs_binfo binfo;
 	struct buffer_head *bh, *bh_org;
-	ino_t ino = 0;
+	u64 ino = 0;
 	int err = 0;
 
 	if (!nfinfo)
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 460 lines · Ryusuke Konishi

Variables handling inode numbers - such as the 'i_ino' member of the inode structure - have been converted to 'u64' within the kernel to ensure consistency.  However, some parts of the nilfs2 implementation still use 'ino_t' or 'unsigned long' - both of which are architecture-dependent types - to handle inode numbers.

Replace those remaining instances of 'ino_t' or 'unsigned long' with 'u64'.

---
Hi Viacheslav,

Please apply this for the next cycle.

Following the treewide conversion of inode numbers to 64-bit, this cleans up the remaining architecture-dependent types in the nilfs2 implementation, standardizing them to 'u64'.

Thanks,
Ryusuke Konishi

 fs/nilfs2/dir.c      | 11 +++++------

 fs/nilfs2/ifile.c    | 13 ++++++-------
 fs/nilfs2/ifile.h    | 10 ++++++----
 fs/nilfs2/inode.c    | 24 +++++++++++-------------
 fs/nilfs2/ioctl.c    |  2 +-
 fs/nilfs2/namei.c    |  6 +++---
 fs/nilfs2/nilfs.h    | 15 +++++++--------
 fs/nilfs2/page.c     |  9 ++++-----
 fs/nilfs2/recovery.c |  4 ++--
 fs/nilfs2/segment.c  |  2 +-
 10 files changed, 46 insertions(+), 50 deletions(-)
fs/nilfs2/dir.c +0 -0
index 3653db5cdb65..8b53802b6ebd 100644
@@ -169,17 +169,16 @@ static bool nilfs_check_folio(struct folio
 *folio, char *kaddr)
  	error = "disallowed inode number";

 bad_entry:
  nilfs_error(sb,

fs/nilfs2/dir.c +0 -1
-		    "bad entry in directory #%llu: %s - offset=%lu,

inode=%lu, rec_len=%zd, name_len=%d",

fs/nilfs2/dir.c +1 -0
+		    "bad entry in directory #%llu: %s - offset=%lu,

inode=%llu, rec_len=%zd, name_len=%d",
      dir->i_ino, error, (folio->index << PAGE_SHIFT)
+ offs,

fs/nilfs2/dir.c +1 -2
-		    (unsigned long)le64_to_cpu(p->inode),
-		    rec_len, p->name_len);
+		    le64_to_cpu(p->inode), rec_len, p->name_len);

  goto fail;
 Eend:
  p = (struct nilfs_dir_entry *)(kaddr + offs); nilfs_error(sb,

fs/nilfs2/dir.c +0 -1
-		    "entry in directory #%llu spans the page

boundary offset=%lu, inode=%lu",

fs/nilfs2/dir.c +1 -0
+		    "entry in directory #%llu spans the page

boundary offset=%lu, inode=%llu",
      dir->i_ino, (folio->index << PAGE_SHIFT) + offs,

fs/nilfs2/dir.c +1 -1
-		    (unsigned long)le64_to_cpu(p->inode));
+		    le64_to_cpu(p->inode));

 fail:
  return false;
 }

fs/nilfs2/dir.c +0 -0
@@ -387,7 +386,7 @@ struct nilfs_dir_entry *nilfs_dotdot(struct inode
 *dir, struct folio **foliop)
  	return NULL;
  }


-int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, ino_t *ino)
+int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, u64 *ino)
 {
  struct nilfs_dir_entry *de;
  struct folio *folio;

fs/nilfs2/ifile.c +1 -1
index 99eb8a59009e..c99e1e6356ae 100644
@@ -49,7 +49,7 @@ static inline struct nilfs_ifile_info
 *NILFS_IFILE_I(struct inode *ifile)
   * * %-ENOMEM	- Insufficient memory available.
   * * %-ENOSPC	- No inode left.
   */
-int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
+int nilfs_ifile_create_inode(struct inode *ifile, u64 *out_ino,
  			     struct buffer_head **out_bh)
  {

  struct nilfs_palloc_req req;

fs/nilfs2/ifile.c +1 -1
@@ -72,7 +72,7 @@ int nilfs_ifile_create_inode(struct inode *ifile,
 ino_t *out_ino,
  	nilfs_palloc_commit_alloc_entry(ifile, &req);
  	mark_buffer_dirty(req.pr_entry_bh);
  	nilfs_mdt_mark_dirty(ifile);
-	*out_ino = (ino_t)req.pr_entry_nr;
+	*out_ino = req.pr_entry_nr;
  	*out_bh = req.pr_entry_bh;
  	return 0;

 }

fs/nilfs2/ifile.c +1 -1
@@ -88,7 +88,7 @@ int nilfs_ifile_create_inode(struct inode *ifile,
 ino_t *out_ino,
   * * %-ENOENT	- Inode number unallocated.
   * * %-ENOMEM	- Insufficient memory available.
   */
-int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
+int nilfs_ifile_delete_inode(struct inode *ifile, u64 ino)
  {
  	struct nilfs_palloc_req req = {

  .pr_entry_nr = ino, .pr_entry_bh = NULL

fs/nilfs2/ifile.c +0 -0
@@ -123,21 +123,20 @@ int nilfs_ifile_delete_inode(struct inode
 *ifile, ino_t ino)
  	return 0;
  }

fs/nilfs2/ifile.c +1 -1
-int nilfs_ifile_get_inode_block(struct inode *ifile, ino_t ino,
+int nilfs_ifile_get_inode_block(struct inode *ifile, u64 ino,

  struct buffer_head **out_bh) {
  struct super_block *sb = ifile->i_sb;
  int err;

  if (unlikely(!NILFS_VALID_INODE(sb, ino))) {

fs/nilfs2/ifile.c +0 -1
-		nilfs_error(sb, "bad inode number: %lu", (unsigned

long)ino);

fs/nilfs2/ifile.c +1 -0
+		nilfs_error(sb, "bad inode number: %llu", ino);

  return -EINVAL;
  }

  err = nilfs_palloc_get_entry_block(ifile, ino, 0, out_bh); if (unlikely(err))

fs/nilfs2/ifile.c +1 -2
-		nilfs_warn(sb, "error %d reading inode: ino=%lu",
-			   err, (unsigned long)ino);
+		nilfs_warn(sb, "error %d reading inode: ino=%llu",

err, ino);
  return err;
 }

fs/nilfs2/ifile.h +0 -0
index 5d116a566d9e..d38a46f5ae41 100644
@@ -19,7 +19,7 @@



 static inline struct nilfs_inode * -nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)
+nilfs_ifile_map_inode(struct inode *ifile, u64 ino, struct buffer_head *ibh)
 {
  size_t __offset_in_folio = nilfs_palloc_entry_offset(ifile, ino, ibh);

fs/nilfs2/ifile.h +0 -0
@@ -31,9 +31,11 @@ static inline void nilfs_ifile_unmap_inode(struct
 nilfs_inode *raw_inode)
  	kunmap_local(raw_inode);
  }


-int nilfs_ifile_create_inode(struct inode *, ino_t *, struct buffer_head **);

fs/nilfs2/ifile.h +0 -2
-int nilfs_ifile_delete_inode(struct inode *, ino_t);
-int nilfs_ifile_get_inode_block(struct inode *, ino_t, struct

buffer_head **);

fs/nilfs2/ifile.h +5 -0
+int nilfs_ifile_create_inode(struct inode *ifile, u64 *out_ino,
+			struct buffer_head **out_bh);
+int nilfs_ifile_delete_inode(struct inode *ifile, u64 ino);
+int nilfs_ifile_get_inode_block(struct inode *ifile, u64 ino,
+				struct buffer_head **out_bh);


 int nilfs_ifile_count_free_inodes(struct inode *, u64 *, u64 *);

fs/nilfs2/inode.c +0 -0
index 51f7e125a311..34e6096069ad 100644
@@ -287,8 +287,7 @@ const struct address_space_operations
 nilfs_buffer_cache_aops = {
  };


 static int nilfs_insert_inode_locked(struct inode *inode,

fs/nilfs2/inode.c +1 -2
-				     struct nilfs_root *root,
-				     unsigned long ino)
+				struct nilfs_root *root, u64 ino)

 {
  struct nilfs_iget_args args = {
  .ino = ino, .root = root, .cno = 0, .type = NILFS_I_TYPE_NORMAL

fs/nilfs2/inode.c +1 -1
@@ -305,7 +304,7 @@ struct inode *nilfs_new_inode(struct inode *dir,
 umode_t mode)
  	struct nilfs_root *root;
  	struct buffer_head *bh;
  	int err = -ENOMEM;
-	ino_t ino;
+	u64 ino;


  inode = new_inode(sb);
  if (unlikely(!inode))

fs/nilfs2/inode.c +0 -0
@@ -443,7 +442,7 @@ int nilfs_read_inode_common(struct inode *inode,
  }


 static int __nilfs_read_inode(struct super_block *sb,

fs/nilfs2/inode.c +0 -1
-			      struct nilfs_root *root, unsigned long

ino,

fs/nilfs2/inode.c +1 -0
+			      struct nilfs_root *root, u64 ino,

        struct inode *inode) {
  struct the_nilfs *nilfs = sb->s_fs_info;

fs/nilfs2/inode.c +0 -0
@@ -482,8 +481,8 @@ static int __nilfs_read_inode(struct super_block
 *sb,

  huge_decode_dev(le64_to_cpu(raw_inode-

Quoted 1 line

i_device_code)));

  } else {
  nilfs_error(sb,

fs/nilfs2/inode.c +0 -1
-			    "invalid file type bits in mode 0%o for

inode %lu",

fs/nilfs2/inode.c +1 -1
-			    inode->i_mode, ino);
+			"invalid file type bits in mode 0%o for

inode %llu",

fs/nilfs2/inode.c +1 -0
+			inode->i_mode, ino);

  err = -EIO;
  goto failed_unmap;
  }

fs/nilfs2/inode.c +0 -0
@@ -533,7 +532,7 @@ static int nilfs_iget_set(struct inode *inode,
 void *opaque)
  }


 struct inode *nilfs_ilookup(struct super_block *sb, struct nilfs_root *root,

fs/nilfs2/inode.c +1 -1
-			    unsigned long ino)
+			    u64 ino)

 {
  struct nilfs_iget_args args = {
  .ino = ino, .root = root, .cno = 0, .type = NILFS_I_TYPE_NORMAL

fs/nilfs2/inode.c +0 -0
@@ -542,8 +541,8 @@ struct inode *nilfs_ilookup(struct super_block
 *sb, struct nilfs_root *root,
  	return ilookup5(sb, ino, nilfs_iget_test, &args);
  }


-struct inode *nilfs_iget_locked(struct super_block *sb, struct nilfs_root *root,

fs/nilfs2/inode.c +2 -1
-				unsigned long ino)
+struct inode *nilfs_iget_locked(struct super_block *sb,
+				struct nilfs_root *root, u64 ino)

 {
  struct nilfs_iget_args args = {
  .ino = ino, .root = root, .cno = 0, .type = NILFS_I_TYPE_NORMAL

fs/nilfs2/inode.c +0 -0
@@ -553,7 +552,7 @@ struct inode *nilfs_iget_locked(struct
 super_block *sb, struct nilfs_root *root,
  }


 struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root,

fs/nilfs2/inode.c +1 -1
-			 unsigned long ino)
+			 u64 ino)

 {
  struct inode *inode;
  int err;

fs/nilfs2/inode.c +0 -0
@@ -579,8 +578,7 @@ struct inode *nilfs_iget(struct super_block *sb,
 struct nilfs_root *root,
  	return inode;
  }


-struct inode *nilfs_iget_for_gc(struct super_block *sb, unsigned long ino,

fs/nilfs2/inode.c +1 -1
-				__u64 cno)
+struct inode *nilfs_iget_for_gc(struct super_block *sb, u64 ino,

__u64 cno)
 {
  struct nilfs_iget_args args = {
  .ino = ino, .root = NULL, .cno = cno, .type = NILFS_I_TYPE_GC

fs/nilfs2/inode.c +0 -0
@@ -740,7 +738,7 @@ void nilfs_write_inode_common(struct inode
 *inode,


 void nilfs_update_inode(struct inode *inode, struct buffer_head *ibh, int flags)
 {

fs/nilfs2/inode.c +1 -1
-	ino_t ino = inode->i_ino;
+	u64 ino = inode->i_ino;

  struct nilfs_inode_info *ii = NILFS_I(inode); struct inode *ifile = ii->i_root->ifile; struct nilfs_inode *raw_inode;

fs/nilfs2/ioctl.c +1 -1
index 0957316e58b8..01a04080ef70 100644
@@ -612,7 +612,7 @@ static int nilfs_ioctl_move_blocks(struct
 super_block *sb,
  	struct nilfs_vdesc *vdesc;
  	struct buffer_head *bh, *n;
  	LIST_HEAD(buffers);
-	ino_t ino;
+	u64 ino;
  	__u64 cno;
  	int i, ret;

fs/nilfs2/namei.c +0 -0
index e2fe95de3d71..6a482da7c682 100644
@@ -54,7 +54,7 @@ static struct dentry *

 nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
 {
  struct inode *inode;

fs/nilfs2/namei.c +1 -1
-	ino_t ino;
+	u64 ino;

  int res;

  if (dentry->d_name.len > NILFS_NAME_LEN)

fs/nilfs2/namei.c +1 -1
@@ -69,7 +69,7 @@ nilfs_lookup(struct inode *dir, struct dentry
 *dentry, unsigned int flags)
  		inode = nilfs_iget(dir->i_sb, NILFS_I(dir)->i_root,
 ino);
  		if (inode == ERR_PTR(-ESTALE)) {
  			nilfs_error(dir->i_sb,
-					"deleted inode referenced:
 %lu", ino);
+				"deleted inode referenced: %llu",

ino);
  return ERR_PTR(-EIO);
  }
  }

fs/nilfs2/namei.c +1 -1
@@ -463,7 +463,7 @@ static int nilfs_rename(struct mnt_idmap *idmap,
   */
  static struct dentry *nilfs_get_parent(struct dentry *child)
  {
-	ino_t ino;
+	u64 ino;
  	int res;
  	struct nilfs_root *root;

fs/nilfs2/nilfs.h +0 -0
index b7e3d91b6243..4fc42d3787a4 100644
@@ -144,7 +144,7 @@ enum {

  ((ino) < NILFS_USER_INO && (NILFS_SYS_INO_BITS & BIT(ino))))

 #define NILFS_PRIVATE_INODE(ino)
({ \

fs/nilfs2/nilfs.h +0 -1
-	ino_t __ino =

(ino); \

fs/nilfs2/nilfs.h +1 -0
+	u64 __ino =

(ino); \
  ((__ino) < NILFS_USER_INO && (__ino) != NILFS_ROOT_INO
&& \
  (__ino) != NILFS_SKETCH_INO); })

fs/nilfs2/nilfs.h +0 -0
@@ -255,7 +255,7 @@ static inline __u32 nilfs_mask_flags(umode_t
 mode, __u32 flags)


 /* dir.c */
 int nilfs_add_link(struct dentry *, struct inode *); -int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, ino_t *ino);
+int nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr, u64 *ino);
 int nilfs_make_empty(struct inode *, struct inode *); struct nilfs_dir_entry *nilfs_find_entry(struct inode *, const struct qstr *,
  struct folio **);

fs/nilfs2/nilfs.h +0 -0
@@ -287,13 +287,12 @@ extern int nilfs_read_inode_common(struct inode
 *, struct nilfs_inode *);
  void nilfs_write_inode_common(struct inode *inode,
  			      struct nilfs_inode *raw_inode);

 struct inode *nilfs_ilookup(struct super_block *sb, struct nilfs_root *root,

fs/nilfs2/nilfs.h +0 -2
-			    unsigned long ino);
-struct inode *nilfs_iget_locked(struct super_block *sb, struct

nilfs_root *root,

fs/nilfs2/nilfs.h +3 -1
-				unsigned long ino);
+			    u64 ino);
+struct inode *nilfs_iget_locked(struct super_block *sb,
+				struct nilfs_root *root, u64 ino);

 struct inode *nilfs_iget(struct super_block *sb, struct nilfs_root *root,

fs/nilfs2/nilfs.h +0 -3
-			 unsigned long ino);
-extern struct inode *nilfs_iget_for_gc(struct super_block *sb,
-				       unsigned long ino, __u64

cno);

fs/nilfs2/nilfs.h +2 -0
+			 u64 ino);
+struct inode *nilfs_iget_for_gc(struct super_block *sb, u64 ino,

__u64 cno);
 int nilfs_attach_btree_node_cache(struct inode *inode); void nilfs_detach_btree_node_cache(struct inode *inode); struct inode *nilfs_iget_for_shadow(struct inode *inode);

fs/nilfs2/page.c +1 -1
index 1d00bce21c37..cf4f1c6798f5 100644
@@ -154,7 +154,7 @@ void nilfs_folio_bug(struct folio *folio)
  {
  	struct buffer_head *bh, *head;
  	struct address_space *m;
-	unsigned long ino;
+	u64 ino;


  if (unlikely(!folio)) {
  printk(KERN_CRIT "NILFS_FOLIO_BUG(NULL)\n");

fs/nilfs2/page.c +0 -0
@@ -164,10 +164,9 @@ void nilfs_folio_bug(struct folio *folio)
  	m = folio->mapping;
  	ino = m ? m->host->i_ino : 0;

fs/nilfs2/page.c +0 -1
-	printk(KERN_CRIT "NILFS_FOLIO_BUG(%p): cnt=%d index#=%llu

flags=0x%lx "

fs/nilfs2/page.c +0 -3
-	       "mapping=%p ino=%lu\n",
-	       folio, folio_ref_count(folio),
-	       (unsigned long long)folio->index, folio->flags.f, m,

ino);

fs/nilfs2/page.c +1 -0
+	printk(KERN_CRIT "NILFS_FOLIO_BUG(%p): cnt=%d index#=%lu

flags=0x%lx  mapping=%p ino=%llu\n",

fs/nilfs2/page.c +1 -0
+		folio, folio_ref_count(folio), folio->index, folio-
Quoted 1 line

flags.f,

fs/nilfs2/page.c +1 -0
+		m, ino);


  head = folio_buffers(folio);
  if (head) {

fs/nilfs2/recovery.c +0 -0
index 4d5a6aa5214c..45fb37215669 100644
@@ -34,7 +34,7 @@ enum {


 /* work structure for recovery */
 struct nilfs_recovery_block {

fs/nilfs2/recovery.c +1 -1
-	ino_t ino;		/*
+	u64 ino;		/*

  * Inode number of the file that this block
  * belongs to
  */

fs/nilfs2/recovery.c +1 -1
@@ -333,7 +333,7 @@ static int nilfs_scan_dsync_log(struct the_nilfs
 *nilfs, sector_t start_blocknr,
  	unsigned int offset;
  	u32 nfinfo, sumbytes;
  	sector_t blocknr;
-	ino_t ino;
+	u64 ino;
  	int err = -EIO;


  nfinfo = le32_to_cpu(sum->ss_nfinfo);

fs/nilfs2/segment.c +1 -1
index 5896fdae5669..829573cb6131 100644
@@ -1610,7 +1610,7 @@ nilfs_segctor_update_payload_blocknr(struct
 nilfs_sc_info *sci,
  	struct nilfs_finfo *finfo = NULL;
  	union nilfs_binfo binfo;
  	struct buffer_head *bh, *bh_org;
-	ino_t ino = 0;
+	u64 ino = 0;
  	int err = 0;
Quoted 2 lines


  if (!nfinfo)

Applied.

Thanks,
Slava.