shithub: lwext4

Download patch

ref: 0f9ff0446d301b8016b261d27f8a382c54364d34
parent: aa0d32fd7de1c9edeb520cf41046f87041dbf6e0
author: gkostka <kostka.grzegorz@gmail.com>
date: Mon Oct 7 16:51:07 EDT 2013

Code format.

--- a/src/ext4.h
+++ b/src/ext4.h
@@ -86,7 +86,7 @@
 #define SEEK_END	2
 #endif
 
-/********************************OS LOCK INFERFACE******************************/
+/********************************OS LOCK INFERFACE****************************/
 
 /**@brief	OS dependent lock interface.*/
 struct ext4_lock {
@@ -99,7 +99,7 @@
 };
 
 
-/********************************FILE DESCRIPTOR********************************/
+/********************************FILE DESCRIPTOR******************************/
 
 /**@brief	File descriptor*/
 typedef struct ext4_file {
@@ -120,7 +120,7 @@
     uint64_t fpos;
 }ext4_file;
 
-/*****************************DIRECTORY DESCRIPTOR******************************/
+/*****************************DIRECTORY DESCRIPTOR****************************/
 /**@brief	Directory entry types. Copy from ext4_types.h*/
 enum  {
     EXT4_DIRENTRY_UNKNOWN = 0,
@@ -155,14 +155,14 @@
 /********************************MOUNT OPERATIONS*****************************/
 
 /**@brief	Register a block device to a name.
- * 			@warning Block device has to be filled by
- * 			@ref EXT4_BLOCKDEV_STATIC_INSTANCE. Block cache may be created
- * 			@ref EXT4_BCACHE_STATIC_INSTANCE.
+ *          @warning Block device has to be filled by
+ *          @ref EXT4_BLOCKDEV_STATIC_INSTANCE. Block cache may be created
+ *          @ref EXT4_BCACHE_STATIC_INSTANCE.
  * 			Block cache may by created automaticly when bc parameter is 0.
- * @param	bd block device
- * @param	bd block device cache (0 = automatic cache mode)
- * @param	dev_name register name
- * @param	standard error code*/
+ * @param   bd block device
+ * @param   bd block device cache (0 = automatic cache mode)
+ * @param   dev_name register name
+ * @param   standard error code*/
 int	ext4_device_register(struct ext4_blockdev *bd, struct ext4_bcache *bc,
         const char *dev_name);
 
@@ -180,7 +180,7 @@
  * @return  standard error code */
 int	ext4_umount(char *mount_point);
 
-/********************************FILE OPERATIONS******************************/
+/********************************FILE OPERATIONS*****************************/
 
 /**@brief	*/
 int	    ext4_fremove(const char *path);
@@ -224,7 +224,7 @@
 /**@brief	*/
 uint64_t ext4_fsize (ext4_file *f);
 
-/*********************************DIRECTORY OPERATION*************************/
+/*********************************DIRECTORY OPERATION************************/
 /**@brief	*/
 int ext4_mkdir(const char *path);
 
--- a/src/lwext4/ext4_balloc.c
+++ b/src/lwext4/ext4_balloc.c
@@ -49,7 +49,8 @@
 
 
 
-static uint32_t ext4_balloc_get_bgid_of_block(struct ext4_sblock *s, uint32_t baddr)
+static uint32_t ext4_balloc_get_bgid_of_block(struct ext4_sblock *s,
+    uint32_t baddr)
 {
     if(ext4_get32(s, first_data_block))
         baddr--;
@@ -59,7 +60,7 @@
 
 
 uint32_t ext4_balloc_get_first_data_block_in_group(struct ext4_sblock *s,
-        struct ext4_block_group_ref * bg_ref)
+    struct ext4_block_group_ref * bg_ref)
 {
     uint32_t block_group_count 		 = ext4_block_group_cnt(s);
     uint32_t inode_table_first_block =
@@ -147,7 +148,7 @@
             ext4_bg_get_free_blocks_count(bg_ref.block_group, sb);
     free_blocks++;
     ext4_bg_set_free_blocks_count(bg_ref.block_group,
-            sb, free_blocks);
+        sb, free_blocks);
 
     bg_ref.dirty = true;
 
@@ -159,7 +160,8 @@
     return EOK;
 }
 
