Unionfs: use braces in both branches of conditionals
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 18 Nov 2007 04:30:13 +0000 (23:30 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:12 +0000 (19:03 -0400)
As per CodingStyle, if one branch of an if-then-else has braces because it
has multiple statements, then the other branch should have braces too, even
if the other branch has only one statement in it.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/dentry.c
fs/unionfs/lookup.c
fs/unionfs/main.c
fs/unionfs/rdstate.c
fs/unionfs/rename.c

index 4e5143e6bf58a2dc712932898427a860b5e019b3..79bae96fa35ded5fb6d47777f6b3a193eaeafac8 100644 (file)
@@ -249,8 +249,9 @@ static int open_all_files(struct file *file)
                if (IS_ERR(lower_file)) {
                        err = PTR_ERR(lower_file);
                        goto out;
-               } else
+               } else {
                        unionfs_set_lower_file_idx(file, bindex, lower_file);
+               }
        }
 out:
        return err;
@@ -565,8 +566,9 @@ static int __open_file(struct inode *inode, struct file *file)
                                        break;
                        }
                        return err;
-               } else
+               } else {
                        lower_flags &= ~(OPEN_WRITE_FLAGS);
+               }
        }
 
        dget(lower_dentry);
index b7e13e37f5f8a64b234a7c714805f93cac6135af..1c76e9fd5d7f8cfc51485fa05310c4d0ffafea14 100644 (file)
@@ -315,9 +315,9 @@ bool __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd,
                 * always be valid, but its lower inode times don't have to
                 * be, so sync up the times only.
                 */
-               if (IS_ROOT(dtmp))
+               if (IS_ROOT(dtmp)) {
                        unionfs_copy_attr_times(dtmp->d_inode);
-               else {
+               else {
                        /*
                         * reset generation number to zero, guaranteed to be
                         * "old"
@@ -392,9 +392,9 @@ out_this:
 
        if (unlikely(is_newer_lower(dentry))) {
                /* root dentry special case as aforementioned */
-               if (IS_ROOT(dentry))
+               if (IS_ROOT(dentry)) {
                        unionfs_copy_attr_times(dentry->d_inode);
-               else {
+               else {
                        /*
                         * reset generation number to zero, guaranteed to be
                         * "old"
index 0f9d6f34c9b43576b688d3e0061500b56cb619b2..ec866ecdaf937a994faaef9b66e451b28ae9293b 100644 (file)
@@ -181,8 +181,9 @@ struct dentry *unionfs_lookup_backend(struct dentry *dentry,
                                first_lower_mnt =
                                        unionfs_mntget(parent_dentry, bindex);
                                first_dentry_offset = bindex;
-                       } else
+                       } else {
                                dput(lower_dentry);
+                       }
 
                        continue;
                }
index 54c8584866e714907b39d5cf6af12f8736e8a56c..fc69ea1343ed49630a2224df0a078c1a585756f8 100644 (file)
@@ -172,9 +172,9 @@ skip:
                break;
        case INTERPOSE_LOOKUP:
                spliced = d_splice_alias(inode, dentry);
-               if (IS_ERR(spliced))
+               if (IS_ERR(spliced)) {
                        err = PTR_ERR(spliced);
-               else if (spliced && spliced != dentry) {
+               else if (spliced && spliced != dentry) {
                        /*
                         * d_splice can return a dentry if it was
                         * disconnected and had to be moved.  We must ensure
index 31c41e796cfe1baad7e09b1961cefb9292810a59..ffa1a98d391d931c9db96634f9d5de235042dd13 100644 (file)
@@ -228,9 +228,9 @@ int add_filldir_node(struct unionfs_dir_state *rdstate, const char *name,
        new->bindex = bindex;
        new->whiteout = whiteout;
 
-       if (namelen < DNAME_INLINE_LEN_MIN)
+       if (namelen < DNAME_INLINE_LEN_MIN) {
                new->name = new->iname;
-       else {
+       else {
                new->name = kmalloc(namelen + 1, GFP_KERNEL);
                if (unlikely(!new->name)) {
                        kmem_cache_free(unionfs_filldir_cachep, new);
index 1259a64ed7d896918ba10593c1719d44c57b90c6..6cc7923959367334168ce3e3c0d655befd7534d7 100644 (file)
@@ -417,10 +417,10 @@ int unionfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        }
        err = do_unionfs_rename(old_dir, old_dentry, new_dir, new_dentry);
 out:
-       if (err)
+       if (err) {
                /* clear the new_dentry stuff created */
                d_drop(new_dentry);
-       else {
+       else {
                /*
                 * force re-lookup since the dir on ro branch is not renamed,
                 * and lower dentries still indicate the un-renamed ones.