Whamcloud - gitweb
Whitespace.
authoradilger <adilger>
Mon, 25 Nov 2002 20:26:02 +0000 (20:26 +0000)
committeradilger <adilger>
Mon, 25 Nov 2002 20:26:02 +0000 (20:26 +0000)
lustre/llite/lproc_llite.c
lustre/llite/namei.c

index 1f51681..65df985 100644 (file)
 #include <linux/lprocfs_status.h>
 
 
-int rd_path(char* page, char **start, off_t off, int count, int *eof, 
+int rd_path(char* page, char **start, off_t off, int count, int *eof,
             void *data)
 {
         return 0;
 }
-int rd_fstype(char* page, char **start, off_t off, int count, int *eof, 
+
+int rd_fstype(char* page, char **start, off_t off, int count, int *eof,
               void *data)
 {
         int len = 0;
         struct super_block *sb = (struct super_block*)data;
-        
-        len += snprintf(page, count, "%s\n", sb->s_type->name); 
+
+        len += snprintf(page, count, "%s\n", sb->s_type->name);
         return len;
 }
-int rd_blksize(char* page, char **start, off_t off, int count, int *eof, 
+
+int rd_blksize(char* page, char **start, off_t off, int count, int *eof,
                void *data)
 {
         int len = 0;
@@ -47,11 +49,12 @@ int rd_blksize(char* page, char **start, off_t off, int count, int *eof,
         struct statfs mystats;
 
         (sb->s_op->statfs)(sb, &mystats);
-        len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_bsize)); 
+        len += snprintf(page, count, "%lu\n", mystats.f_bsize);
         return len;
 
 }
-int rd_kbytestotal(char* page, char **start, off_t off, int count, int *eof, 
+
+int rd_kbytestotal(char* page, char **start, off_t off, int count, int *eof,
                    void *data)
 {
         int len = 0;
@@ -64,23 +67,21 @@ int rd_kbytestotal(char* page, char **start, off_t off, int count, int *eof,
         blk_size = mystats.f_bsize;
         blk_size >>= 10;
         result = mystats.f_blocks;
-        
-        while(blk_size >>= 1){
+
+        while(blk_size >>= 1)
                 result <<= 1;
-        }
-       
-        len += snprintf(page, count, LPU64"\n", result); 
+
+        len += snprintf(page, count, LPU64"\n", result);
         return len;
-        
 }
 
 
-int rd_kbytesfree(char* page, char **start, off_t off, int count, int *eof, 
+int rd_kbytesfree(char* page, char **start, off_t off, int count, int *eof,
                   void *data)
 {
         int len = 0;
         struct super_block *sb = (struct super_block*)data;
-        struct statfs mystats; 
+        struct statfs mystats;
         __u32 blk_size;
         __u64 result;
 
@@ -88,59 +89,56 @@ int rd_kbytesfree(char* page, char **start, off_t off, int count, int *eof,
         blk_size = mystats.f_bsize;
         blk_size >>= 10;
         result = mystats.f_bfree;
-        
-        while(blk_size >>= 1){
+
+        while(blk_size >>= 1)
                 result <<= 1;
-        }
-       
-        len += snprintf(page, count, LPU64"\n", result); 
-        return len;
 
-        
+        len += snprintf(page, count, LPU64"\n", result);
+        return len;
 }
 
-int rd_filestotal(char* page, char **start, off_t off, int count, int *eof, 
+int rd_filestotal(char* page, char **start, off_t off, int count, int *eof,
                   void *data)
 {
-        
         int len = 0;
         struct super_block *sb = (struct super_block*)data;
-        struct statfs mystats; 
-        
+        struct statfs mystats;
+
         (sb->s_op->statfs)(sb, &mystats);
-        len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_files)); 
+        len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_files));
         return len;
 }
 
-int rd_filesfree(char* page, char **start, off_t off, int count, int *eof, 
+int rd_filesfree(char* page, char **start, off_t off, int count, int *eof,
                  void *data)
 {
-        
         int len = 0;
         struct super_block *sb = (struct super_block*)data;
-        struct statfs mystats; 
-        
+        struct statfs mystats;
+
         (sb->s_op->statfs)(sb, &mystats);
-        len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_ffree)); 
+        len += snprintf(page, count, LPU64"\n", (__u64)(mystats.f_ffree));
         return len;
 }
 
-int rd_filegroups(char* page, char **start, off_t off, int count, int *eof, 
+int rd_filegroups(char* page, char **start, off_t off, int count, int *eof,
                   void *data)
 {
         return 0;
 }
-int rd_uuid(char* page, char **start, off_t off, int count, int *eof, 
+int rd_uuid(char* page, char **start, off_t off, int count, int *eof,
             void *data)
 {
         int len = 0;
         struct super_block *sb = (struct super_block*)data;
         struct ll_sb_info *sbi = ll_s2sbi(sb);
-        len += snprintf(page, count, "%s\n", sbi->ll_sb_uuid); 
-        return len;    
+
+        len += snprintf(page, count, "%s\n", sbi->ll_sb_uuid);
+
+        return len;
 
 }
-int rd_dev_name(char* page, char **start, off_t off, int count, int *eof, 
+int rd_dev_name(char* page, char **start, off_t off, int count, int *eof,
                 void *data)
 {
         int len = 0;
@@ -149,7 +147,7 @@ int rd_dev_name(char* page, char **start, off_t off, int count, int *eof,
         return len;
 }
 
-int rd_dev_uuid(char* page, char **start, off_t off, int count, int *eof, 
+int rd_dev_uuid(char* page, char **start, off_t off, int count, int *eof,
                 void *data)
 {
         int len = 0;
@@ -172,7 +170,7 @@ struct lprocfs_vars status_var_nm_1[] = {
         {0}
 };
 
-/* 
+/*
  * Proc registration function for Lustre
  * file system
  */
@@ -188,7 +186,6 @@ void ll_proc_namespace(struct super_block* sb, char* osc, char* mdc)
         struct obd_device* obd;
         int err;
 
-        
         /* Register this mount instance with LProcFS */
         snprintf(mnt_name, MAX_STRING_SIZE, "mount_%s", sbi->ll_sb_uuid);
         mnt_name[MAX_STRING_SIZE] = '\0';
@@ -205,7 +202,7 @@ void ll_proc_namespace(struct super_block* sb, char* osc, char* mdc)
         }
         /* MDC */
         obd = class_uuid2obd(mdc);
-        snprintf(mnt_name, MAX_STRING_SIZE, "status/%s/common_name", 
+        snprintf(mnt_name, MAX_STRING_SIZE, "status/%s/common_name",
                  obd->obd_type->typ_name);
         mnt_name[MAX_STRING_SIZE] = '\0';
         memset(d_vars, 0, sizeof(d_vars));
@@ -228,7 +225,7 @@ void ll_proc_namespace(struct super_block* sb, char* osc, char* mdc)
         obd = class_uuid2obd(osc);
 
         /* Reuse mnt_name */
-        snprintf(mnt_name, MAX_STRING_SIZE, 
+        snprintf(mnt_name, MAX_STRING_SIZE,
                  "status/%s/common_name", obd->obd_type->typ_name);
         mnt_name[MAX_STRING_SIZE] = '\0';
         memset(d_vars, 0, sizeof(d_vars));
index 2b80ce1..b349bc8 100644 (file)
@@ -124,15 +124,13 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
         struct inode *inode;
 
         LASSERT(hash != 0);
-       inode = iget5_locked(sb, hash, ll_test_inode, ll_read_inode2, lic);
+        inode = iget5_locked(sb, hash, ll_test_inode, ll_read_inode2, lic);
 
-       if (!inode)
-               return ERR_PTR(-ENOMEM);
+        if (!inode)
+                return ERR_PTR(-ENOMEM);
 
-       if (inode->i_state & I_NEW) {
-
-               unlock_new_inode(inode);
-       }
+        if (inode->i_state & I_NEW)
+                unlock_new_inode(inode);
 
         // XXX Coda always fills inodes, should Lustre?
         return inode;
@@ -388,11 +386,11 @@ int ll_intent_lock(struct inode *parent, struct dentry **de,
  * de.  If found, return it.  If not found, return de. */
 struct dentry *ll_find_alias(struct inode *inode, struct dentry *de)
 {
-       struct list_head *tmp;
+        struct list_head *tmp;
 
-       spin_lock(&dcache_lock);
+        spin_lock(&dcache_lock);
         list_for_each(tmp, &inode->i_dentry) {
-               struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
+                struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
 
                 /* We are called here with 'de' already on the aliases list. */
                 if (dentry == de) { 
@@ -416,12 +414,12 @@ struct dentry *ll_find_alias(struct inode *inode, struct dentry *de)
                 list_del_init(&dentry->d_hash);
                 spin_unlock(&dcache_lock);
                 d_rehash(dentry);
-               atomic_inc(&dentry->d_count);
+                atomic_inc(&dentry->d_count);
                 iput(inode);
                 return dentry;
-       }
+        }
 
-       spin_unlock(&dcache_lock);
+        spin_unlock(&dcache_lock);
 
         return de;
 }