summaryrefslogtreecommitdiff
path: root/fs/aufs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/dir.c')
-rw-r--r--fs/aufs/dir.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c
index 4644de4a9..4dc666eb4 100644
--- a/fs/aufs/dir.c
+++ b/fs/aufs/dir.c
@@ -42,7 +42,7 @@ void au_sub_nlink(struct inode *dir, struct inode *h_dir)
loff_t au_dir_size(struct file *file, struct dentry *dentry)
{
loff_t sz;
- aufs_bindex_t bindex, bend;
+ aufs_bindex_t bindex, bbot;
struct file *h_file;
struct dentry *h_dentry;
@@ -50,9 +50,9 @@ loff_t au_dir_size(struct file *file, struct dentry *dentry)
if (file) {
AuDebugOn(!d_is_dir(file->f_path.dentry));
- bend = au_fbend_dir(file);
- for (bindex = au_fbstart(file);
- bindex <= bend && sz < KMALLOC_MAX_SIZE;
+ bbot = au_fbbot_dir(file);
+ for (bindex = au_fbtop(file);
+ bindex <= bbot && sz < KMALLOC_MAX_SIZE;
bindex++) {
h_file = au_hf_dir(file, bindex);
if (h_file && file_inode(h_file))
@@ -62,9 +62,9 @@ loff_t au_dir_size(struct file *file, struct dentry *dentry)
AuDebugOn(!dentry);
AuDebugOn(!d_is_dir(dentry));
- bend = au_dbtaildir(dentry);
- for (bindex = au_dbstart(dentry);
- bindex <= bend && sz < KMALLOC_MAX_SIZE;
+ bbot = au_dbtaildir(dentry);
+ for (bindex = au_dbtop(dentry);
+ bindex <= bbot && sz < KMALLOC_MAX_SIZE;
bindex++) {
h_dentry = au_h_dptr(dentry, bindex);
if (h_dentry && d_is_positive(h_dentry))
@@ -97,7 +97,7 @@ static void au_do_dir_ts(void *arg)
struct au_branch *br;
struct au_hinode *hdir;
int err;
- aufs_bindex_t bstart, bindex;
+ aufs_bindex_t btop, bindex;
sb = a->dentry->d_sb;
if (d_really_is_negative(a->dentry))
@@ -106,9 +106,9 @@ static void au_do_dir_ts(void *arg)
aufs_read_lock(a->dentry, AuLock_DW); /* noflush */
dir = d_inode(a->dentry);
- bstart = au_ibstart(dir);
+ btop = au_ibtop(dir);
bindex = au_br_index(sb, a->brid);
- if (bindex < bstart)
+ if (bindex < btop)
goto out_unlock;
br = au_sbr(sb, bindex);
@@ -118,17 +118,17 @@ static void au_do_dir_ts(void *arg)
h_path.mnt = au_br_mnt(br);
au_dtime_store(&dt, a->dentry, &h_path);
- br = au_sbr(sb, bstart);
+ br = au_sbr(sb, btop);
if (!au_br_writable(br->br_perm))
goto out_unlock;
- h_path.dentry = au_h_dptr(a->dentry, bstart);
+ h_path.dentry = au_h_dptr(a->dentry, btop);
h_path.mnt = au_br_mnt(br);
err = vfsub_mnt_want_write(h_path.mnt);
if (err)
goto out_unlock;
- hdir = au_hi(dir, bstart);
+ hdir = au_hi(dir, btop);
au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT);
- h_dir = au_h_iptr(dir, bstart);
+ h_dir = au_h_iptr(dir, btop);
if (h_dir->i_nlink
&& timespec_compare(&h_dir->i_mtime, &dt.dt_mtime) < 0) {
dt.dt_h_path = h_path;
@@ -149,7 +149,7 @@ out:
void au_dir_ts(struct inode *dir, aufs_bindex_t bindex)
{
int perm, wkq_err;
- aufs_bindex_t bstart;
+ aufs_bindex_t btop;
struct au_dir_ts_arg *arg;
struct dentry *dentry;
struct super_block *sb;
@@ -159,13 +159,13 @@ void au_dir_ts(struct inode *dir, aufs_bindex_t bindex)
dentry = d_find_any_alias(dir);
AuDebugOn(!dentry);
sb = dentry->d_sb;
- bstart = au_ibstart(dir);
- if (bstart == bindex) {
+ btop = au_ibtop(dir);
+ if (btop == bindex) {
au_cpup_attr_timesizes(dir);
goto out;
}
- perm = au_sbr_perm(sb, bstart);
+ perm = au_sbr_perm(sb, btop);
if (!au_br_writable(perm))
goto out;
@@ -192,24 +192,24 @@ static int reopen_dir(struct file *file)
{
int err;
unsigned int flags;
- aufs_bindex_t bindex, btail, bstart;
+ aufs_bindex_t bindex, btail, btop;
struct dentry *dentry, *h_dentry;
struct file *h_file;
/* open all lower dirs */
dentry = file->f_path.dentry;
- bstart = au_dbstart(dentry);
- for (bindex = au_fbstart(file); bindex < bstart; bindex++)
+ btop = au_dbtop(dentry);
+ for (bindex = au_fbtop(file); bindex < btop; bindex++)
au_set_h_fptr(file, bindex, NULL);
- au_set_fbstart(file, bstart);
+ au_set_fbtop(file, btop);
btail = au_dbtaildir(dentry);
- for (bindex = au_fbend_dir(file); btail < bindex; bindex--)
+ for (bindex = au_fbbot_dir(file); btail < bindex; bindex--)
au_set_h_fptr(file, bindex, NULL);
- au_set_fbend_dir(file, btail);
+ au_set_fbbot_dir(file, btail);
flags = vfsub_file_flags(file);
- for (bindex = bstart; bindex <= btail; bindex++) {
+ for (bindex = btop; bindex <= btail; bindex++) {
h_dentry = au_h_dptr(dentry, bindex);
if (!h_dentry)
continue;
@@ -246,10 +246,10 @@ static int do_open_dir(struct file *file, int flags, struct file *h_file)
mnt = file->f_path.mnt;
dentry = file->f_path.dentry;
file->f_version = d_inode(dentry)->i_version;
- bindex = au_dbstart(dentry);
- au_set_fbstart(file, bindex);
+ bindex = au_dbtop(dentry);
+ au_set_fbtop(file, bindex);
btail = au_dbtaildir(dentry);
- au_set_fbend_dir(file, btail);
+ au_set_fbbot_dir(file, btail);
for (; !err && bindex <= btail; bindex++) {
h_dentry = au_h_dptr(dentry, bindex);
if (!h_dentry)
@@ -272,10 +272,10 @@ static int do_open_dir(struct file *file, int flags, struct file *h_file)
return 0; /* success */
/* close all */
- for (bindex = au_fbstart(file); bindex <= btail; bindex++)
+ for (bindex = au_fbtop(file); bindex <= btail; bindex++)
au_set_h_fptr(file, bindex, NULL);
- au_set_fbstart(file, -1);
- au_set_fbend_dir(file, -1);
+ au_set_fbtop(file, -1);
+ au_set_fbbot_dir(file, -1);
return err;
}
@@ -310,7 +310,7 @@ static int aufs_release_dir(struct inode *inode __maybe_unused,
struct au_vdir *vdir_cache;
struct au_finfo *finfo;
struct au_fidir *fidir;
- aufs_bindex_t bindex, bend;
+ aufs_bindex_t bindex, bbot;
finfo = au_fi(file);
fidir = finfo->fi_hdir;
@@ -327,8 +327,8 @@ static int aufs_release_dir(struct inode *inode __maybe_unused,
* calls fput() instead of filp_close(),
* since no dnotify or lock for the lower file.
*/
- bend = fidir->fd_bbot;
- for (; bindex <= bend; bindex++)
+ bbot = fidir->fd_bbot;
+ for (; bindex <= bbot; bindex++)
au_set_h_fptr(file, bindex, NULL);
}
kfree(fidir);
@@ -343,12 +343,12 @@ static int aufs_release_dir(struct inode *inode __maybe_unused,
static int au_do_flush_dir(struct file *file, fl_owner_t id)
{
int err;
- aufs_bindex_t bindex, bend;
+ aufs_bindex_t bindex, bbot;
struct file *h_file;
err = 0;
- bend = au_fbend_dir(file);
- for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) {
+ bbot = au_fbbot_dir(file);
+ for (bindex = au_fbtop(file); !err && bindex <= bbot; bindex++) {
h_file = au_hf_dir(file, bindex);
if (h_file)
err = vfsub_flush(h_file, id);
@@ -366,7 +366,7 @@ static int aufs_flush_dir(struct file *file, fl_owner_t id)
static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync)
{
int err;
- aufs_bindex_t bend, bindex;
+ aufs_bindex_t bbot, bindex;
struct inode *inode;
struct super_block *sb;
@@ -374,8 +374,8 @@ static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync)
sb = dentry->d_sb;
inode = d_inode(dentry);
IMustLock(inode);
- bend = au_dbend(dentry);
- for (bindex = au_dbstart(dentry); !err && bindex <= bend; bindex++) {
+ bbot = au_dbbot(dentry);
+ for (bindex = au_dbtop(dentry); !err && bindex <= bbot; bindex++) {
struct path h_path;
if (au_test_ro(sb, bindex, inode))
@@ -394,7 +394,7 @@ static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync)
static int au_do_fsync_dir(struct file *file, int datasync)
{
int err;
- aufs_bindex_t bend, bindex;
+ aufs_bindex_t bbot, bindex;
struct file *h_file;
struct super_block *sb;
struct inode *inode;
@@ -405,8 +405,8 @@ static int au_do_fsync_dir(struct file *file, int datasync)
inode = file_inode(file);
sb = inode->i_sb;
- bend = au_fbend_dir(file);
- for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) {
+ bbot = au_fbbot_dir(file);
+ for (bindex = au_fbtop(file); !err && bindex <= bbot; bindex++) {
h_file = au_hf_dir(file, bindex);
if (!h_file || au_test_ro(sb, bindex, inode))
continue;
@@ -478,7 +478,7 @@ static int aufs_iterate(struct file *file, struct dir_context *ctx)
if (unlikely(err))
goto out_unlock;
- h_inode = au_h_iptr(inode, au_ibstart(inode));
+ h_inode = au_h_iptr(inode, au_ibtop(inode));
if (!au_test_nfsd()) {
err = au_vdir_fill_de(file, ctx);
fsstack_copy_attr_atime(inode, h_inode);
@@ -647,7 +647,7 @@ int au_test_empty_lower(struct dentry *dentry)
{
int err;
unsigned int rdhash;
- aufs_bindex_t bindex, bstart, btail;
+ aufs_bindex_t bindex, btop, btail;
struct au_nhash whlist;
struct test_empty_arg arg = {
.ctx = {
@@ -667,20 +667,20 @@ int au_test_empty_lower(struct dentry *dentry)
arg.flags = 0;
arg.whlist = &whlist;
- bstart = au_dbstart(dentry);
+ btop = au_dbtop(dentry);
if (au_opt_test(au_mntflags(dentry->d_sb), SHWH))
au_fset_testempty(arg.flags, SHWH);
test_empty = do_test_empty;
if (au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1))
test_empty = sio_test_empty;
- arg.bindex = bstart;
+ arg.bindex = btop;
err = test_empty(dentry, &arg);
if (unlikely(err))
goto out_whlist;
au_fset_testempty(arg.flags, WHONLY);
btail = au_dbtaildir(dentry);
- for (bindex = bstart + 1; !err && bindex <= btail; bindex++) {
+ for (bindex = btop + 1; !err && bindex <= btail; bindex++) {
struct dentry *h_dentry;
h_dentry = au_h_dptr(dentry, bindex);
@@ -712,7 +712,7 @@ int au_test_empty(struct dentry *dentry, struct au_nhash *whlist)
if (au_opt_test(au_mntflags(dentry->d_sb), SHWH))
au_fset_testempty(arg.flags, SHWH);
btail = au_dbtaildir(dentry);
- for (bindex = au_dbstart(dentry); !err && bindex <= btail; bindex++) {
+ for (bindex = au_dbtop(dentry); !err && bindex <= btail; bindex++) {
struct dentry *h_dentry;
h_dentry = au_h_dptr(dentry, bindex);