diff mbox

[U-Boot,v3] fat: Define MAX_CLUSTSIZE using CONFIG_FS_FAT_MAX_CLUSTSIZE

Message ID 57c596df-747c-452b-b08a-3b8711a78590@BN1BFFO11FD055.protection.gbl
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Siva Durga Prasad Paladugu May 26, 2014, 1:48 p.m. UTC
Define the MAX_CLUSTSIZE to default of 65536 only if
CONFIG_FS_FAT_MAX_CLUSTSIZE is not defined.
This option has been provided to save memory in some
memory constrained cases.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
---

Changes in v3:
-Used CONFIG_FS_FAT_MAX_CLUSTSIZE to define MAX_CLUSTSIZE
as per review comment.

Changes in v2:
-Defined CONFIG_FS_FAT_MAX_CLUSTSIZE and documented as
per review comment.

 README        |    6 ++++++
 include/fat.h |    6 +++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

Comments

Michal Simek May 28, 2014, 12:10 p.m. UTC | #1
On 05/26/2014 03:48 PM, Siva Durga Prasad Paladugu wrote:
> Define the MAX_CLUSTSIZE to default of 65536 only if
> CONFIG_FS_FAT_MAX_CLUSTSIZE is not defined.
> This option has been provided to save memory in some
> memory constrained cases.
> 
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> ---
> 
> Changes in v3:
> -Used CONFIG_FS_FAT_MAX_CLUSTSIZE to define MAX_CLUSTSIZE
> as per review comment.
> 
> Changes in v2:
> -Defined CONFIG_FS_FAT_MAX_CLUSTSIZE and documented as
> per review comment.
> 
>  README        |    6 ++++++
>  include/fat.h |    6 +++++-
>  2 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/README b/README
> index 5f89552..2f2aba3 100644
> --- a/README
> +++ b/README
> @@ -1613,6 +1613,12 @@ CBFS (Coreboot Filesystem) support
>  		filesystem. Available commands are cbfsinit, cbfsinfo, cbfsls
>  		and cbfsload.
>  
> +- FAT(File Allocation Table) filesystem cluster size:
> +		CONFIG_FS_FAT_MAX_CLUSTSIZE
> +
> +		Define the max cluster size for fat operations else
> +		a default value of 65536 will be defined.
> +
>  - Keyboard Support:
>  		CONFIG_ISA_KEYBOARD
>  
> diff --git a/include/fat.h b/include/fat.h
> index 81d9790..63cf787 100644
> --- a/include/fat.h
> +++ b/include/fat.h
> @@ -18,7 +18,11 @@
>  #define VFAT_MAXSEQ		9   /* Up to 9 of 13 2-byte UTF-16 entries */
>  #define PREFETCH_BLOCKS		2
>  
> -#define MAX_CLUSTSIZE	65536
> +#ifndef CONFIG_FS_FAT_MAX_CLUSTSIZE
> +#define CONFIG_FS_FAT_MAX_CLUSTSIZE 65536
> +#endif
> +#define MAX_CLUSTSIZE	CONFIG_FS_FAT_MAX_CLUSTSIZE
> +
>  #define DIRENTSPERBLOCK	(mydata->sect_size / sizeof(dir_entry))
>  #define DIRENTSPERCLUST	((mydata->clust_size * mydata->sect_size) / \
>  			 sizeof(dir_entry))
> 

Acked-by: Michal Simek <monstr@monstr.eu>

Thanks,
Michal
Tom Rini June 5, 2014, 10:47 p.m. UTC | #2
On Mon, May 26, 2014 at 07:18:37PM +0530, Siva Durga Prasad Paladugu wrote:

> Define the MAX_CLUSTSIZE to default of 65536 only if
> CONFIG_FS_FAT_MAX_CLUSTSIZE is not defined.
> This option has been provided to save memory in some
> memory constrained cases.
> 
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Acked-by: Michal Simek <monstr@monstr.eu>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/README b/README
index 5f89552..2f2aba3 100644
--- a/README
+++ b/README
@@ -1613,6 +1613,12 @@  CBFS (Coreboot Filesystem) support
 		filesystem. Available commands are cbfsinit, cbfsinfo, cbfsls
 		and cbfsload.
 
+- FAT(File Allocation Table) filesystem cluster size:
+		CONFIG_FS_FAT_MAX_CLUSTSIZE
+
+		Define the max cluster size for fat operations else
+		a default value of 65536 will be defined.
+
 - Keyboard Support:
 		CONFIG_ISA_KEYBOARD
 
diff --git a/include/fat.h b/include/fat.h
index 81d9790..63cf787 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -18,7 +18,11 @@ 
 #define VFAT_MAXSEQ		9   /* Up to 9 of 13 2-byte UTF-16 entries */
 #define PREFETCH_BLOCKS		2
 
-#define MAX_CLUSTSIZE	65536
+#ifndef CONFIG_FS_FAT_MAX_CLUSTSIZE
+#define CONFIG_FS_FAT_MAX_CLUSTSIZE 65536
+#endif
+#define MAX_CLUSTSIZE	CONFIG_FS_FAT_MAX_CLUSTSIZE
+
 #define DIRENTSPERBLOCK	(mydata->sect_size / sizeof(dir_entry))
 #define DIRENTSPERCLUST	((mydata->clust_size * mydata->sect_size) / \
 			 sizeof(dir_entry))