mtd/fs/jffs inode-v22.c, 1.67, 1.68 inode-v23.c, 1.74, 1.75 intrep.c,
1.105, 1.106 intrep.h, 1.14, 1.15 jffs_fm.c, 1.31,
1.32 jffs_proc.c, 1.6, 1.7
gleixner at infradead.org
gleixner at infradead.org
Mon Nov 7 06:16:01 EST 2005
- Previous message: mtd/fs/jffs2/ecos/src dir-ecos.c, 1.12, 1.13 fs-ecos.c, 1.45,
1.46 gcthread.c, 1.3, 1.4 malloc-ecos.c, 1.4, 1.5 os-ecos.h,
1.26, 1.27
- Next message: mtd/grub doc_stage1.h,1.2,1.3 makecsum.c,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/fs/jffs
In directory phoenix.infradead.org:/tmp/cvs-serv29274/fs/jffs
Modified Files:
inode-v22.c inode-v23.c intrep.c intrep.h jffs_fm.c
jffs_proc.c
Log Message:
[MTD / JFFS2] Clean up trailing white spaces
Index: inode-v22.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/inode-v22.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- inode-v22.c 23 Sep 2001 23:28:36 -0000 1.67
+++ inode-v22.c 7 Nov 2005 11:14:35 -0000 1.68
@@ -75,46 +75,46 @@
kdev_t dev = sb->s_dev;
struct inode *root_inode;
struct jffs_control *c;
-
+
D1(printk(KERN_NOTICE "JFFS: Trying to mount device %s.\n",
kdevname(dev)));
-
+
if (MAJOR(dev)!=MTD_BLOCK_MAJOR) {
printk(KERN_WARNING "JFFS: Trying to mount non-mtd device.\n");
[...1192 lines suppressed...]
-
+
#ifdef CONFIG_JFFS_PROC_FS
#ifdef KERNEL_VERSION /* Not defined for kernel 2.0.*. */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,2,0)
@@ -1945,12 +1945,12 @@
proc_register_dynamic(&proc_root_fs, &jffs_proc_root);
#endif /* KERNEL_VERSION */
#endif /* CONFIG_JFFS_PROC_FS */
-
+
fm_cache = kmem_cache_create("jffs_fm", sizeof(struct jffs_fm),
0, SLAB_HWCACHE_ALIGN, NULL, NULL);
node_cache = kmem_cache_create("jffs_node",sizeof(struct jffs_node),
0, SLAB_HWCACHE_ALIGN, NULL, NULL);
-
+
return register_filesystem(&jffs_fs_type);
}
Index: inode-v23.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/inode-v23.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- inode-v23.c 2 Jul 2003 20:36:26 -0000 1.74
+++ inode-v23.c 7 Nov 2005 11:14:35 -0000 1.75
@@ -144,8 +144,8 @@
c->gc_maxdirty_threshold = c->fmc->sector_size;
- c->thread_pid = kernel_thread (jffs_garbage_collect_thread,
- (void *) c,
+ c->thread_pid = kernel_thread (jffs_garbage_collect_thread,
+ (void *) c,
CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
D1(printk(KERN_NOTICE "JFFS: GC thread pid=%d.\n", (int) c->thread_pid));
@@ -771,7 +771,7 @@
if (result) {
SetPageError(page);
}else {
- SetPageUptodate(page);
+ SetPageUptodate(page);
}
flush_dcache_page(page);
@@ -915,7 +915,7 @@
jffs_unlink(struct inode *dir, struct dentry *dentry)
{
struct jffs_control *c = (struct jffs_control *)dir->i_sb->u.generic_sbp;
- int ret;
+ int ret;
D3(printk("***jffs_unlink()\n"));
D3(printk (KERN_NOTICE "unlink(): down biglock\n"));
@@ -969,7 +969,7 @@
}
child = child->sibling_next;
}
- }
+ }
else if (S_ISDIR(del_f->mode)) {
D(printk("jffs_remove(): node is a directory "
"but it shouldn't be.\n"));
@@ -1146,7 +1146,7 @@
int err;
D1({
- int len = dentry->d_name.len;
+ int len = dentry->d_name.len;
char *_name = (char *)kmalloc(len + 1, GFP_KERNEL);
char *_symname = (char *)kmalloc(symname_len + 1, GFP_KERNEL);
memcpy(_name, dentry->d_name.name, len);
@@ -1360,7 +1360,7 @@
err = -EROFS;
goto out_isem;
}
-#endif
+#endif
err = -EINVAL;
if (!S_ISREG(inode->i_mode)) {
@@ -1391,7 +1391,7 @@
D3(printk (KERN_NOTICE "file_write(): down biglock\n"));
down(&c->fmc->biglock);
- /* Urgh. POSIX says we can do short writes if we feel like it.
+ /* Urgh. POSIX says we can do short writes if we feel like it.
* In practice, we can't. Nothing will cope. So we loop until
* we're done.
*
@@ -1450,7 +1450,7 @@
smaller node than we were expecting. There's no need for it
to waste the space at the end of the flash just because it's
a little smaller than what we asked for. But that's a whole
- new can of worms which I'm not going to open this week.
+ new can of worms which I'm not going to open this week.
-- dwmw2.
*/
if ((err = jffs_write_node(c, node, &raw_inode, f->name,
@@ -1747,7 +1747,7 @@
{
printk(KERN_INFO "JFFS version " JFFS_VERSION_STRING
", (C) 1999, 2000 Axis Communications AB\n");
-
+
fm_cache = kmem_cache_create("jffs_fm", sizeof(struct jffs_fm),
0, SLAB_HWCACHE_ALIGN, NULL, NULL);
node_cache = kmem_cache_create("jffs_node",sizeof(struct jffs_node),
Index: intrep.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/intrep.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- intrep.c 2 Jul 2003 20:39:55 -0000 1.105
+++ intrep.c 7 Nov 2005 11:14:35 -0000 1.106
@@ -223,7 +223,7 @@
D3(printk(KERN_NOTICE "flash_safe_writev(%p, %08x, %p)\n",
mtd, (unsigned int) to, vecs));
-
+
if (mtd->writev) {
res = MTD_WRITEV(mtd, vecs, iovec_cnt, to, &retlen);
return res ? res : retlen;
@@ -242,7 +242,7 @@
return -EIO;
}
/* If res is non-zero, retlen_a is undefined, but we don't
- care because in that case it's not going to be
+ care because in that case it's not going to be
returned anyway.
*/
to += retlen_a;
@@ -558,7 +558,7 @@
c->sb = sb;
if ((err = jffs_scan_flash(c)) < 0) {
if(err == -EAGAIN){
- /* scan_flash() wants us to try once more. A flipping
+ /* scan_flash() wants us to try once more. A flipping
bits sector was detect in the middle of the scan flash.
Clean up old allocated memory before going in.
*/
@@ -573,7 +573,7 @@
if ((err = jffs_scan_flash(c)) < 0) {
goto jffs_build_fs_fail;
- }
+ }
}else{
goto jffs_build_fs_fail;
}
@@ -632,29 +632,29 @@
/*
- This checks for sectors that were being erased in their previous
- lifetimes and for some reason or the other (power fail etc.),
+ This checks for sectors that were being erased in their previous
+ lifetimes and for some reason or the other (power fail etc.),
the erase cycles never completed.
- As the flash array would have reverted back to read status,
+ As the flash array would have reverted back to read status,
these sectors are detected by the symptom of the "flipping bits",
i.e. bits being read back differently from the same location in
flash if read multiple times.
The only solution to this is to re-erase the entire
sector.
Unfortunately detecting "flipping bits" is not a simple exercise
- as a bit may be read back at 1 or 0 depending on the alignment
+ as a bit may be read back at 1 or 0 depending on the alignment
of the stars in the universe.
- The level of confidence is in direct proportion to the number of
- scans done. By power fail testing I (Vipin) have been able to
+ The level of confidence is in direct proportion to the number of
+ scans done. By power fail testing I (Vipin) have been able to
proove that reading twice is not enough.
Maybe 4 times? Change NUM_REREADS to a higher number if you want
- a (even) higher degree of confidence in your mount process.
+ a (even) higher degree of confidence in your mount process.
A higher number would of course slow down your mount.
*/
int check_partly_erased_sectors(struct jffs_fmcontrol *fmc){
#define NUM_REREADS 4 /* see note above */
-#define READ_AHEAD_BYTES 4096 /* must be a multiple of 4,
+#define READ_AHEAD_BYTES 4096 /* must be a multiple of 4,
usually set to kernel page size */
__u8 *read_buf1;
@@ -682,18 +682,18 @@
CHECK_NEXT:
while(pos < end){
-
+
D1(printk("check_partly_erased_sector():checking sector which contains"
" offset 0x%x for flipping bits..\n", (__u32)pos));
-
+
retlen = flash_safe_read(fmc->mtd, pos,
&read_buf1[0], READ_AHEAD_BYTES);
retlen &= ~3;
-
+
for(cnt = 0; cnt < NUM_REREADS; cnt++){
(void)flash_safe_read(fmc->mtd, pos,
&read_buf2[0], READ_AHEAD_BYTES);
-
+
for (i=0 ; i < retlen ; i+=4) {
/* buffers MUST match, double word for word! */
if(*((__u32 *) &read_buf1[i]) !=
@@ -705,21 +705,21 @@
cnt, NUM_REREADS));
D1(printk("check_partly_erased_sectors:flipping bits detected"
" @offset:0x%x(0x%x!=0x%x)\n",
- (__u32)pos+i, *((__u32 *) &read_buf1[i]),
+ (__u32)pos+i, *((__u32 *) &read_buf1[i]),
*((__u32 *) &read_buf2[i])));
-
+
/* calculate start of present sector */
offset = (((__u32)pos+i)/(__u32)fmc->sector_size) * (__u32)fmc->sector_size;
-
+
D1(printk("check_partly_erased_sector():erasing sector starting 0x%x.\n",
offset));
-
+
if (flash_erase_region(fmc->mtd,
offset, fmc->sector_size) < 0) {
printk(KERN_ERR "JFFS: Erase of flash failed. "
"offset = %u, erase_size = %d\n",
offset , fmc->sector_size);
-
+
err = -EIO;
goto returnBack;
@@ -777,13 +777,13 @@
__u32 largest_hole = 0;
__u32 hole_end_offset = 0;
__u32 head_offset;
-
+
#define NUMFREEALLOWED 2 /* 2 chunks of at least erase size space allowed */
int num_free_space = 0; /* Flag err if more than TWO
free blocks found. This is NOT allowed
by the current jffs design.
*/
- int num_free_spc_not_accp = 0; /* For debugging purposed keep count
+ int num_free_spc_not_accp = 0; /* For debugging purposed keep count
of how much free space was rejected and
marked dirty
*/
@@ -810,7 +810,7 @@
flash_safe_release(fmc->mtd);
return -ENOMEM;
}
-
+
/* Start the scan. */
while (pos < end) {
deleted_file = 0;
@@ -823,7 +823,7 @@
/* We have found 0xffffffff at this position. We have to
scan the rest of the flash till the end or till
something else than 0xffffffff is found.
- Keep going till we do not find JFFS_EMPTY_BITMASK
+ Keep going till we do not find JFFS_EMPTY_BITMASK
anymore */
D1(printk("jffs_scan_flash(): 0xffffffff at pos 0x%lx.\n",
@@ -832,12 +832,12 @@
while(pos < end){
len = end - pos < 4096 ? end - pos : 4096;
-
+
retlen = flash_safe_read(fmc->mtd, pos,
&read_buf[0], len);
retlen &= ~3;
-
+
for (i=0 ; i < retlen ; i+=4, pos += 4) {
if(*((__u32 *) &read_buf[i]) !=
JFFS_EMPTY_BITMASK)
@@ -851,20 +851,20 @@
D1(printk("jffs_scan_flash():0xffffffff ended at pos 0x%lx.\n",
(long)pos));
-
+
/* If some free space ends in the middle of a sector,
treat it as dirty rather than clean.
- This is to handle the case where one thread
+ This is to handle the case where one thread
allocated space for a node, but didn't get to
actually _write_ it before power was lost, leaving
a gap in the log. Shifting all node writes into
a single kernel thread will fix the original problem.
*/
if ((__u32) pos % fmc->sector_size) {
- /* If there was free space in previous
- sectors, don't mark that dirty too -
+ /* If there was free space in previous
+ sectors, don't mark that dirty too -
only from the beginning of this sector
- (or from start)
+ (or from start)
*/
test_start = pos & ~(fmc->sector_size-1); /* end of last sector */
@@ -873,15 +873,15 @@
/* free space started in the previous sector! */
- if((num_free_space < NUMFREEALLOWED) &&
+ if((num_free_space < NUMFREEALLOWED) &&
((unsigned int)(test_start - start) >= fmc->sector_size)){
/*
- Count it in if we are still under NUMFREEALLOWED *and* it is
- at least 1 erase sector in length. This will keep us from
+ Count it in if we are still under NUMFREEALLOWED *and* it is
+ at least 1 erase sector in length. This will keep us from
picking any little ole' space as "free".
*/
-
+
D1(printk("Reducing end of free space to 0x%x from 0x%x\n",
(unsigned int)test_start, (unsigned int)pos));
@@ -892,7 +892,7 @@
D1(printk("Reducing start to 0x%x from 0x%x\n",
test_start, start));
if (largest_hole < test_start - start){
-
+
D3(printk("was hole = %x end_offset = %x\n",
largest_hole, hole_end_offset));
if (fmc->head) {
@@ -905,9 +905,9 @@
largest_hole, hole_end_offset));
/* below, space from "start" to "pos" will be marked dirty. */
- start = test_start;
-
- /* Being in here means that we have found at least an entire
+ start = test_start;
+
+ /* Being in here means that we have found at least an entire
erase sector size of free space ending on a sector boundary.
Keep track of free spaces accepted.
*/
@@ -916,11 +916,11 @@
num_free_spc_not_accp++;
D1(printk("Free space (#%i) found but *Not* accepted: Starting"
" 0x%x for 0x%x bytes\n",
- num_free_spc_not_accp, (unsigned int)start,
+ num_free_spc_not_accp, (unsigned int)start,
(unsigned int)((unsigned int)(pos & ~(fmc->sector_size-1)) - (unsigned int)start)));
-
+
}
-
+
}
if((((__u32)(pos - start)) != 0)){
@@ -933,7 +933,7 @@
did not catch this offset. See check_partly_erased_sectors() for
more info.
*/
-
+
D1(printk("jffs_scan_flash():wants to allocate dirty flash "
"space for 0 bytes.\n"));
D1(printk("jffs_scan_flash(): Flipping bits! We will free "
@@ -941,10 +941,10 @@
/* calculate start of present sector */
offset = (((__u32)pos)/(__u32)fmc->sector_size) * (__u32)fmc->sector_size;
-
+
D1(printk("jffs_scan_flash():erasing sector starting 0x%x.\n",
offset));
-
+
if (flash_erase_region(fmc->mtd,
offset, fmc->sector_size) < 0) {
printk(KERN_ERR "JFFS: Erase of flash failed. "
@@ -964,21 +964,21 @@
}else{
/* Being in here means that we have found free space that ends on an erase sector
boundary.
- Count it in if we are still under NUMFREEALLOWED *and* it is at least 1 erase
+ Count it in if we are still under NUMFREEALLOWED *and* it is at least 1 erase
sector in length. This will keep us from picking any little ole' space as "free".
*/
- if((num_free_space < NUMFREEALLOWED) &&
+ if((num_free_space < NUMFREEALLOWED) &&
((unsigned int)(pos - start) >= fmc->sector_size)){
- /* We really don't do anything to mark space as free, except *not*
- mark it dirty and just advance the "pos" location pointer.
+ /* We really don't do anything to mark space as free, except *not*
+ mark it dirty and just advance the "pos" location pointer.
It will automatically be picked up as free space.
- */
+ */
num_free_space++;
D1(printk("Free space accepted: Starting 0x%x for 0x%x bytes\n",
(unsigned int) start, (unsigned int) (pos - start)));
if (largest_hole < pos - start) {
-
+
D3(printk("was hole = %x end_offset = %x\n",
largest_hole, hole_end_offset));
if (fmc->head){
@@ -992,22 +992,22 @@
}else{
num_free_spc_not_accp++;
D1(printk("Free space (#%i) found but *Not* accepted: Starting "
- "0x%x for 0x%x bytes\n", num_free_spc_not_accp,
- (unsigned int) start,
+ "0x%x for 0x%x bytes\n", num_free_spc_not_accp,
+ (unsigned int) start,
(unsigned int) (pos - start)));
-
+
/* Mark this space as dirty. We already have our free space. */
D1(printk("Dirty space: Starting 0x%x for 0x%x bytes\n",
(unsigned int) start, (unsigned int) (pos - start)));
jffs_fmalloced(fmc, (__u32) start,
- (__u32) (pos - start), 0);
+ (__u32) (pos - start), 0);
}
-
+
}
if(num_free_space > NUMFREEALLOWED){
printk(KERN_WARNING "jffs_scan_flash(): Found free space "
"number %i. Only %i free space is allowed.\n",
- num_free_space, NUMFREEALLOWED);
+ num_free_space, NUMFREEALLOWED);
}
continue;
@@ -1059,7 +1059,7 @@
jffs_fmalloced(fmc, (__u32) start,
(__u32) (pos - start),
0);
-
+
continue;
}/* switch */
@@ -1072,7 +1072,7 @@
/* Release the flash device */
flash_safe_release(fmc->mtd);
-
+
return -ENOMEM;
}
DJM(no_jffs_node++);
@@ -1180,7 +1180,7 @@
(__u32) (pos - start), 0);
/* Reuse this unused struct jffs_node. */
continue;
- }
+ }
pos += raw_inode.dsize
+ JFFS_GET_PAD_BYTES(raw_inode.dsize);
@@ -1285,7 +1285,7 @@
else {
head_offset = hole_end_offset;
}
-
+
if (jffs_build_end(fmc, head_offset) < 0) {
D(printk("jffs_build_end() failed\n"));
return -ENOMEM;
@@ -1311,13 +1311,13 @@
printk(KERN_WARNING "jffs_scan_falsh():Free size accounting screwed\n");
printk(KERN_WARNING "jfffs_scan_flash():free_chunk_size1 == 0x%x, "
- "free_chunk_size2 == 0x%x, fmc->free_size == 0x%x\n",
+ "free_chunk_size2 == 0x%x, fmc->free_size == 0x%x\n",
free_chunk_size1, free_chunk_size2, fmc->free_size);
return -1; /* Do NOT mount f/s so that we can inspect what happened.
Mounting this screwed up f/s will screw us up anyway.
*/
- }
+ }
return 0; /* as far as we are concerned, we are happy! */
} /* jffs_scan_flash() */
@@ -1803,14 +1803,14 @@
+ JFFS_GET_PAD_BYTES(raw_inode->dsize);
__u32 total_size = sizeof(struct jffs_raw_inode)
+ total_name_size + total_data_size;
-
+
/* If this node isn't something that will eventually let
GC free even more space, then don't allow it unless
there's at least max_chunk_size space still available
*/
if (!recoverable)
slack = fmc->max_chunk_size;
-
+
/* Fire the retrorockets and shoot the fruiton torpedoes, sir! */
@@ -1846,7 +1846,7 @@
/* First try to allocate some flash memory. */
err = jffs_fmalloc(fmc, total_size, node, &fm);
-
+
if (err == -ENOSPC) {
/* Just out of space. GC and try again */
if (fmc->dirty_size < fmc->sector_size) {
@@ -1855,7 +1855,7 @@
total_size));
return err;
}
-
+
D1(printk(KERN_INFO "jffs_write_node(): Calling jffs_garbage_collect_now()\n"));
jffs_fm_write_unlock(fmc);
if ((err = jffs_garbage_collect_now(c))) {
@@ -1864,7 +1864,7 @@
}
jffs_fm_write_lock(fmc);
continue;
- }
+ }
if (err < 0) {
jffs_fm_write_unlock(fmc);
@@ -1978,7 +1978,7 @@
shouldn't be read again. 'max_size' is how much space there is in
the buffer. */
static int
-jffs_get_node_data(struct jffs_file *f, struct jffs_node *node,
+jffs_get_node_data(struct jffs_file *f, struct jffs_node *node,
unsigned char *buf,__u32 node_offset, __u32 max_size,
kdev_t dev)
{
@@ -2333,9 +2333,9 @@
if (node->removed_size > (f->size - node->data_offset)) {
/* It's possible that the removed_size is in fact
* greater than the amount of data we actually thought
- * were present in the first place - some of the nodes
+ * were present in the first place - some of the nodes
* which this node originally obsoleted may already have
- * been deleted from the flash by subsequent garbage
+ * been deleted from the flash by subsequent garbage
* collection.
*
* If this is the case, don't let f->size go negative.
@@ -2766,7 +2766,7 @@
DJM(no_jffs_fm--);
jffs_fm_write_unlock(fmc);
kfree(fm);
-
+
return err;
}
new_node->fm = fm;
@@ -2932,7 +2932,7 @@
"No oldest node found!\n");
err = -1;
goto jffs_garbage_collect_next_end;
-
+
});
@@ -2964,7 +2964,7 @@
D1(printk("jffs_garbage_collect_next(): \"%s\", "
"ino: %u, version: %u, location 0x%x, dsize %u\n",
- (f->name ? f->name : ""), node->ino, node->version,
+ (f->name ? f->name : ""), node->ino, node->version,
node->fm->offset, node->data_size));
/* Compute how many data it's possible to rewrite at the moment. */
@@ -3027,7 +3027,7 @@
*/
if (space_needed > fmc->free_size) {
/* If we've gone below min_free_size for some reason,
- don't fuck up. This is why we have
+ don't fuck up. This is why we have
min_free_size > sector_size. Whinge about it though,
just so I can convince myself my maths is right.
*/
@@ -3041,16 +3041,16 @@
/* Check that we don't use up any more 'extra' space than
what's available */
- if (size > JFFS_PAD(node->data_size) + total_name_size +
+ if (size > JFFS_PAD(node->data_size) + total_name_size +
sizeof(struct jffs_raw_inode) + extra_available) {
D1(printk("Reducing size of new node from %d to %ld to avoid "
- "catching our tail\n", size,
- (long) (JFFS_PAD(node->data_size) + JFFS_PAD(node->name_size) +
+ "catching our tail\n", size,
+ (long) (JFFS_PAD(node->data_size) + JFFS_PAD(node->name_size) +
sizeof(struct jffs_raw_inode) + extra_available)));
- D1(printk("space_needed = %d, extra_available = %d\n",
+ D1(printk("space_needed = %d, extra_available = %d\n",
space_needed, extra_available));
- size = JFFS_PAD(node->data_size) + total_name_size +
+ size = JFFS_PAD(node->data_size) + total_name_size +
sizeof(struct jffs_raw_inode) + extra_available;
data_size = size - sizeof(struct jffs_raw_inode)
- total_name_size;
@@ -3070,7 +3070,7 @@
printk(KERN_WARNING "jffs_rewrite_data() failed: %d\n", err);
return err;
}
-
+
jffs_garbage_collect_next_end:
D3(printk("jffs_garbage_collect_next: Leaving...\n"));
return err;
@@ -3264,7 +3264,7 @@
// down(&fmc->gclock);
/* If it is possible to garbage collect, do so. */
-
+
while (erased == 0) {
D1(printk("***jffs_garbage_collect_now(): round #%u, "
"fmc->dirty_size = %u\n", i++, fmc->dirty_size));
@@ -3278,7 +3278,7 @@
}
if (erased)
break;
-
+
if (fmc->free_size == 0) {
/* Argh */
printk(KERN_ERR "jffs_garbage_collect_now(): free_size == 0. This is BAD.\n");
@@ -3287,7 +3287,7 @@
}
if (fmc->dirty_size < fmc->sector_size) {
- /* Actually, we _may_ have been able to free some,
+ /* Actually, we _may_ have been able to free some,
* if there are many overlapping nodes which aren't
* actually marked dirty because they still have
* some valid data in each.
@@ -3307,7 +3307,7 @@
D1(printk(" jffs_garbage_collect_now(): erased: %ld\n", erased));
DJM(jffs_print_memory_allocation_statistics());
}
-
+
gc_end:
// up(&fmc->gclock);
@@ -3360,7 +3360,7 @@
if (c->fmc->dirty_size > c->gc_maxdirty_threshold) {
D2(printk(KERN_NOTICE "thread_should_wake(): Waking due to excessive dirty space\n"));
return 1;
- }
+ }
/* FIXME: What about the "There are many versions of a node" condition? */
return 0;
@@ -3376,7 +3376,7 @@
if (c->gc_task && thread_should_wake(c))
send_sig(SIGHUP, c->gc_task, 1);
}
-
+
/* Kernel threads take (void *) as arguments. Thus we pass
the jffs_control data as a (void *) and then cast it. */
@@ -3396,7 +3396,7 @@
current->session = 1;
current->pgrp = 1;
- init_completion(&c->gc_thread_comp); /* barrier */
+ init_completion(&c->gc_thread_comp); /* barrier */
spin_lock_irq(¤t->sigmask_lock);
siginitsetinv (¤t->blocked, sigmask(SIGHUP) | sigmask(SIGKILL) | sigmask(SIGSTOP) | sigmask(SIGCONT));
recalc_sigpending();
@@ -3408,8 +3408,8 @@
for (;;) {
/* See if we need to start gc. If we don't, go to sleep.
-
- Current implementation is a BAD THING(tm). If we try
+
+ Current implementation is a BAD THING(tm). If we try
to unmount the FS, the unmount operation will sleep waiting
for this thread to exit. We need to arrange to send it a
sig before the umount process sleeps.
@@ -3417,12 +3417,12 @@
if (!thread_should_wake(c))
set_current_state (TASK_INTERRUPTIBLE);
-
+
schedule(); /* Yes, we do this even if we want to go
- on immediately - we're a low priority
+ on immediately - we're a low priority
background task. */
- /* Put_super will send a SIGKILL and then wait on the sem.
+ /* Put_super will send a SIGKILL and then wait on the sem.
*/
while (signal_pending(current)) {
siginfo_t info;
@@ -3451,7 +3451,7 @@
D3(printk (KERN_NOTICE "g_c_thread(): down biglock\n"));
down(&fmc->biglock);
-
+
D1(printk("***jffs_garbage_collect_thread(): round #%u, "
"fmc->dirty_size = %u\n", i++, fmc->dirty_size));
D2(jffs_print_fmcontrol(fmc));
@@ -3471,14 +3471,14 @@
// panic()
goto gc_end;
}
-
+
/* Let's dare to make a garbage collect. */
if ((result = jffs_garbage_collect_next(c)) < 0) {
printk(KERN_ERR "JFFS: Something "
"has gone seriously wrong "
"with a garbage collect: %d\n", result);
}
-
+
gc_end:
D3(printk (KERN_NOTICE "g_c_thread(): up biglock\n"));
up(&fmc->biglock);
Index: intrep.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/intrep.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- intrep.h 23 Sep 2001 23:28:37 -0000 1.14
+++ intrep.h 7 Nov 2005 11:14:36 -0000 1.15
@@ -64,7 +64,7 @@
struct jffs_fmcontrol *fmc = c->fmc;
while (1) {
- if ((fmc->flash_size - (fmc->used_size + fmc->dirty_size))
+ if ((fmc->flash_size - (fmc->used_size + fmc->dirty_size))
>= fmc->min_free_size + space) {
return 1;
}
Index: jffs_fm.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/jffs_fm.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- jffs_fm.c 21 Jul 2003 15:09:02 -0000 1.31
+++ jffs_fm.c 7 Nov 2005 11:14:36 -0000 1.32
@@ -41,7 +41,7 @@
{
struct jffs_fmcontrol *fmc;
struct mtd_info *mtd;
-
+
D3(printk("jffs_build_begin()\n"));
fmc = (struct jffs_fmcontrol *)kmalloc(sizeof(struct jffs_fmcontrol),
GFP_KERNEL);
@@ -59,7 +59,7 @@
DJM(no_jffs_fmcontrol--);
return NULL;
}
-
+
/* Retrieve the size of the flash memory. */
fmc->flash_size = mtd->size;
D3(printk(" fmc->flash_size = %d bytes\n", fmc->flash_size));
@@ -72,7 +72,7 @@
/* min_free_size:
1 sector, obviously.
+ 1 x max_chunk_size, for when a nodes overlaps the end of a sector
- + 1 x max_chunk_size again, which ought to be enough to handle
+ + 1 x max_chunk_size again, which ought to be enough to handle
the case where a rename causes a name to grow, and GC has
to write out larger nodes than the ones it's obsoleting.
We should fix it so it doesn't have to write the name
@@ -148,7 +148,7 @@
else if (cur->offset > cur->next->offset) {
if (cur->offset + cur->size < fmc->flash_size){
if (!(fm = kmalloc(sizeof(struct jffs_fm), GFP_KERNEL))){
-
+
D(printk("jffs_buid_end(): kmalloc failed!\n"));
return -ENOMEM;
}
@@ -169,7 +169,7 @@
cur = cur->next;
}
if (cur->offset > 0) {
-
+
if (!(fm = kmalloc(sizeof(struct jffs_fm), GFP_KERNEL))) {
D(printk("jffs_buid_end(): kmalloc failed!\n"));
return -ENOMEM;
@@ -360,7 +360,7 @@
fm->size = free_chunk_size1;
fm->nodes = 0;
fmc->free_size -= fm->size;
- fmc->dirty_size += fm->size; /* Changed by simonk. This seemingly fixes a
+ fmc->dirty_size += fm->size; /* Changed by simonk. This seemingly fixes a
bug that caused infinite garbage collection.
It previously set fmc->dirty_size to size (which is the
size of the requested chunk).
@@ -801,7 +801,7 @@
fm = kmem_cache_alloc(fm_cache,GFP_KERNEL);
DJM(if (fm) no_jffs_fm++;);
-
+
return fm;
}
Index: jffs_proc.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/jffs_proc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- jffs_proc.c 13 Mar 2003 10:04:52 -0000 1.6
+++ jffs_proc.c 7 Nov 2005 11:14:36 -0000 1.7
@@ -260,7 +260,7 @@
&& (last_fm->offset < c->fmc->flash_size)) {
len += sprintf (page + len,
"%08lX %08lX free\n",
- (unsigned long) last_fm->offset +
+ (unsigned long) last_fm->offset +
last_fm->size,
(unsigned long) (c->fmc->flash_size -
(last_fm->offset + last_fm->size)));
- Previous message: mtd/fs/jffs2/ecos/src dir-ecos.c, 1.12, 1.13 fs-ecos.c, 1.45,
1.46 gcthread.c, 1.3, 1.4 malloc-ecos.c, 1.4, 1.5 os-ecos.h,
1.26, 1.27
- Next message: mtd/grub doc_stage1.h,1.2,1.3 makecsum.c,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list