projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e42617b
)
fat: use prandom_u32() for i_generation
author
Arnd Bergmann
<arnd@arndb.de>
Thu, 24 Oct 2019 13:31:19 +0000
(15:31 +0200)
committer
Arnd Bergmann
<arnd@arndb.de>
Wed, 18 Dec 2019 17:07:31 +0000
(18:07 +0100)
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>
fs/fat/inode.c
patch
|
blob
|
history
diff --git
a/fs/fat/inode.c
b/fs/fat/inode.c
index 5f04c5c810fb67276a92a705bb4ccf5ed6f89da5..594b05ae16c9bf04584ae9c6c4dba50dbdecffcb 100644
(file)
--- 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;