commit 7dcde41e1b63a47184756c30a446e80c0d605dd6
Author: Erez Zadok <[EMAIL PROTECTED]>
Date: Sat Nov 17 23:30:13 2007 -0500
Unionfs: use braces in both branches of conditionals
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 <[EMAIL PROTECTED]>
diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index 4e5143e..79bae96 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -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);
diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
index b7e13e3..1c76e9f 100644
--- a/fs/unionfs/dentry.c
+++ b/fs/unionfs/dentry.c
@@ -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"
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 0f9d6f3..ec866ec 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -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;
}
diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index 54c8584..fc69ea1 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -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
diff --git a/fs/unionfs/rdstate.c b/fs/unionfs/rdstate.c
index 31c41e7..ffa1a98 100644
--- a/fs/unionfs/rdstate.c
+++ b/fs/unionfs/rdstate.c
@@ -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);
diff --git a/fs/unionfs/rename.c b/fs/unionfs/rename.c
index 1259a64..6cc7923 100644
--- a/fs/unionfs/rename.c
+++ b/fs/unionfs/rename.c
@@ -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.
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs