Unionfs: coding style: proper spacing
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 30 Sep 2007 17:56:44 +0000 (13:56 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 30 Sep 2007 17:56:44 +0000 (13:56 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/copyup.c
fs/unionfs/debug.c
fs/unionfs/dentry.c
fs/unionfs/fanout.h
fs/unionfs/mmap.c
fs/unionfs/super.c
fs/unionfs/union.h

index 037cb066cc9530aaee0b7dc8558e8e317d6b2fd1..15c7555f7700a99f8ac9f52f59d737dc79f8e30f 100644 (file)
@@ -869,7 +869,7 @@ void unionfs_postcopyup_release(struct dentry *dentry)
        int bindex;
 
        BUG_ON(S_ISDIR(dentry->d_inode->i_mode));
-       for (bindex=dbstart(dentry)+1; bindex<=dbend(dentry); bindex++) {
+       for (bindex = dbstart(dentry)+1; bindex <= dbend(dentry); bindex++) {
                if (unionfs_lower_mnt_idx(dentry, bindex)) {
                        unionfs_mntput(dentry, bindex);
                        unionfs_set_lower_mnt_idx(dentry, bindex, NULL);
index 818bf56560dcfa8c7d111231fd3a5a50e5b10acc..45f9eeed07155479ac57ffdec10f131b0bf6314a 100644 (file)
@@ -20,7 +20,7 @@
 #define PRINT_CALLER(fname, fxn, line)                                 \
        do {                                                            \
                if (!printed_caller) {                                  \
-                       pr_debug("PC:%s:%s:%d\n",(fname),(fxn),(line)); \
+                       pr_debug("PC:%s:%s:%d\n", (fname), (fxn), (line)); \
                        printed_caller = 1;                             \
                }                                                       \
        } while (0)
@@ -310,7 +310,7 @@ void __unionfs_check_dentry(const struct dentry *dentry,
        /* check if lower inode is newer than upper one (it shouldn't) */
        if (unlikely(is_newer_lower(dentry))) {
                PRINT_CALLER(fname, fxn, line);
-               for (bindex=ibstart(inode); bindex <= ibend(inode); bindex++) {
+               for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
                        lower_inode = unionfs_lower_inode_idx(inode, bindex);
                        if (unlikely(!lower_inode))
                                continue;
@@ -413,7 +413,7 @@ void __unionfs_check_file(const struct file *file,
                }
        }
 
-       __unionfs_check_dentry(dentry,fname,fxn,line);
+       __unionfs_check_dentry(dentry, fname, fxn, line);
 }
 
 /* useful to track vfsmount leaks that could cause EBUSY on unmount */
@@ -424,14 +424,14 @@ void __show_branch_counts(const struct super_block *sb,
        struct vfsmount *mnt;
 
        pr_debug("BC:");
-       for (i=0; i<sbmax(sb); i++) {
+       for (i = 0; i < sbmax(sb); i++) {
                if (likely(sb->s_root))
                        mnt = UNIONFS_D(sb->s_root)->lower_paths[i].mnt;
                else
                        mnt = NULL;
                pr_debug("%d:", (mnt ? atomic_read(&mnt->mnt_count) : -99));
        }
-       pr_debug("%s:%s:%d\n",file,fxn,line);
+       pr_debug("%s:%s:%d\n", file, fxn, line);
 }
 
 void __show_inode_times(const struct inode *inode,
@@ -440,12 +440,12 @@ void __show_inode_times(const struct inode *inode,
        struct inode *lower_inode;
        int bindex;
 
-       for (bindex=ibstart(inode); bindex <= ibend(inode); bindex++) {
+       for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
                lower_inode = unionfs_lower_inode_idx(inode, bindex);
                if (unlikely(!lower_inode))
                        continue;
                pr_debug("IT(%lu:%d): ", inode->i_ino, bindex);
-               pr_debug("%s:%s:%d ",file,fxn,line);
+               pr_debug("%s:%s:%d ", file, fxn, line);
                pr_debug("um=%lu/%lu lm=%lu/%lu ",
                         inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec,
                         lower_inode->i_mtime.tv_sec,
@@ -464,13 +464,13 @@ void __show_dinode_times(const struct dentry *dentry,
        struct inode *lower_inode;
        int bindex;
 
-       for (bindex=ibstart(inode); bindex <= ibend(inode); bindex++) {
+       for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
                lower_inode = unionfs_lower_inode_idx(inode, bindex);
                if (!lower_inode)
                        continue;
                pr_debug("DT(%s:%lu:%d): ", dentry->d_name.name, inode->i_ino,
                         bindex);
-               pr_debug("%s:%s:%d ",file,fxn,line);
+               pr_debug("%s:%s:%d ", file, fxn, line);
                pr_debug("um=%lu/%lu lm=%lu/%lu ",
                         inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec,
                         lower_inode->i_mtime.tv_sec,
@@ -492,7 +492,7 @@ void __show_inode_counts(const struct inode *inode,
                pr_debug("SiC: Null inode\n");
                return;
        }
-       for (bindex=sbstart(inode->i_sb); bindex <= sbend(inode->i_sb);
+       for (bindex = sbstart(inode->i_sb); bindex <= sbend(inode->i_sb);
             bindex++) {
                lower_inode = unionfs_lower_inode_idx(inode, bindex);
                if (unlikely(!lower_inode))
@@ -500,6 +500,6 @@ void __show_inode_counts(const struct inode *inode,
                pr_debug("SIC(%lu:%d:%d): ", inode->i_ino, bindex,
                         atomic_read(&(inode)->i_count));
                pr_debug("lc=%d ", atomic_read(&(lower_inode)->i_count));
-               pr_debug("%s:%s:%d\n",file,fxn,line);
+               pr_debug("%s:%s:%d\n", file, fxn, line);
        }
 }
index 1a41947ac87000bfbe6a13b256eecf1e55f5cb9b..af3de1685dd6dd9a9d0d81d8af54d6cb4edae92b 100644 (file)
@@ -330,7 +330,7 @@ bool __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd,
         * if failed, then sleep for a little, then retry.
         */
        dtmp = dentry->d_parent;
-       for (i=chain_len-1; i>=0; i--) {
+       for (i = chain_len-1; i >= 0; i--) {
                chain[i] = dget(dtmp);
                dtmp = dtmp->d_parent;
        }
@@ -339,7 +339,7 @@ bool __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd,
         * call __unionfs_d_revalidate_one() on each dentry, but in parent
         * to child order.
         */
-       for (i=0; i<chain_len; i++) {
+       for (i = 0; i < chain_len; i++) {
                unionfs_lock_dentry(chain[i]);
                saved_bstart = dbstart(chain[i]);
                saved_bend = dbend(chain[i]);
@@ -402,7 +402,7 @@ out_this:
 out_free:
        /* unlock/dput all dentries in chain and return status */
        if (chain_len > 0) {
-               for (i=0; i<chain_len; i++)
+               for (i = 0; i < chain_len; i++)
                        dput(chain[i]);
                kfree(chain);
        }
@@ -458,7 +458,7 @@ static void unionfs_d_release(struct dentry *dentry)
                dput(unionfs_lower_dentry_idx(dentry, bindex));
                unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
                /* NULL lower mnt is ok if this is a negative dentry */
-               if (!dentry->d_inode && !unionfs_lower_mnt_idx(dentry,bindex))
+               if (!dentry->d_inode && !unionfs_lower_mnt_idx(dentry, bindex))
                        continue;
                unionfs_mntput(dentry, bindex);
                unionfs_set_lower_mnt_idx(dentry, bindex, NULL);
index 536a51fa593d0110d1f8c58154d6c962d260a814..8d5f15e0e3acc68c72f99cbb7fbd895508ae0478 100644 (file)
@@ -310,7 +310,7 @@ static inline void unionfs_copy_attr_times(struct inode *upper)
 
        if (!upper || ibstart(upper) < 0)
                return;
-       for (bindex=ibstart(upper); bindex <= ibend(upper); bindex++) {
+       for (bindex = ibstart(upper); bindex <= ibend(upper); bindex++) {
                lower = unionfs_lower_inode_idx(upper, bindex);
                if (!lower)
                        continue; /* not all lower dir objects may exist */
index 5ce1fc25839e8c38c2d58a2ab5e698c4eb8100fb..5efbf39b73bb31ad9f9e7f0d204c1791bf1d9798 100644 (file)
@@ -102,7 +102,7 @@ static int unionfs_writepage(struct page *page, struct writeback_control *wbc)
        BUG_ON(!lower_inode->i_mapping->a_ops->writepage);
 
        /* workaround for some lower file systems: see big comment on top */
-       if (wbc->for_writepages /* && !wbc->fs_private */)
+       if (wbc->for_writepages)
                wbc->for_writepages = 0;
 
        /* call lower writepage (expects locked page) */
index 0fc80431c36cd19d21164205aa7cbfc41d3a12d8..4d3251c41502633ca311e49f11110b8c42ad27c0 100644 (file)
@@ -202,7 +202,7 @@ static noinline int do_remount_mode_option(char *optarg, int cur_branches,
                       optarg, err);
                goto out;
        }
-       for (idx=0; idx<cur_branches; idx++)
+       for (idx = 0; idx < cur_branches; idx++)
                if (nd.mnt == new_lower_paths[idx].mnt &&
                    nd.dentry == new_lower_paths[idx].dentry)
                        break;
@@ -245,7 +245,7 @@ static noinline int do_remount_del_option(char *optarg, int cur_branches,
                       optarg, err);
                goto out;
        }
-       for (idx=0; idx < cur_branches; idx++)
+       for (idx = 0; idx < cur_branches; idx++)
                if (nd.mnt == new_lower_paths[idx].mnt &&
                    nd.dentry == new_lower_paths[idx].dentry)
                        break;
@@ -329,7 +329,7 @@ static noinline int do_remount_add_option(char *optarg, int cur_branches,
                       optarg, err);
                goto out;
        }
-       for (idx=0; idx < cur_branches; idx++)
+       for (idx = 0; idx < cur_branches; idx++)
                if (nd.mnt == new_lower_paths[idx].mnt &&
                    nd.dentry == new_lower_paths[idx].dentry)
                        break;
@@ -540,7 +540,7 @@ static int unionfs_remount_fs(struct super_block *sb, int *flags,
               cur_branches * sizeof(struct unionfs_data));
        memcpy(tmp_lower_paths, UNIONFS_D(sb->s_root)->lower_paths,
               cur_branches * sizeof(struct path));
-       for (i=0; i<cur_branches; i++)
+       for (i = 0; i < cur_branches; i++)
                pathget(&tmp_lower_paths[i]); /* drop refs at end of fxn */
 
        /*******************************************************************
@@ -743,14 +743,14 @@ out_no_change:
         * Update lower inodes: 3 steps
         * 1. grab ref on all new lower inodes
         */
-       for (i=dbstart(sb->s_root); i<=dbend(sb->s_root); i++) {
+       for (i = dbstart(sb->s_root); i <= dbend(sb->s_root); i++) {
                struct dentry *lower_dentry =
                        unionfs_lower_dentry_idx(sb->s_root, i);
                igrab(lower_dentry->d_inode);
                new_lower_inodes[i] = lower_dentry->d_inode;
        }
        /* 2. release reference on all older lower inodes */
-       for (i=old_ibstart; i<=old_ibend; i++) {
+       for (i = old_ibstart; i <= old_ibend; i++) {
                iput(unionfs_lower_inode_idx(sb->s_root->d_inode, i));
                unionfs_set_lower_inode_idx(sb->s_root->d_inode, i, NULL);
        }
@@ -785,7 +785,7 @@ out_no_change:
 out_release:
        /* no need to cleanup/release anything in tmp_data */
        if (tmp_lower_paths)
-               for (i=0; i<new_branches; i++)
+               for (i = 0; i < new_branches; i++)
                        pathput(&tmp_lower_paths[i]);
 out_free:
        kfree(tmp_lower_paths);
index 19dbcc7cf3c57ee00b6037d22cb613fed00ce8b6..6d5980a1eb92620e21a1ecefc98c58ae81368b9f 100644 (file)
@@ -394,7 +394,7 @@ static inline int is_robranch_super(const struct super_block *sb, int index)
 {
        int ret;
 
-       ret = (!(branchperms(sb, index) & MAY_WRITE)) ? -EROFS : 0;
+       ret = (!(branchperms(sb, index) & MAY_WRITE)) ? -EROFS : 0;
        return ret;
 }
 
@@ -509,22 +509,22 @@ static inline void unionfs_mntput(struct dentry *dentry, int bindex)
 #ifdef CONFIG_UNION_FS_DEBUG
 
 /* useful for tracking code reachability */
-#define UDBG pr_debug("DBG:%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__)
+#define UDBG pr_debug("DBG:%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__)
 
 #define unionfs_check_inode(i) __unionfs_check_inode((i),      \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 #define unionfs_check_dentry(d)        __unionfs_check_dentry((d),     \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 #define unionfs_check_file(f)  __unionfs_check_file((f),       \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 #define show_branch_counts(sb) __show_branch_counts((sb),      \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 #define show_inode_times(i)    __show_inode_times((i),         \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 #define show_dinode_times(d)   __show_dinode_times((d),        \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 #define show_inode_counts(i)   __show_inode_counts((i),        \
-       __FILE__,__FUNCTION__,__LINE__)
+       __FILE__, __FUNCTION__, __LINE__)
 
 extern void __unionfs_check_inode(const struct inode *inode, const char *fname,
                                  const char *fxn, int line);
@@ -540,19 +540,19 @@ extern void __show_inode_times(const struct inode *inode,
 extern void __show_dinode_times(const struct dentry *dentry,
                                const char *file, const char *fxn, int line);
 extern void __show_inode_counts(const struct inode *inode,
-                               const char *file, const char *fxn, int line);
+                               const char *file, const char *fxn, int line);
 
 #else /* not CONFIG_UNION_FS_DEBUG */
 
 /* we leave useful hooks for these check functions throughout the code */
-#define unionfs_check_inode(i)         do { } while(0)
-#define unionfs_check_dentry(d)                do { } while(0)
-#define unionfs_check_file(f)          do { } while(0)
-#define unionfs_check_nd(n)            do { } while(0)
-#define show_branch_counts(sb)         do { } while(0)
-#define show_inode_times(i)            do { } while(0)
-#define show_dinode_times(d)           do { } while(0)
-#define show_inode_counts(i)           do { } while(0)
+#define unionfs_check_inode(i)         do { } while (0)
+#define unionfs_check_dentry(d)                do { } while (0)
+#define unionfs_check_file(f)          do { } while (0)
+#define unionfs_check_nd(n)            do { } while (0)
+#define show_branch_counts(sb)         do { } while (0)
+#define show_inode_times(i)            do { } while (0)
+#define show_dinode_times(d)           do { } while (0)
+#define show_inode_counts(i)           do { } while (0)
 
 #endif /* not CONFIG_UNION_FS_DEBUG */