Unionfs: coding style: avoid lines longer than 80 chars
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 18 Nov 2007 20:07:27 +0000 (15:07 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:13 +0000 (19:03 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/debug.c
fs/unionfs/dentry.c
fs/unionfs/fanout.h

index 7ab027772b71ae39d3495edb253d9d7e8a4e0cc9..15d160bc7b6037b69155fcd09857bac644ac2d9c 100644 (file)
@@ -406,7 +406,8 @@ int unionfs_file_revalidate(struct file *file, bool willwrite)
        if (unlikely(!d_deleted(dentry) &&
                     (sbgen > fgen || dbstart(dentry) != fbstart(file)))) {
                /* save orig branch ID */
-               int orig_brid = UNIONFS_F(file)->saved_branch_ids[fbstart(file)];
+               int orig_brid =
+                       UNIONFS_F(file)->saved_branch_ids[fbstart(file)];
 
                /* First we throw out the existing files. */
                cleanup_file(file);
@@ -455,7 +456,8 @@ int unionfs_file_revalidate(struct file *file, bool willwrite)
                        }
                }
                atomic_set(&UNIONFS_F(file)->generation,
-                          atomic_read(&UNIONFS_I(dentry->d_inode)->generation));
+                          atomic_read(
+                                  &UNIONFS_I(dentry->d_inode)->generation));
        }
 
        /* Copyup on the first write to a file on a readonly branch. */
@@ -487,7 +489,9 @@ static int __open_dir(struct inode *inode, struct file *file)
        int bindex, bstart, bend;
        struct dentry *odf_cache;
        struct timespec *newest;
+       struct vfsmount *mnt;
        int err;
+
        bstart = fbstart(file) = dbstart(file->f_path.dentry);
        bend = fbend(file) = dbend(file->f_path.dentry);
 
@@ -501,10 +505,8 @@ static int __open_dir(struct inode *inode, struct file *file)
 
                dget(lower_dentry);
                unionfs_mntget(file->f_path.dentry, bindex);
-               lower_file = dentry_open(lower_dentry,
-                                        unionfs_lower_mnt_idx(file->f_path.dentry,
-                                                              bindex),
-                                        file->f_flags);
+               mnt = unionfs_lower_mnt_idx(file->f_path.dentry, bindex);
+               lower_file = dentry_open(lower_dentry, mnt, file->f_flags);
                if (IS_ERR(lower_file))
                        return PTR_ERR(lower_file);
 
@@ -755,8 +757,9 @@ static long do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
        } else if (lower_file->f_op->ioctl) {
                lock_kernel();
-               err = lower_file->f_op->ioctl(lower_file->f_path.dentry->d_inode,
-                                             lower_file, cmd, arg);
+               err = lower_file->f_op->ioctl(
+                       lower_file->f_path.dentry->d_inode,
+                       lower_file, cmd, arg);
                unlock_kernel();
        }
 
index c0d710ffeb2a1660044239989bfdc1c9d5b935c8..68692d7858053f5acfdf0b79bf067f7e8ab56030 100644 (file)
@@ -157,27 +157,26 @@ void __unionfs_check_dentry(const struct dentry *dentry,
                                         bindex, dstart, dend);
                        }
                } else {        /* lower_dentry == NULL */
-                       if (bindex >= dstart && bindex <= dend) {
-                               /*
-                                * Directories can have NULL lower inodes in
-                                * b/t start/end, but NOT if at the
-                                * start/end range.  Ignore this rule,
-                                * however, if this is a NULL dentry or a
-                                * deleted dentry.
-                                */
-                               if (unlikely(!d_deleted((struct dentry *) dentry) &&
-                                            inode &&
-                                            !(inode && S_ISDIR(inode->i_mode) &&
-                                              bindex > dstart && bindex < dend))) {
-                                       PRINT_CALLER(fname, fxn, line);
-                                       pr_debug(" CD2: dentry/lower=%p:%p(%p) "
-                                                "bindex=%d dstart/end=%d:%d\n",
-                                                dentry, lower_dentry,
-                                                (lower_dentry ?
-                                                 lower_dentry->d_inode :
-                                                 (void *) -1L),
-                                                bindex, dstart, dend);
-                               }
+                       if (bindex < dstart || bindex > dend)
+                               continue;
+                       /*
+                        * Directories can have NULL lower inodes in b/t
+                        * start/end, but NOT if at the start/end range.
+                        * Ignore this rule, however, if this is a NULL
+                        * dentry or a deleted dentry.
+                        */
+                       if (unlikely(!d_deleted((struct dentry *) dentry) &&
+                                    inode &&
+                                    !(inode && S_ISDIR(inode->i_mode) &&
+                                      bindex > dstart && bindex < dend))) {
+                               PRINT_CALLER(fname, fxn, line);
+                               pr_debug(" CD2: dentry/lower=%p:%p(%p) "
+                                        "bindex=%d dstart/end=%d:%d\n",
+                                        dentry, lower_dentry,
+                                        (lower_dentry ?
+                                         lower_dentry->d_inode :
+                                         (void *) -1L),
+                                        bindex, dstart, dend);
                        }
                }
        }
