Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9158
b: refs/heads/master
c: 62a36c4
h: refs/heads/master
v: v3
  • Loading branch information
Stephane Kardas authored and Linus Torvalds committed Sep 21, 2005
1 parent 382271a commit f0f3a52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 89d7cbf73e1a85241eb42339f6cb7a429fec178c
refs/heads/master: 62a36c43c898d45efcfe3376ea1da6a9a182e1ad
11 changes: 8 additions & 3 deletions trunk/fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,21 @@ static int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
inode->i_blksize = sbi->cluster_size;
inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1))
& ~((loff_t)sbi->cluster_size - 1)) >> 9;
inode->i_mtime.tv_sec = inode->i_atime.tv_sec =
inode->i_mtime.tv_sec =
date_dos2unix(le16_to_cpu(de->time), le16_to_cpu(de->date));
inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = 0;
inode->i_mtime.tv_nsec = 0;
if (sbi->options.isvfat) {
int secs = de->ctime_cs / 100;
int csecs = de->ctime_cs % 100;
inode->i_ctime.tv_sec =
date_dos2unix(le16_to_cpu(de->ctime),
le16_to_cpu(de->cdate)) + secs;
inode->i_ctime.tv_nsec = csecs * 10000000;
inode->i_atime.tv_sec =
date_dos2unix(le16_to_cpu(0), le16_to_cpu(de->adate));
inode->i_atime.tv_nsec = 0;
} else
inode->i_ctime = inode->i_mtime;
inode->i_ctime = inode->i_atime = inode->i_mtime;

return 0;
}
Expand Down Expand Up @@ -513,7 +516,9 @@ static int fat_write_inode(struct inode *inode, int wait)
raw_entry->starthi = cpu_to_le16(MSDOS_I(inode)->i_logstart >> 16);
fat_date_unix2dos(inode->i_mtime.tv_sec, &raw_entry->time, &raw_entry->date);
if (sbi->options.isvfat) {
__le16 atime;
fat_date_unix2dos(inode->i_ctime.tv_sec,&raw_entry->ctime,&raw_entry->cdate);
fat_date_unix2dos(inode->i_atime.tv_sec,&atime,&raw_entry->adate);
raw_entry->ctime_cs = (inode->i_ctime.tv_sec & 1) * 100 +
inode->i_ctime.tv_nsec / 10000000;
}
Expand Down

0 comments on commit f0f3a52

Please sign in to comment.