From: Erez Zadok <ezk@cs.sunysb.edu>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
viro@ftp.linux.org.uk, hch@infradead.org,
Erez Zadok <ezk@cs.sunysb.edu>
Subject: [PATCH 19/19] Unionfs: coding style: avoid lines longer than 80 chars
Date: Mon, 1 Oct 2007 01:50:56 -0400 [thread overview]
Message-ID: <11912178651441-git-send-email-ezk@cs.sunysb.edu> (raw)
In-Reply-To: <1191217856647-git-send-email-ezk@cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
---
fs/unionfs/commonfops.c | 18 ++++++-----
fs/unionfs/debug.c | 80 +++++++++++++++++++++++-----------------------
fs/unionfs/dentry.c | 3 +-
fs/unionfs/dirfops.c | 8 +++--
fs/unionfs/fanout.h | 9 +++--
5 files changed, 63 insertions(+), 55 deletions(-)
diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index 6f2970d..7654bcb 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -339,7 +339,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);
@@ -388,7 +389,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. */
@@ -418,6 +420,7 @@ static int __open_dir(struct inode *inode, struct file *file)
struct dentry *lower_dentry;
struct file *lower_file;
int bindex, bstart, bend;
+ struct vfsmount *mnt;
bstart = fbstart(file) = dbstart(file->f_path.dentry);
bend = fbend(file) = dbend(file->f_path.dentry);
@@ -430,10 +433,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);
@@ -679,8 +680,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();
}
diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
index c0d710f..68692d7 100644
--- a/fs/unionfs/debug.c
+++ b/fs/unionfs/debug.c
@@ -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) {
diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
index 49323de..6bab9d6 100644
--- a/fs/unionfs/dentry.c
+++ b/fs/unionfs/dentry.c
@@ -328,7 +328,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;
}
diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
index 0064723..c644c13 100644
--- a/fs/unionfs/dirfops.c
+++ b/fs/unionfs/dirfops.c
@@ -155,7 +155,8 @@ static int unionfs_readdir(struct file *file, void *dirent, filldir_t filldir)
uds->dirpos = offset;
/* Copy the atime. */
- fsstack_copy_attr_atime(inode, lower_file->f_path.dentry->d_inode);
+ fsstack_copy_attr_atime(inode,
+ lower_file->f_path.dentry->d_inode);
if (err < 0)
goto out;
@@ -240,8 +241,9 @@ static loff_t unionfs_dir_llseek(struct file *file, loff_t offset, int origin)
else
err = -EINVAL;
} else {
- rdstate = find_rdstate(file->f_path.dentry->d_inode,
- offset);
+ struct inode *inode;
+ inode = file->f_path.dentry->d_inode;
+ rdstate = find_rdstate(inode, offset);
if (rdstate) {
UNIONFS_F(file)->rdstate = rdstate;
err = rdstate->offset;
diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h
index 8d5f15e..ec18013 100644
--- a/fs/unionfs/fanout.h
+++ b/fs/unionfs/fanout.h
@@ -314,11 +314,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;
}
}
--
1.5.2.2
prev parent reply other threads:[~2007-10-01 5:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 5:50 [GIT PULL -mm] 00/19 Unionfs updates/cleanups/fixes Erez Zadok
2007-10-01 5:50 ` [PATCH 01/19] Unionfs: compile if debug is off Erez Zadok
2007-10-01 5:50 ` [PATCH 02/19] Unionfs: add un/likely on conditionals Erez Zadok
2007-10-01 5:50 ` [PATCH 03/19] Unionfs: minor comment cleanups Erez Zadok
2007-10-01 5:50 ` [PATCH 04/19] Unionfs: use consistent printk prefixes Erez Zadok
2007-10-01 5:50 ` [PATCH 05/19] Unionfs: use UNIONFS_NAME macro Erez Zadok
2007-10-01 5:50 ` [PATCH 06/19] Unionfs: properly indent static struct Erez Zadok
2007-10-01 5:50 ` [PATCH 07/19] Unionfs: remove unnecessary if condition Erez Zadok
2007-10-01 5:50 ` [PATCH 08/19] Unionfs: use page_offset() helper Erez Zadok
2007-10-01 5:50 ` [PATCH 09/19] Unionfs: use pr_debug() instead of custom dprintk() Erez Zadok
2007-10-01 5:50 ` [PATCH 10/19] Unionfs: convert all appropriate printk's to pr_debug calls Erez Zadok
2007-10-01 5:50 ` [PATCH 11/19] Unionfs: add missing newlines in printk's Erez Zadok
2007-10-01 5:50 ` [PATCH 12/19] Unionfs: update/assign a KERN_* level to all printk statements Erez Zadok
2007-10-01 5:50 ` [PATCH 13/19] Unionfs: remove periods from the end of printk strings Erez Zadok
2007-10-01 5:50 ` [PATCH 14/19] Unionfs: use braces in both branches of conditionals Erez Zadok
2007-10-01 5:50 ` [PATCH 15/19] Unionfs: coding style: proper spacing Erez Zadok
2007-10-01 5:50 ` [PATCH 16/19] Unionfs: coding style: take assignments out of "if" conditions Erez Zadok
2007-10-01 5:50 ` [PATCH 17/19] Unionfs: coding style: avoid multiple assignments on same line Erez Zadok
2007-10-01 5:50 ` [PATCH 18/19] Unionfs: coding style: miscellaneous fixes Erez Zadok
2007-10-01 5:50 ` Erez Zadok [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11912178651441-git-send-email-ezk@cs.sunysb.edu \
--to=ezk@cs.sunysb.edu \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).