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);
#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)
/* 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;
}
}
- __unionfs_check_dentry(dentry,fname,fxn,line);
+ __unionfs_check_dentry(dentry, fname, fxn, line);
}
void __unionfs_check_nd(const struct nameidata *nd,
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,
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,
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,
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))
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);
}
}
* 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;
}
* 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]);
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);
}
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);
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 */
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;
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;
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;
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 */
/*******************************************************************
* 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);
}
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);
{
int ret;
- ret = (!(branchperms(sb, index) & MAY_WRITE)) ? -EROFS : 0;
+ ret = (!(branchperms(sb, index) & MAY_WRITE)) ? -EROFS : 0;
return ret;
}
#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 unionfs_check_nd(n) __unionfs_check_nd((n), \
- __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);
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 */