aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/dir.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-22 19:38:06 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-22 19:38:06 -0400
commit9fe4854cd1f60273f9a3ece053f4789605f58a5e (patch)
tree277ac17807a1596f78464641500ed35f3d47a32a /fs/jffs2/dir.c
parent5fa433942ba4e399f7e28764c9db4ade89e91d40 (diff)
[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>
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r--fs/jffs2/dir.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index ff1b7950dd44..edd8371fc6a5 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -308,7 +308,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
308 struct jffs2_full_dnode *fn; 308 struct jffs2_full_dnode *fn;
309 struct jffs2_full_dirent *fd; 309 struct jffs2_full_dirent *fd;
310 int namelen; 310 int namelen;
311 uint32_t alloclen, phys_ofs; 311 uint32_t alloclen;
312 int ret, targetlen = strlen(target); 312 int ret, targetlen = strlen(target);
313 313
314 /* FIXME: If you care. We'd need to use frags for the target 314 /* 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
327 * Just the node will do for now, though 327 * Just the node will do for now, though
328 */ 328 */
329 namelen = dentry->d_name.len; 329 namelen = dentry->d_name.len;
330 ret = jffs2_reserve_space(c, sizeof(*ri) + targetlen, &phys_ofs, &alloclen, 330 ret = jffs2_reserve_space(c, sizeof(*ri) + targetlen, &alloclen,
331 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); 331 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
332 332
333 if (ret) { 333 if (ret) {
334 jffs2_free_raw_inode(ri); 334 jffs2_free_raw_inode(ri);
@@ -356,7 +356,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
356 ri->data_crc = cpu_to_je32(crc32(0, target, targetlen)); 356 ri->data_crc = cpu_to_je32(crc32(0, target, targetlen));
357 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); 357 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
358 358
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);
360 360
361 jffs2_free_raw_inode(ri); 361 jffs2_free_raw_inode(ri);
362 362
@@ -400,8 +400,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
400 return ret; 400 return ret;
401 } 401 }
402 402
403 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, 403 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
404 ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen)); 404 ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
405 if (ret) { 405 if (ret) {
406 /* Eep. */ 406 /* Eep. */
407 jffs2_clear_inode(inode); 407 jffs2_clear_inode(inode);
@@ -433,7 +433,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
433 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); 433 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
434 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); 434 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen));
435 435
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);
437 437
438 if (IS_ERR(fd)) { 438 if (IS_ERR(fd)) {
439 /* dirent failed to write. Delete the inode normally 439 /* 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)
471 struct jffs2_full_dnode *fn; 471 struct jffs2_full_dnode *fn;
472 struct jffs2_full_dirent *fd; 472 struct jffs2_full_dirent *fd;
473 int namelen; 473 int namelen;
474 uint32_t alloclen, phys_ofs; 474 uint32_t alloclen;
475 int ret; 475 int ret;
476 476
477 mode |= S_IFDIR; 477 mode |= S_IFDIR;
@@ -486,8 +486,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
486 * Just the node will do for now, though 486 * Just the node will do for now, though
487 */ 487 */
488 namelen = dentry->d_name.len; 488 namelen = dentry->d_name.len;
489 ret = jffs2_reserve_space(c, sizeof(*ri), &phys_ofs, &alloclen, ALLOC_NORMAL, 489 ret = jffs2_reserve_space(c, sizeof(*ri), &alloclen, ALLOC_NORMAL,
490 JFFS2_SUMMARY_INODE_SIZE); 490 JFFS2_SUMMARY_INODE_SIZE);
491 491
492 if (ret) { 492 if (ret) {
493 jffs2_free_raw_inode(ri); 493 jffs2_free_raw_inode(ri);
@@ -512,7 +512,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
512 ri->data_crc = cpu_to_je32(0); 512 ri->data_crc = cpu_to_je32(0);
513 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); 513 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
514 514
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);
516 516
517 jffs2_free_raw_inode(ri); 517 jffs2_free_raw_inode(ri);
518 518
@@ -542,8 +542,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
542 return ret; 542 return ret;
543 } 543 }
544 544
545 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, 545 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
546 ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen)); 546 ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
547 if (ret) { 547 if (ret) {
548 /* Eep. */ 548 /* Eep. */
549 jffs2_clear_inode(inode); 549 jffs2_clear_inode(inode);
@@ -575,7 +575,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
575 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); 575 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
576 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); 576 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen));
577 577
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);
579 579
580 if (IS_ERR(fd)) { 580 if (IS_ERR(fd)) {
581 /* dirent failed to write. Delete the inode normally 581 /* 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
631 int namelen; 631 int namelen;
632 union jffs2_device_node dev; 632 union jffs2_device_node dev;
633 int devlen = 0; 633 int devlen = 0;
634 uint32_t alloclen, phys_ofs; 634 uint32_t alloclen;
635 int ret; 635 int ret;
636 636
637 if (!new_valid_dev(rdev)) 637 if (!new_valid_dev(rdev))
@@ -650,7 +650,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
650 * Just the node will do for now, though 650 * Just the node will do for now, though
651 */ 651 */
652 namelen = dentry->d_name.len; 652 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,
654 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); 654 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
655 655
656 if (ret) { 656 if (ret) {
@@ -678,7 +678,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
678 ri->data_crc = cpu_to_je32(crc32(0, &dev, devlen)); 678 ri->data_crc = cpu_to_je32(crc32(0, &dev, devlen));
679 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); 679 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
680 680
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);
682 682
683 jffs2_free_raw_inode(ri); 683 jffs2_free_raw_inode(ri);
684 684
@@ -708,8 +708,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
708 return ret; 708 return ret;
709 } 709 }
710 710
711 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, 711 ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
712 ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen)); 712 ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
713 if (ret) { 713 if (ret) {
714 /* Eep. */ 714 /* Eep. */
715 jffs2_clear_inode(inode); 715 jffs2_clear_inode(inode);
@@ -744,7 +744,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
744 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); 744 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
745 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen)); 745 rd->name_crc = cpu_to_je32(crc32(0, dentry->d_name.name, namelen));
746 746
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);
748 748
749 if (IS_ERR(fd)) { 749 if (IS_ERR(fd)) {
750 /* dirent failed to write. Delete the inode normally 750 /* dirent failed to write. Delete the inode normally