Commit 3eff30ba authored by J. R. Okajima's avatar J. R. Okajima
Browse files

Merge branch 'aufs5.1/30stdalone' into aufs5.1/39public


Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>

# Conflicts:
#	include/uapi/linux/aufs_type.h
parents d85ef1b5 9987a951
...@@ -81,7 +81,7 @@ int au_dr_hino_test_add(struct au_dr_br *dr, ino_t ino, ...@@ -81,7 +81,7 @@ int au_dr_hino_test_add(struct au_dr_br *dr, ino_t ino,
found = 0; found = 0;
idx = au_dr_ihash(ino); idx = au_dr_ihash(ino);
hbl = dr->dr_h_ino + idx; hbl = dr->dr_h_ino + idx;
#if 0 #if 0 /* debug print */
{ {
struct hlist_bl_node *tmp; struct hlist_bl_node *tmp;
......
...@@ -330,7 +330,7 @@ static ssize_t au_do_iter(struct file *h_file, int rw, struct kiocb *kio, ...@@ -330,7 +330,7 @@ static ssize_t au_do_iter(struct file *h_file, int rw, struct kiocb *kio,
if (unlikely(err)) if (unlikely(err))
goto out; goto out;
err = -ENOSYS; err = -ENOSYS; /* the branch doesn't have its ->(read|write)_iter() */
iter = NULL; iter = NULL;
if (rw == MAY_READ) if (rw == MAY_READ)
iter = h_file->f_op->read_iter; iter = h_file->f_op->read_iter;
...@@ -774,7 +774,7 @@ out: ...@@ -774,7 +774,7 @@ out:
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* no one supports this operation, currently */ /* no one supports this operation, currently */
#if 0 #if 0 /* reserved for future use */
static ssize_t aufs_sendpage(struct file *file, struct page *page, int offset, static ssize_t aufs_sendpage(struct file *file, struct page *page, int offset,
size_t len, loff_t *pos, int more) size_t len, loff_t *pos, int more)
{ {
...@@ -810,7 +810,7 @@ const struct file_operations aufs_file_fop = { ...@@ -810,7 +810,7 @@ const struct file_operations aufs_file_fop = {
.setfl = aufs_setfl, .setfl = aufs_setfl,
.splice_write = aufs_splice_write, .splice_write = aufs_splice_write,
.splice_read = aufs_splice_read, .splice_read = aufs_splice_read,
#if 0 #if 0 /* reserved for future use */
.aio_splice_write = aufs_aio_splice_write, .aio_splice_write = aufs_aio_splice_write,
.aio_splice_read = aufs_aio_splice_read, .aio_splice_read = aufs_aio_splice_read,
#endif #endif
......
...@@ -182,12 +182,6 @@ static int hn_gen_tree(struct dentry *dentry) ...@@ -182,12 +182,6 @@ static int hn_gen_tree(struct dentry *dentry)
out_dpages: out_dpages:
au_dpages_free(&dpages); au_dpages_free(&dpages);
#if 0
/* discard children */
dentry_unhash(dentry);
dput(dentry);
#endif
out: out:
return err; return err;
} }
......
...@@ -72,19 +72,6 @@ static int h_permission(struct inode *h_inode, int mask, ...@@ -72,19 +72,6 @@ static int h_permission(struct inode *h_inode, int mask,
if (!err) if (!err)
err = security_inode_permission(h_inode, mask); err = security_inode_permission(h_inode, mask);
#if 0
if (!err) {
/* todo: do we need to call ima_path_check()? */
struct path h_path = {
.dentry =
.mnt = h_mnt
};
err = ima_path_check(&h_path,
mask & (MAY_READ | MAY_WRITE | MAY_EXEC),
IMA_COUNT_LEAVE);
}
#endif
out: out:
return err; return err;
} }
...@@ -106,7 +93,13 @@ static int aufs_permission(struct inode *inode, int mask) ...@@ -106,7 +93,13 @@ static int aufs_permission(struct inode *inode, int mask)
sb = inode->i_sb; sb = inode->i_sb;
si_read_lock(sb, AuLock_FLUSH); si_read_lock(sb, AuLock_FLUSH);
ii_read_lock_child(inode); ii_read_lock_child(inode);
#if 0 #if 0 /* reserved for future use */
/*
* This test may be rather 'too much' since the test is essentially done
* in the aufs_lookup(). Theoretically it is possible that the inode
* generation doesn't match to the superblock's here. But it isn't a
* big deal I suppose.
*/
err = au_iigen_test(inode, au_sigen(sb)); err = au_iigen_test(inode, au_sigen(sb));
if (unlikely(err)) if (unlikely(err))
goto out; goto out;
...@@ -224,7 +217,7 @@ static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry, ...@@ -224,7 +217,7 @@ static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry,
if (inode) if (inode)
atomic_inc(&inode->i_count); atomic_inc(&inode->i_count);
ret = d_splice_alias(inode, dentry); ret = d_splice_alias(inode, dentry);
#if 0 #if 0 /* reserved for future use */
if (unlikely(d_need_lookup(dentry))) { if (unlikely(d_need_lookup(dentry))) {
spin_lock(&dentry->d_lock); spin_lock(&dentry->d_lock);
dentry->d_flags &= ~DCACHE_NEED_LOOKUP; dentry->d_flags &= ~DCACHE_NEED_LOOKUP;
...@@ -640,7 +633,8 @@ out: ...@@ -640,7 +633,8 @@ out:
static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task) static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task)
{ {
#if !defined(CONFIG_RWSEM_GENERIC_SPINLOCK) && defined(CONFIG_RWSEM_SPIN_ON_OWNER) #if !defined(CONFIG_RWSEM_GENERIC_SPINLOCK) \
&& defined(CONFIG_RWSEM_SPIN_ON_OWNER)
p->hdir->hi_inode->i_rwsem.owner = task; p->hdir->hi_inode->i_rwsem.owner = task;
#endif #endif
} }
......
...@@ -415,7 +415,7 @@ static int do_rename(struct au_ren_args *a) ...@@ -415,7 +415,7 @@ static int do_rename(struct au_ren_args *a)
} }
BUG_ON(d_is_positive(a->dst_h_dentry) && a->src_btop != a->btgt); BUG_ON(d_is_positive(a->dst_h_dentry) && a->src_btop != a->btgt);
#if 0 #if 0 /* debugging */
BUG_ON(!au_ftest_ren(a->auren_flags, DIRREN) BUG_ON(!au_ftest_ren(a->auren_flags, DIRREN)
&& d_is_positive(a->dst_h_dentry) && d_is_positive(a->dst_h_dentry)
&& a->src_btop != a->btgt); && a->src_btop != a->btgt);
......
...@@ -212,7 +212,7 @@ static int set_inode(struct inode *inode, struct dentry *dentry) ...@@ -212,7 +212,7 @@ static int set_inode(struct inode *inode, struct dentry *dentry)
struct dentry *h_dentry; struct dentry *h_dentry;
struct inode *h_inode; struct inode *h_inode;
struct au_iinfo *iinfo; struct au_iinfo *iinfo;
struct inode_operations *iop; const struct inode_operations *iop;
IiMustWriteLock(inode); IiMustWriteLock(inode);
......
...@@ -157,7 +157,7 @@ enum { ...@@ -157,7 +157,7 @@ enum {
AuIop_OTHER, AuIop_OTHER,
AuIop_Last AuIop_Last
}; };
extern struct inode_operations aufs_iop[AuIop_Last], extern struct inode_operations aufs_iop[AuIop_Last], /* not const */
aufs_iop_nogetattr[AuIop_Last]; aufs_iop_nogetattr[AuIop_Last];
/* au_wr_dir flags */ /* au_wr_dir flags */
......
...@@ -1627,7 +1627,7 @@ int au_opts_verify(struct super_block *sb, unsigned long sb_flags, ...@@ -1627,7 +1627,7 @@ int au_opts_verify(struct super_block *sb, unsigned long sb_flags,
if ((br->br_perm & AuBrAttr_ICEX) if ((br->br_perm & AuBrAttr_ICEX)
&& !h_dir->i_op->listxattr) && !h_dir->i_op->listxattr)
br->br_perm &= ~AuBrAttr_ICEX; br->br_perm &= ~AuBrAttr_ICEX;
#if 0 #if 0 /* untested */
if ((br->br_perm & AuBrAttr_ICEX_SEC) if ((br->br_perm & AuBrAttr_ICEX_SEC)
&& (au_br_sb(br)->s_flags & SB_NOSEC)) && (au_br_sb(br)->s_flags & SB_NOSEC))
br->br_perm &= ~AuBrAttr_ICEX_SEC; br->br_perm &= ~AuBrAttr_ICEX_SEC;
......
...@@ -249,7 +249,7 @@ static int aufs_show_options(struct seq_file *m, struct dentry *dentry) ...@@ -249,7 +249,7 @@ static int aufs_show_options(struct seq_file *m, struct dentry *dentry)
sb = dentry->d_sb; sb = dentry->d_sb;
if (sb->s_flags & SB_POSIXACL) if (sb->s_flags & SB_POSIXACL)
seq_puts(m, ",acl"); seq_puts(m, ",acl");
#if 0 #if 0 /* reserved for future use */
if (sb->s_flags & SB_I_VERSION) if (sb->s_flags & SB_I_VERSION)
seq_puts(m, ",i_version"); seq_puts(m, ",i_version");
#endif #endif
......
...@@ -179,7 +179,7 @@ struct au_sbinfo { ...@@ -179,7 +179,7 @@ struct au_sbinfo {
struct hlist_bl_head si_files; struct hlist_bl_head si_files;
/* with/without getattr, brother of sb->s_d_op */ /* with/without getattr, brother of sb->s_d_op */
struct inode_operations *si_iop_array; const struct inode_operations *si_iop_array;
/* /*
* sysfs and lifetime management. * sysfs and lifetime management.
......
...@@ -34,6 +34,7 @@ static void sysrq_sb(struct super_block *sb) ...@@ -34,6 +34,7 @@ static void sysrq_sb(struct super_block *sb)
struct hlist_bl_head *files; struct hlist_bl_head *files;
struct hlist_bl_node *pos; struct hlist_bl_node *pos;
struct au_finfo *finfo; struct au_finfo *finfo;
struct inode *i;
plevel = au_plevel; plevel = au_plevel;
au_plevel = KERN_WARNING; au_plevel = KERN_WARNING;
...@@ -46,14 +47,7 @@ static void sysrq_sb(struct super_block *sb) ...@@ -46,14 +47,7 @@ static void sysrq_sb(struct super_block *sb)
pr("superblock\n"); pr("superblock\n");
au_dpri_sb(sb); au_dpri_sb(sb);
#if 0 #if 0 /* reserved */
pr("root dentry\n");
au_dpri_dentry(sb->s_root);
pr("root inode\n");
au_dpri_inode(d_inode(sb->s_root));
#endif
#if 0
do { do {
int err, i, j, ndentry; int err, i, j, ndentry;
struct au_dcsub_pages dpages; struct au_dcsub_pages dpages;
...@@ -74,21 +68,16 @@ static void sysrq_sb(struct super_block *sb) ...@@ -74,21 +68,16 @@ static void sysrq_sb(struct super_block *sb)
} while (0); } while (0);
#endif #endif
#if 1 pr("isolated inode\n");
{ spin_lock(&sb->s_inode_list_lock);
struct inode *i; list_for_each_entry(i, &sb->s_inodes, i_sb_list) {
spin_lock(&i->i_lock);
pr("isolated inode\n"); if (hlist_empty(&i->i_dentry))
spin_lock(&sb->s_inode_list_lock); au_dpri_inode(i);
list_for_each_entry(i, &sb->s_inodes, i_sb_list) { spin_unlock(&i->i_lock);
spin_lock(&i->i_lock);
if (1 || hlist_empty(&i->i_dentry))
au_dpri_inode(i);
spin_unlock(&i->i_lock);
}
spin_unlock(&sb->s_inode_list_lock);
} }
#endif spin_unlock(&sb->s_inode_list_lock);
pr("files\n"); pr("files\n");
files = &au_sbi(sb)->si_files; files = &au_sbi(sb)->si_files;
hlist_bl_lock(files); hlist_bl_lock(files);
......
...@@ -95,7 +95,7 @@ int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp) ...@@ -95,7 +95,7 @@ int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp)
static void nhash_count(struct hlist_head *head) static void nhash_count(struct hlist_head *head)
{ {
#if 0 #if 0 /* debugging */
unsigned long n; unsigned long n;
struct hlist_node *pos; struct hlist_node *pos;
......
...@@ -305,7 +305,7 @@ static int test_linkable(struct dentry *h_root) ...@@ -305,7 +305,7 @@ static int test_linkable(struct dentry *h_root)
pr_err("%pd (%s) doesn't support link(2), use noplink and rw+nolwh\n", pr_err("%pd (%s) doesn't support link(2), use noplink and rw+nolwh\n",
h_root, au_sbtype(h_root->d_sb)); h_root, au_sbtype(h_root->d_sb));
return -ENOSYS; return -ENOSYS; /* the branch doesn't have its ->link() */
} }
/* todo: should this mkdir be done in /sbin/mount.aufs helper? */ /* todo: should this mkdir be done in /sbin/mount.aufs helper? */
......
...@@ -153,8 +153,8 @@ static int au_wkq_lockdep_alloc(struct au_wkinfo *wkinfo) ...@@ -153,8 +153,8 @@ static int au_wkq_lockdep_alloc(struct au_wkinfo *wkinfo)
goto out; goto out;
err = 0; err = 0;
#if 0 #if 0 /* left for debugging */
if (0 && au_debug_test()) /* left for debugging */ if (0 && au_debug_test())
lockdep_print_held_locks(curr); lockdep_print_held_locks(curr);
#endif #endif
held_locks = curr->held_locks; held_locks = curr->held_locks;
...@@ -231,7 +231,6 @@ static void wkq_func(struct work_struct *wk) ...@@ -231,7 +231,6 @@ static void wkq_func(struct work_struct *wk)
/* /*
* Since struct completion is large, try allocating it dynamically. * Since struct completion is large, try allocating it dynamically.
*/ */
#if 1 /* defined(CONFIG_4KSTACKS) || defined(AuTest4KSTACKS) */
#define AuWkqCompDeclare(name) struct completion *comp = NULL #define AuWkqCompDeclare(name) struct completion *comp = NULL
static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp) static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp)
...@@ -250,25 +249,6 @@ static void au_wkq_comp_free(struct completion *comp) ...@@ -250,25 +249,6 @@ static void au_wkq_comp_free(struct completion *comp)
au_kfree_rcu(comp); au_kfree_rcu(comp);
} }
#else
/* no braces */
#define AuWkqCompDeclare(name) \
DECLARE_COMPLETION_ONSTACK(_ ## name); \
struct completion *comp = &_ ## name
static int au_wkq_comp_alloc(struct au_wkinfo *wkinfo, struct completion **comp)
{
wkinfo->comp = *comp;
return 0;
}
static void au_wkq_comp_free(struct completion *comp __maybe_unused)
{
/* empty */
}
#endif /* 4KSTACKS */
static void au_wkq_run(struct au_wkinfo *wkinfo) static void au_wkq_run(struct au_wkinfo *wkinfo)
{ {
if (au_ftest_wkq(wkinfo->flags, NEST)) { if (au_ftest_wkq(wkinfo->flags, NEST)) {
......
...@@ -1355,7 +1355,7 @@ static void au_xino_release(struct kref *kref) ...@@ -1355,7 +1355,7 @@ static void au_xino_release(struct kref *kref)
if (unlikely(ul)) { if (unlikely(ul)) {
pr_warn("xi_writing %lu\n", ul); pr_warn("xi_writing %lu\n", ul);
hlist_bl_lock(hbl); hlist_bl_lock(hbl);
hlist_bl_for_each_entry_safe (p, pos, n, hbl, node) { hlist_bl_for_each_entry_safe(p, pos, n, hbl, node) {
hlist_bl_del(&p->node); hlist_bl_del(&p->node);
au_kfree_rcu(p); au_kfree_rcu(p);
} }
......
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
#define pr_fmt(fmt) \ #define pr_fmt(fmt) \
AUFS_NAME " %s:%d:%.*s[%d]: " fmt, __func__, __LINE__, \ AUFS_NAME " %s:%d:%.*s[%d]: " fmt, __func__, __LINE__, \
(int)sizeof(current->comm), current->comm, current->pid (int)sizeof(current->comm), current->comm, current->pid
#include <linux/limits.h>
#else #else
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#include <limits.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <linux/limits.h> #define AUFS_VERSION "5.1"
#define AUFS_VERSION "5.1-20200113"
/* todo? move this to linux-2.6.19/include/magic.h */ /* todo? move this to linux-2.6.19/include/magic.h */
#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') #define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment