summaryrefslogtreecommitdiffstats
path: root/fs/fat/inode.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-10-24 15:31:19 +0200
committerArnd Bergmann <arnd@arndb.de>2019-12-18 18:07:31 +0100
commit74b5cab6cc8554d759c3cd5aeba884bd8b12f22e (patch)
treee67b584c5b55ba511890b3b593da30dde9034e9a /fs/fat/inode.c
parente42617b825f8073569da76dc4510bfa019b1c35a (diff)
downloadlinux-74b5cab6cc8554d759c3cd5aeba884bd8b12f22e.tar.gz
linux-74b5cab6cc8554d759c3cd5aeba884bd8b12f22e.tar.bz2
linux-74b5cab6cc8554d759c3cd5aeba884bd8b12f22e.zip
fat: use prandom_u32() for i_generation
Similar to commit 46c9a946d766 ("shmem: use monotonic time for i_generation") we should not use the deprecated get_seconds() interface for i_generation. prandom_u32() is the replacement used in other file systems. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r--fs/fat/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 5f04c5c810fb..594b05ae16c9 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -21,6 +21,7 @@
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <asm/unaligned.h>
+#include <linux/random.h>
#include <linux/iversion.h>
#include "fat.h"
@@ -521,7 +522,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
inode->i_uid = sbi->options.fs_uid;
inode->i_gid = sbi->options.fs_gid;
inode_inc_iversion(inode);
- inode->i_generation = get_seconds();
+ inode->i_generation = prandom_u32();
if ((de->attr & ATTR_DIR) && !IS_FREE(de->name)) {
inode->i_generation &= ~1;