Commit ed5916c1 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman
Browse files

staging: exfat: Clean up the namespace pollution part 2

parent 19e2bfe6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -842,13 +842,13 @@ int multi_sector_read(struct super_block *sb, sector_t sec,
int multi_sector_write(struct super_block *sb, sector_t sec,
		       struct buffer_head *bh, s32 num_secs, bool sync);

void bdev_open(struct super_block *sb);
void bdev_close(struct super_block *sb);
int bdev_read(struct super_block *sb, sector_t secno,
void exfat_bdev_open(struct super_block *sb);
void exfat_bdev_close(struct super_block *sb);
int exfat_bdev_read(struct super_block *sb, sector_t secno,
	      struct buffer_head **bh, u32 num_secs, bool read);
int bdev_write(struct super_block *sb, sector_t secno,
int exfat_bdev_write(struct super_block *sb, sector_t secno,
	       struct buffer_head *bh, u32 num_secs, bool sync);
int bdev_sync(struct super_block *sb);
int exfat_bdev_sync(struct super_block *sb);

extern const u8 uni_upcase[];
#endif /* _EXFAT_H */
+5 −5
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#include <linux/fs.h>
#include "exfat.h"

void bdev_open(struct super_block *sb)
void exfat_bdev_open(struct super_block *sb)
{
	struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);

@@ -23,14 +23,14 @@ void bdev_open(struct super_block *sb)
	p_bd->opened = true;
}

void bdev_close(struct super_block *sb)
void exfat_bdev_close(struct super_block *sb)
{
	struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);

	p_bd->opened = false;
}

int bdev_read(struct super_block *sb, sector_t secno, struct buffer_head **bh,
int exfat_bdev_read(struct super_block *sb, sector_t secno, struct buffer_head **bh,
	      u32 num_secs, bool read)
{
	struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
@@ -65,7 +65,7 @@ int bdev_read(struct super_block *sb, sector_t secno, struct buffer_head **bh,
	return -EIO;
}

int bdev_write(struct super_block *sb, sector_t secno, struct buffer_head *bh,
int exfat_bdev_write(struct super_block *sb, sector_t secno, struct buffer_head *bh,
	       u32 num_secs, bool sync)
{
	s32 count;
@@ -118,7 +118,7 @@ no_bh:
	return -EIO;
}

int bdev_sync(struct super_block *sb)
int exfat_bdev_sync(struct super_block *sb)
{
	struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
#ifdef CONFIG_EXFAT_KERNEL_DEBUG
+4 −4
Original line number Diff line number Diff line
@@ -2569,7 +2569,7 @@ int sector_read(struct super_block *sb, sector_t sec, struct buffer_head **bh,
	}

	if (!p_fs->dev_ejected) {
		ret = bdev_read(sb, sec, bh, 1, read);
		ret = exfat_bdev_read(sb, sec, bh, 1, read);
		if (ret != 0)
			p_fs->dev_ejected = 1;
	}
@@ -2598,7 +2598,7 @@ int sector_write(struct super_block *sb, sector_t sec, struct buffer_head *bh,
	}

	if (!p_fs->dev_ejected) {
		ret = bdev_write(sb, sec, bh, 1, sync);
		ret = exfat_bdev_write(sb, sec, bh, 1, sync);
		if (ret != 0)
			p_fs->dev_ejected = 1;
	}
@@ -2621,7 +2621,7 @@ int multi_sector_read(struct super_block *sb, sector_t sec,
	}

	if (!p_fs->dev_ejected) {
		ret = bdev_read(sb, sec, bh, num_secs, read);
		ret = exfat_bdev_read(sb, sec, bh, num_secs, read);
		if (ret != 0)
			p_fs->dev_ejected = 1;
	}
@@ -2649,7 +2649,7 @@ int multi_sector_write(struct super_block *sb, sector_t sec,
	}

	if (!p_fs->dev_ejected) {
		ret = bdev_write(sb, sec, bh, num_secs, sync);
		ret = exfat_bdev_write(sb, sec, bh, num_secs, sync);
		if (ret != 0)
			p_fs->dev_ejected = 1;
	}
+8 −8
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ static DEFINE_MUTEX(z_mutex);
static inline void fs_sync(struct super_block *sb, bool do_sync)
{
	if (do_sync)
		bdev_sync(sb);
		exfat_bdev_sync(sb);
}

/*
@@ -361,7 +361,7 @@ static int ffsMountVol(struct super_block *sb)
	p_fs->dev_ejected = 0;

	/* open the block device */
	bdev_open(sb);
	exfat_bdev_open(sb);

	if (p_bd->sector_size < sb->s_blocksize) {
		printk(KERN_INFO "EXFAT: maont failed - sector size %d less than blocksize %ld\n",
@@ -385,7 +385,7 @@ static int ffsMountVol(struct super_block *sb)
	/* check the validity of PBR */
	if (GET16_A(p_pbr->signature) != PBR_SIGNATURE) {
		brelse(tmp_bh);
		bdev_close(sb);
		exfat_bdev_close(sb);
		ret = -EFSCORRUPTED;
		goto out;
	}
@@ -407,26 +407,26 @@ static int ffsMountVol(struct super_block *sb)
	brelse(tmp_bh);

	if (ret) {
		bdev_close(sb);
		exfat_bdev_close(sb);
		goto out;
	}

	ret = load_alloc_bitmap(sb);
	if (ret) {
		bdev_close(sb);
		exfat_bdev_close(sb);
		goto out;
	}
	ret = load_upcase_table(sb);
	if (ret) {
		free_alloc_bitmap(sb);
		bdev_close(sb);
		exfat_bdev_close(sb);
		goto out;
	}

	if (p_fs->dev_ejected) {
		free_upcase_table(sb);
		free_alloc_bitmap(sb);
		bdev_close(sb);
		exfat_bdev_close(sb);
		ret = -EIO;
		goto out;
	}
@@ -461,7 +461,7 @@ static int ffsUmountVol(struct super_block *sb)
	buf_release_all(sb);

	/* close the block device */
	bdev_close(sb);
	exfat_bdev_close(sb);

	if (p_fs->dev_ejected) {
		pr_info("[EXFAT] unmounted with media errors. Device is already ejected.\n");