Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac2599d1 authored by GrayJack's avatar GrayJack Committed by Andreas Schneider
Browse files

fs: sdfat: Use clean_bdev_bh_alias instead of unmap_underlying_metadata for >=4.10

.readlink should be left uninitialised if no special .readlink is
required
Fixed a mistake of using __sdfat_writepage_end_io() instead of
__mpage_write_end_io() on mpage.c
parent a4c7e654
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -95,9 +95,9 @@ static inline void __sdfat_submit_bio_write2(int flags, struct bio *bio)
static void  mpage_write_end_io(struct bio *bio)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
	__sdfat_writepage_end_io(bio, bio->bi_status);
	__mpage_write_end_io(bio, bio->bi_status);
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) */
	__sdfat_writepage_end_io(bio, bio->bi_error);
	__mpage_write_end_io(bio, bio->bi_error);
#endif
}
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
@@ -369,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
				}
			}

@@ -419,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;
+12 −0
Original line number Diff line number Diff line
@@ -2882,9 +2882,15 @@ static int sdfat_setattr(struct dentry *dentry, struct iattr *attr)
	return error;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
static int sdfat_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags)
{
	struct inode *inode = path->dentry->d_inode;
#else
static int sdfat_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
{
	struct inode *inode = dentry->d_inode;
#endif

	TMSG("%s entered\n", __func__);

@@ -2919,7 +2925,9 @@ static const struct inode_operations sdfat_dir_inode_operations = {
/*  File Operations                                                     */
/*======================================================================*/
static const struct inode_operations sdfat_symlink_inode_operations = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
	.readlink    = generic_readlink,
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
	.get_link = sdfat_follow_link,
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) */
@@ -3531,7 +3539,11 @@ static int sdfat_writepage(struct page *page, struct writeback_control *wbc)

			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
			}
		}