Skip to content

Commit 9fe4854

Browse files
committed
[JFFS2] Remove flash offset argument from various functions.
We don't need the upper layers to deal with the physical offset. It's _always_ c->nextblock->offset + c->sector_size - c->nextblock->free_size so we might as well just let the actual write functions deal with that. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
1 parent 5fa4339 commit 9fe4854

File tree

9 files changed

+135
-115
lines changed

9 files changed

+135
-115
lines changed

fs/jffs2/dir.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
308308
struct jffs2_full_dnode *fn;
309309
struct jffs2_full_dirent *fd;
310310
int namelen;
311-
uint32_t alloclen, phys_ofs;
311+
uint32_t alloclen;
312312
int ret, targetlen = strlen(target);
313313

314314
/* FIXME: If you care. We'd need to use frags for the target
@@ -327,8 +327,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
327327
* Just the node will do for now, though
328328
*/
329329
namelen = dentry->d_name.len;
330-
ret = jffs2_reserve_space(c, sizeof(*ri) + targetlen, &phys_ofs, &alloclen,
331-
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
330+
ret = jffs2_reserve_space(c, sizeof(*ri) + targetlen, &alloclen,
331+
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
332332

333333
if (ret) {
334334
jffs2_free_raw_inode(ri);
@@ -356,7 +356,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
356356
ri->data_crc = cpu_to_je32(crc32(0, target, targetlen));
357357
ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
358358

359-
fn = jffs2_write_dnode(c, f, ri, target, targetlen, phys_ofs, ALLOC_NORMAL);
359+
fn = jffs2_write_dnode(c, f, ri, target, targetlen, ALLOC_NORMAL);
360360

361361
jffs2_free_raw_inode(ri);
362362

@@ -400,8 +400,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
400400
return ret;
401401
}
402402

403-
ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen,
404-
ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
403+
ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
404+
ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
405405
if (ret) {
406406
/* Eep. */
407407
jffs2_clear_inode(inode);
@@ -433,7 +433,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
433433
rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
434434
rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen));
435435

436-
fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, phys_ofs, ALLOC_NORMAL);
436+
fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL);
437437

438438
if (IS_ERR(fd)) {
439439
/* dirent failed to write. Delete the inode normally
@@ -471,7 +471,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
471471
struct jffs2_full_dnode *fn;
472472
struct jffs2_full_dirent *fd;
473473
int namelen;
474-
uint32_t alloclen, phys_ofs;
474+
uint32_t alloclen;
475475
int ret;
476476

477477
mode |= S_IFDIR;
@@ -486,8 +486,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
486486
* Just the node will do for now, though
487487
*/
488488
namelen = dentry->d_name.len;
489-
ret = jffs2_reserve_space(c, sizeof(*ri), &phys_ofs, &alloclen, ALLOC_NORMAL,
490-
JFFS2_SUMMARY_INODE_SIZE);
489+
ret = jffs2_reserve_space(c, sizeof(*ri), &alloclen, ALLOC_NORMAL,
490+
JFFS2_SUMMARY_INODE_SIZE);
491491

492492
if (ret) {
493493
jffs2_free_raw_inode(ri);
@@ -512,7 +512,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
512512
ri->data_crc = cpu_to_je32(0);
513513
ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
514514

515-
fn = jffs2_write_dnode(c, f, ri, NULL, 0, phys_ofs, ALLOC_NORMAL);
515+
fn = jffs2_write_dnode(c, f, ri, NULL, 0, ALLOC_NORMAL);
516516

517517
jffs2_free_raw_inode(ri);
518518

@@ -542,8 +542,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
542542
return ret;
543543
}
544544

545-
ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen,
546-
ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
545+
ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
546+
ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
547547
if (ret) {
548548
/* Eep. */
549549
jffs2_clear_inode(inode);
@@ -575,7 +575,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
575575
rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
576576
rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen));
577577

578-
fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, phys_ofs, ALLOC_NORMAL);
578+
fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL);
579579

