@@ -391,40 +391,6 @@ struct pid *pidfd_pid(const struct file *file)
391
391
392
392
static struct vfsmount * pidfs_mnt __ro_after_init ;
393
393
394
- #if BITS_PER_LONG == 32
395
- /*
396
- * Provide a fallback mechanism for 32-bit systems so processes remain
397
- * reliably comparable by inode number even on those systems.
398
- */
399
- static DEFINE_IDA (pidfd_inum_ida );
400
-
401
- static int pidfs_inum (struct pid * pid , unsigned long * ino )
402
- {
403
- int ret ;
404
-
405
- ret = ida_alloc_range (& pidfd_inum_ida , RESERVED_PIDS + 1 ,
406
- UINT_MAX , GFP_ATOMIC );
407
- if (ret < 0 )
408
- return - ENOSPC ;
409
-
410
- * ino = ret ;
411
- return 0 ;
412
- }
413
-
414
- static inline void pidfs_free_inum (unsigned long ino )
415
- {
416
- if (ino > 0 )
417
- ida_free (& pidfd_inum_ida , ino );
418
- }
419
- #else
420
- static inline int pidfs_inum (struct pid * pid , unsigned long * ino )
421
- {
422
- * ino = pidfs_ino (pid -> ino );
423
- return 0 ;
424
- }
425
- #define pidfs_free_inum (ino ) ((void)(ino))
426
- #endif
427
-
428
394
/*
429
395
* The vfs falls back to simple_setattr() if i_op->setattr() isn't
430
396
* implemented. Let's reject it completely until we have a clean
@@ -476,7 +442,6 @@ static void pidfs_evict_inode(struct inode *inode)
476
442
477
443
clear_inode (inode );
478
444
put_pid (pid );
479
- pidfs_free_inum (inode -> i_ino );
480
445
}
481
446
482
447
static const struct super_operations pidfs_sops = {
@@ -509,13 +474,9 @@ static int pidfs_init_inode(struct inode *inode, void *data)
509
474
inode -> i_mode |= S_IRWXU ;
510
475
inode -> i_op = & pidfs_inode_operations ;
511
476
inode -> i_fop = & pidfs_file_operations ;
477
+ inode -> i_ino = pidfs_ino (pid -> ino );
512
478
inode -> i_generation = pidfs_gen (pid -> ino );
513
- /*
514
- * Inode numbering for pidfs start at RESERVED_PIDS + 1. This
515
- * avoids collisions with the root inode which is 1 for pseudo
516
- * filesystems.
517
- */
518
- return pidfs_inum (data , & inode -> i_ino );
479
+ return 0 ;
519
480
}
520
481
521
482
static void pidfs_put_data (void * data )
0 commit comments