Commit 6b390e82 authored by Dyneteve's avatar Dyneteve

kernel: Update sdfat filesystem

Change-Id: I488101ba5ae319f02836b99534af907b29db8056
parent 559bf6de
......@@ -253,9 +253,15 @@ void sdfat_time_unix2fat(struct sdfat_sb_info *sbi, struct timespec *ts,
TIMESTAMP_T *tm_now(struct sdfat_sb_info *sbi, TIMESTAMP_T *tp)
{
struct timespec ts = CURRENT_TIME_SEC;
struct timespec ts;
DATE_TIME_T dt;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
ts = CURRENT_TIME_SEC;
#else
ktime_get_real_ts(&ts);
#endif
sdfat_time_unix2fat(sbi, &ts, &dt);
tp->year = dt.Year;
......@@ -378,4 +384,3 @@ void __sdfat_dmsg(int level, const char *fmt, ...)
#endif
}
#endif
......@@ -94,7 +94,11 @@ static inline void __sdfat_submit_bio_write2(int flags, struct bio *bio)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
static void mpage_write_end_io(struct bio *bio)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
__mpage_write_end_io(bio, bio->bi_status);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) */
__mpage_write_end_io(bio, bio->bi_error);
#endif
}
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
static void mpage_write_end_io(struct bio *bio, int err)
......@@ -277,7 +281,11 @@ mpage_alloc(struct block_device *bdev,
}
if (bio) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
bio_set_dev(bio, bdev);
#else
bio->bi_bdev = bdev;
#endif
__sdfat_set_bio_sector(bio, first_sector);
}
return bio;
......@@ -361,7 +369,11 @@ static int sdfat_mpage_writepage(struct page *page,
if (buffer_new(bh)) {
clear_buffer_new(bh);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
clean_bdev_bh_alias(bh);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) */
unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr);
#endif
}
}
......@@ -411,8 +423,12 @@ static int sdfat_mpage_writepage(struct page *page,
goto confused;
if (buffer_new(&map_bh))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
clean_bdev_bh_alias(&map_bh);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) */
unmap_underlying_metadata(map_bh.b_bdev,
map_bh.b_blocknr);
#endif
if (buffer_boundary(&map_bh)) {
boundary_block = map_bh.b_blocknr;
boundary_bdev = map_bh.b_bdev;
......@@ -604,4 +620,3 @@ int sdfat_mpage_writepages(struct address_space *mapping,
}
#endif /* CONFIG_SDFAT_ALIGNED_MPAGE_WRITE */
This diff is collapsed.
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