mtd/fs/ffs2 ffs2_fs.h, 1.1, 1.2 ffs2_fs_i.h, 1.1, 1.2 ffs2_fs_sb.h, 1.1, 1.2 io.c, 1.1, 1.2 makefile, 1.1, 1.2 super.c, 1.1, 1.2

gleixner at infradead.org gleixner at infradead.org
Mon Nov 7 06:15:54 EST 2005


Update of /home/cvs/mtd/fs/ffs2
In directory phoenix.infradead.org:/tmp/cvs-serv29274/fs/ffs2

Modified Files:
	ffs2_fs.h ffs2_fs_i.h ffs2_fs_sb.h io.c makefile super.c 
Log Message:
[MTD / JFFS2] Clean up trailing white spaces


Index: ffs2_fs.h
===================================================================
RCS file: /home/cvs/mtd/fs/ffs2/ffs2_fs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ffs2_fs.h	27 Mar 2000 07:14:15 -0000	1.1
+++ ffs2_fs.h	7 Nov 2005 11:14:33 -0000	1.2
@@ -3,21 +3,21 @@
 // $Id$
 /* ######################################################################
 
-   Microsoft Flash File System 2 
+   Microsoft Flash File System 2
 
    File System block structures as defined the MS ffs2 spec, names are
-   taken directly from there. 
-   
+   taken directly from there.
+
    The structure of the filesystem follows a linked list design, their
    are no blocking constraints like in normal FS's, structures start
    anyplace on the flash. Directories are linked lists of files and files
    are linked lists of extents, the whole thing forms a tree on the flash.
 
-   Every structure is permanently tied to being in a single block, but 
-   the offset in the block is flexable. All accesses are indirected 
-   through a block allocation scheme. Inodes numbrs are assigned to the 
-   pointer location values of the head of the 'extent' list. 
-     
+   Every structure is permanently tied to being in a single block, but
+   the offset in the block is flexable. All accesses are indirected
+   through a block allocation scheme. Inodes numbrs are assigned to the
+   pointer location values of the head of the 'extent' list.
+
    ##################################################################### */
 									/*}}} */
 #ifndef __LINUX_FFS2FS_FS_H
@@ -28,7 +28,7 @@
 
 #include <asm/types.h>
 
-// Probably should change this to use __attribute__ 
+// Probably should change this to use __attribute__
 #pragma pack(1)
 
 /* The boot record is hidden inside the media and pointed too by one of
@@ -77,8 +77,8 @@
 #define FFS_ENTRY_SIBLING    (1 << 6)
 #define FFS_ENTRY_COMPIP_SHIFT (8)
 
-/* This is an 'extent', it contains the pointer to the raw file data, 
-   foolishly they store the compression type in the file entry 
+/* This is an 'extent', it contains the pointer to the raw file data,
+   foolishly they store the compression type in the file entry
    record <grr> */
 struct ffs2_fileinfo
 {
@@ -91,7 +91,7 @@
    __u16 Date;
    __u16 VarStructLen;
    __u16 UncompressedExtentLen;
-   __u16 CompressedExtentLen;   
+   __u16 CompressedExtentLen;
 };
 #define FFS_SIZEOF_FILEINFO sizeof(struct ffs2_fileinfo)
 

Index: ffs2_fs_i.h
===================================================================
RCS file: /home/cvs/mtd/fs/ffs2/ffs2_fs_i.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ffs2_fs_i.h	27 Mar 2000 07:14:15 -0000	1.1
+++ ffs2_fs_i.h	7 Nov 2005 11:14:33 -0000	1.2
@@ -3,7 +3,7 @@
 // $Id$
 /* ######################################################################
 
-   Microsoft Flash File System 2 
+   Microsoft Flash File System 2
 
    ##################################################################### */
 									/*}}} */
@@ -11,7 +11,7 @@
 #define __LINUX_FFS2FS_FS_I_H
 
 // Kernel Inode data
-struct ffs2_inode_info 
+struct ffs2_inode_info
 {
 };
 

Index: ffs2_fs_sb.h
===================================================================
RCS file: /home/cvs/mtd/fs/ffs2/ffs2_fs_sb.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ffs2_fs_sb.h	27 Mar 2000 07:14:15 -0000	1.1
+++ ffs2_fs_sb.h	7 Nov 2005 11:14:33 -0000	1.2
@@ -4,10 +4,10 @@
 /* ######################################################################
 
    Microsoft Flash File System 2
-      
-   The super block stores some misc information that is occasionally 
+
+   The super block stores some misc information that is occasionally
    needed when reading/writing the FS.
-   
+
    ##################################################################### */
 									/*}}} */
 #ifndef __LINUX_FFS2FS_FS_SB_H
@@ -30,7 +30,7 @@
    unsigned long FreeSpace;
    unsigned long ReclaimableSpace;
    unsigned long LargestSpace;
-   struct ffs2_free_space *FreeList;   
+   struct ffs2_free_space *FreeList;
    enum ffs2_block_state Sate;
    unsigned short VirtualBlock;
 };
@@ -39,7 +39,7 @@
 struct ffs2_sb_info
 {
    unsigned long EraseSize;      // The block size in bytes
-   unsigned long ZeroBlock;      /* The first flash block in the file system 
+   unsigned long ZeroBlock;      /* The first flash block in the file system
                                     (hack to advoid needing paritions sometimes) */
    struct ffs2_bootrecord Boot;
    unsigned short *BlockMap;     // Mapping of virtual blocks to real blocks

Index: io.c
===================================================================
RCS file: /home/cvs/mtd/fs/ffs2/io.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- io.c	27 Mar 2000 07:14:15 -0000	1.1
+++ io.c	7 Nov 2005 11:14:33 -0000	1.2
@@ -4,11 +4,11 @@
 /* ######################################################################
 
    Microsoft Flash File System 2 IO Operations
-   
-   These are some generic IO operations that are not depenend on the 
-   linux kernel. The boot loader uses this file to get FFS2 read 
+
+   These are some generic IO operations that are not depenend on the
+   linux kernel. The boot loader uses this file to get FFS2 read
    capability.
-   
+
    ##################################################################### */
 									/*}}} */
 #include "local.h"
@@ -30,13 +30,13 @@
 
    if (offset <= 0)
       return -1;
-   
+
    // Fetch it..
    if (ffs2_read(r,block,offset,FFS_SIZEOF_BLOCKALLOC) == 0)
       return -1;
-   
+
    alloc = (struct ffs2_blockalloc *)r->p;
-   
+
    // Make sure it is allocated
 #ifndef SMALLER
    if (isflagset(alloc->Status,FFS_ALLOC_SMASK,FFS_ALLOC_ALLOCATED) == 0)
@@ -47,13 +47,13 @@
       return -1;
    }
 #endif
-   
+
    if (blk != 0)
       memcpy(blk,alloc,FFS_SIZEOF_BLOCKALLOC);
-   
+
    // Prepare the reader
    offset = (alloc->Offset[2] << 16) + (alloc->Offset[1] << 8) + alloc->Offset[0];
-#ifndef SMALLER   
+#ifndef SMALLER
    if (offset >= getFFS2_sb(r->super).EraseSize ||
        offset + alloc->Len >= getFFS2_sb(r->super).EraseSize)
    {
@@ -61,34 +61,34 @@
       return -1;
    }
 #endif
-   
+
    r->location = location;
-   
+
    // Preload it with the block
    if (alloc->Len < 100)
    {
       if (ffs2_read(r,block,offset,alloc->Len) == 0)
 	 return -1;
-   }   
+   }
    else
    {
       if (ffs2_read(r,block,offset,100) == 0)
 	 return -1;
    }
-   
+
    return 0;
 }
 									/*}}}*/
 // ffs2_find_entry - Find an entry					/*{{{*/
 // ---------------------------------------------------------------------
