Skip to content

Commit

Permalink
Apply "aufs2-20100125.patch"
Browse files Browse the repository at this point in the history
  • Loading branch information
Debian kernel team committed May 26, 2010
1 parent 5185f54 commit 149f66e
Show file tree
Hide file tree
Showing 65 changed files with 751 additions and 544 deletions.
11 changes: 11 additions & 0 deletions fs/aufs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ config AUFS_RDU
environment variables for your readdir(3).
See detail in aufs.5.

config AUFS_SP_IATTR
bool "Respect the attributes (mtime/ctime mainly) of special files"
help
When you write something to a special file, some attributes of it
(mtime/ctime mainly) may be updated. Generally such updates are
less important (actually some device drivers and NFS ignore
it). But some applications (such like test program) requires
such updates. If you need these updates, then enable this
configuration which introduces some overhead.
Currently this configuration handles FIFO only.

config AUFS_SHWH
bool "Show whiteouts"
help
Expand Down
1 change: 1 addition & 0 deletions fs/aufs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ aufs-$(CONFIG_AUFS_HINOTIFY) += hinotify.o
aufs-$(CONFIG_AUFS_EXPORT) += export.o
aufs-$(CONFIG_AUFS_POLL) += poll.o
aufs-$(CONFIG_AUFS_RDU) += rdu.o
aufs-$(CONFIG_AUFS_SP_IATTR) += f_op_sp.o
aufs-$(CONFIG_AUFS_DEBUG) += debug.o
aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o
10 changes: 9 additions & 1 deletion fs/aufs/aufs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -25,6 +25,14 @@

#ifdef __KERNEL__

#define AuStub(type, name, body, ...) \
static inline type name(__VA_ARGS__) { body; }

#define AuStubVoid(name, ...) \
AuStub(void, name, , __VA_ARGS__)
#define AuStubInt0(name, ...) \
AuStub(int, name, return 0, __VA_ARGS__)

#include "debug.h"

#include "branch.h"
Expand Down
42 changes: 25 additions & 17 deletions fs/aufs/branch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -111,7 +111,9 @@ static struct au_branch *au_br_alloc(struct super_block *sb, int new_nbranch,
{
struct au_branch *add_branch;
struct dentry *root;
int err;

err = -ENOMEM;
root = sb->s_root;
add_branch = kmalloc(sizeof(*add_branch), GFP_NOFS);
if (unlikely(!add_branch))
Expand All @@ -126,18 +128,20 @@ static struct au_branch *au_br_alloc(struct super_block *sb, int new_nbranch,
goto out_br;
}

if (unlikely(au_sbr_realloc(au_sbi(sb), new_nbranch)
|| au_di_realloc(au_di(root), new_nbranch)
|| au_ii_realloc(au_ii(root->d_inode), new_nbranch)))
goto out_wbr;
return add_branch; /* success */
err = au_sbr_realloc(au_sbi(sb), new_nbranch);
if (!err)
err = au_di_realloc(au_di(root), new_nbranch);
if (!err)
err = au_ii_realloc(au_ii(root->d_inode), new_nbranch);
if (!err)
return add_branch; /* success */

out_wbr:
kfree(add_branch->br_wbr);

out_br:
kfree(add_branch);
out:
return ERR_PTR(-ENOMEM);
return ERR_PTR(err);
}

/*
Expand All @@ -147,13 +151,14 @@ static int test_br(struct inode *inode, int brperm, char *path)
{
int err;

err = 0;
if (unlikely(au_br_writable(brperm) && IS_RDONLY(inode))) {
pr_err("write permission for readonly mount or inode, %s\n",
path);
err = -EINVAL;
}
err = (au_br_writable(brperm) && IS_RDONLY(inode));
if (!err)
goto out;

err = -EINVAL;
pr_err("write permission for readonly mount or inode, %s\n", path);

out:
return err;
}

Expand Down Expand Up @@ -421,7 +426,7 @@ static void au_br_do_add(struct super_block *sb, struct dentry *h_dentry,

root = sb->s_root;
root_inode = root->d_inode;
au_plink_block_maintain(sb);
au_plink_maint_block(sb);
bend = au_sbend(sb);
amount = bend + 1 - bindex;
au_br_do_add_brp(au_sbi(sb), bindex, br, bend, amount);
Expand Down Expand Up @@ -647,6 +652,7 @@ static void au_br_do_del_brp(struct au_sbinfo *sbinfo,
p = krealloc(sbinfo->si_branch, sizeof(*p) * bend, GFP_NOFS);
if (p)
sbinfo->si_branch = p;
/* harmless error */
}

