int avail;
/* see how much room is in cluster.
* The interesting values are:
- * none, one descriptor, one grouphead and one descriptor
+ * none, one descriptor, one group_head and one descriptor
* These are assigned values 0, 1, 2.
*/
if (wc->cluster_space >= (sizeof(struct group_head) +
struct group_head *gh = (struct group_head *)((char *)wc->chead +
wc->chead_size);
u16 tnf;
+ u64 tstamp;
dprintk("CLUSTER addhead %d\n", wc->chead_size);
*headstart = gh;
gh->inum = cpu_to_le32(ino->i_ino);
gh->fsnum = cpu_to_le32(LAFSI(ino)->filesys->i_ino);
+ if (LAFSI(ino)->type >= TypeBase) {
+ tstamp = encode_time(&ino->i_mtime);
+ if (tstamp != encode_time(&ino->i_ctime))
+ tstamp = 0;
+ } else
+ tstamp = 0;
+ gh->timestamp = cpu_to_le64(tstamp);
+
tnf = ((ino->i_generation<<8) | (LAFSI(ino)->trunc_gen & 0xff))
& 0x7fff;
if (wc->cnum)
struct group_head {
u32 inum;
u32 fsnum;
+ u64 timestamp; /* If non-zero, the ctime and mtime
+ * of the file should be set to this.
+ */
u16 truncatenum_and_flag;
u16 group_size_words; /* 4byte words */
union {
static int __must_check
roll_block(struct fs *fs, int fsnum, int inum, int trunc,
- u32 bnum, u64 baddr, int bytes, struct page *p)
+ u32 bnum, u64 baddr, int bytes, u64 tstamp, struct page *p)
{
struct inode *inode;
struct datablock *blk = NULL;
inode->i_size = ((loff_t)bnum << inode->i_blkbits) + bytes;
set_bit(I_Dirty, &LAFSI(inode)->iflags);
}
+ if (tstamp) {
+ decode_time(&inode->i_mtime, tstamp);
+ decode_time(&inode->i_ctime, tstamp);
+ set_bit(I_Dirty, &LAFSI(inode)->iflags);
+ }
/* FIXME: we pretend this is a dirty, pinned block
* so the lower-level code doesn't get confused.
int fsnum = le32_to_cpu(gh->fsnum);
int trunc = le16_to_cpu(gh->truncatenum_and_flag) & 0x7fff;
int flg = le16_to_cpu(gh->truncatenum_and_flag) & 0x8000;
+ u64 tstamp = le64_to_cpu(gh->timestamp);
desc = gh->u.desc;
while (((char *)desc - (char *)gh) <
cnt == 0 || bytes == DescHole
? bytes
: blocksize,
+ tstamp,
pg);
bnum++;
}