@@ -193,22 +192,22 @@ void __unionfs_check_dentry(const struct dentry *dentry,
                                         lower_mnt, bindex, dstart, dend);
                        }
                } else {        /* lower_mnt == NULL */
-                       if (bindex >= dstart && bindex <= dend) {
-                               /*
-                                * Directories can have NULL lower inodes in
-                                * b/t start/end, but NOT if at the
-                                * start/end range.  Ignore this rule,
-                                * however, if this is a NULL dentry.
-                                */
-                               if (unlikely(inode &&
-                                            !(inode && S_ISDIR(inode->i_mode) &&
-                                              bindex > dstart && bindex < dend))) {
-                                       PRINT_CALLER(fname, fxn, line);
-                                       pr_debug(" CM1: dentry/lmnt=%p:%p "
-                                                "bindex=%d dstart/end=%d:%d\n",
-                                                dentry, lower_mnt, bindex,
-                                                dstart, dend);
-                               }
+                       if (bindex < dstart || bindex > dend)
+                               continue;
+                       /*
+                        * Directories can have NULL lower inodes in b/t
+                        * start/end, but NOT if at the start/end range.
+                        * Ignore this rule, however, if this is a NULL
+                        * dentry.
+                        */
+                       if (unlikely(inode &&
+                                    !(inode && S_ISDIR(inode->i_mode) &&
+                                      bindex > dstart && bindex < dend))) {
+                               PRINT_CALLER(fname, fxn, line);
+                               pr_debug(" CM1: dentry/lmnt=%p:%p "
+                                        "bindex=%d dstart/end=%d:%d\n",
+                                        dentry, lower_mnt, bindex,
+                                        dstart, dend);
                        }
                }
        }
@@ -310,7 +309,8 @@ 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;
@@ -390,8 +390,8 @@ void __unionfs_check_file(const struct file *file,
                        if (unlikely(bindex < fstart || bindex > fend)) {
                                PRINT_CALLER(fname, fxn, line);
                                pr_debug(" CF5: file/lower=%p:%p bindex=%d "
-                                        "fstart/end=%d:%d\n",
-                                        file, lower_file, bindex, fstart, fend);
+                                        "fstart/end=%d:%d\n", file,
+                                        lower_file, bindex, fstart, fend);
                        }
                } else {        /* lower_file == NULL */
                        if (bindex >= fstart && bindex <= fend) {
index d51c6abb20d06e45534519399d2ec57cb18880d1..f711f3f65f9e42905e6ee5ec48d4b82728efdb19 100644 (file)
@@ -344,7 +344,8 @@ bool __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd,
         */
        chain = kzalloc(chain_len * sizeof(struct dentry *), GFP_KERNEL);
        if (unlikely(!chain)) {
-               printk(KERN_CRIT "unionfs: no more memory in %s\n", __FUNCTION__);
+               printk(KERN_CRIT "unionfs: no more memory in %s\n",
+                      __FUNCTION__);
                goto out;
        }
 
index 998ccdb30693e971cd0405b3a2d4269fe1b1f48f..0f88500dcc12d947866774d705d2dd4d3e2acd58 100644 (file)
@@ -307,11 +307,14 @@ static inline void unionfs_copy_attr_times(struct inode *upper)
                lower = unionfs_lower_inode_idx(upper, bindex);
                if (!lower)
                        continue; /* not all lower dir objects may exist */
-               if (unlikely(timespec_compare(&upper->i_mtime, &lower->i_mtime) < 0))
+               if (unlikely(timespec_compare(&upper->i_mtime,
+                                             &lower->i_mtime) < 0))
                        upper->i_mtime = lower->i_mtime;
-               if (unlikely(timespec_compare(&upper->i_ctime, &lower->i_ctime) < 0))
+               if (unlikely(timespec_compare(&upper->i_ctime,
+                                             &lower->i_ctime) < 0))
                        upper->i_ctime = lower->i_ctime;
-               if (unlikely(timespec_compare(&upper->i_atime, &lower->i_atime) < 0))
+               if (unlikely(timespec_compare(&upper->i_atime,
+                                             &lower->i_atime) < 0))
                        upper->i_atime = lower->i_atime;
        }
 }