Commit 74b5cab6 authored by Arnd Bergmann's avatar Arnd Bergmann

fat: use prandom_u32() for i_generation

Similar to commit 46c9a946 ("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: default avatarArnd Bergmann <arnd@arndb.de>
parent e42617b8
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <linux/random.h>
#include <linux/iversion.h> #include <linux/iversion.h>
#include "fat.h" #include "fat.h"
...@@ -521,7 +522,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) ...@@ -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_uid = sbi->options.fs_uid;
inode->i_gid = sbi->options.fs_gid; inode->i_gid = sbi->options.fs_gid;
inode_inc_iversion(inode); inode_inc_iversion(inode);
inode->i_generation = get_seconds(); inode->i_generation = prandom_u32();
if ((de->attr & ATTR_DIR) && !IS_FREE(de->name)) { if ((de->attr & ATTR_DIR) && !IS_FREE(de->name)) {
inode->i_generation &= ~1; inode->i_generation &= ~1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment