X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.c;h=c89b29ca86f7c92c8a56344698ef8e7515e35b82;hp=bf58eca1da0b3ceaf0316adbb7ed055b6519733b;hb=ba5e2f04db2bf57788cf6e326f54bd858296c29e;hpb=5cd357cc797ac725ca90b13cb7020ba4dd924f18 diff --git a/yaffs_guts.c b/yaffs_guts.c index bf58eca..c89b29c 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -4635,8 +4635,11 @@ static int yaffs_check_dev_fns(struct yaffs_dev *dev) static int yaffs_create_initial_dir(struct yaffs_dev *dev) { /* Initialise the unlinked, deleted, root and lost+found directories */ - dev->lost_n_found = dev->root_dir = NULL; - dev->unlinked_dir = dev->del_dir = NULL; + dev->lost_n_found = NULL; + dev->root_dir = NULL; + dev->unlinked_dir = NULL; + dev->del_dir = NULL; + dev->unlinked_dir = yaffs_create_fake_dir(dev, YAFFS_OBJECTID_UNLINKED, S_IFDIR); dev->del_dir = @@ -4648,9 +4651,15 @@ static int yaffs_create_initial_dir(struct yaffs_dev *dev) yaffs_create_fake_dir(dev, YAFFS_OBJECTID_LOSTNFOUND, YAFFS_LOSTNFOUND_MODE | S_IFDIR); - if (dev->lost_n_found && dev->root_dir && dev->unlinked_dir - && dev->del_dir) { - yaffs_add_obj_to_dir(dev->root_dir, dev->lost_n_found); + if (dev->lost_n_found && + dev->root_dir && + dev->unlinked_dir && + dev->del_dir) { + /* If lost-n-found is hidden then yank it out of the directory tree. */ + if (dev->param.hide_lost_n_found) + list_del_init(&dev->lost_n_found->siblings); + else + yaffs_add_obj_to_dir(dev->root_dir, dev->lost_n_found); return YAFFS_OK; } return YAFFS_FAIL;