Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92998
b: refs/heads/master
c: dd91966
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse committed Feb 25, 2008
1 parent f3c2904 commit 71fb84e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: b28ba9fa0154f78f3d36f5ae9a42f7bb01663cca
refs/heads/master: dd919660aacdf4adfcd279556aa03e595f7f0fc2
7 changes: 6 additions & 1 deletion trunk/fs/jffs2/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
unsigned int ivalid;
uint32_t alloclen;
int ret;
int alloc_type = ALLOC_NORMAL;

D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino));

Expand Down Expand Up @@ -115,14 +116,18 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
ri->compr = JFFS2_COMPR_ZERO;
ri->dsize = cpu_to_je32(iattr->ia_size - inode->i_size);
ri->offset = cpu_to_je32(inode->i_size);
} else if (ivalid & ATTR_SIZE && !iattr->ia_size) {
/* For truncate-to-zero, treat it as deletion because
it'll always be obsoleting all previous nodes */
alloc_type = ALLOC_DELETION;
}
ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
if (mdatalen)
ri->data_crc = cpu_to_je32(crc32(0, mdata, mdatalen));
else
ri->data_crc = cpu_to_je32(0);

new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, ALLOC_NORMAL);
new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, alloc_type);
if (S_ISLNK(inode->i_mode))
kfree(mdata);

Expand Down

0 comments on commit 71fb84e

Please sign in to comment.