-/* This follows the secondary pointers to resolve the superceding 
-   mechanism. It will work on any type of entry structure 
+/* This follows the secondary pointers to resolve the superceding
+   mechanism. It will work on any type of entry structure
    (dir/file/extent) */
 struct ffs2_entry *ffs2_find_entry(struct ffs_read *r,unsigned long loc)
 {
    struct ffs2_entry *entry;
    struct ffs2_blockalloc alloc;
-   
+
    while (1)
    {
       if (ffs2_find_blockalloc(r,loc,&alloc) != 0)
@@ -100,8 +100,8 @@
       else
       {
 	 unsigned long size = alloc.Len;
-	 
-	 /* Range check the structure to make sure that it is the right 
+
+	 /* Range check the structure to make sure that it is the right
 	    size */
 	 if (isflagset(entry->Status,FFS_ENTRY_TYPEMASK,FFS_ENTRY_TYPEDIR) ||
 	     isflagset(entry->Status,FFS_ENTRY_TYPEMASK,FFS_ENTRY_TYPEFILE))
@@ -110,27 +110,27 @@
 	    size = FFS_SIZEOF_FILEINFO + entry->VarStructLen;
 
 	 // Overflows the block (bad!)
-#ifndef SMaLLER	 
+#ifndef SMaLLER
 	 if (size > alloc.Len)
 	 {
 	    printk("ffs2: Invalid entry %lu (%lu %u)\n",loc,size,alloc.Len);
 	    return 0;
-	 }	    
-	 
+	 }
+
 	 if (size != alloc.Len)
 	    printk("ffs2: Size off %lu %u\n",size,alloc.Len);
 #endif
-	 
+
 	 // See if we need a larger read-ahead
 	 if (size < r->ahead)
 	 {
 	    if (ffs2_read(r,r->block,r->offset,alloc.Len) == 0)
 	       return 0;
 	    entry = (struct ffs2_entry *)r->p;
-	 }	 
-	 
-	 return entry;	 
-      }      
+	 }
+
+	 return entry;
+      }
    }
    printk("ffs2: Failed to find entry\n");
    return 0;
@@ -138,7 +138,7 @@
 									/*}}}*/
 // ffs2_copy_to_buff - Copy from an extent into a buffer		/*{{{*/
 // ---------------------------------------------------------------------
-/* This is the only routine that reads file extents. Any sort of 
+/* This is the only routine that reads file extents. Any sort of
    compression algorithm can be placed here. */
 int ffs2_copy_to_buff(struct ffs_read *r,unsigned char *buf,
 		      struct ffs2_fileinfo *extent,unsigned long toread,
@@ -146,7 +146,7 @@
 {
    if (ffs2_find_blockalloc(r,extent->ExtentPtr,0) != 0)
       return -1;
-      
+
    /* Read in the block by repeatedly repositioning the memory window
       at consecutive bytes and reading the maximum possible length */
    while(toread != 0)
@@ -157,19 +157,19 @@
 
       if (r->ahead > toread)
 	 r->ahead = toread;
-      
+
       memcpy(buf,r->p,r->ahead);
       r->offset += r->ahead;
       buf += r->ahead;
       toread -= r->ahead;
    }
-   
+
    return 0;
 }
 									/*}}}*/
 // ffs2_find_boot_block - Find the boot block				/*{{{*/
 // ---------------------------------------------------------------------
-/* Search the media for the first block and the boot block. This is a 
+/* Search the media for the first block and the boot block. This is a
    simple search looking for valid block records and then one with a boot
    block pointer */
 int ffs2_find_boot_block(struct ffs_read *r,unsigned long blocks)
@@ -177,7 +177,7 @@
    unsigned I;
    unsigned long firstvalid = 0xFFFFF;
    struct ffs2_sb_info *sb = &getFFS2_sb(r->super);
-      
+
    for (I = 0; I != blocks; I++)
    {
       struct ffs2_block *block;
@@ -186,7 +186,7 @@
       if (ffs2_read(r,I,sb->EraseSize - FFS_SIZEOF_BLOCK,
 		    FFS_SIZEOF_BLOCK) == 0)
 	 return -1;
-      
+
       block = (struct ffs2_block *)r->p;
 
       // It is either an erased block or junk..
@@ -197,9 +197,9 @@
 	    firstvalid = I;
 	 continue;
       }
-      
+
       // Check the status field
-#ifndef SMALLER      
+#ifndef SMALLER
       if ((block->BlockSeq ^ block->BlockSeqChecksum) != 0xFFFF ||
 	  ((block->Status >> 3) & FFS_STATE_RESERVED) != FFS_STATE_RESERVED ||
 	  block->BlockSeq >= blocks)
@@ -208,12 +208,12 @@
 	 continue;
       }
 #endif
-      
+
       if (firstvalid == 0xFFFFF)
 	 firstvalid = I;
 
       // See if there is a boot block pointer..
-      if (isflagset(block->Status,FFS_STATE_MASK,FFS_STATE_READY) && 
+      if (isflagset(block->Status,FFS_STATE_MASK,FFS_STATE_READY) &&
 	  isflagset(block->Status,FFS_BOOTP_MASK,FFS_BOOTP_CURRENT) &&
 	  (block->BootRecordPtr >> 16) == block->BlockSeq)
       {
@@ -232,7 +232,7 @@
 	 // Verify it
 	 boot = (struct ffs2_bootrecord *)r->p;
 	 if (boot->Signature == 0xF1A5 && boot->FFSWriteVersion == 0x0200 &&
-	     boot->FFSReadVersion == 0x0200 && 
+	     boot->FFSReadVersion == 0x0200 &&
 	     boot->TotalBlockCount <= blocks - sb->ZeroBlock &&
 	     boot->SpareBlockCount < boot->TotalBlockCount &&
 	     (boot->BlockLen % sb->EraseSize) == 0)
@@ -241,7 +241,7 @@
 	    return 0;
 	 }
       }
