summaryrefslogtreecommitdiff
path: root/fs/fat/fat_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/fat_write.c')
-rw-r--r--fs/fat/fat_write.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 0132ef9b42..b43a27b205 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -108,10 +108,7 @@ static int set_name(fat_itr *itr, const char *filename, char *shortname)
char buf[13];
int i;
int ret;
- struct {
- char name[8];
- char ext[3];
- } dirent;
+ struct nameext dirent;
if (!filename)
return -EIO;
@@ -185,7 +182,7 @@ static int set_name(fat_itr *itr, const char *filename, char *shortname)
}
return -EIO;
out:
- memcpy(shortname, dirent.name, SHORT_NAME_SIZE);
+ memcpy(shortname, &dirent, SHORT_NAME_SIZE);
return ret;
}
@@ -576,7 +573,6 @@ static __u32 determine_fatent(fsdata *mydata, __u32 entry)
static int
set_sectors(fsdata *mydata, u32 startsect, u8 *buffer, u32 size)
{
- u32 nsects = 0;
int ret;
debug("startsect: %d\n", startsect);
@@ -598,6 +594,8 @@ set_sectors(fsdata *mydata, u32 startsect, u8 *buffer, u32 size)
size -= mydata->sect_size;
}
} else if (size >= mydata->sect_size) {
+ u32 nsects;
+
nsects = size / mydata->sect_size;
ret = disk_write(startsect, nsects, buffer);
if (ret != nsects) {
@@ -788,7 +786,6 @@ get_set_cluster(fsdata *mydata, __u32 clustnum, loff_t pos, __u8 *buffer,
}
size -= wsize;
- buffer += wsize;
*gotsize += wsize;
}
@@ -1485,10 +1482,10 @@ static int delete_single_dentry(fat_itr *itr)
*/
static int delete_long_name(fat_itr *itr)
{
- struct dir_entry *dent = itr->dent;
int seqn = itr->dent->nameext.name[0] & ~LAST_LONG_ENTRY_MASK;
while (seqn--) {
+ struct dir_entry *dent;
int ret;
ret = delete_single_dentry(itr);