Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4500
b: refs/heads/master
c: 31fbdf7
h: refs/heads/master
v: v3
  • Loading branch information
Artem B. Bityuckiy authored and Thomas Gleixner committed May 23, 2005
1 parent a18299f commit 7568b2b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 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: 67e345d17ff8c2085a54c293001ae548f7be7b21
refs/heads/master: 31fbdf7aa5aac8a2a34f180a25deb157297a10c9
9 changes: 6 additions & 3 deletions trunk/fs/jffs2/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
* $Id: build.c,v 1.69 2004/12/16 20:22:18 dmarlin Exp $
* $Id: build.c,v 1.70 2005/02/28 08:21:05 dedekind Exp $
*
*/

Expand Down Expand Up @@ -97,14 +97,16 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
/* First, scan the medium and build all the inode caches with
lists of physical nodes */

c->flags |= JFFS2_SB_FLAG_MOUNTING;
c->flags |= JFFS2_SB_FLAG_SCANNING;
ret = jffs2_scan_medium(c);
c->flags &= ~JFFS2_SB_FLAG_SCANNING;
if (ret)
goto exit;

D1(printk(KERN_DEBUG "Scanned flash completely\n"));
D2(jffs2_dump_block_lists(c));

c->flags |= JFFS2_SB_FLAG_BUILDING;
/* Now scan the directory tree, increasing nlink according to every dirent found. */
for_each_inode(i, c, ic) {
D1(printk(KERN_DEBUG "Pass 1: ino #%u\n", ic->ino));
Expand All @@ -116,7 +118,6 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
cond_resched();
}
}
c->flags &= ~JFFS2_SB_FLAG_MOUNTING;

D1(printk(KERN_DEBUG "Pass 1 complete\n"));

Expand Down Expand Up @@ -164,6 +165,8 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
ic->scan_dents = NULL;
cond_resched();
}
c->flags &= ~JFFS2_SB_FLAG_BUILDING;

D1(printk(KERN_DEBUG "Pass 3 complete\n"));
D2(jffs2_dump_block_lists(c));

Expand Down
11 changes: 6 additions & 5 deletions trunk/fs/jffs2/nodemgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
* $Id: nodemgmt.c,v 1.118 2005/02/27 23:01:32 dwmw2 Exp $
* $Id: nodemgmt.c,v 1.119 2005/02/28 08:21:05 dedekind Exp $
*
*/

Expand Down Expand Up @@ -403,7 +403,7 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
jeb = &c->blocks[blocknr];

if (jffs2_can_mark_obsolete(c) && !jffs2_is_readonly(c) &&
!(c->flags & JFFS2_SB_FLAG_MOUNTING)) {
!(c->flags & (JFFS2_SB_FLAG_SCANNING | JFFS2_SB_FLAG_BUILDING))) {
/* Hm. This may confuse static lock analysis. If any of the above
three conditions is false, we're going to return from this
function without actually obliterating any nodes or freeing
Expand Down Expand Up @@ -470,8 +470,8 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref

D1(ACCT_PARANOIA_CHECK(jeb));

if (c->flags & JFFS2_SB_FLAG_MOUNTING) {
/* Mount in progress. Don't muck about with the block
if (c->flags & JFFS2_SB_FLAG_SCANNING) {
/* Flash scanning is in progress. Don't muck about with the block
lists because they're not ready yet, and don't actually
obliterate nodes that look obsolete. If they weren't
marked obsolete on the flash at the time they _became_
Expand Down Expand Up @@ -530,7 +530,8 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref

spin_unlock(&c->erase_completion_lock);

if (!jffs2_can_mark_obsolete(c) || jffs2_is_readonly(c)) {
if (!jffs2_can_mark_obsolete(c) || jffs2_is_readonly(c) ||
(c->flags & JFFS2_SB_FLAG_BUILDING)) {
/* We didn't lock the erase_free_sem */
return;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/include/linux/jffs2_fs_sb.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: jffs2_fs_sb.h,v 1.50 2005/02/09 09:23:55 pavlov Exp $ */
/* $Id: jffs2_fs_sb.h,v 1.51 2005/02/28 08:21:06 dedekind Exp $ */

#ifndef _JFFS2_FS_SB
#define _JFFS2_FS_SB
Expand All @@ -14,7 +14,8 @@
#include <linux/rwsem.h>

#define JFFS2_SB_FLAG_RO 1
#define JFFS2_SB_FLAG_MOUNTING 2
#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */
#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */

struct jffs2_inodirty;

Expand Down

0 comments on commit 7568b2b

Please sign in to comment.