-   }   
+   }
    return -1;
 }
 									/*}}}*/
@@ -254,7 +254,7 @@
    unsigned I;
    struct ffs2_sb_info *sb = &getFFS2_sb(r->super);
    unsigned Blocks = sb->Boot.TotalBlockCount - sb->Boot.SpareBlockCount;
-   
+
    // Create the block mapping
    for (I = 0; I != sb->Boot.TotalBlockCount; I++)
    {
@@ -281,9 +281,9 @@
 	 continue;
       sb->BlockMap[block->BlockSeq] = I;
    }
-   
+
    // Verify that every block is accounted for
-#ifndef SMALLER   
+#ifndef SMALLER
    for (I = 0; I != Blocks; I++)
    {
       if (sb->BlockMap[I] == 0xFFFF)
@@ -293,21 +293,21 @@
       }
    }
 #endif
-   
+
    return 0;
 }
 									/*}}}*/
 // find_dirent - Lookup a file in a directory by name			/*{{{*/
 // ---------------------------------------------------------------------
 /* This is the same as ffs2_readdir, but doesnt do adds, just compares.
-   If name is null then this returns 0 if the directory has anything 
+   If name is null then this returns 0 if the directory has anything
    in it */
 int ffs2_find_dirent(struct ffs_read *r,unsigned long loc,
 		     struct qstr *name,unsigned long *pos)
 {
    struct ffs2_entry *entry;
    unsigned long cur;
-   
+
    // Locate the inode
    entry = ffs2_find_entry(r,loc);
    if (entry == 0)
@@ -328,14 +328,14 @@
 	 }
 
 	 // This should not happen.
-#ifndef SMALLER	 
+#ifndef SMALLER
 	 if (isflagset(extent->Status,FFS_ENTRY_TYPEMASK,FFS_ENTRY_TYPEEXTENT))
 	 {
 	    printk("ffs2: Filesystem corruption, an extent in the directory list\n");
 	    break;
 	 }
 #endif
-	 
+
 	 // Match?
 	 if ((extent->Status & FFS_ENTRY_EXISTS) == FFS_ENTRY_EXISTS)
 	 {
@@ -346,7 +346,7 @@
 	       return 0;
 	    }
 	 }
-	 
+
 	 // Skip to the next one
 	 if (isFNULL(extent->SiblingPtr) == 0 &&
 	     (extent->Status & FFS_ENTRY_SIBLING) != FFS_ENTRY_SIBLING)

Index: makefile
===================================================================
RCS file: /home/cvs/mtd/fs/ffs2/makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- makefile	27 Mar 2000 07:14:15 -0000	1.1
+++ makefile	7 Nov 2005 11:14:34 -0000	1.2
@@ -4,6 +4,6 @@
 O_TARGET := ffs2.o
 O_OBJS   := super.o io.o
 MI_OBJS   := $(O_TARGET)
-	    
+
 include $(TOPDIR)/Rules.make
-	    
+

Index: super.c
===================================================================
RCS file: /home/cvs/mtd/fs/ffs2/super.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- super.c	27 Mar 2000 07:14:15 -0000	1.1
+++ super.c	7 Nov 2005 11:14:34 -0000	1.2
@@ -3,27 +3,27 @@
 // $Id$
 /* ######################################################################
 
-   Microsoft Flash File System 2 
-   
+   Microsoft Flash File System 2
+
    Information for the FFS2.0 was found in Microsoft's knowledge base,
    http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/specs/S346A.HTM
    Try searching for "Flash File System" if it has been moved
-   
[...1354 lines suppressed...]
 	 res = -EINVAL;
 	 break;
-      }      
+      }
    }
-   
+
    kfree(tmp);
    ffs2_relse(&r);
-   
+
    if (res != 0)
       return res;
    *ppos = pos;
    if (pos > inode->i_size)
-      inode->i_size = pos;   
+      inode->i_size = pos;
    return written;
 }
 									/*}}}*/





More information about the linux-mtd-cvs mailing list