-int ext4_balloc_free_blocks(struct ext4_inode_ref *inode_ref, uint32_t first, uint32_t count)
+int ext4_balloc_free_blocks(struct ext4_inode_ref *inode_ref, uint32_t first,
+    uint32_t count)
 {
     struct ext4_fs *fs = inode_ref->fs;
     struct ext4_sblock *sb = &fs->sb;
@@ -222,7 +224,7 @@
             ext4_bg_get_free_blocks_count(bg_ref.block_group, sb);
     free_blocks += count;
     ext4_bg_set_free_blocks_count(bg_ref.block_group,
-            sb, free_blocks);
+        sb, free_blocks);
     bg_ref.dirty = true;
 
     /* Release block group reference */
@@ -289,8 +291,8 @@
         uint32_t inodes_count_total = ext4_get32(sb, inodes_count);
 
         inode_table_bytes =
-                (inodes_count_total - ((block_group_count - 1) * inodes_per_group)) *
-                inode_table_item_size;
+                (inodes_count_total - ((block_group_count - 1) *
+                        inodes_per_group)) * inode_table_item_size;
     }
 
     uint32_t inode_table_blocks = inode_table_bytes / block_size;
@@ -306,7 +308,8 @@
 }
 
 
-int ext4_balloc_alloc_block(struct ext4_inode_ref *inode_ref, uint32_t *fblock)
+int ext4_balloc_alloc_block(struct ext4_inode_ref *inode_ref,
+    uint32_t *fblock)
 {
     uint32_t allocated_block = 0;
     uint32_t bitmap_block_addr;
@@ -349,7 +352,8 @@
     bitmap_block_addr =
             ext4_bg_get_block_bitmap(bg_ref.block_group, sb);
 
-    rc = ext4_block_get(inode_ref->fs->bdev, &bitmap_block, bitmap_block_addr);
+    rc = ext4_block_get(inode_ref->fs->bdev, &bitmap_block,
+            bitmap_block_addr);
     if (rc != EOK) {
         ext4_fs_put_block_group_ref(&bg_ref);
         return rc;
@@ -512,7 +516,7 @@
             ext4_bg_get_free_blocks_count(bg_ref.block_group, sb);
     bg_free_blocks--;
     ext4_bg_set_free_blocks_count(bg_ref.block_group, sb,
-            bg_free_blocks);
+        bg_free_blocks);
 
     bg_ref.dirty = true;
 
@@ -523,7 +527,7 @@
 }
 
 int ext4_balloc_try_alloc_block(struct ext4_inode_ref *inode_ref,
-        uint32_t baddr, bool *free)
+    uint32_t baddr, bool *free)
 {
     int rc = EOK;
 
@@ -592,7 +596,7 @@
             ext4_bg_get_free_blocks_count(bg_ref.block_group, sb);
     free_blocks--;
     ext4_bg_set_free_blocks_count(bg_ref.block_group,
-            sb, free_blocks);
+        sb, free_blocks);
 
     bg_ref.dirty = true;
 
--- a/src/lwext4/ext4_balloc.h
+++ b/src/lwext4/ext4_balloc.h
@@ -54,7 +54,7 @@
  * @param	bg_ref block group reference
  * @return	block id of the first datablock in block group*/
 uint32_t ext4_balloc_get_first_data_block_in_group(struct ext4_sblock *s,
-        struct ext4_block_group_ref * bg_ref);
+         struct ext4_block_group_ref * bg_ref);
 
 /**@brief	Free block from inode.
  * @param	inode_ref inode reference