vfs-ino.patch 604 B

12345678910111213141516171819202122232425
  1. SPDX-License-Identifier: GPL-2.0
  2. diff --git a/fs/inode.c b/fs/inode.c
  3. index 9cafde77e2b0..318aef01fe9e 100644
  4. --- a/fs/inode.c
  5. +++ b/fs/inode.c
  6. @@ -1011,6 +1011,8 @@ unsigned int get_next_ino(void)
  7. unsigned int *p = &get_cpu_var(last_ino);
  8. unsigned int res = *p;
  9. +start:
  10. +
  11. #ifdef CONFIG_SMP
  12. if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
  13. static atomic_t shared_last_ino;
  14. @@ -1023,7 +1025,7 @@ unsigned int get_next_ino(void)
  15. res++;
  16. /* get_next_ino should not provide a 0 inode number */
  17. if (unlikely(!res))
  18. - res++;
  19. + goto start;
  20. *p = res;
  21. put_cpu_var(last_ino);
  22. return res;