summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderfelot <frederic.koch@gmail.com>2018-08-20 14:40:20 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-20 15:38:47 +0200
commitf3a2a47c5b6cd42babdf053fc99ce96152005f37 (patch)
treeeca31b9a9ca5b8d8d275311d05b7e17464b1ded7
parenta661c8568be7ba543e0bc33d1599beca8071d3c3 (diff)
Revert "fs: sdfat: Update to version 2.0.8"
This reverts commit a661c8568be7ba543e0bc33d1599beca8071d3c3. This commit accidentally reverted 8949555ac66dc451b39d07607d3613036338ed67 in the process. I will redo it.
-rw-r--r--amap_smart.c5
-rw-r--r--statistics.c38
-rw-r--r--version.h2
3 files changed, 18 insertions, 27 deletions
diff --git a/amap_smart.c b/amap_smart.c
index 5a76bd96bd44..b556f868d76e 100644
--- a/amap_smart.c
+++ b/amap_smart.c
@@ -325,6 +325,7 @@ int amap_create(struct super_block *sb, u32 pack_ratio, u32 sect_per_au, u32 hid
int i, i_clu, i_au;
int i_au_root = -1, i_au_hot_from = INT_MAX;
u32 misaligned_sect = hidden_sect;
+ u64 tmp;
BUG_ON(!fsi->bd_opened);
@@ -383,7 +384,9 @@ int amap_create(struct super_block *sb, u32 pack_ratio, u32 sect_per_au, u32 hid
amap->sb = sb;
- amap->n_au = (fsi->num_sectors + misaligned_sect + sect_per_au - 1) / sect_per_au;
+ tmp = fsi->num_sectors + misaligned_sect + sect_per_au - 1;
+ do_div(tmp, sect_per_au);
+ amap->n_au = tmp;
amap->n_clean_au = 0;
amap->n_full_au = 0;
diff --git a/statistics.c b/statistics.c
index 2ae1a93fb330..00624df5a636 100644
--- a/statistics.c
+++ b/statistics.c
@@ -47,10 +47,8 @@ static struct kset *sdfat_statistics_kset;
static ssize_t vfat_cl_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
- return snprintf(buff, PAGE_SIZE, "\"VCL_512B_I\":\"%u\","
- "\"VCL_1K_I\":\"%u\",\"VCL_2K_I\":\"%u\","
- "\"VCL_4K_I\":\"%u\",\"VCL_8K_I\":\"%u\","
- "\"VCL_16K_I\":\"%u\",\"VCL_32K_I\":\"%u\"\n",
+ return snprintf(buff, PAGE_SIZE, "VCL_512B_I:%u,VCL_1K_I:%u,VCL_2K_I:%u,"
+ "VCL_4K_I:%u,VCL_8K_I:%u,VCL_16K_I:%u,VCL_32K_I:%u\n",
statistics.clus_vfat[0], statistics.clus_vfat[1],
statistics.clus_vfat[2], statistics.clus_vfat[3],
statistics.clus_vfat[4], statistics.clus_vfat[5],
@@ -60,15 +58,10 @@ static ssize_t vfat_cl_show(struct kobject *kobj,
static ssize_t exfat_cl_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
- return snprintf(buff, PAGE_SIZE, "\"ECL_512B_I\":\"%u\","
- "\"ECL_1K_I\":\"%u\",\"ECL_2K_I\":\"%u\","
- "\"ECL_4K_I\":\"%u\",\"ECL_8K_I\":\"%u\","
- "\"ECL_16K_I\":\"%u\",\"ECL_32K_I\":\"%u\","
- "\"ECL_64K_I\":\"%u\",\"ECL_128K_I\":\"%u\","
- "\"ECL_256K_I\":\"%u\",\"ECL_512K_I\":\"%u\","
- "\"ECL_1M_I\":\"%u\",\"ECL_2M_I\":\"%u\","
- "\"ECL_4M_I\":\"%u\",\"ECL_8M_I\":\"%u\","
- "\"ECL_16M_I\":\"%u\",\"ECL_32M_I\":\"%u\"\n",
+ return snprintf(buff, PAGE_SIZE, "ECL_512B_I:%u,ECL_1K_I:%u,ECL_2K_I:%u,"
+ "ECL_4K_I:%u,ECL_8K_I:%u,ECL_16K_I:%u,ECL_32K_I:%u,ECL_64K_I:%u,"
+ "ECL_128K_I:%u,ECL_256K_I:%u,ECL_512K_I:%u,ECL_1M_I:%u,"
+ "ECL_2M_I:%u,ECL_4M_I:%u,ECL_8M_I:%u,ECL_16M_I:%u,ECL_32M_I:%u\n",
statistics.clus_exfat[0], statistics.clus_exfat[1],
statistics.clus_exfat[2], statistics.clus_exfat[3],
statistics.clus_exfat[4], statistics.clus_exfat[5],
@@ -83,9 +76,8 @@ static ssize_t exfat_cl_show(struct kobject *kobj,
static ssize_t mount_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
- return snprintf(buff, PAGE_SIZE, "\"FAT12_MNT_I\":\"%u\","
- "\"FAT16_MNT_I\":\"%u\",\"FAT32_MNT_I\":\"%u\","
- "\"EXFAT_MNT_I\":\"%u\"\n",
+ return snprintf(buff, PAGE_SIZE, "FAT12_MNT_I:%u,FAT16_MNT_I:%u,FAT32_MNT_I:%u,"
+ "EXFAT_MNT_I:%u\n",
statistics.mnt_cnt[SDFAT_MNT_FAT12],
statistics.mnt_cnt[SDFAT_MNT_FAT16],
statistics.mnt_cnt[SDFAT_MNT_FAT32],
@@ -95,10 +87,8 @@ static ssize_t mount_show(struct kobject *kobj,
static ssize_t nofat_op_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
- return snprintf(buff, PAGE_SIZE, "\"NOFAT_MOUNT_I\":\"%u\","
- "\"NOFAT_MKDIR_I\":\"%u\",\"NOFAT_CREATE_I\":\"%u\","
- "\"NOFAT_READ_I\":\"%u\",\"NOFAT_WRITE_I\":\"%u\","
- "\"NOFAT_TRUNC_I\":\"%u\"\n",
+ return snprintf(buff, PAGE_SIZE, "NOFAT_MOUNT_I:%u,NOFAT_MKDIR_I:%u,NOFAT_CREATE_I:%u,"
+ "NOFAT_READ_I:%u,NOFAT_WRITE_I:%u,NOFAT_TRUNC_I:%u\n",
statistics.nofat_op[SDFAT_OP_EXFAT_MNT],
statistics.nofat_op[SDFAT_OP_MKDIR],
statistics.nofat_op[SDFAT_OP_CREATE],
@@ -110,11 +100,9 @@ static ssize_t nofat_op_show(struct kobject *kobj,
static ssize_t vol_size_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
- return snprintf(buff, PAGE_SIZE, "\"VOL_4G_I\":\"%u\","
- "\"VOL_8G_I\":\"%u\",\"VOL_16G_I\":\"%u\","
- "\"VOL_32G_I\":\"%u\",\"VOL_64G_I\":\"%u\","
- "\"VOL_128G_I\":\"%u\",\"VOL_256G_I\":\"%u\","
- "\"VOL_512G_I\":\"%u\",\"VOL_XTB_I\":\"%u\"\n",
+ return snprintf(buff, PAGE_SIZE, "VOL_4G_I:%u,VOL_8G_I:%u,VOL_16G_I:%u,"
+ "VOL_32G_I:%u,VOL_64G_I:%u,VOL_128G_I:%u,VOL_256G_I:%u,"
+ "VOL_512G_I:%u,VOL_XTB_I:%u\n",
statistics.vol_size[SDFAT_VOL_4G],
statistics.vol_size[SDFAT_VOL_8G],
statistics.vol_size[SDFAT_VOL_16G],
diff --git a/version.h b/version.h
index 999f052a7e92..c49175c0228b 100644
--- a/version.h
+++ b/version.h
@@ -22,4 +22,4 @@
/* PURPOSE : sdFAT File Manager */
/* */
/************************************************************************/
-#define SDFAT_VERSION "2.0.8-lineage"
+#define SDFAT_VERSION "2.0.6-lineage"