static void au_br_do_del_hdp(struct au_dinfo *dinfo, const aufs_bindex_t bindex,
Expand All @@ -665,6 +671,7 @@ static void au_br_do_del_hdp(struct au_dinfo *dinfo, const aufs_bindex_t bindex,
p = krealloc(dinfo->di_hdentry, sizeof(*p) * bend, GFP_NOFS);
if (p)
dinfo->di_hdentry = p;
/* harmless error */
}

static void au_br_do_del_hip(struct au_iinfo *iinfo, const aufs_bindex_t bindex,
Expand All @@ -684,6 +691,7 @@ static void au_br_do_del_hip(struct au_iinfo *iinfo, const aufs_bindex_t bindex,
p = krealloc(iinfo->ii_hinode, sizeof(*p) * bend, GFP_NOFS);
if (p)
iinfo->ii_hinode = p;
/* harmless error */
}

static void au_br_do_del(struct super_block *sb, aufs_bindex_t bindex,
Expand All @@ -698,7 +706,7 @@ static void au_br_do_del(struct super_block *sb, aufs_bindex_t bindex,

root = sb->s_root;
inode = root->d_inode;
au_plink_block_maintain(sb);
au_plink_maint_block(sb);
sbinfo = au_sbi(sb);
bend = sbinfo->si_bend;

Expand Down Expand Up @@ -912,7 +920,7 @@ int au_br_mod(struct super_block *sb, struct au_opt_mod *mod, int remount,
struct au_branch *br;

root = sb->s_root;
au_plink_block_maintain(sb);
au_plink_maint_block(sb);
bindex = au_find_dbindex(root, mod->h_root);
if (bindex < 0) {
if (remount)
Expand Down
2 changes: 1 addition & 1 deletion fs/aufs/branch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
1 change: 1 addition & 0 deletions fs/aufs/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $(foreach i, BRANCH_MAX_127 BRANCH_MAX_511 BRANCH_MAX_1023 BRANCH_MAX_32767 \
HINOTIFY \
EXPORT INO_T_64 \
RDU \
SP_IATTR \
SHWH \
BR_RAMFS \
BR_FUSE POLL \
Expand Down
2 changes: 1 addition & 1 deletion fs/aufs/cpup.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion fs/aufs/cpup.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion fs/aufs/dbgaufs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
41 changes: 7 additions & 34 deletions fs/aufs/dbgaufs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -39,40 +39,13 @@ void dbgaufs_si_fin(struct au_sbinfo *sbinfo);
int dbgaufs_si_init(struct au_sbinfo *sbinfo);
void dbgaufs_fin(void);
int __init dbgaufs_init(void);

#else

static inline
void dbgaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex)
{
/* empty */
}

static inline
void dbgaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex)
{
/* empty */
}

static inline
void dbgaufs_si_fin(struct au_sbinfo *sbinfo)
{
/* empty */
}

static inline
int dbgaufs_si_init(struct au_sbinfo *sbinfo)
{
return 0;
}

#define dbgaufs_fin() do {} while (0)

static inline
int __init dbgaufs_init(void)
{
return 0;
}
AuStubVoid(dbgaufs_brs_del, struct super_block *sb, aufs_bindex_t bindex)
AuStubVoid(dbgaufs_brs_add, struct super_block *sb, aufs_bindex_t bindex)
AuStubVoid(dbgaufs_si_fin, struct au_sbinfo *sbinfo)
AuStubInt0(dbgaufs_si_init, struct au_sbinfo *sbinfo)
AuStubVoid(dbgaufs_fin, void)
AuStubInt0(__init dbgaufs_init, void)
#endif /* CONFIG_DEBUG_FS */

#endif /* __KERNEL__ */
Expand Down
2 changes: 1 addition & 1 deletion fs/aufs/dcsub.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion fs/aufs/dcsub.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
5 changes: 3 additions & 2 deletions fs/aufs/debug.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -188,7 +188,8 @@ static int do_pri_file(aufs_bindex_t bindex, struct file *file)
&& file->f_dentry
&& au_test_aufs(file->f_dentry->d_sb)
&& au_fi(file))
snprintf(a, sizeof(a), ", mmapped %d", au_test_mmapped(file));
snprintf(a, sizeof(a), ", mmapped %d",
!!au_fi(file)->fi_h_vm_ops);
dpri("f%d: mode 0x%x, flags 0%o, cnt %ld, pos %llu%s\n",
bindex, file->f_mode, file->f_flags, (long)file_count(file),
file->f_pos, a);
Expand Down
58 changes: 15 additions & 43 deletions fs/aufs/debug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2009 Junjiro R. Okajima
* Copyright (C) 2005-2010 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -55,11 +55,8 @@ static inline int au_debug_test(void)
}
#else
#define AuDebugOn(a) do {} while (0)
#define au_debug() do {} while (0)
static inline int au_debug_test(void)
{
return 0;
}
AuStubVoid(au_debug, int n)
AuStubInt0(au_debug_test, void)
#endif /* CONFIG_AUFS_DEBUG */

/* ---------------------------------------------------------------------- */
Expand Down Expand Up @@ -187,37 +184,15 @@ void au_debug_sbinfo_init(struct au_sbinfo *sbinfo);
au_dbg_iattr(ia); \
} while (0)
#else
static inline void au_dbg_verify_dir_parent(struct dentry *dentry,
unsigned int sigen)
{
/* empty */
}
static inline void au_dbg_verify_nondir_parent(struct dentry *dentry,
unsigned int sigen)
{
/* empty */
}
static inline void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen)
{
/* empty */
}
static inline void au_dbg_verify_hf(struct au_finfo *finfo)
{
/* empty */
}
static inline void au_dbg_verify_kthread(void)
{
/* empty */
}
AuStubVoid(au_dbg_verify_dir_parent, struct dentry *dentry, unsigned int sigen)
AuStubVoid(au_dbg_verify_nondir_parent, struct dentry *dentry,
unsigned int sigen)
AuStubVoid(au_dbg_verify_gen, struct dentry *parent, unsigned int sigen)
AuStubVoid(au_dbg_verify_hf, struct au_finfo *finfo)
AuStubVoid(au_dbg_verify_kthread, void)
AuStubInt0(__init au_debug_init, void)
AuStubVoid(au_debug_sbinfo_init, struct au_sbinfo *sbinfo)

static inline int au_debug_init(void)
{
return 0;
}
static inline void au_debug_sbinfo_init(struct au_sbinfo *sbinfo)
{
/* empty */
}
#define AuDbgWhlist(w) do {} while (0)
#define AuDbgVdir(v) do {} while (0)
#define AuDbgInode(i) do {} while (0)
Expand All @@ -241,16 +216,13 @@ void au_sysrq_fin(void);
handle_sysrq('w', vc_cons[fg_console].d->vc_tty); \
} while (0)
#else
#define au_dbg_blocked() do {} while (0)
AuStubVoid(au_dbg_blocked, void)
#endif

#else
static inline int au_sysrq_init(void)
{
return 0;
}
#define au_sysrq_fin() do {} while (0)
#define au_dbg_blocked() do {} while (0)
AuStubInt0(__init au_sysrq_init, void)
AuStubVoid(au_sysrq_fin, void)
AuStubVoid(au_dbg_blocked, void)
#endif /* CONFIG_AUFS_MAGIC_SYSRQ */

#endif /* __KERNEL__ */
Expand Down
Loading

0 comments on commit 149f66e

Please sign in to comment.