All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect
       [not found] <20160911205142.4259-1-stefan.bruens@rwth-aachen.de>
@ 2016-09-11 20:51 ` Stefan Brüns
  2016-09-12 10:43   ` Lukasz Majewski
                     ` (3 more replies)
  2016-09-11 20:51 ` [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk Stefan Brüns
                   ` (2 subsequent siblings)
  3 siblings, 4 replies; 14+ messages in thread
From: Stefan Brüns @ 2016-09-11 20:51 UTC (permalink / raw)
  To: u-boot

fatlength is a local variable which is no more used after the assignment.
s_name is not used in the function, save the strncpy.

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 fs/fat/fat_write.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index eb3a916..961ccd8 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -183,7 +183,6 @@ static __u32 get_fatent_value(fsdata *mydata, __u32 entry)
 		if (getsize > fatlength)
 			getsize = fatlength;
 
-		fatlength *= mydata->sect_size;	/* We want it in bytes now */
 		startblock += mydata->fat_sect;	/* Offset from start of disk */
 
 		/* Write back the fatbuf to the disk */
@@ -326,10 +325,8 @@ fill_dir_slot(fsdata *mydata, dir_entry **dentptr, const char *l_name)
 	dir_slot *slotptr = (dir_slot *)get_contents_vfatname_block;
 	__u8 counter = 0, checksum;
 	int idx = 0, ret;
-	char s_name[16];
 
-	/* Get short file name and checksum value */
-	strncpy(s_name, (*dentptr)->name, 16);
+	/* Get short file name checksum value */
 	checksum = mkcksum((*dentptr)->name, (*dentptr)->ext);
 
 	do {
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk
       [not found] <20160911205142.4259-1-stefan.bruens@rwth-aachen.de>
  2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
@ 2016-09-11 20:51 ` Stefan Brüns
  2016-09-12 10:56   ` Lukasz Majewski
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  2016-09-11 20:51 ` [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function Stefan Brüns
  2016-09-11 20:51 ` [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified Stefan Brüns
  3 siblings, 2 replies; 14+ messages in thread
From: Stefan Brüns @ 2016-09-11 20:51 UTC (permalink / raw)
  To: u-boot

The code caches 6 sectors of the FAT. On FAT traversal, the old contents
needs to be flushed to disk, but only if any FAT entries had been modified.
Explicitly flag the buffer on modification.

Currently, creating a new file traverses the whole FAT up to the first
free cluster and rewrites the on-disk blocks.

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 fs/fat/fat.c       |  1 +
 fs/fat/fat_write.c | 31 +++++++++++++++++++------------
 include/fat.h      |  1 +
 3 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 826bd85..df9f2b5 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -876,6 +876,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 	}
 
 	mydata->fatbufnum = -1;
+	mydata->fat_dirty = 0;
 	mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
 	if (mydata->fatbuf == NULL) {
 		debug("Error: allocating memory\n");
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 961ccd8..babe9c8 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -104,13 +104,19 @@ static __u8 num_of_fats;
 /*
  * Write fat buffer into block device
  */
-static int flush_fat_buffer(fsdata *mydata)
+static int flush_dirty_fat_buffer(fsdata *mydata)
 {
 	int getsize = FATBUFBLOCKS;
 	__u32 fatlength = mydata->fatlength;
 	__u8 *bufptr = mydata->fatbuf;
 	__u32 startblock = mydata->fatbufnum * FATBUFBLOCKS;
 
+	debug("debug: evicting %d, dirty: %d\n", mydata->fatbufnum,
+	      (int)mydata->fat_dirty);
+
+	if ((!mydata->fat_dirty) || (mydata->fatbufnum == -1))
+		return 0;
+
 	startblock += mydata->fat_sect;
 
 	if (getsize > fatlength)
@@ -130,6 +136,7 @@ static int flush_fat_buffer(fsdata *mydata)
 			return -1;
 		}
 	}
+	mydata->fat_dirty = 0;
 
 	return 0;
 }
@@ -186,10 +193,8 @@ static __u32 get_fatent_value(fsdata *mydata, __u32 entry)
 		startblock += mydata->fat_sect;	/* Offset from start of disk */
 
 		/* Write back the fatbuf to the disk */
-		if (mydata->fatbufnum != -1) {
-			if (flush_fat_buffer(mydata) < 0)
-				return -1;
-		}
+		if (flush_dirty_fat_buffer(mydata) < 0)
+			return -1;
 
 		if (disk_read(startblock, getsize, bufptr) < 0) {
 			debug("Error reading FAT blocks\n");
@@ -494,10 +499,8 @@ static int set_fatent_value(fsdata *mydata, __u32 entry, __u32 entry_value)
 		if (getsize > fatlength)
 			getsize = fatlength;
 
-		if (mydata->fatbufnum != -1) {
-			if (flush_fat_buffer(mydata) < 0)
-				return -1;
-		}
+		if (flush_dirty_fat_buffer(mydata) < 0)
+			return -1;
 
 		if (disk_read(startblock, getsize, bufptr) < 0) {
 			debug("Error reading FAT blocks\n");
@@ -506,6 +509,9 @@ static int set_fatent_value(fsdata *mydata, __u32 entry, __u32 entry_value)
 		mydata->fatbufnum = bufnum;
 	}
 
+	/* Mark as dirty */
+	mydata->fat_dirty = 1;
+
 	/* Set the actual entry */
 	switch (mydata->fatsize) {
 	case 32:
@@ -645,7 +651,7 @@ static void flush_dir_table(fsdata *mydata, dir_entry **dentptr)
 
 	dir_curclust = dir_newclust;
 
-	if (flush_fat_buffer(mydata) < 0)
+	if (flush_dirty_fat_buffer(mydata) < 0)
 		return;
 
 	memset(get_dentfromdir_block, 0x00,
@@ -675,7 +681,7 @@ static int clear_fatent(fsdata *mydata, __u32 entry)
 	}
 
 	/* Flush fat buffer */
-	if (flush_fat_buffer(mydata) < 0)
+	if (flush_dirty_fat_buffer(mydata) < 0)
 		return -1;
 
 	return 0;
@@ -1011,6 +1017,7 @@ static int do_fat_write(const char *filename, void *buffer, loff_t size,
 	}
 
 	mydata->fatbufnum = -1;
+	mydata->fat_dirty = 0;
 	mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
 	if (mydata->fatbuf == NULL) {
 		debug("Error: allocating memory\n");
@@ -1111,7 +1118,7 @@ static int do_fat_write(const char *filename, void *buffer, loff_t size,
 	debug("attempt to write 0x%llx bytes\n", *actwrite);
 
 	/* Flush fat buffer */
-	ret = flush_fat_buffer(mydata);
+	ret = flush_dirty_fat_buffer(mydata);
 	if (ret) {
 		printf("Error: flush fat buffer\n");
 		goto exit;
diff --git a/include/fat.h b/include/fat.h
index 9d053e6..8ec91cd 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -169,6 +169,7 @@ typedef struct {
 	int	fatsize;	/* Size of FAT in bits */
 	__u32	fatlength;	/* Length of FAT in sectors */
 	__u16	fat_sect;	/* Starting sector of the FAT */
+	__u8	fat_dirty;      /* Set if fatbuf has been modified */
 	__u32	rootdir_sect;	/* Start sector of root directory */
 	__u16	sect_size;	/* Size of sectors in bytes */
 	__u16	clust_size;	/* Size of clusters in sectors */
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function
       [not found] <20160911205142.4259-1-stefan.bruens@rwth-aachen.de>
  2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
  2016-09-11 20:51 ` [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk Stefan Brüns
@ 2016-09-11 20:51 ` Stefan Brüns
  2016-09-12 11:04   ` Lukasz Majewski
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  2016-09-11 20:51 ` [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified Stefan Brüns
  3 siblings, 2 replies; 14+ messages in thread
From: Stefan Brüns @ 2016-09-11 20:51 UTC (permalink / raw)
  To: u-boot

Current description does not match the function behaviour.

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 fs/fat/fat_write.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index babe9c8..0583af3 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -528,7 +528,8 @@ static int set_fatent_value(fsdata *mydata, __u32 entry, __u32 entry_value)
 }
 
 /*
- * Determine the entry value at index 'entry' in a FAT (16/32) table
+ * Determine the next free cluster after 'entry' in a FAT (16/32) table
+ * and link it to 'entry'. EOC marker is not set on returned entry.
  */
 static __u32 determine_fatent(fsdata *mydata, __u32 entry)
 {
@@ -537,6 +538,7 @@ static __u32 determine_fatent(fsdata *mydata, __u32 entry)
 	while (1) {
 		next_fat = get_fatent_value(mydata, next_entry);
 		if (next_fat == 0) {
+			/* found free entry, link to entry */
 			set_fatent_value(mydata, entry, next_entry);
 			break;
 		}
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified
       [not found] <20160911205142.4259-1-stefan.bruens@rwth-aachen.de>
                   ` (2 preceding siblings ...)
  2016-09-11 20:51 ` [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function Stefan Brüns
@ 2016-09-11 20:51 ` Stefan Brüns
  2016-09-19  0:57   ` Simon Glass
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  3 siblings, 2 replies; 14+ messages in thread
From: Stefan Brüns @ 2016-09-11 20:51 UTC (permalink / raw)
  To: u-boot

argc is checked, but is off by one. In case <bytes> is not specified,
create an empty file, which is identical to the ext4write behaviour.

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 cmd/fat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/fat.c b/cmd/fat.c
index 4e20746..ad1dc2a 100644
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -126,7 +126,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
 		return 1;
 	}
 	addr = simple_strtoul(argv[3], NULL, 16);
-	count = simple_strtoul(argv[5], NULL, 16);
+	count = (argc <= 5) ? 0 : simple_strtoul(argv[5], NULL, 16);
 
 	buf = map_sysmem(addr, count);
 	ret = file_fat_write(argv[4], buf, 0, count, &size);
@@ -145,7 +145,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
 U_BOOT_CMD(
 	fatwrite,	6,	0,	do_fat_fswrite,
 	"write file into a dos filesystem",
-	"<interface> <dev[:part]> <addr> <filename> <bytes>\n"
+	"<interface> <dev[:part]> <addr> <filename> [<bytes>]\n"
 	"    - write file 'filename' from the address 'addr' in RAM\n"
 	"      to 'dev' on 'interface'"
 );
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect
  2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
@ 2016-09-12 10:43   ` Lukasz Majewski
  2016-09-12 18:48   ` Stephen Warren
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Lukasz Majewski @ 2016-09-12 10:43 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

> fatlength is a local variable which is no more used after the
> assignment. s_name is not used in the function, save the strncpy.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> ---
>  fs/fat/fat_write.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
> index eb3a916..961ccd8 100644
> --- a/fs/fat/fat_write.c
> +++ b/fs/fat/fat_write.c
> @@ -183,7 +183,6 @@ static __u32 get_fatent_value(fsdata *mydata,
> __u32 entry) if (getsize > fatlength)
>  			getsize = fatlength;
>  
> -		fatlength *= mydata->sect_size;	/* We want it
> in bytes now */ startblock += mydata->fat_sect;	/* Offset from
> start of disk */ 
>  		/* Write back the fatbuf to the disk */
> @@ -326,10 +325,8 @@ fill_dir_slot(fsdata *mydata, dir_entry
> **dentptr, const char *l_name) dir_slot *slotptr = (dir_slot
> *)get_contents_vfatname_block; __u8 counter = 0, checksum;
>  	int idx = 0, ret;
> -	char s_name[16];
>  
> -	/* Get short file name and checksum value */
> -	strncpy(s_name, (*dentptr)->name, 16);
> +	/* Get short file name checksum value */
>  	checksum = mkcksum((*dentptr)->name, (*dentptr)->ext);
>  
>  	do {

Acked-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk
  2016-09-11 20:51 ` [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk Stefan Brüns
@ 2016-09-12 10:56   ` Lukasz Majewski
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 14+ messages in thread
From: Lukasz Majewski @ 2016-09-12 10:56 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

> The code caches 6 sectors of the FAT. On FAT traversal, the old
> contents needs to be flushed to disk, but only if any FAT entries had
> been modified. Explicitly flag the buffer on modification.
> 
> Currently, creating a new file traverses the whole FAT up to the first
> free cluster and rewrites the on-disk blocks.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> ---
>  fs/fat/fat.c       |  1 +
>  fs/fat/fat_write.c | 31 +++++++++++++++++++------------
>  include/fat.h      |  1 +
>  3 files changed, 21 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 826bd85..df9f2b5 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -876,6 +876,7 @@ int do_fat_read_at(const char *filename, loff_t
> pos, void *buffer, }
>  
>  	mydata->fatbufnum = -1;
> +	mydata->fat_dirty = 0;
>  	mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
>  	if (mydata->fatbuf == NULL) {
>  		debug("Error: allocating memory\n");
> diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
> index 961ccd8..babe9c8 100644
> --- a/fs/fat/fat_write.c
> +++ b/fs/fat/fat_write.c
> @@ -104,13 +104,19 @@ static __u8 num_of_fats;
>  /*
>   * Write fat buffer into block device
>   */
> -static int flush_fat_buffer(fsdata *mydata)
> +static int flush_dirty_fat_buffer(fsdata *mydata)
>  {
>  	int getsize = FATBUFBLOCKS;
>  	__u32 fatlength = mydata->fatlength;
>  	__u8 *bufptr = mydata->fatbuf;
>  	__u32 startblock = mydata->fatbufnum * FATBUFBLOCKS;
>  
> +	debug("debug: evicting %d, dirty: %d\n", mydata->fatbufnum,
> +	      (int)mydata->fat_dirty);
> +
> +	if ((!mydata->fat_dirty) || (mydata->fatbufnum == -1))
> +		return 0;
> +
>  	startblock += mydata->fat_sect;
>  
>  	if (getsize > fatlength)
> @@ -130,6 +136,7 @@ static int flush_fat_buffer(fsdata *mydata)
>  			return -1;
>  		}
>  	}
> +	mydata->fat_dirty = 0;
>  
>  	return 0;
>  }
> @@ -186,10 +193,8 @@ static __u32 get_fatent_value(fsdata *mydata,
> __u32 entry) startblock += mydata->fat_sect;	/* Offset from
> start of disk */ 
>  		/* Write back the fatbuf to the disk */
> -		if (mydata->fatbufnum != -1) {
> -			if (flush_fat_buffer(mydata) < 0)
> -				return -1;
> -		}
> +		if (flush_dirty_fat_buffer(mydata) < 0)
> +			return -1;
>  
>  		if (disk_read(startblock, getsize, bufptr) < 0) {
>  			debug("Error reading FAT blocks\n");
> @@ -494,10 +499,8 @@ static int set_fatent_value(fsdata *mydata,
> __u32 entry, __u32 entry_value) if (getsize > fatlength)
>  			getsize = fatlength;
>  
> -		if (mydata->fatbufnum != -1) {
> -			if (flush_fat_buffer(mydata) < 0)
> -				return -1;
> -		}
> +		if (flush_dirty_fat_buffer(mydata) < 0)
> +			return -1;
>  
>  		if (disk_read(startblock, getsize, bufptr) < 0) {
>  			debug("Error reading FAT blocks\n");
> @@ -506,6 +509,9 @@ static int set_fatent_value(fsdata *mydata, __u32
> entry, __u32 entry_value) mydata->fatbufnum = bufnum;
>  	}
>  
> +	/* Mark as dirty */
> +	mydata->fat_dirty = 1;
> +
>  	/* Set the actual entry */
>  	switch (mydata->fatsize) {
>  	case 32:
> @@ -645,7 +651,7 @@ static void flush_dir_table(fsdata *mydata,
> dir_entry **dentptr) 
>  	dir_curclust = dir_newclust;
>  
> -	if (flush_fat_buffer(mydata) < 0)
> +	if (flush_dirty_fat_buffer(mydata) < 0)
>  		return;
>  
>  	memset(get_dentfromdir_block, 0x00,
> @@ -675,7 +681,7 @@ static int clear_fatent(fsdata *mydata, __u32
> entry) }
>  
>  	/* Flush fat buffer */
> -	if (flush_fat_buffer(mydata) < 0)
> +	if (flush_dirty_fat_buffer(mydata) < 0)
>  		return -1;
>  
>  	return 0;
> @@ -1011,6 +1017,7 @@ static int do_fat_write(const char *filename,
> void *buffer, loff_t size, }
>  
>  	mydata->fatbufnum = -1;
> +	mydata->fat_dirty = 0;
>  	mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
>  	if (mydata->fatbuf == NULL) {
>  		debug("Error: allocating memory\n");
> @@ -1111,7 +1118,7 @@ static int do_fat_write(const char *filename,
> void *buffer, loff_t size, debug("attempt to write 0x%llx bytes\n",
> *actwrite); 
>  	/* Flush fat buffer */
> -	ret = flush_fat_buffer(mydata);
> +	ret = flush_dirty_fat_buffer(mydata);
>  	if (ret) {
>  		printf("Error: flush fat buffer\n");
>  		goto exit;
> diff --git a/include/fat.h b/include/fat.h
> index 9d053e6..8ec91cd 100644
> --- a/include/fat.h
> +++ b/include/fat.h
> @@ -169,6 +169,7 @@ typedef struct {
>  	int	fatsize;	/* Size of FAT in bits */
>  	__u32	fatlength;	/* Length of FAT in sectors */
>  	__u16	fat_sect;	/* Starting sector of the FAT
> */
> +	__u8	fat_dirty;      /* Set if fatbuf has been
> modified */ __u32	rootdir_sect;	/* Start sector of root
> directory */ __u16	sect_size;	/* Size of sectors in
> bytes */ __u16	clust_size;	/* Size of clusters in
> sectors */

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function
  2016-09-11 20:51 ` [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function Stefan Brüns
@ 2016-09-12 11:04   ` Lukasz Majewski
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 14+ messages in thread
From: Lukasz Majewski @ 2016-09-12 11:04 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

> Current description does not match the function behaviour.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> ---
>  fs/fat/fat_write.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
> index babe9c8..0583af3 100644
> --- a/fs/fat/fat_write.c
> +++ b/fs/fat/fat_write.c
> @@ -528,7 +528,8 @@ static int set_fatent_value(fsdata *mydata, __u32
> entry, __u32 entry_value) }
>  
>  /*
> - * Determine the entry value at index 'entry' in a FAT (16/32) table
> + * Determine the next free cluster after 'entry' in a FAT (16/32)
> table
> + * and link it to 'entry'. EOC marker is not set on returned entry.
>   */
>  static __u32 determine_fatent(fsdata *mydata, __u32 entry)
>  {
> @@ -537,6 +538,7 @@ static __u32 determine_fatent(fsdata *mydata,
> __u32 entry) while (1) {
>  		next_fat = get_fatent_value(mydata, next_entry);
>  		if (next_fat == 0) {
> +			/* found free entry, link to entry */
>  			set_fatent_value(mydata, entry, next_entry);
>  			break;
>  		}

Acked-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect
  2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
  2016-09-12 10:43   ` Lukasz Majewski
@ 2016-09-12 18:48   ` Stephen Warren
  2016-09-12 20:15   ` Benoît Thébaudeau
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  3 siblings, 0 replies; 14+ messages in thread
From: Stephen Warren @ 2016-09-12 18:48 UTC (permalink / raw)
  To: u-boot

On 09/11/2016 02:51 PM, Stefan Br?ns wrote:
> fatlength is a local variable which is no more used after the assignment.
> s_name is not used in the function, save the strncpy.

The series,
Acked-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect
  2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
  2016-09-12 10:43   ` Lukasz Majewski
  2016-09-12 18:48   ` Stephen Warren
@ 2016-09-12 20:15   ` Benoît Thébaudeau
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  3 siblings, 0 replies; 14+ messages in thread
From: Benoît Thébaudeau @ 2016-09-12 20:15 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Sun, Sep 11, 2016 at 10:51 PM, Stefan Br?ns
<stefan.bruens@rwth-aachen.de> wrote:
> fatlength is a local variable which is no more used after the assignment.
> s_name is not used in the function, save the strncpy.
>
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>

[...]

For the series:
Reviewed-by: Beno?t Th?baudeau <benoit.thebaudeau.dev@gmail.com>

Best regards,
Beno?t

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified
  2016-09-11 20:51 ` [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified Stefan Brüns
@ 2016-09-19  0:57   ` Simon Glass
  2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 14+ messages in thread
From: Simon Glass @ 2016-09-19  0:57 UTC (permalink / raw)
  To: u-boot

On 11 September 2016 at 14:51, Stefan Br?ns
<stefan.bruens@rwth-aachen.de> wrote:
> argc is checked, but is off by one. In case <bytes> is not specified,
> create an empty file, which is identical to the ext4write behaviour.
>
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> ---
>  cmd/fat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [U-Boot, 1/4] fs/fat: Remove two statements without effect
  2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
                     ` (2 preceding siblings ...)
  2016-09-12 20:15   ` Benoît Thébaudeau
@ 2016-09-23 19:55   ` Tom Rini
  3 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2016-09-23 19:55 UTC (permalink / raw)
  To: u-boot

On Sun, Sep 11, 2016 at 10:51:39PM +0200, Stefan Br?ns wrote:

> fatlength is a local variable which is no more used after the assignment.
> s_name is not used in the function, save the strncpy.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
> Acked-by: Stephen Warren <swarren@nvidia.com>
> Reviewed-by: Beno?t Th?baudeau <benoit.thebaudeau.dev@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/cb3fcce7/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [U-Boot, 2/4] fs/fat: Do not write unmodified fat entries to disk
  2016-09-11 20:51 ` [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk Stefan Brüns
  2016-09-12 10:56   ` Lukasz Majewski
@ 2016-09-23 19:55   ` Tom Rini
  1 sibling, 0 replies; 14+ messages in thread
From: Tom Rini @ 2016-09-23 19:55 UTC (permalink / raw)
  To: u-boot

On Sun, Sep 11, 2016 at 10:51:40PM +0200, Stefan Br?ns wrote:

> The code caches 6 sectors of the FAT. On FAT traversal, the old contents
> needs to be flushed to disk, but only if any FAT entries had been modified.
> Explicitly flag the buffer on modification.
> 
> Currently, creating a new file traverses the whole FAT up to the first
> free cluster and rewrites the on-disk blocks.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/6a83fa08/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [U-Boot, 3/4] fs/fat: Correct description of determine_fatent function
  2016-09-11 20:51 ` [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function Stefan Brüns
  2016-09-12 11:04   ` Lukasz Majewski
@ 2016-09-23 19:55   ` Tom Rini
  1 sibling, 0 replies; 14+ messages in thread
From: Tom Rini @ 2016-09-23 19:55 UTC (permalink / raw)
  To: u-boot

On Sun, Sep 11, 2016 at 10:51:41PM +0200, Stefan Br?ns wrote:

> Current description does not match the function behaviour.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Acked-by: Lukasz Majewski <l.majewski@samsung.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/157dde13/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [U-Boot, 4/4] cmd/fat: Do not crash on write when <bytes> is not specified
  2016-09-11 20:51 ` [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified Stefan Brüns
  2016-09-19  0:57   ` Simon Glass
@ 2016-09-23 19:55   ` Tom Rini
  1 sibling, 0 replies; 14+ messages in thread
From: Tom Rini @ 2016-09-23 19:55 UTC (permalink / raw)
  To: u-boot

On Sun, Sep 11, 2016 at 10:51:42PM +0200, Stefan Br?ns wrote:

> argc is checked, but is off by one. In case <bytes> is not specified,
> create an empty file, which is identical to the ext4write behaviour.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/1ac4ca59/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-09-23 19:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20160911205142.4259-1-stefan.bruens@rwth-aachen.de>
2016-09-11 20:51 ` [U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect Stefan Brüns
2016-09-12 10:43   ` Lukasz Majewski
2016-09-12 18:48   ` Stephen Warren
2016-09-12 20:15   ` Benoît Thébaudeau
2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-11 20:51 ` [U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk Stefan Brüns
2016-09-12 10:56   ` Lukasz Majewski
2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-11 20:51 ` [U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function Stefan Brüns
2016-09-12 11:04   ` Lukasz Majewski
2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-11 20:51 ` [U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when <bytes> is not specified Stefan Brüns
2016-09-19  0:57   ` Simon Glass
2016-09-23 19:55   ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.