SMART FS update from Ken Pettit

This commit is contained in:
Gregory Nutt 2014-09-22 09:33:58 -06:00
parent 6dd4fceec1
commit 109ccc774d

View File

@ -710,6 +710,8 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
/* Now perform the write. */
if (readwrite.count > 0)
{
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0)
{
@ -723,6 +725,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
sf->curroffset += readwrite.count;
buflen -= readwrite.count;
byteswritten += readwrite.count;
}
/* Test if we wrote to the end of the current sector */
@ -771,6 +774,8 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
/* Perform the write */
if (readwrite.count > 0)
{
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0)
{
@ -786,6 +791,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
sf->curroffset += readwrite.count;
buflen -= readwrite.count;
byteswritten += readwrite.count;
}
/* Test if we wrote a full sector of data */