hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/omfs/inode.c
....@@ -1,7 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Optimized MPEG FS - inode and super operations.
34 * Copyright (C) 2006 Bob Copeland <me@bobcopeland.com>
4
- * Released under GPL v2.
55 */
66 #include <linux/module.h>
77 #include <linux/sched.h>
....@@ -20,6 +20,7 @@
2020 MODULE_AUTHOR("Bob Copeland <me@bobcopeland.com>");
2121 MODULE_DESCRIPTION("OMFS (ReplayTV/Karma) Filesystem for Linux");
2222 MODULE_LICENSE("GPL");
23
+MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY);
2324
2425 struct buffer_head *omfs_bread(struct super_block *sb, sector_t block)
2526 {
....@@ -282,8 +283,7 @@
282283 buf->f_blocks = sbi->s_num_blocks;
283284 buf->f_files = sbi->s_num_blocks;
284285 buf->f_namelen = OMFS_NAMELEN;
285
- buf->f_fsid.val[0] = (u32)id;
286
- buf->f_fsid.val[1] = (u32)(id >> 32);
286
+ buf->f_fsid = u64_to_fsid(id);
287287
288288 buf->f_bfree = buf->f_bavail = buf->f_ffree =
289289 omfs_count_free(s);
....@@ -363,12 +363,11 @@
363363 bh = sb_bread(sb, block++);
364364 if (!bh)
365365 goto nomem_free;
366
- *ptr = kmalloc(sb->s_blocksize, GFP_KERNEL);
366
+ *ptr = kmemdup(bh->b_data, sb->s_blocksize, GFP_KERNEL);
367367 if (!*ptr) {
368368 brelse(bh);
369369 goto nomem_free;
370370 }
371
- memcpy(*ptr, bh->b_data, sb->s_blocksize);
372371 if (count < sb->s_blocksize)
373372 memset((void *)*ptr + count, 0xff,
374373 sb->s_blocksize - count);
....@@ -478,6 +477,10 @@
478477
479478 sb->s_maxbytes = 0xffffffff;
480479
480
+ sb->s_time_gran = NSEC_PER_MSEC;
481
+ sb->s_time_min = 0;
482
+ sb->s_time_max = U64_MAX / MSEC_PER_SEC;
483
+
481484 sb_set_blocksize(sb, 0x200);
482485
483486 bh = sb_bread(sb, 0);