580580
if (IS_ERR(fd)) {
581581
/* dirent failed to write. Delete the inode normally
@@ -631,7 +631,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
631631
int namelen;
632632
union jffs2_device_node dev;
633633
int devlen = 0;
634-
uint32_t alloclen, phys_ofs;
634+
uint32_t alloclen;
635635
int ret;
636636

637637
if (!new_valid_dev(rdev))
@@ -650,7 +650,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
650650
* Just the node will do for now, though
651651
*/
652652
namelen = dentry->d_name.len;
653-
ret = jffs2_reserve_space(c, sizeof(*ri) + devlen, &phys_ofs, &alloclen,
653+
ret = jffs2_reserve_space(c, sizeof(*ri) + devlen, &alloclen,
654654
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
655655

656656
if (ret) {
@@ -678,7 +678,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
678678
ri->data_crc = cpu_to_je32(crc32(0, &dev, devlen));
679679
ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
680680

681-
fn = jffs2_write_dnode(c, f, ri, (char *)&dev, devlen, phys_ofs, ALLOC_NORMAL);
681+
fn = jffs2_write_dnode(c, f, ri, (char *)&dev, devlen, ALLOC_NORMAL);
682682

683683
jffs2_free_raw_inode(ri);
684684

@@ -708,8 +708,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
708708
return ret;
709709
}
710710

711-
ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen,
712-
ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
711+
ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
712+
ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
713713
if (ret) {
714714
/* Eep. */
715715
jffs2_clear_inode(inode);
@@ -744,7 +744,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
744744
rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
745745
rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen));
746746

747-
fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, phys_ofs, ALLOC_NORMAL);
747+
fd = jffs2_write_dirent(c, dir_f, rd, dentry->d_name.name, namelen, ALLOC_NORMAL);
748748

749749
if (IS_ERR(fd)) {
750750
/* dirent failed to write. Delete the inode normally

fs/jffs2/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ static int jffs2_prepare_write (struct file *filp, struct page *pg,
134134
struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
135135
struct jffs2_raw_inode ri;
136136
struct jffs2_full_dnode *fn;
137-
uint32_t phys_ofs, alloc_len;
137+
uint32_t alloc_len;
138138

139139
D1(printk(KERN_DEBUG "Writing new hole frag 0x%x-0x%x between current EOF and new page\n",
140140
(unsigned int)inode->i_size, pageofs));
141141

142-
ret = jffs2_reserve_space(c, sizeof(ri), &phys_ofs, &alloc_len,
143-
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
142+
ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
143+
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
144144
if (ret)
145145
return ret;
146146

@@ -166,7 +166,7 @@ static int jffs2_prepare_write (struct file *filp, struct page *pg,
166166
ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
167167
ri.data_crc = cpu_to_je32(0);
168168

169-
fn = jffs2_write_dnode(c, f, &ri, NULL, 0, phys_ofs, ALLOC_NORMAL);
169+
fn = jffs2_write_dnode(c, f, &ri, NULL, 0, ALLOC_NORMAL);
170170

171171
if (IS_ERR(fn)) {
172172
ret = PTR_ERR(fn);

fs/jffs2/fs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
3737
unsigned char *mdata = NULL;
3838
int mdatalen = 0;
3939
unsigned int ivalid;
40-
uint32_t phys_ofs, alloclen;
40+
uint32_t alloclen;
4141
int ret;
4242
D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino));
4343
ret = inode_change_ok(inode, iattr);
@@ -79,8 +79,8 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
7979
return -ENOMEM;
8080
}
8181

82-
ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &phys_ofs, &alloclen,
83-
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
82+
ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &alloclen,
83+
ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
8484
if (ret) {
8585
jffs2_free_raw_inode(ri);
8686
if (S_ISLNK(inode->i_mode & S_IFMT))
@@ -131,7 +131,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
131131
else
132132
ri->data_crc = cpu_to_je32(0);
133133

134-
new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, phys_ofs, ALLOC_NORMAL);
134+
new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, ALLOC_NORMAL);
135135
if (S_ISLNK(inode->i_mode))
136136
kfree(mdata);
137137

fs/jffs2/gc.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
545545
if (ic && alloclen > sizeof(struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN)
546546
alloclen = sizeof(struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN;
547547

548-
ret = jffs2_reserve_space_gc(c, alloclen, &phys_ofs, &alloclen, rawlen);
548+
ret = jffs2_reserve_space_gc(c, alloclen, &alloclen, rawlen);
549549
/* 'rawlen' is not the exact summary size; it is only an upper estimation */
550550

551551
if (ret)
@@ -626,13 +626,13 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
626626

627627
/* OK, all the CRCs are good; this node can just be copied as-is. */
628628
retry:
629-
nraw->flash_offset = phys_ofs;
629+
nraw->flash_offset = phys_ofs = write_ofs(c);
630630

631631
ret = jffs2_flash_write(c, phys_ofs, rawlen, &retlen, (char *)node);
632632

633633
if (ret || (retlen != rawlen)) {
634634
printk(KERN_NOTICE "Write of %d bytes at 0x%08x failed. returned %d, retlen %zd\n",
635-
rawlen, phys_ofs, ret, retlen);
635+
rawlen, nraw->flash_offset, ret, retlen);
636636
if (retlen) {
637637
nraw->flash_offset |= REF_OBSOLETE;
638638
jffs2_add_physical_node_ref(c, nraw, rawlen, NULL);
@@ -653,7 +653,7 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
653653
jffs2_dbg_acct_sanity_check(c,jeb);
654654
jffs2_dbg_acct_paranoia_check(c, jeb);
655655

656-
ret = jffs2_reserve_space_gc(c, rawlen, &phys_ofs, &dummy, rawlen);
656+
ret = jffs2_reserve_space_gc(c, rawlen, &dummy, rawlen);
657657
/* this is not the exact summary size of it,
658658
it is only an upper estimation */
659659

@@ -696,7 +696,7 @@ static int jffs2_garbage_collect_metadata(struct jffs2_sb_info *c, struct jffs2_
696696
struct jffs2_node_frag *last_frag;
697697
union jffs2_device_node dev;
698698
char *mdata = NULL, mdatalen = 0;
699-
uint32_t alloclen, phys_ofs, ilen;
699+
uint32_t alloclen, ilen;
700700
int ret;
701701

702702
if (S_ISBLK(JFFS2_F_I_MODE(f)) ||
@@ -722,7 +722,7 @@ static int jffs2_garbage_collect_metadata(struct jffs2_sb_info *c, struct jffs2_
722722

723723
}
724724

725-
ret = jffs2_reserve_space_gc(c, sizeof(ri) + mdatalen, &phys_ofs, &alloclen,
725+
ret = jffs2_reserve_space_gc(c, sizeof(ri) + mdatalen, &alloclen,
726726
JFFS2_SUMMARY_INODE_SIZE);
727727
if (ret) {
728728
printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_metadata failed: %d\n",
@@ -760,7 +760,7 @@ static int jffs2_garbage_collect_metadata(struct jffs2_sb_info *c, struct jffs2_
760760
ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
761761
ri.data_crc = cpu_to_je32(crc32(0, mdata, mdatalen));
762762

763-
new_fn = jffs2_write_dnode(c, f, &ri, mdata, mdatalen, phys_ofs, ALLOC_GC);
763+
new_fn = jffs2_write_dnode(c, f, &ri, mdata, mdatalen, ALLOC_GC);
764764

765765
if (IS_ERR(new_fn)) {
766766
printk(KERN_WARNING "Error writing new dnode: %ld\n", PTR_ERR(new_fn));
@@ -781,7 +781,7 @@ static int jffs2_garbage_collect_dirent(struct jffs2_sb_info *c, struct jffs2_er
781781
{
782782
struct jffs2_full_dirent *new_fd;
783783
struct jffs2_raw_dirent rd;
784-
uint32_t alloclen, phys_ofs;
784+
uint32_t alloclen;
785785
int ret;
786786

787787
rd.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
@@ -803,14 +803,14 @@ static int jffs2_garbage_collect_dirent(struct jffs2_sb_info *c, struct jffs2_er
803803
rd.node_crc = cpu_to_je32(crc32(0, &rd, sizeof(rd)-8));
804804
rd.name_crc = cpu_to_je32(crc32(0, fd->name, rd.nsize));
805805

806-
ret = jffs2_reserve_space_gc(c, sizeof(rd)+rd.nsize, &phys_ofs, &alloclen,
806+
ret = jffs2_reserve_space_gc(c, sizeof(rd)+rd.nsize, &alloclen,
807807
JFFS2_SUMMARY_DIRENT_SIZE(rd.nsize));
808808
if (ret) {
809809
printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_dirent failed: %d\n",
810810
sizeof(rd)+rd.nsize, ret);
811811
return ret;
812812
}
813-
new_fd = jffs2_write_dirent(c, f, &rd, fd->name, rd.nsize, phys_ofs, ALLOC_GC);
813+
new_fd = jffs2_write_dirent(c, f, &rd, fd->name, rd.nsize, ALLOC_GC);
814814

815815
if (IS_ERR(new_fd)) {
816816
printk(KERN_WARNING "jffs2_write_dirent in garbage_collect_dirent failed: %ld\n", PTR_ERR(new_fd));
@@ -938,7 +938,7 @@ static int jffs2_garbage_collect_hole(struct jffs2_sb_info *c, struct jffs2_eras
938938
struct jffs2_raw_inode ri;
939939
struct jffs2_node_frag *frag;
940940
struct jffs2_full_dnode *new_fn;
941-
uint32_t alloclen, phys_ofs, ilen;
941+
uint32_t alloclen, ilen;
942942
int ret;
943943

944944
D1(printk(KERN_DEBUG "Writing replacement hole node for ino #%u from offset 0x%x to 0x%x\n",
@@ -1017,14 +1017,14 @@ static int jffs2_garbage_collect_hole(struct jffs2_sb_info *c, struct jffs2_eras
10171017
ri.data_crc = cpu_to_je32(0);
10181018
ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
10191019

1020-
ret = jffs2_reserve_space_gc(c, sizeof(ri), &phys_ofs, &alloclen,
1021-
JFFS2_SUMMARY_INODE_SIZE);
1020+
ret = jffs2_reserve_space_gc(c, sizeof(ri), &alloclen,
1021+
JFFS2_SUMMARY_INODE_SIZE);
10221022
if (ret) {
10231023
printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_hole failed: %d\n",
10241024
sizeof(ri), ret);
10251025
return ret;
10261026
}
1027-
new_fn = jffs2_write_dnode(c, f, &ri, NULL, 0, phys_ofs, ALLOC_GC);
1027+
new_fn = jffs2_write_dnode(c, f, &ri, NULL, 0, ALLOC_GC);
10281028

10291029
if (IS_ERR(new_fn)) {
10301030
printk(KERN_WARNING "Error writing new hole node: %ld\n", PTR_ERR(new_fn));
@@ -1086,7 +1086,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
10861086
{
10871087
struct jffs2_full_dnode *new_fn;
10881088
struct jffs2_raw_inode ri;
1089-
uint32_t alloclen, phys_ofs, offset, orig_end, orig_start;
1089+
uint32_t alloclen, offset, orig_end, orig_start;
10901090
int ret = 0;
10911091
unsigned char *comprbuf = NULL, *writebuf;
10921092
unsigned long pg;
@@ -1243,7 +1243,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
12431243
uint32_t cdatalen;
12441244
uint16_t comprtype = JFFS2_COMPR_NONE;
12451245

1246-
ret = jffs2_reserve_space_gc(c, sizeof(ri) + JFFS2_MIN_DATA_LEN, &phys_ofs,
1246+
ret = jffs2_reserve_space_gc(c, sizeof(ri) + JFFS2_MIN_DATA_LEN,
12471247
&alloclen, JFFS2_SUMMARY_INODE_SIZE);
12481248

12491249
if (ret) {
@@ -1280,7 +1280,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
12801280
ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
12811281
ri.data_crc = cpu_to_je32(crc32(0, comprbuf, cdatalen));
12821282

1283-
new_fn = jffs2_write_dnode(c, f, &ri, comprbuf, cdatalen, phys_ofs, ALLOC_GC);
1283+
new_fn = jffs2_write_dnode(c, f, &ri, comprbuf, cdatalen, ALLOC_GC);
12841284

12851285
jffs2_free_comprbuf(comprbuf, writebuf);
12861286

fs/jffs2/nodelist.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ struct jffs2_inode_cache {
167167

168168
#define INOCACHE_HASHSIZE 128
169169

170+
#define write_ofs(c) ((c)->nextblock->offset + (c)->sector_size - (c)->nextblock->free_size)
171+
170172
/*
171173
Larger representation of a raw node, kept in-core only when the
172174
struct inode for this particular ino is instantiated.
@@ -325,9 +327,9 @@ extern uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c,
325327

326328
/* nodemgmt.c */
327329
int jffs2_thread_should_wake(struct jffs2_sb_info *c);
328-
int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs,
330+
int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
329331
uint32_t *len, int prio, uint32_t sumsize);
330-
int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs,
332+
int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize,
331333
uint32_t *len, uint32_t sumsize);
332334
int jffs2_add_physical_node_ref(struct jffs2_sb_info *c,
333335
struct jffs2_raw_node_ref *new,
@@ -339,14 +341,21 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
339341
/* write.c */
340342
int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri);
341343

342-
struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, uint32_t flash_ofs, int alloc_mode);
343-
struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, uint32_t flash_ofs, int alloc_mode);
344+
struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
345+
struct jffs2_raw_inode *ri, const unsigned char *data,
346+
uint32_t datalen, int alloc_mode);
347+
struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
348+
struct jffs2_raw_dirent *rd, const unsigned char *name,
349+
uint32_t namelen, int alloc_mode);
344350
int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
345351
struct jffs2_raw_inode *ri, unsigned char *buf,
346352
uint32_t offset, uint32_t writelen, uint32_t *retlen);
347-
int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen);
348-
int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f, uint32_t time);
349-
int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen, uint32_t time);
353+
int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f,
354+
struct jffs2_raw_inode *ri, const char *name, int namelen);
355+
int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name,
356+
int namelen, struct jffs2_inode_info *dead_f, uint32_t time);
357+
int jffs2_do_link(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino,
358+
uint8_t type, const char *name, int namelen, uint32_t time);
350359

351360

352361
/* readinode.c */

0 commit comments

Comments
 (0)