]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
fs: fat: don't call disk_write with zero sector num
authorWu, Josh <Josh.wu@atmel.com>
Wed, 24 Jul 2013 09:55:30 +0000 (17:55 +0800)
committerTom Rini <trini@ti.com>
Fri, 6 Sep 2013 17:09:07 +0000 (13:09 -0400)
commit6b8f185faf29db302a20f584cc54253667535f08
tree6e8a65e683845756d20603f2bfd66c7f2de80a3b
parent7ea50d52849fe8ffa5b5b74c979b60b1045d6fc9
fs: fat: don't call disk_write with zero sector num

In the set_cluster() function, it will convert the buffer size to sector
numbers. Then call disk_write() to write by sector.
For remaining buffer, the size is less than a sector, call disk_write()
again to write them in one sector.

But if the total buffer size is less then one sector, the original code
will call disk_write() with zero sector number. It is unnecessary.
So this patch fix this. Now it will not call disk_write() if total buffer size
is less than one sector.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
fs/fat/fat_write.c