kernel-4.10

This commit is contained in:
milisarge 2017-06-03 04:34:14 +03:00
parent 155b054977
commit afcd5ab658
40 changed files with 63106 additions and 1287 deletions

View File

@ -0,0 +1,232 @@
aufs4.4 base patch
diff --git a/MAINTAINERS b/MAINTAINERS
index 233f834..c250892 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2029,6 +2029,19 @@ F: include/linux/audit.h
F: include/uapi/linux/audit.h
F: kernel/audit*
+AUFS (advanced multi layered unification filesystem) FILESYSTEM
+M: "J. R. Okajima" <hooanon05g@gmail.com>
+L: linux-unionfs@vger.kernel.org
+L: aufs-users@lists.sourceforge.net (members only)
+W: http://aufs.sourceforge.net
+T: git://github.com/sfjro/aufs4-linux.git
+S: Supported
+F: Documentation/filesystems/aufs/
+F: Documentation/ABI/testing/debugfs-aufs
+F: Documentation/ABI/testing/sysfs-aufs
+F: fs/aufs/
+F: include/uapi/linux/aufs_type.h
+
AUXILIARY DISPLAY DRIVERS
M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
W: http://miguelojeda.es/auxdisplay.htm
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 423f4ca..0b816b2 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -706,6 +706,24 @@ static inline int is_loop_device(struct file *file)
return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR;
}
+/*
+ * for AUFS
+ * no get/put for file.
+ */
+struct file *loop_backing_file(struct super_block *sb)
+{
+ struct file *ret;
+ struct loop_device *l;
+
+ ret = NULL;
+ if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
+ l = sb->s_bdev->bd_disk->private_data;
+ ret = l->lo_backing_file;
+ }
+ return ret;
+}
+EXPORT_SYMBOL_GPL(loop_backing_file);
+
/* loop sysfs attributes */
static ssize_t loop_attr_show(struct device *dev, char *page,
diff --git a/fs/dcache.c b/fs/dcache.c
index 5c33aeb..8aa7f26 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1167,7 +1167,7 @@ enum d_walk_ret {
*
* The @enter() and @finish() callbacks are called with d_lock held.
*/
-static void d_walk(struct dentry *parent, void *data,
+void d_walk(struct dentry *parent, void *data,
enum d_walk_ret (*enter)(void *, struct dentry *),
void (*finish)(void *))
{
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ee85cd4..dacbf71 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -29,7 +29,7 @@
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
-static int setfl(int fd, struct file * filp, unsigned long arg)
+int setfl(int fd, struct file * filp, unsigned long arg)
{
struct inode * inode = file_inode(filp);
int error = 0;
@@ -59,6 +59,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
if (filp->f_op->check_flags)
error = filp->f_op->check_flags(arg);
+ if (!error && filp->f_op->setfl)
+ error = filp->f_op->setfl(filp, arg);
if (error)
return error;
diff --git a/fs/inode.c b/fs/inode.c
index 1be5f90..05c423e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1584,7 +1584,7 @@ EXPORT_SYMBOL(generic_update_time);
* This does the actual work of updating an inodes time or version. Must have
* had called mnt_want_write() before calling this.
*/
-static int update_time(struct inode *inode, struct timespec *time, int flags)
+int update_time(struct inode *inode, struct timespec *time, int flags)
{
int (*update_time)(struct inode *, struct timespec *, int);
diff --git a/fs/read_write.c b/fs/read_write.c
index 819ef3f..fd0414e 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -494,6 +494,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
}
EXPORT_SYMBOL(__vfs_write);
+vfs_readf_t vfs_readf(struct file *file)
+{
+ const struct file_operations *fop = file->f_op;
+
+ if (fop->read)
+ return fop->read;
+ if (fop->read_iter)
+ return new_sync_read;
+ return ERR_PTR(-ENOSYS);
+}
+
+vfs_writef_t vfs_writef(struct file *file)
+{
+ const struct file_operations *fop = file->f_op;
+
+ if (fop->write)
+ return fop->write;
+ if (fop->write_iter)
+ return new_sync_write;
+ return ERR_PTR(-ENOSYS);
+}
+
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
{
mm_segment_t old_fs;
diff --git a/fs/splice.c b/fs/splice.c
index 4cf700d..30a091d 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1110,8 +1110,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
/*
* Attempt to initiate a splice from pipe to file.
*/
-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
- loff_t *ppos, size_t len, unsigned int flags)
+long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ loff_t *ppos, size_t len, unsigned int flags)
{
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
loff_t *, size_t, unsigned int);
@@ -1127,9 +1127,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
/*
* Attempt to initiate a splice from a file to a pipe.
*/
-static long do_splice_to(struct file *in, loff_t *ppos,
- struct pipe_inode_info *pipe, size_t len,
- unsigned int flags)
+long do_splice_to(struct file *in, loff_t *ppos,
+ struct pipe_inode_info *pipe, size_t len,
+ unsigned int flags)
{
ssize_t (*splice_read)(struct file *, loff_t *,
struct pipe_inode_info *, size_t, unsigned int);
diff --git a/include/linux/file.h b/include/linux/file.h
index f87d308..9a290b3 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -19,6 +19,7 @@ struct dentry;
struct path;
extern struct file *alloc_file(struct path *, fmode_t mode,
const struct file_operations *fop);
+extern struct file *get_empty_filp(void);
static inline void fput_light(struct file *file, int fput_needed)
{
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3aa5142..36a997e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1233,6 +1233,7 @@ extern void fasync_free(struct fasync_struct *);
/* can be called from interrupts */
extern void kill_fasync(struct fasync_struct **, int, int);
+extern int setfl(int fd, struct file * filp, unsigned long arg);
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern void f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
@@ -1619,6 +1620,7 @@ struct file_operations {
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
+ int (*setfl)(struct file *, unsigned long);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
@@ -1672,6 +1674,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct iovec *fast_pointer,
struct iovec **ret_pointer);
+typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *);
+typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t,
+ loff_t *);
+vfs_readf_t vfs_readf(struct file *file);
+vfs_writef_t vfs_writef(struct file *file);
+
extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
@@ -2021,6 +2029,7 @@ extern int current_umask(void);
extern void ihold(struct inode * inode);
extern void iput(struct inode *);
extern int generic_update_time(struct inode *, struct timespec *, int);
+extern int update_time(struct inode *, struct timespec *, int);
/* /sys/fs */
extern struct kobject *fs_kobj;
diff --git a/include/linux/splice.h b/include/linux/splice.h
index da2751d..2e0fca6 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -83,4 +83,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
+
+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ loff_t *ppos, size_t len, unsigned int flags);
+extern long do_splice_to(struct file *in, loff_t *ppos,
+ struct pipe_inode_info *pipe, size_t len,
+ unsigned int flags);
#endif

View File

@ -0,0 +1,35 @@
aufs4.4 kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
index 6ce72d8..4aa31ea 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -221,6 +221,7 @@ source "fs/pstore/Kconfig"
source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
source "fs/exofs/Kconfig"
+source "fs/aufs/Kconfig"
endif # MISC_FILESYSTEMS
diff --git a/fs/Makefile b/fs/Makefile
index 79f5225..a7c7f16 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -126,3 +126,4 @@ obj-y += exofs/ # Multiple modules
obj-$(CONFIG_CEPH_FS) += ceph/
obj-$(CONFIG_PSTORE) += pstore/
obj-$(CONFIG_EFIVAR_FS) += efivarfs/
+obj-$(CONFIG_AUFS_FS) += aufs/
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index c2e5d6c..d736c11 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -59,6 +59,7 @@ header-y += atmsvc.h
header-y += atm_tcp.h
header-y += atm_zatm.h
header-y += audit.h
+header-y += aufs_type.h
header-y += auto_fs4.h
header-y += auto_fs.h
header-y += auxvec.h

View File

@ -0,0 +1,274 @@
aufs4.4 loopback patch
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 0b816b2..86dd454 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -556,7 +556,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
}
struct switch_request {
- struct file *file;
+ struct file *file, *virt_file;
struct completion wait;
};
@@ -582,6 +582,7 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
mapping = file->f_mapping;
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
+ lo->lo_backing_virt_file = p->virt_file;
lo->lo_blocksize = S_ISBLK(mapping->host->i_mode) ?
mapping->host->i_bdev->bd_block_size : PAGE_SIZE;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
@@ -594,11 +595,13 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
* First it needs to flush existing IO, it does this by sending a magic
* BIO down the pipe. The completion of this BIO does the actual switch.
*/
-static int loop_switch(struct loop_device *lo, struct file *file)
+static int loop_switch(struct loop_device *lo, struct file *file,
+ struct file *virt_file)
{
struct switch_request w;
w.file = file;
+ w.virt_file = virt_file;
/* freeze queue and wait for completion of scheduled requests */
blk_mq_freeze_queue(lo->lo_queue);
@@ -617,7 +620,16 @@ static int loop_switch(struct loop_device *lo, struct file *file)
*/
static int loop_flush(struct loop_device *lo)
{
- return loop_switch(lo, NULL);
+ return loop_switch(lo, NULL, NULL);
+}
+
+static struct file *loop_real_file(struct file *file)
+{
+ struct file *f = NULL;
+
+ if (file->f_path.dentry->d_sb->s_op->real_loop)
+ f = file->f_path.dentry->d_sb->s_op->real_loop(file);
+ return f;
}
static void loop_reread_partitions(struct loop_device *lo,
@@ -654,6 +666,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
unsigned int arg)
{
struct file *file, *old_file;
+ struct file *f, *virt_file = NULL, *old_virt_file;
struct inode *inode;
int error;
@@ -670,9 +683,16 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
file = fget(arg);
if (!file)
goto out;
+ f = loop_real_file(file);
+ if (f) {
+ virt_file = file;
+ file = f;
+ get_file(file);
+ }
inode = file->f_mapping->host;
old_file = lo->lo_backing_file;
+ old_virt_file = lo->lo_backing_virt_file;
error = -EINVAL;
@@ -684,17 +704,21 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
goto out_putf;
/* and ... switch */
- error = loop_switch(lo, file);
+ error = loop_switch(lo, file, virt_file);
if (error)
goto out_putf;
fput(old_file);
+ if (old_virt_file)
+ fput(old_virt_file);
if (lo->lo_flags & LO_FLAGS_PARTSCAN)
loop_reread_partitions(lo, bdev);
return 0;
out_putf:
fput(file);
+ if (virt_file)
+ fput(virt_file);
out:
return error;
}
@@ -881,7 +905,7 @@ static int loop_prepare_queue(struct loop_device *lo)
static int loop_set_fd(struct loop_device *lo, fmode_t mode,
struct block_device *bdev, unsigned int arg)
{
- struct file *file, *f;
+ struct file *file, *f, *virt_file = NULL;
struct inode *inode;
struct address_space *mapping;
unsigned lo_blocksize;
@@ -896,6 +920,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
file = fget(arg);
if (!file)
goto out;
+ f = loop_real_file(file);
+ if (f) {
+ virt_file = file;
+ file = f;
+ get_file(file);
+ }
error = -EBUSY;
if (lo->lo_state != Lo_unbound)
@@ -948,6 +978,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
lo->lo_backing_file = file;
+ lo->lo_backing_virt_file = virt_file;
lo->transfer = NULL;
lo->ioctl = NULL;
lo->lo_sizelimit = 0;
@@ -980,6 +1011,8 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
out_putf:
fput(file);
+ if (virt_file)
+ fput(virt_file);
out:
/* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE);
@@ -1026,6 +1059,7 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
static int loop_clr_fd(struct loop_device *lo)
{
struct file *filp = lo->lo_backing_file;
+ struct file *virt_filp = lo->lo_backing_virt_file;
gfp_t gfp = lo->old_gfp_mask;
struct block_device *bdev = lo->lo_device;
@@ -1057,6 +1091,7 @@ static int loop_clr_fd(struct loop_device *lo)
spin_lock_irq(&lo->lo_lock);
lo->lo_state = Lo_rundown;
lo->lo_backing_file = NULL;
+ lo->lo_backing_virt_file = NULL;
spin_unlock_irq(&lo->lo_lock);
loop_release_xfer(lo);
@@ -1101,6 +1136,8 @@ static int loop_clr_fd(struct loop_device *lo)
* bd_mutex which is usually taken before lo_ctl_mutex.
*/
fput(filp);
+ if (virt_filp)
+ fput(virt_filp);
return 0;
}
diff --git a/drivers/block/loop.h b/drivers/block/loop.h
index fb2237c..c3888c5 100644
--- a/drivers/block/loop.h
+++ b/drivers/block/loop.h
@@ -46,7 +46,7 @@ struct loop_device {
int (*ioctl)(struct loop_device *, int cmd,
unsigned long arg);
- struct file * lo_backing_file;
+ struct file * lo_backing_file, *lo_backing_virt_file;
struct block_device *lo_device;
unsigned lo_blocksize;
void *key_data;
diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
index a2256c7..6f03771 100644
--- a/fs/aufs/f_op.c
+++ b/fs/aufs/f_op.c
@@ -348,7 +348,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
if (IS_ERR(h_file))
goto out;
- if (au_test_loopback_kthread()) {
+ if (0 && au_test_loopback_kthread()) {
au_warn_loopback(h_file->f_path.dentry->d_sb);
if (file->f_mapping != h_file->f_mapping) {
file->f_mapping = h_file->f_mapping;
diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c
index c3ca50f..a3dbdaf 100644
--- a/fs/aufs/loop.c
+++ b/fs/aufs/loop.c
@@ -132,3 +132,19 @@ void au_loopback_fin(void)
symbol_put(loop_backing_file);
au_delayed_kfree(au_warn_loopback_array);
}
+
+/* ---------------------------------------------------------------------- */
+
+/* support the loopback block device insude aufs */
+
+struct file *aufs_real_loop(struct file *file)
+{
+ struct file *f;
+
+ BUG_ON(!au_test_aufs(file->f_path.dentry->d_sb));
+ fi_read_lock(file);
+ f = au_hf_top(file);
+ fi_read_unlock(file);
+ AuDebugOn(!f);
+ return f;
+}
diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h
index 48bf070..66afec7 100644
--- a/fs/aufs/loop.h
+++ b/fs/aufs/loop.h
@@ -25,7 +25,11 @@ void au_warn_loopback(struct super_block *h_sb);
int au_loopback_init(void);
void au_loopback_fin(void);
+
+struct file *aufs_real_loop(struct file *file);
#else
+AuStub(struct file *, loop_backing_file, return NULL)
+
AuStubInt0(au_test_loopback_overlap, struct super_block *sb,
struct dentry *h_adding)
AuStubInt0(au_test_loopback_kthread, void)
@@ -33,6 +37,8 @@ AuStubVoid(au_warn_loopback, struct super_block *h_sb)
AuStubInt0(au_loopback_init, void)
AuStubVoid(au_loopback_fin, void)
+
+AuStub(struct file *, aufs_real_loop, return NULL, struct file *file)
#endif /* BLK_DEV_LOOP */
#endif /* __KERNEL__ */
diff --git a/fs/aufs/super.c b/fs/aufs/super.c
index 6baa5f4..3700427 100644
--- a/fs/aufs/super.c
+++ b/fs/aufs/super.c
@@ -831,7 +831,10 @@ static const struct super_operations aufs_sop = {
.statfs = aufs_statfs,
.put_super = aufs_put_super,
.sync_fs = aufs_sync_fs,
- .remount_fs = aufs_remount_fs
+ .remount_fs = aufs_remount_fs,
+#ifdef CONFIG_AUFS_BDEV_LOOP
+ .real_loop = aufs_real_loop
+#endif
};
/* ---------------------------------------------------------------------- */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 36a997e..b2a9cad 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1721,6 +1721,10 @@ struct super_operations {
struct shrink_control *);
long (*free_cached_objects)(struct super_block *,
struct shrink_control *);
+#if defined(CONFIG_BLK_DEV_LOOP) || defined(CONFIG_BLK_DEV_LOOP_MODULE)
+ /* and aufs */
+ struct file *(*real_loop)(struct file *);
+#endif
};
/*

View File

@ -0,0 +1,410 @@
aufs4.4 mmap patch
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 4bd5d31..aa41f2a 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1921,7 +1921,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path)
down_read(&mm->mmap_sem);
vma = find_exact_vma(mm, vm_start, vm_end);
if (vma && vma->vm_file) {
- *path = vma->vm_file->f_path;
+ *path = vma_pr_or_file(vma)->f_path;
path_get(path);
rc = 0;
}
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
index f8595e8..cb8eda0 100644
--- a/fs/proc/nommu.c
+++ b/fs/proc/nommu.c
@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
file = region->vm_file;
if (file) {
- struct inode *inode = file_inode(region->vm_file);
+ struct inode *inode;
+
+ file = vmr_pr_or_file(region);
+ inode = file_inode(file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 187b3b5..e03793e 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -281,7 +281,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
const char *name = NULL;
if (file) {
- struct inode *inode = file_inode(vma->vm_file);
+ struct inode *inode;
+
+ file = vma_pr_or_file(vma);
+ inode = file_inode(file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
@@ -1505,7 +1508,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
struct vm_area_struct *vma = v;
struct numa_maps *md = &numa_priv->md;
- struct file *file = vma->vm_file;
+ struct file *file = vma_pr_or_file(vma);
struct mm_struct *mm = vma->vm_mm;
struct mm_walk walk = {
.hugetlb_entry = gather_hugetlb_stats,
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index e0d64c9..7aa92db 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -160,7 +160,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
file = vma->vm_file;
if (file) {
- struct inode *inode = file_inode(vma->vm_file);
+ struct inode *inode;
+
+ file = vma_pr_or_file(vma);
+ inode = file_inode(file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 00bad77..cc616b0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1183,6 +1183,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
}
#endif
+extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int);
+extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[],
+ int);
+extern void vma_do_get_file(struct vm_area_struct *, const char[], int);
+extern void vma_do_fput(struct vm_area_struct *, const char[], int);
+
+#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \
+ __LINE__)
+#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \
+ __LINE__)
+#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__)
+#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__)
+
+#ifndef CONFIG_MMU
+extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int);
+extern void vmr_do_fput(struct vm_region *, const char[], int);
+
+#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \
+ __LINE__)
+#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__)
+#endif /* !CONFIG_MMU */
+
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
void *buf, int len, int write);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index f8d1492..c3a3760 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -272,6 +272,7 @@ struct vm_region {
unsigned long vm_top; /* region allocated to here */
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */
struct file *vm_file; /* the backing file or NULL */
+ struct file *vm_prfile; /* the virtual backing file or NULL */
int vm_usage; /* region usage count (access under nommu_region_sem) */
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
@@ -346,6 +347,7 @@ struct vm_area_struct {
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
units, *not* PAGE_CACHE_SIZE */
struct file * vm_file; /* File we map to (can be NULL). */
+ struct file *vm_prfile; /* shadow of vm_file */
void * vm_private_data; /* was vm_pte (shared mem) */
#ifndef CONFIG_MMU
diff --git a/kernel/fork.c b/kernel/fork.c
index 1155eac..c001ea4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -465,7 +465,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
struct inode *inode = file_inode(file);
struct address_space *mapping = file->f_mapping;
- get_file(file);
+ vma_get_file(tmp);
if (tmp->vm_flags & VM_DENYWRITE)
atomic_dec(&inode->i_writecount);
i_mmap_lock_write(mapping);
diff --git a/mm/Makefile b/mm/Makefile
index 2ed4319..e3a53f5 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -21,7 +21,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
mm_init.o mmu_context.o percpu.o slab_common.o \
compaction.o vmacache.o \
interval_tree.o list_lru.o workingset.o \
- debug.o $(mmu-y)
+ prfile.o debug.o $(mmu-y)
obj-y += init-mm.o
diff --git a/mm/filemap.c b/mm/filemap.c
index 1bb0076..8eaece8 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2128,7 +2128,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
int ret = VM_FAULT_LOCKED;
sb_start_pagefault(inode->i_sb);
- file_update_time(vma->vm_file);
+ vma_file_update_time(vma);
lock_page(page);
if (page->mapping != inode->i_mapping) {
unlock_page(page);
diff --git a/mm/memory.c b/mm/memory.c
index c387430..d434404 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2035,7 +2035,7 @@ static inline int wp_page_reuse(struct mm_struct *mm,
}
if (!page_mkwrite)
- file_update_time(vma->vm_file);
+ vma_file_update_time(vma);
}
return VM_FAULT_WRITE;
diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a6..11bc34d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -275,7 +275,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
mpol_put(vma_policy(vma));
kmem_cache_free(vm_area_cachep, vma);
return next;
@@ -887,7 +887,7 @@ again: remove_next = 1 + (end > next->vm_end);
if (remove_next) {
if (file) {
uprobe_munmap(next, next->vm_start, next->vm_end);
- fput(file);
+ vma_fput(vma);
}
if (next->anon_vma)
anon_vma_merge(vma, next);
@@ -1681,8 +1681,8 @@ out:
return addr;
unmap_and_free_vma:
+ vma_fput(vma);
vma->vm_file = NULL;
- fput(file);
/* Undo any partial mapping done by a device driver. */
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
@@ -2488,7 +2488,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
goto out_free_mpol;
if (new->vm_file)
- get_file(new->vm_file);
+ vma_get_file(new);
if (new->vm_ops && new->vm_ops->open)
new->vm_ops->open(new);
@@ -2507,7 +2507,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
if (new->vm_ops && new->vm_ops->close)
new->vm_ops->close(new);
if (new->vm_file)
- fput(new->vm_file);
+ vma_fput(new);
unlink_anon_vmas(new);
out_free_mpol:
mpol_put(vma_policy(new));
@@ -2649,7 +2649,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
struct vm_area_struct *vma;
unsigned long populate = 0;
unsigned long ret = -EINVAL;
- struct file *file;
+ struct file *file, *prfile;
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. "
"See Documentation/vm/remap_file_pages.txt.\n",
@@ -2693,10 +2693,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
munlock_vma_pages_range(vma, start, start + size);
}
- file = get_file(vma->vm_file);
+ vma_get_file(vma);
+ file = vma->vm_file;
+ prfile = vma->vm_prfile;
ret = do_mmap_pgoff(vma->vm_file, start, size,
prot, flags, pgoff, &populate);
+ if (!IS_ERR_VALUE(ret) && file && prfile) {
+ struct vm_area_struct *new_vma;
+
+ new_vma = find_vma(mm, ret);
+ if (!new_vma->vm_prfile)
+ new_vma->vm_prfile = prfile;
+ if (new_vma != vma)
+ get_file(prfile);
+ }
+ /*
+ * two fput()s instead of vma_fput(vma),
+ * coz vma may not be available anymore.
+ */
fput(file);
+ if (prfile)
+ fput(prfile);
out:
up_write(&mm->mmap_sem);
if (populate)
@@ -2966,7 +2983,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
if (anon_vma_clone(new_vma, vma))
goto out_free_mempol;
if (new_vma->vm_file)
- get_file(new_vma->vm_file);
+ vma_get_file(new_vma);
if (new_vma->vm_ops && new_vma->vm_ops->open)
new_vma->vm_ops->open(new_vma);
vma_link(mm, new_vma, prev, rb_link, rb_parent);
diff --git a/mm/nommu.c b/mm/nommu.c
index 92be862..29179f7 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -671,7 +671,7 @@ static void __put_nommu_region(struct vm_region *region)
up_write(&nommu_region_sem);
if (region->vm_file)
- fput(region->vm_file);
+ vmr_fput(region);
/* IO memory and memory shared directly out of the pagecache
* from ramfs/tmpfs mustn't be released here */
@@ -829,7 +829,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
put_nommu_region(vma->vm_region);
kmem_cache_free(vm_area_cachep, vma);
}
@@ -1355,7 +1355,7 @@ unsigned long do_mmap(struct file *file,
goto error_just_free;
}
}
- fput(region->vm_file);
+ vmr_fput(region);
kmem_cache_free(vm_region_jar, region);
region = pregion;
result = start;
@@ -1430,10 +1430,10 @@ error_just_free:
up_write(&nommu_region_sem);
error:
if (region->vm_file)
- fput(region->vm_file);
+ vmr_fput(region);
kmem_cache_free(vm_region_jar, region);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
kmem_cache_free(vm_area_cachep, vma);
return ret;
diff --git a/mm/prfile.c b/mm/prfile.c
new file mode 100644
index 0000000..b323b8a
--- /dev/null
+++ b/mm/prfile.c
@@ -0,0 +1,86 @@
+/*
+ * Mainly for aufs which mmap(2) diffrent file and wants to print different path
+ * in /proc/PID/maps.
+ * Call these functions via macros defined in linux/mm.h.
+ *
+ * See Documentation/filesystems/aufs/design/06mmap.txt
+ *
+ * Copyright (c) 2014 Junjro R. Okajima
+ * Copyright (c) 2014 Ian Campbell
+ */
+
+#include <linux/mm.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+
+/* #define PRFILE_TRACE */
+static inline void prfile_trace(struct file *f, struct file *pr,
+ const char func[], int line, const char func2[])
+{
+#ifdef PRFILE_TRACE
+ if (pr)
+ pr_info("%s:%d: %s, %s\n", func, line, func2,
+ f ? (char *)f->f_path.dentry->d_name.name : "(null)");
+#endif
+}
+
+void vma_do_file_update_time(struct vm_area_struct *vma, const char func[],
+ int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ file_update_time(f);
+ if (f && pr)
+ file_update_time(pr);
+}
+
+struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[],
+ int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ return (f && pr) ? pr : f;
+}
+
+void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ get_file(f);
+ if (f && pr)
+ get_file(pr);
+}
+
+void vma_do_fput(struct vm_area_struct *vma, const char func[], int line)
+{
+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ fput(f);
+ if (f && pr)
+ fput(pr);
+}
+
+#ifndef CONFIG_MMU
+struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[],
+ int line)
+{
+ struct file *f = region->vm_file, *pr = region->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ return (f && pr) ? pr : f;
+}
+
+void vmr_do_fput(struct vm_region *region, const char func[], int line)
+{
+ struct file *f = region->vm_file, *pr = region->vm_prfile;
+
+ prfile_trace(f, pr, func, line, __func__);
+ fput(f);
+ if (f && pr)
+ fput(pr);
+}
+#endif /* !CONFIG_MMU */

View File

@ -0,0 +1,382 @@
aufs4.4 standalone patch
diff --git a/fs/dcache.c b/fs/dcache.c
index 8aa7f26..ff9a6f3 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1272,6 +1272,7 @@ rename_retry:
seq = 1;
goto again;
}
+EXPORT_SYMBOL_GPL(d_walk);
/*
* Search for at least 1 mount point in the dentry's subdirs.
diff --git a/fs/exec.c b/fs/exec.c
index b06623a..3526d30 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -103,6 +103,7 @@ bool path_noexec(const struct path *path)
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
}
+EXPORT_SYMBOL_GPL(path_noexec);
#ifdef CONFIG_USELIB
/*
diff --git a/fs/fcntl.c b/fs/fcntl.c
index dacbf71..8abb9f81 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -81,6 +81,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
out:
return error;
}
+EXPORT_SYMBOL_GPL(setfl);
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff --git a/fs/file_table.c b/fs/file_table.c
index ad17e05..ae9f267 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -147,6 +147,7 @@ over:
}
return ERR_PTR(-ENFILE);
}
+EXPORT_SYMBOL_GPL(get_empty_filp);
/**
* alloc_file - allocate and initialize a 'struct file'
@@ -258,6 +259,7 @@ void flush_delayed_fput(void)
{
delayed_fput(NULL);
}
+EXPORT_SYMBOL_GPL(flush_delayed_fput);
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
@@ -300,6 +302,7 @@ void __fput_sync(struct file *file)
}
EXPORT_SYMBOL(fput);
+EXPORT_SYMBOL_GPL(__fput_sync);
void put_filp(struct file *file)
{
@@ -308,6 +311,7 @@ void put_filp(struct file *file)
file_free(file);
}
}
+EXPORT_SYMBOL_GPL(put_filp);
void __init files_init(void)
{
diff --git a/fs/inode.c b/fs/inode.c
index 05c423e..5d437a9 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1593,6 +1593,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
return update_time(inode, time, flags);
}
+EXPORT_SYMBOL_GPL(update_time);
/**
* touch_atime - update the access time
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..fc50028 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
+EXPORT_SYMBOL_GPL(__mnt_drop_write);
/**
* mnt_drop_write - give up write access to a mount
@@ -1803,6 +1804,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
+EXPORT_SYMBOL_GPL(iterate_mounts);
static void cleanup_group_ids(struct mount *mnt, struct mount *end)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
index d16b62c..53e45b6 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -22,6 +22,7 @@
#include <linux/srcu.h>
#include <linux/rculist.h>
#include <linux/wait.h>
+#include <linux/module.h>
#include <linux/fsnotify_backend.h>
#include "fsnotify.h"
@@ -72,6 +73,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
{
atomic_inc(&group->refcnt);
}
+EXPORT_SYMBOL_GPL(fsnotify_get_group);
/*
* Drop a reference to a group. Free it if it's through.
@@ -81,6 +83,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
if (atomic_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group);
}
+EXPORT_SYMBOL_GPL(fsnotify_put_group);
/*
* Create a new fsnotify_group and hold a reference for the group returned.
@@ -109,6 +112,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
return group;
}
+EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
int fsnotify_fasync(int fd, struct file *file, int on)
{
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index fc0df44..8175f3c 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -109,6 +109,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
mark->free_mark(mark);
}
}
+EXPORT_SYMBOL_GPL(fsnotify_put_mark);
/* Calculate mask of events for a list of marks */
u32 fsnotify_recalc_mask(struct hlist_head *head)
@@ -208,6 +209,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
mutex_unlock(&group->mark_mutex);
fsnotify_free_mark(mark);
}
+EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
void fsnotify_destroy_marks(struct hlist_head *head, spinlock_t *lock)
{
@@ -392,6 +394,7 @@ err:
return ret;
}
+EXPORT_SYMBOL_GPL(fsnotify_add_mark);
int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
struct inode *inode, struct vfsmount *mnt, int allow_dups)
@@ -492,6 +495,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
atomic_set(&mark->refcnt, 1);
mark->free_mark = free_mark;
}
+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
static int fsnotify_mark_destroy(void *ignored)
{
diff --git a/fs/open.c b/fs/open.c
index b6f1e96..e59c51b 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
mutex_unlock(&dentry->d_inode->i_mutex);
return ret;
}
+EXPORT_SYMBOL_GPL(do_truncate);
long vfs_truncate(struct path *path, loff_t length)
{
@@ -678,6 +679,7 @@ int open_check_o_direct(struct file *f)
}
return 0;
}
+EXPORT_SYMBOL_GPL(open_check_o_direct);
static int do_dentry_open(struct file *f,
struct inode *inode,
diff --git a/fs/read_write.c b/fs/read_write.c
index fd0414e..0a28933 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -504,6 +504,7 @@ vfs_readf_t vfs_readf(struct file *file)
return new_sync_read;
return ERR_PTR(-ENOSYS);
}
+EXPORT_SYMBOL_GPL(vfs_readf);
vfs_writef_t vfs_writef(struct file *file)
{
@@ -515,6 +516,7 @@ vfs_writef_t vfs_writef(struct file *file)
return new_sync_write;
return ERR_PTR(-ENOSYS);
}
+EXPORT_SYMBOL_GPL(vfs_writef);
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
{
diff --git a/fs/splice.c b/fs/splice.c
index 30a091d..b0ade1f 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1123,6 +1123,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return splice_write(pipe, out, ppos, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_from);
/*
* Attempt to initiate a splice from a file to a pipe.
@@ -1149,6 +1150,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return splice_read(in, ppos, pipe, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_to);
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/fs/xattr.c b/fs/xattr.c
index 9b932b9..0c317c4 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
*xattr_value = value;
return error;
}
+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
/* Compare an extended attribute value with the given value */
int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name,
diff --git a/kernel/task_work.c b/kernel/task_work.c
index 53fa971..bce3211 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -118,3 +118,4 @@ void task_work_run(void)
} while (work);
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff --git a/security/commoncap.c b/security/commoncap.c
index 1832cf7..646e9b2 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1053,12 +1053,14 @@ int cap_mmap_addr(unsigned long addr)
}
return ret;
}
+EXPORT_SYMBOL_GPL(cap_mmap_addr);
int cap_mmap_file(struct file *file, unsigned long reqprot,
unsigned long prot, unsigned long flags)
{
return 0;
}
+EXPORT_SYMBOL_GPL(cap_mmap_file);
#ifdef CONFIG_SECURITY
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 03c1652..f88c84b 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -7,6 +7,7 @@
#include <linux/device_cgroup.h>
#include <linux/cgroup.h>
#include <linux/ctype.h>
+#include <linux/export.h>
#include <linux/list.h>
#include <linux/uaccess.h>
#include <linux/seq_file.h>
@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct inode *inode, int mask)
return __devcgroup_check_permission(type, imajor(inode), iminor(inode),
access);
}
+EXPORT_SYMBOL_GPL(__devcgroup_inode_permission);
int devcgroup_inode_mknod(int mode, dev_t dev)
{
diff --git a/security/security.c b/security/security.c
index 46f405c..bc8514e 100644
--- a/security/security.c
+++ b/security/security.c
@@ -433,6 +433,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
+EXPORT_SYMBOL_GPL(security_path_rmdir);
int security_path_unlink(struct path *dir, struct dentry *dentry)
{
@@ -449,6 +450,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
+EXPORT_SYMBOL_GPL(security_path_symlink);
int security_path_link(struct dentry *old_dentry, struct path *new_dir,
struct dentry *new_dentry)
@@ -457,6 +459,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
+EXPORT_SYMBOL_GPL(security_path_link);
int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
struct path *new_dir, struct dentry *new_dentry,
@@ -484,6 +487,7 @@ int security_path_truncate(struct path *path)
return 0;
return call_int_hook(path_truncate, 0, path);
}
+EXPORT_SYMBOL_GPL(security_path_truncate);
int security_path_chmod(struct path *path, umode_t mode)
{
@@ -491,6 +495,7 @@ int security_path_chmod(struct path *path, umode_t mode)
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
+EXPORT_SYMBOL_GPL(security_path_chmod);
int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
{
@@ -498,6 +503,7 @@ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
+EXPORT_SYMBOL_GPL(security_path_chown);
int security_path_chroot(struct path *path)
{
@@ -583,6 +589,7 @@ int security_inode_readlink(struct dentry *dentry)
return 0;
return call_int_hook(inode_readlink, 0, dentry);
}
+EXPORT_SYMBOL_GPL(security_inode_readlink);
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
bool rcu)
@@ -598,6 +605,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
+EXPORT_SYMBOL_GPL(security_inode_permission);
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
@@ -736,6 +744,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
+EXPORT_SYMBOL_GPL(security_file_permission);
int security_file_alloc(struct file *file)
{
@@ -795,6 +804,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
return ret;
return ima_file_mmap(file, prot);
}
+EXPORT_SYMBOL_GPL(security_mmap_file);
int security_mmap_addr(unsigned long addr)
{

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
aufs4.4 lockdep patch
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index c57e424..4153563 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -29,7 +29,7 @@ extern int lock_stat;
*/
#define XXX_LOCK_USAGE_STATES (1+3*4)
-#define MAX_LOCKDEP_SUBCLASSES 8UL
+#define MAX_LOCKDEP_SUBCLASSES (8UL + 4)
/*
* NR_LOCKDEP_CACHING_CLASSES ... Number of classes
@@ -203,7 +203,7 @@ struct lock_chain {
u64 chain_key;
};
-#define MAX_LOCKDEP_KEYS_BITS 13
+#define MAX_LOCKDEP_KEYS_BITS (13 + 3)
/*
* Subtract one because we offset hlock->class_idx by 1 in order
* to make 0 mean no class. This avoids overflowing the class_idx
diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h
index 51c4b24..fba7557 100644
--- a/kernel/locking/lockdep_internals.h
+++ b/kernel/locking/lockdep_internals.h
@@ -54,9 +54,9 @@ enum {
* table (if it's not there yet), and we check it for lock order
* conflicts and deadlocks.
*/
-#define MAX_LOCKDEP_ENTRIES 32768UL
+#define MAX_LOCKDEP_ENTRIES (32768UL << 5)
-#define MAX_LOCKDEP_CHAINS_BITS 16
+#define MAX_LOCKDEP_CHAINS_BITS (16 + 5)
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
@@ -65,7 +65,7 @@ enum {
* Stack-trace: tightly packed array of stack backtrace
* addresses. Protected by the hash_lock.
*/
-#define MAX_STACK_TRACE_ENTRIES 524288UL
+#define MAX_STACK_TRACE_ENTRIES (524288UL << 5)
extern struct list_head all_lock_classes;
extern struct lock_chain lock_chains[];

View File

@ -0,0 +1,250 @@
# Description: uzun donem kararli kernel surumu
# URL: http://www.kernel.org
# Packagers: milisarge
name=kernel-lts
version=4.4.27
_srcname=linux-4.4
release=3
_version=${version:0:3}
alias=(linux-lts)
# Virtualbox
vb_version=5.1.8
[ "`uname -m`" == "i686" ] && _VBARCH=x86
[ "`uname -m`" == "x86_64" ] && _VBARCH=amd64
# Broadcom
wl_version=6.30.223.271
_wlarch=_64
source=(\
http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_version}.tar.xz
https://www.kernel.org/pub/linux/kernel/v4.x/patch-$version.xz
https://sourceforge.net/projects/kaosx/files/sources/virtualbox-modules/vbox-kernel-module-src-${vb_version}.tar.xz
http://www.broadcom.com/docs/linux_sta/hybrid-v35${_wlarch}-nodebug-pcoem-${wl_version//./_}.tar.gz
broadcom-wl.modprobe.d broadcom-wl.license.patch wl_linux.c.patch
aufs4-loopback.patch
aufs4-base.patch
aufs4-mmap.patch
aufs4-standalone.patch
aufs4-kbuild.patch
aufs4.4-20160912.patch
lockdep-debug.patch
tmpfs-idr.patch
vfs-ino.patch
aufs_type.h
$name.config_64
virtualbox.conf
virtualbox-modules-depmod.patch
https://github.com/milisarge/aufs/archive/master.tar.gz)
build(){
cd linux-${_version}
cp -r $SRC/aufs-master $SRC/fs/
if [ -f $SRC/patch-$version.xz ]; then
xz -d -c $SRC/patch-$version.xz | patch -Np1
fi
#aufs patches for Live:
patch -p1 -i "${SRC}/aufs4.4-20160912.patch"
patch -p1 -i "${SRC}/aufs4-base.patch"
patch -p1 -i "${SRC}/aufs4-kbuild.patch"
patch -p1 -i "${SRC}/aufs4-loopback.patch"
patch -p1 -i "${SRC}/aufs4-mmap.patch"
patch -p1 -i "${SRC}/aufs4-standalone.patch"
patch -p1 -i "${SRC}/lockdep-debug.patch"
patch -p1 -i "${SRC}/tmpfs-idr.patch"
patch -p1 -i "${SRC}/vfs-ino.patch"
make mrproper
cp $SRC/kernel-lts.config_64 ./.config
make
cp .config $SRC/$name.config_64
## Modules
#
# Kernel modules
cd $SRC/linux-${_version}
make INSTALL_MOD_PATH=$PKG modules_install
KERNEL_VERSION="${version}-milis-lts"
# Module broadcom is broken on 32 bits machine
if [ "$PKGMK_ARCH" == "x86_64" ]; then
cd $SRC
bsdtar xf $DERLEME_KAYNAKDIZIN/hybrid-v35${_wlarch}-nodebug-pcoem-${wl_version//./_}.tar.gz
patch -p1 -i broadcom-wl.license.patch
patch -p1 -i wl_linux.c.patch
sed -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" \
-i src/wl/sys/wl_linux.c
BUILD_NOPEDANTIC=1 make -C $SRC/linux-${_version} M=`pwd`
install -m 0644 -D wl.ko $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/wl.ko
install -Dm644 broadcom-wl.modprobe.d $PKG/etc/modprobe.d/broadcom-wl.conf
fi
for i in *.ko
do
install -D -m0644 $i $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/$i
done
# Module virtualbox
cd vbox-kernel-module-src-5.1.8
patch -p0 -i $SRC/virtualbox-modules-depmod.patch
KERNELRELEASE=${version}
KERN_DIR=$SRC/linux-${_version} make
mkdir -p $PKG/etc/sysconfig/modules.d
install -D -m644 $SRC/virtualbox.conf $PKG/etc/sysconfig/modules.d/virtualbox.conf
for i in *.ko
do
install -D -m0644 $i $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/$i
done
# depmod needed
depmod -b $PKG -a ${KERNEL_VERSION}
install -D -m 644 $SRC/aufs_type.h "${PKG}/usr/include/linux/aufs_type.h"
# Install config and kernel files
cd $SRC/linux-${_version}
mkdir -p $PKG/boot
cp System.map $PKG/boot/System_64.map-$version
cp .config $PKG/boot/config_64-$version
cp arch/x86_64/boot/bzImage $PKG/boot/kernel-$version
#kaynak basliklarin ayarlanmasi
KARCH=x86
cd "${SRC}/${_srcname}"
install -D -m644 Makefile \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Makefile"
install -D -m644 kernel/Makefile \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/kernel/Makefile"
install -D -m644 .config \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/.config"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include"
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
media net pcmcia scsi soc sound trace uapi video xen; do
cp -a include/${i} "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/"
done
# copy arch includes for external modules
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/x86"
cp -a arch/x86/include "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
cp -a scripts "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
# fix permissions on scripts dir
chmod og-w -R "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/scripts"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/.tmp_versions"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/"
cp arch/${KARCH}/kernel/asm-offsets.s "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/kernel/"
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/md"
cp drivers/md/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/md"
# add inotify.h
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/linux"
cp include/linux/inotify.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/linux/"
# add wireless headers
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/net/mac80211/"
cp net/mac80211/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-core"
cp drivers/media/dvb-core/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/config/dvb/"
cp include/config/dvb/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
cp drivers/media/dvb-frontends/lgdt330x.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/i2c/"
cp drivers/media/i2c/msp3400-driver.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/i2c/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/usb/dvb-usb"
cp drivers/media/usb/dvb-usb/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/usb/dvb-usb/"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends"
cp drivers/media/dvb-frontends/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/tuners"
cp drivers/media/tuners/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/fs/xfs"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/mm"
# removed in 3.17 series
# cp fs/xfs/xfs_sb.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in $(find . -name "Kconfig*"); do
mkdir -p "${PKG}"/usr/lib/modules/${KERNEL_VERSION}/build/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/${i}"
done
# add objtool for external module building and enabled VALIDATION_STACK option
if [ -f tools/objtool/objtool ]; then
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/tools/objtool"
cp -a tools/objtool/objtool ${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/tools/objtool/
fi
chown -R root.root "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
find "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${PKG}"/usr/lib/modules/${KERNEL_VERSION}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
# remove a files already in linux-docs package
rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.recursion-issue-01"
rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.recursion-issue-02"
rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.select-break"
# Firmware are in linux-firmware
rm -rf $PKG/lib/firmware
}

View File

@ -0,0 +1,232 @@
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 50777b5..f9c6b3d 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -26,10 +26,13 @@ struct shmem_inode_info {
};
struct shmem_sb_info {
+ struct mutex idr_lock;
+ bool idr_nouse;
+ struct idr idr; /* manages inode-number */
unsigned long max_blocks; /* How many blocks are allowed */
struct percpu_counter used_blocks; /* How many are allocated */
- unsigned long max_inodes; /* How many inodes are allowed */
- unsigned long free_inodes; /* How many are left for allocation */
+ int max_inodes; /* How many inodes are allowed */
+ int free_inodes; /* How many are left for allocation */
spinlock_t stat_lock; /* Serialize shmem_sb_info changes */
kuid_t uid; /* Mount uid for root directory */
kgid_t gid; /* Mount gid for root directory */
diff --git a/mm/shmem.c b/mm/shmem.c
index 2afcdbb..4d81c75 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -112,9 +112,13 @@ static unsigned long shmem_default_max_blocks(void)
return totalram_pages / 2;
}
-static unsigned long shmem_default_max_inodes(void)
+static int shmem_default_max_inodes(void)
{
- return min(totalram_pages - totalhigh_pages, totalram_pages / 2);
+ unsigned long ul;
+
+ ul = INT_MAX;
+ ul = min3(ul, totalram_pages - totalhigh_pages, totalram_pages / 2);
+ return ul;
}
#endif
@@ -610,6 +614,7 @@ static int shmem_setattr(struct dentry *dentry, struct iattr *attr)
static void shmem_evict_inode(struct inode *inode)
{
struct shmem_inode_info *info = SHMEM_I(inode);
+ struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
if (inode->i_mapping->a_ops == &shmem_aops) {
shmem_unacct_size(info->flags, inode->i_size);
@@ -625,6 +630,11 @@ static void shmem_evict_inode(struct inode *inode)
simple_xattrs_free(&info->xattrs);
WARN_ON(inode->i_blocks);
+ if (!sbinfo->idr_nouse && inode->i_ino) {
+ mutex_lock(&sbinfo->idr_lock);
+ idr_remove(&sbinfo->idr, inode->i_ino);
+ mutex_unlock(&sbinfo->idr_lock);
+ }
shmem_free_inode(inode->i_sb);
clear_inode(inode);
}
@@ -1418,13 +1428,13 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
struct inode *inode;
struct shmem_inode_info *info;
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
+ int ino;
if (shmem_reserve_inode(sb))
return NULL;
inode = new_inode(sb);
if (inode) {
- inode->i_ino = get_next_ino();
inode_init_owner(inode, dir, mode);
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -1465,6 +1475,25 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
mpol_shared_policy_init(&info->policy, NULL);
break;
}
+
+ if (!sbinfo->idr_nouse) {
+ /* inum 0 and 1 are unused */
+ mutex_lock(&sbinfo->idr_lock);
+ ino = idr_alloc(&sbinfo->idr, inode, 2, INT_MAX,
+ GFP_NOFS);
+ if (ino > 0) {
+ inode->i_ino = ino;
+ mutex_unlock(&sbinfo->idr_lock);
+ __insert_inode_hash(inode, inode->i_ino);
+ } else {
+ inode->i_ino = 0;
+ mutex_unlock(&sbinfo->idr_lock);
+ iput(inode);
+ /* shmem_free_inode() will be called */
+ inode = NULL;
+ }
+ } else
+ inode->i_ino = get_next_ino();
} else
shmem_free_inode(sb);
return inode;
@@ -2682,8 +2711,7 @@ static struct dentry *shmem_get_parent(struct dentry *child)
static int shmem_match(struct inode *ino, void *vfh)
{
__u32 *fh = vfh;
- __u64 inum = fh[2];
- inum = (inum << 32) | fh[1];
+ __u64 inum = fh[1];
return ino->i_ino == inum && fh[0] == ino->i_generation;
}
@@ -2694,14 +2722,11 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
struct dentry *dentry = NULL;
u64 inum;
- if (fh_len < 3)
+ if (fh_len < 2)
return NULL;
- inum = fid->raw[2];
- inum = (inum << 32) | fid->raw[1];
-
- inode = ilookup5(sb, (unsigned long)(inum + fid->raw[0]),
- shmem_match, fid->raw);
+ inum = fid->raw[1];
+ inode = ilookup5(sb, inum, shmem_match, fid->raw);
if (inode) {
dentry = d_find_alias(inode);
iput(inode);
@@ -2713,30 +2738,15 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
static int shmem_encode_fh(struct inode *inode, __u32 *fh, int *len,
struct inode *parent)
{
- if (*len < 3) {
- *len = 3;
+ if (*len < 2) {
+ *len = 2;
return FILEID_INVALID;
}
- if (inode_unhashed(inode)) {
- /* Unfortunately insert_inode_hash is not idempotent,
- * so as we hash inodes here rather than at creation
- * time, we need a lock to ensure we only try
- * to do it once
- */
- static DEFINE_SPINLOCK(lock);
- spin_lock(&lock);
- if (inode_unhashed(inode))
- __insert_inode_hash(inode,
- inode->i_ino + inode->i_generation);
- spin_unlock(&lock);
- }
-
fh[0] = inode->i_generation;
fh[1] = inode->i_ino;
- fh[2] = ((__u64)inode->i_ino) >> 32;
- *len = 3;
+ *len = 2;
return 1;
}
@@ -2801,7 +2811,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,
goto bad_val;
} else if (!strcmp(this_char,"nr_inodes")) {
sbinfo->max_inodes = memparse(value, &rest);
- if (*rest)
+ if (*rest || sbinfo->max_inodes < 2)
goto bad_val;
} else if (!strcmp(this_char,"mode")) {
if (remount)
@@ -2854,7 +2864,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
struct shmem_sb_info config = *sbinfo;
- unsigned long inodes;
+ int inodes;
int error = -EINVAL;
config.mpol = NULL;
@@ -2902,7 +2912,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
seq_printf(seq, ",size=%luk",
sbinfo->max_blocks << (PAGE_CACHE_SHIFT - 10));
if (sbinfo->max_inodes != shmem_default_max_inodes())
- seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes);
+ seq_printf(seq, ",nr_inodes=%d", sbinfo->max_inodes);
if (sbinfo->mode != (S_IRWXUGO | S_ISVTX))
seq_printf(seq, ",mode=%03ho", sbinfo->mode);
if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID))
@@ -2991,6 +3001,8 @@ static void shmem_put_super(struct super_block *sb)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
+ if (!sbinfo->idr_nouse)
+ idr_destroy(&sbinfo->idr);
percpu_counter_destroy(&sbinfo->used_blocks);
mpol_put(sbinfo->mpol);
kfree(sbinfo);
@@ -3009,6 +3021,8 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
if (!sbinfo)
return -ENOMEM;
+ mutex_init(&sbinfo->idr_lock);
+ idr_init(&sbinfo->idr);
sbinfo->mode = S_IRWXUGO | S_ISVTX;
sbinfo->uid = current_fsuid();
sbinfo->gid = current_fsgid();
@@ -3112,6 +3126,15 @@ static void shmem_destroy_inodecache(void)
kmem_cache_destroy(shmem_inode_cachep);
}
+static __init void shmem_no_idr(struct super_block *sb)
+{
+ struct shmem_sb_info *sbinfo;
+
+ sbinfo = SHMEM_SB(sb);
+ sbinfo->idr_nouse = true;
+ idr_destroy(&sbinfo->idr);
+}
+
static const struct address_space_operations shmem_aops = {
.writepage = shmem_writepage,
.set_page_dirty = __set_page_dirty_no_writeback,
@@ -3248,6 +3271,7 @@ int __init shmem_init(void)
printk(KERN_ERR "Could not kern_mount tmpfs\n");
goto out1;
}
+ shmem_no_idr(shm_mnt->mnt_sb);
return 0;
out1:

View File

@ -0,0 +1,22 @@
diff --git a/fs/inode.c b/fs/inode.c
index 1be5f90..b6678aa 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -844,6 +844,8 @@ unsigned int get_next_ino(void)
unsigned int *p = &get_cpu_var(last_ino);
unsigned int res = *p;
+start:
+
#ifdef CONFIG_SMP
if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
static atomic_t shared_last_ino;
@@ -856,7 +858,7 @@ unsigned int get_next_ino(void)
res++;
/* get_next_ino should not provide a 0 inode number */
if (unlikely(!res))
- res++;
+ goto start;
*p = res;
put_cpu_var(last_ino);
return res;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
# Description: The latest stable kernel version
# URL: http://www.kernel.org
# Packagers: milisarge
name=kernel-lts
version=4.4.6
release=1
_version=${version%.*}
source=(http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_version}.tar.xz
https://www.kernel.org/pub/linux/kernel/v4.x/patch-$version.xz
$name.config $name.config_64 )
build(){
cd linux-${_version}
if [ -f $SRC/patch-$version.xz ]; then
xz -d -c $SRC/patch-$version.xz | patch -Np1
fi
make mrproper
case `uname -m` in
x86_64)
cp $SRC/$name.config_64 ./.config;;
i?86)
cp $SRC/$name.config ./.config;
esac
# make menuconfig
make || make -j1
case `uname -m` in
x86_64)
cp .config $SRC/$name.config_64;;
i?86)
cp .config $SRC/$name.config;;
esac
# Install modules
cd $SRC/linux-${_version}
sed -i "/rm\ -rf\ \$(MODLIB)\/kernel/d" Makefile
make INSTALL_MOD_PATH=$PKG modules_install || make -j1 INSTALL_MOD_PATH=$PKG modules_install
mkdir -p $PKG/boot
case `uname -m` in
x86_64)
cp System.map \
$PKG/boot/System_64.map-$version
cp .config \
$PKG/boot/config_64-$version
cp arch/x86_64/boot/bzImage \
$PKG/boot/$name-$version ;;
i?86)
cp System.map \
$PKG/boot/System.map-$version
cp .config \
$PKG/boot/config-$version
cp arch/i386/boot/bzImage \
$PKG/boot/$name-$version ;;
esac
cd $PKG/lib/modules/${version}*/
mkdir -p $PKG/usr/src
mv $SRC/linux-${_version} $PKG/usr/src/
rm {build,source}
ln -sv /usr/src/linux-${_version} build
ln -sv /usr/src/linux-${_version} source
mkdir $SRC/linux-${_version}
mv $PKG/usr/src/linux-${_version}/Documentation \
$SRC/linux-${_version}
# Firmware are in linux-firmware
rm -rf $PKG/lib/firmware
# post-install autogen
INITRD_VERSION="`basename $PKG/lib/modules/*`"
echo "mkinitramfs $INITRD_VERSION" > $PKGMK_ROOT/$name.post-install
echo "[ -f boot/initrd ] && rm boot/initrd" >> $PKGMK_ROOT/$name.post-install
echo "ln -sf initrd-$INITRD_VERSION boot/initrd" >> $PKGMK_ROOT/$name.post-install
echo "ln -sf $name-$version boot/kernel" >> $PKGMK_ROOT/$name.post-install
#pre-install autogen
cd $SRC
if [ -f aaabasicfs-${AAABASICFS}.tar.xz ]; then
bsdtar -p -o -C $SRC -xf aaabasicfs-${AAABASICFS}.tar.xz
echo ". lib/lsb/init-functions" > $PKGMK_ROOT/$name.pre-install
for FILE in `tar --list --file aaabasicfs-${AAABASICFS}.tar.xz|grep -v /$`
do
echo "log_info_msg \"update $FILE\"" >> $PKGMK_ROOT/$name.pre-install
echo "cat > $FILE << \"END_OF_FILE\"" >> $PKGMK_ROOT/$name.pre-install
cat $SRC/$FILE >> $PKGMK_ROOT/$name.pre-install
echo "END_OF_FILE" >> $PKGMK_ROOT/$name.pre-install
echo "evaluate_retval" >> $PKGMK_ROOT/$name.pre-install
done
fi
}
rm -r $PKG/usr/src/

View File

@ -1,10 +1,10 @@
aufs4.4 base patch
aufs4.10 base patch
diff --git a/MAINTAINERS b/MAINTAINERS
index 233f834..c250892 100644
index 527d137..b6ea8ae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2029,6 +2029,19 @@ F: include/linux/audit.h
@@ -2308,6 +2308,19 @@ F: include/linux/audit.h
F: include/uapi/linux/audit.h
F: kernel/audit*
@ -25,10 +25,10 @@ index 233f834..c250892 100644
M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
W: http://miguelojeda.es/auxdisplay.htm
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 423f4ca..0b816b2 100644
index f347285..b63f68b 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -706,6 +706,24 @@ static inline int is_loop_device(struct file *file)
@@ -701,6 +701,24 @@ static inline int is_loop_device(struct file *file)
return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR;
}
@ -54,10 +54,10 @@ index 423f4ca..0b816b2 100644
static ssize_t loop_attr_show(struct device *dev, char *page,
diff --git a/fs/dcache.c b/fs/dcache.c
index 5c33aeb..8aa7f26 100644
index 95d71ed..8ca5f09 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1167,7 +1167,7 @@ enum d_walk_ret {
@@ -1164,7 +1164,7 @@ enum d_walk_ret {
*
* The @enter() and @finish() callbacks are called with d_lock held.
*/
@ -67,7 +67,7 @@ index 5c33aeb..8aa7f26 100644
void (*finish)(void *))
{
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ee85cd4..dacbf71 100644
index e1c54f2..9f07008 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -29,7 +29,7 @@
@ -79,7 +79,7 @@ index ee85cd4..dacbf71 100644
{
struct inode * inode = file_inode(filp);
int error = 0;
@@ -59,6 +59,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
@@ -60,6 +60,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
if (filp->f_op->check_flags)
error = filp->f_op->check_flags(arg);
@ -89,10 +89,10 @@ index ee85cd4..dacbf71 100644
return error;
diff --git a/fs/inode.c b/fs/inode.c
index 1be5f90..05c423e 100644
index 88110fd..9a9ba3a 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1584,7 +1584,7 @@ EXPORT_SYMBOL(generic_update_time);
@@ -1642,7 +1642,7 @@ EXPORT_SYMBOL(generic_update_time);
* This does the actual work of updating an inodes time or version. Must have
* had called mnt_want_write() before calling this.
*/
@ -102,10 +102,10 @@ index 1be5f90..05c423e 100644
int (*update_time)(struct inode *, struct timespec *, int);
diff --git a/fs/read_write.c b/fs/read_write.c
index 819ef3f..fd0414e 100644
index 5816d4c..670b365 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -494,6 +494,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
@@ -515,6 +515,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
}
EXPORT_SYMBOL(__vfs_write);
@ -135,10 +135,10 @@ index 819ef3f..fd0414e 100644
{
mm_segment_t old_fs;
diff --git a/fs/splice.c b/fs/splice.c
index 4cf700d..30a091d 100644
index 4ef78aa..178acc0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1110,8 +1110,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
@@ -857,8 +857,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
/*
* Attempt to initiate a splice from pipe to file.
*/
@ -149,7 +149,7 @@ index 4cf700d..30a091d 100644
{
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
loff_t *, size_t, unsigned int);
@@ -1127,9 +1127,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
@@ -874,9 +874,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
/*
* Attempt to initiate a splice from a file to a pipe.
*/
@ -162,23 +162,36 @@ index 4cf700d..30a091d 100644
{
ssize_t (*splice_read)(struct file *, loff_t *,
struct pipe_inode_info *, size_t, unsigned int);
diff --git a/fs/sync.c b/fs/sync.c
index 2a54c1f..7a5fa3f 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -27,7 +27,7 @@
* wait == 1 case since in that case write_inode() functions do
* sync_dirty_buffer() and thus effectively write one block at a time.
*/
-static int __sync_filesystem(struct super_block *sb, int wait)
+int __sync_filesystem(struct super_block *sb, int wait)
{
if (wait)
sync_inodes_sb(sb);
diff --git a/include/linux/file.h b/include/linux/file.h
index f87d308..9a290b3 100644
index 61eb82c..e700888 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -19,6 +19,7 @@ struct dentry;
struct path;
extern struct file *alloc_file(struct path *, fmode_t mode,
extern struct file *alloc_file(const struct path *, fmode_t mode,
const struct file_operations *fop);
+extern struct file *get_empty_filp(void);
static inline void fput_light(struct file *file, int fput_needed)
{
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3aa5142..36a997e 100644
index 2ba0743..d1c583b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1233,6 +1233,7 @@ extern void fasync_free(struct fasync_struct *);
@@ -1240,6 +1240,7 @@ extern void fasync_free(struct fasync_struct *);
/* can be called from interrupts */
extern void kill_fasync(struct fasync_struct **, int, int);
@ -186,7 +199,7 @@ index 3aa5142..36a997e 100644
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern void f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
@@ -1619,6 +1620,7 @@ struct file_operations {
@@ -1664,6 +1665,7 @@ struct file_operations {
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
@ -194,7 +207,7 @@ index 3aa5142..36a997e 100644
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
@@ -1672,6 +1674,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
@@ -1717,6 +1719,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct iovec *fast_pointer,
struct iovec **ret_pointer);
@ -207,7 +220,7 @@ index 3aa5142..36a997e 100644
extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
@@ -2021,6 +2029,7 @@ extern int current_umask(void);
@@ -2108,6 +2116,7 @@ extern int current_umask(void);
extern void ihold(struct inode * inode);
extern void iput(struct inode *);
extern int generic_update_time(struct inode *, struct timespec *, int);
@ -215,14 +228,22 @@ index 3aa5142..36a997e 100644
/* /sys/fs */
extern struct kobject *fs_kobj;
@@ -2387,6 +2396,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
return false;
}
#endif
+extern int __sync_filesystem(struct super_block *, int);
extern int sync_filesystem(struct super_block *);
extern const struct file_operations def_blk_fops;
extern const struct file_operations def_chr_fops;
diff --git a/include/linux/splice.h b/include/linux/splice.h
index da2751d..2e0fca6 100644
index 00a2116..1f0a4a2 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -83,4 +83,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
@@ -86,4 +86,10 @@ extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
extern const struct pipe_buf_operations default_pipe_buf_ops;
+
+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ loff_t *ppos, size_t len, unsigned int flags);

View File

@ -1,10 +1,10 @@
aufs4.4 kbuild patch
aufs4.10 kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
index 6ce72d8..4aa31ea 100644
index 83eab52..31f16c4 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -221,6 +221,7 @@ source "fs/pstore/Kconfig"
@@ -248,6 +248,7 @@ source "fs/pstore/Kconfig"
source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
source "fs/exofs/Kconfig"
@ -13,16 +13,16 @@ index 6ce72d8..4aa31ea 100644
endif # MISC_FILESYSTEMS
diff --git a/fs/Makefile b/fs/Makefile
index 79f5225..a7c7f16 100644
index 7bbaca9..a026491 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -126,3 +126,4 @@ obj-y += exofs/ # Multiple modules
@@ -128,3 +128,4 @@ obj-y += exofs/ # Multiple modules
obj-$(CONFIG_CEPH_FS) += ceph/
obj-$(CONFIG_PSTORE) += pstore/
obj-$(CONFIG_EFIVAR_FS) += efivarfs/
+obj-$(CONFIG_AUFS_FS) += aufs/
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index c2e5d6c..d736c11 100644
index f330ba4..67d88cd 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -59,6 +59,7 @@ header-y += atmsvc.h

View File

@ -1,10 +1,10 @@
aufs4.4 loopback patch
aufs4.10 loopback patch
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 0b816b2..86dd454 100644
index b63f68b..c0f4b8c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -556,7 +556,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
@@ -551,7 +551,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
}
struct switch_request {
@ -13,7 +13,7 @@ index 0b816b2..86dd454 100644
struct completion wait;
};
@@ -582,6 +582,7 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
@@ -577,6 +577,7 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
mapping = file->f_mapping;
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
@ -21,7 +21,7 @@ index 0b816b2..86dd454 100644
lo->lo_blocksize = S_ISBLK(mapping->host->i_mode) ?
mapping->host->i_bdev->bd_block_size : PAGE_SIZE;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
@@ -594,11 +595,13 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
@@ -589,11 +590,13 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
* First it needs to flush existing IO, it does this by sending a magic
* BIO down the pipe. The completion of this BIO does the actual switch.
*/
@ -36,7 +36,7 @@ index 0b816b2..86dd454 100644
/* freeze queue and wait for completion of scheduled requests */
blk_mq_freeze_queue(lo->lo_queue);
@@ -617,7 +620,16 @@ static int loop_switch(struct loop_device *lo, struct file *file)
@@ -612,7 +615,16 @@ static int loop_switch(struct loop_device *lo, struct file *file)
*/
static int loop_flush(struct loop_device *lo)
{
@ -54,7 +54,7 @@ index 0b816b2..86dd454 100644
}
static void loop_reread_partitions(struct loop_device *lo,
@@ -654,6 +666,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -649,6 +661,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
unsigned int arg)
{
struct file *file, *old_file;
@ -62,7 +62,7 @@ index 0b816b2..86dd454 100644
struct inode *inode;
int error;
@@ -670,9 +683,16 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -665,9 +678,16 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
file = fget(arg);
if (!file)
goto out;
@ -79,7 +79,7 @@ index 0b816b2..86dd454 100644
error = -EINVAL;
@@ -684,17 +704,21 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
@@ -679,17 +699,21 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
goto out_putf;
/* and ... switch */
@ -102,7 +102,7 @@ index 0b816b2..86dd454 100644
out:
return error;
}
@@ -881,7 +905,7 @@ static int loop_prepare_queue(struct loop_device *lo)
@@ -876,7 +900,7 @@ static int loop_prepare_queue(struct loop_device *lo)
static int loop_set_fd(struct loop_device *lo, fmode_t mode,
struct block_device *bdev, unsigned int arg)
{
@ -111,7 +111,7 @@ index 0b816b2..86dd454 100644
struct inode *inode;
struct address_space *mapping;
unsigned lo_blocksize;
@@ -896,6 +920,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
@@ -891,6 +915,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
file = fget(arg);
if (!file)
goto out;
@ -124,7 +124,7 @@ index 0b816b2..86dd454 100644
error = -EBUSY;
if (lo->lo_state != Lo_unbound)
@@ -948,6 +978,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
@@ -943,6 +973,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
lo->lo_backing_file = file;
@ -132,7 +132,7 @@ index 0b816b2..86dd454 100644
lo->transfer = NULL;
lo->ioctl = NULL;
lo->lo_sizelimit = 0;
@@ -980,6 +1011,8 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
@@ -975,6 +1006,8 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
out_putf:
fput(file);
@ -141,7 +141,7 @@ index 0b816b2..86dd454 100644
out:
/* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE);
@@ -1026,6 +1059,7 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
@@ -1021,6 +1054,7 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
static int loop_clr_fd(struct loop_device *lo)
{
struct file *filp = lo->lo_backing_file;
@ -149,7 +149,7 @@ index 0b816b2..86dd454 100644
gfp_t gfp = lo->old_gfp_mask;
struct block_device *bdev = lo->lo_device;
@@ -1057,6 +1091,7 @@ static int loop_clr_fd(struct loop_device *lo)
@@ -1052,6 +1086,7 @@ static int loop_clr_fd(struct loop_device *lo)
spin_lock_irq(&lo->lo_lock);
lo->lo_state = Lo_rundown;
lo->lo_backing_file = NULL;
@ -157,7 +157,7 @@ index 0b816b2..86dd454 100644
spin_unlock_irq(&lo->lo_lock);
loop_release_xfer(lo);
@@ -1101,6 +1136,8 @@ static int loop_clr_fd(struct loop_device *lo)
@@ -1096,6 +1131,8 @@ static int loop_clr_fd(struct loop_device *lo)
* bd_mutex which is usually taken before lo_ctl_mutex.
*/
fput(filp);
@ -180,10 +180,10 @@ index fb2237c..c3888c5 100644
unsigned lo_blocksize;
void *key_data;
diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
index a2256c7..6f03771 100644
index 6da0f10..d211f9e 100644
--- a/fs/aufs/f_op.c
+++ b/fs/aufs/f_op.c
@@ -348,7 +348,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
@@ -351,7 +351,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
if (IS_ERR(h_file))
goto out;
@ -193,7 +193,7 @@ index a2256c7..6f03771 100644
if (file->f_mapping != h_file->f_mapping) {
file->f_mapping = h_file->f_mapping;
diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c
index c3ca50f..a3dbdaf 100644
index 61e9197..9910bea 100644
--- a/fs/aufs/loop.c
+++ b/fs/aufs/loop.c
@@ -132,3 +132,19 @@ void au_loopback_fin(void)
@ -217,7 +217,7 @@ index c3ca50f..a3dbdaf 100644
+ return f;
+}
diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h
index 48bf070..66afec7 100644
index e2df495..36e5052 100644
--- a/fs/aufs/loop.h
+++ b/fs/aufs/loop.h
@@ -25,7 +25,11 @@ void au_warn_loopback(struct super_block *h_sb);
@ -242,10 +242,10 @@ index 48bf070..66afec7 100644
#endif /* __KERNEL__ */
diff --git a/fs/aufs/super.c b/fs/aufs/super.c
index 6baa5f4..3700427 100644
index 0e9bbc3..b90d52f 100644
--- a/fs/aufs/super.c
+++ b/fs/aufs/super.c
@@ -831,7 +831,10 @@ static const struct super_operations aufs_sop = {
@@ -837,7 +837,10 @@ static const struct super_operations aufs_sop = {
.statfs = aufs_statfs,
.put_super = aufs_put_super,
.sync_fs = aufs_sync_fs,
@ -258,10 +258,10 @@ index 6baa5f4..3700427 100644
/* ---------------------------------------------------------------------- */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 36a997e..b2a9cad 100644
index a808c7c..214b51f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1721,6 +1721,10 @@ struct super_operations {
@@ -1791,6 +1791,10 @@ struct super_operations {
struct shrink_control *);
long (*free_cached_objects)(struct super_block *,
struct shrink_control *);

View File

@ -1,10 +1,10 @@
aufs4.4 mmap patch
aufs4.10 mmap patch
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 4bd5d31..aa41f2a 100644
index 87c9a9a..a0196f0 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1921,7 +1921,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path)
@@ -1958,7 +1958,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
down_read(&mm->mmap_sem);
vma = find_exact_vma(mm, vm_start, vm_end);
if (vma && vma->vm_file) {
@ -14,7 +14,7 @@ index 4bd5d31..aa41f2a 100644
rc = 0;
}
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
index f8595e8..cb8eda0 100644
index 7563437..7c0dc0f 100644
--- a/fs/proc/nommu.c
+++ b/fs/proc/nommu.c
@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
@ -30,10 +30,10 @@ index f8595e8..cb8eda0 100644
ino = inode->i_ino;
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 187b3b5..e03793e 100644
index 8f96a49..0d10404 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -281,7 +281,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
@@ -291,7 +291,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
const char *name = NULL;
if (file) {
@ -45,7 +45,7 @@ index 187b3b5..e03793e 100644
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
@@ -1505,7 +1508,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
@@ -1628,7 +1631,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
struct vm_area_struct *vma = v;
struct numa_maps *md = &numa_priv->md;
@ -55,10 +55,10 @@ index 187b3b5..e03793e 100644
struct mm_walk walk = {
.hugetlb_entry = gather_hugetlb_stats,
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index e0d64c9..7aa92db 100644
index 3717562..6a328f1 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -160,7 +160,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
@@ -155,7 +155,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
file = vma->vm_file;
if (file) {
@ -71,10 +71,10 @@ index e0d64c9..7aa92db 100644
ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 00bad77..cc616b0 100644
index b84615b..3978a35 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1183,6 +1183,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
@@ -1257,6 +1257,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
}
#endif
@ -100,14 +100,14 @@ index 00bad77..cc616b0 100644
+#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__)
+#endif /* !CONFIG_MMU */
+
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len,
unsigned int gup_flags);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
void *buf, int len, int write);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index f8d1492..c3a3760 100644
index 808751d..66fc765 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -272,6 +272,7 @@ struct vm_region {
@@ -275,6 +275,7 @@ struct vm_region {
unsigned long vm_top; /* region allocated to here */
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */
struct file *vm_file; /* the backing file or NULL */
@ -115,19 +115,19 @@ index f8d1492..c3a3760 100644
int vm_usage; /* region usage count (access under nommu_region_sem) */
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
@@ -346,6 +347,7 @@ struct vm_area_struct {
@@ -349,6 +350,7 @@ struct vm_area_struct {
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
units, *not* PAGE_CACHE_SIZE */
units */
struct file * vm_file; /* File we map to (can be NULL). */
+ struct file *vm_prfile; /* shadow of vm_file */
void * vm_private_data; /* was vm_pte (shared mem) */
#ifndef CONFIG_MMU
diff --git a/kernel/fork.c b/kernel/fork.c
index 1155eac..c001ea4 100644
index 11c5c8a..48e7ef7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -465,7 +465,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
@@ -626,7 +626,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
struct inode *inode = file_inode(file);
struct address_space *mapping = file->f_mapping;
@ -137,10 +137,10 @@ index 1155eac..c001ea4 100644
atomic_dec(&inode->i_writecount);
i_mmap_lock_write(mapping);
diff --git a/mm/Makefile b/mm/Makefile
index 2ed4319..e3a53f5 100644
index 295bd7a..14fa1c8 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -21,7 +21,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
@@ -37,7 +37,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
mm_init.o mmu_context.o percpu.o slab_common.o \
compaction.o vmacache.o \
interval_tree.o list_lru.o workingset.o \
@ -150,10 +150,10 @@ index 2ed4319..e3a53f5 100644
obj-y += init-mm.o
diff --git a/mm/filemap.c b/mm/filemap.c
index 1bb0076..8eaece8 100644
index 3f9afde..bb050b0 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2128,7 +2128,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
@@ -2397,7 +2397,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
int ret = VM_FAULT_LOCKED;
sb_start_pagefault(inode->i_sb);
@ -162,24 +162,11 @@ index 1bb0076..8eaece8 100644
lock_page(page);
if (page->mapping != inode->i_mapping) {
unlock_page(page);
diff --git a/mm/memory.c b/mm/memory.c
index c387430..d434404 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2035,7 +2035,7 @@ static inline int wp_page_reuse(struct mm_struct *mm,
}
if (!page_mkwrite)
- file_update_time(vma->vm_file);
+ vma_file_update_time(vma);
}
return VM_FAULT_WRITE;
diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a6..11bc34d 100644
index dc4291d..4b3a2aa 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -275,7 +275,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
@@ -170,7 +170,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
@ -188,7 +175,7 @@ index 2ce04a6..11bc34d 100644
mpol_put(vma_policy(vma));
kmem_cache_free(vm_area_cachep, vma);
return next;
@@ -887,7 +887,7 @@ again: remove_next = 1 + (end > next->vm_end);
@@ -879,7 +879,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
if (remove_next) {
if (file) {
uprobe_munmap(next, next->vm_start, next->vm_end);
@ -197,7 +184,7 @@ index 2ce04a6..11bc34d 100644
}
if (next->anon_vma)
anon_vma_merge(vma, next);
@@ -1681,8 +1681,8 @@ out:
@@ -1727,8 +1727,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
return addr;
unmap_and_free_vma:
@ -207,7 +194,7 @@ index 2ce04a6..11bc34d 100644
/* Undo any partial mapping done by a device driver. */
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
@@ -2488,7 +2488,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -2533,7 +2533,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
goto out_free_mpol;
if (new->vm_file)
@ -216,7 +203,7 @@ index 2ce04a6..11bc34d 100644
if (new->vm_ops && new->vm_ops->open)
new->vm_ops->open(new);
@@ -2507,7 +2507,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -2552,7 +2552,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
if (new->vm_ops && new->vm_ops->close)
new->vm_ops->close(new);
if (new->vm_file)
@ -225,17 +212,17 @@ index 2ce04a6..11bc34d 100644
unlink_anon_vmas(new);
out_free_mpol:
mpol_put(vma_policy(new));
@@ -2649,7 +2649,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
@@ -2703,7 +2703,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
struct vm_area_struct *vma;
unsigned long populate = 0;
unsigned long ret = -EINVAL;
- struct file *file;
+ struct file *file, *prfile;
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. "
"See Documentation/vm/remap_file_pages.txt.\n",
@@ -2693,10 +2693,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
munlock_vma_pages_range(vma, start, start + size);
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.\n",
current->comm, current->pid);
@@ -2778,10 +2778,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
}
}
- file = get_file(vma->vm_file);
@ -263,7 +250,7 @@ index 2ce04a6..11bc34d 100644
out:
up_write(&mm->mmap_sem);
if (populate)
@@ -2966,7 +2983,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
@@ -3056,7 +3073,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
if (anon_vma_clone(new_vma, vma))
goto out_free_mempol;
if (new_vma->vm_file)
@ -273,10 +260,10 @@ index 2ce04a6..11bc34d 100644
new_vma->vm_ops->open(new_vma);
vma_link(mm, new_vma, prev, rb_link, rb_parent);
diff --git a/mm/nommu.c b/mm/nommu.c
index 92be862..29179f7 100644
index 24f9f5f..ac0d37a 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -671,7 +671,7 @@ static void __put_nommu_region(struct vm_region *region)
@@ -636,7 +636,7 @@ static void __put_nommu_region(struct vm_region *region)
up_write(&nommu_region_sem);
if (region->vm_file)
@ -285,7 +272,7 @@ index 92be862..29179f7 100644
/* IO memory and memory shared directly out of the pagecache
* from ramfs/tmpfs mustn't be released here */
@@ -829,7 +829,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
@@ -794,7 +794,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
@ -294,7 +281,7 @@ index 92be862..29179f7 100644
put_nommu_region(vma->vm_region);
kmem_cache_free(vm_area_cachep, vma);
}
@@ -1355,7 +1355,7 @@ unsigned long do_mmap(struct file *file,
@@ -1320,7 +1320,7 @@ unsigned long do_mmap(struct file *file,
goto error_just_free;
}
}
@ -303,7 +290,7 @@ index 92be862..29179f7 100644
kmem_cache_free(vm_region_jar, region);
region = pregion;
result = start;
@@ -1430,10 +1430,10 @@ error_just_free:
@@ -1395,10 +1395,10 @@ unsigned long do_mmap(struct file *file,
up_write(&nommu_region_sem);
error:
if (region->vm_file)

View File

@ -1,22 +1,30 @@
aufs4.4 standalone patch
aufs4.10 standalone patch
diff --git a/fs/dcache.c b/fs/dcache.c
index 8aa7f26..ff9a6f3 100644
index 8ca5f09..b1ff5be 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1272,6 +1272,7 @@ rename_retry:
@@ -1272,6 +1272,7 @@ void d_walk(struct dentry *parent, void *data,
seq = 1;
goto again;
}
+EXPORT_SYMBOL_GPL(d_walk);
/*
* Search for at least 1 mount point in the dentry's subdirs.
struct check_mount {
struct vfsmount *mnt;
@@ -2864,6 +2865,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
write_sequnlock(&rename_lock);
}
+EXPORT_SYMBOL_GPL(d_exchange);
/**
* d_ancestor - search for an ancestor
diff --git a/fs/exec.c b/fs/exec.c
index b06623a..3526d30 100644
index e579466..2566b16 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -103,6 +103,7 @@ bool path_noexec(const struct path *path)
@@ -104,6 +104,7 @@ bool path_noexec(const struct path *path)
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
}
@ -25,10 +33,10 @@ index b06623a..3526d30 100644
#ifdef CONFIG_USELIB
/*
diff --git a/fs/fcntl.c b/fs/fcntl.c
index dacbf71..8abb9f81 100644
index 9f07008..d60b682 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -81,6 +81,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
@@ -82,6 +82,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
out:
return error;
}
@ -37,10 +45,10 @@ index dacbf71..8abb9f81 100644
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff --git a/fs/file_table.c b/fs/file_table.c
index ad17e05..ae9f267 100644
index 6d982b5..9a3c6c8 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -147,6 +147,7 @@ over:
@@ -147,6 +147,7 @@ struct file *get_empty_filp(void)
}
return ERR_PTR(-ENFILE);
}
@ -73,10 +81,10 @@ index ad17e05..ae9f267 100644
void __init files_init(void)
{
diff --git a/fs/inode.c b/fs/inode.c
index 05c423e..5d437a9 100644
index 9a9ba3a..a3a18d8 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1593,6 +1593,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
@@ -1651,6 +1651,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
return update_time(inode, time, flags);
}
@ -85,10 +93,10 @@ index 05c423e..5d437a9 100644
/**
* touch_atime - update the access time
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..fc50028 100644
index 487ba30..642069d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
@@ -462,6 +462,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
@ -96,7 +104,7 @@ index 0570729..fc50028 100644
/**
* mnt_drop_write - give up write access to a mount
@@ -1803,6 +1804,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
@@ -1872,6 +1873,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
@ -105,7 +113,7 @@ index 0570729..fc50028 100644
static void cleanup_group_ids(struct mount *mnt, struct mount *end)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
index d16b62c..53e45b6 100644
index fbe3cbe..bdfc61e 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -22,6 +22,7 @@
@ -116,7 +124,7 @@ index d16b62c..53e45b6 100644
#include <linux/fsnotify_backend.h>
#include "fsnotify.h"
@@ -72,6 +73,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
@@ -100,6 +101,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
{
atomic_inc(&group->refcnt);
}
@ -124,7 +132,7 @@ index d16b62c..53e45b6 100644
/*
* Drop a reference to a group. Free it if it's through.
@@ -81,6 +83,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
@@ -109,6 +111,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
if (atomic_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group);
}
@ -132,7 +140,7 @@ index d16b62c..53e45b6 100644
/*
* Create a new fsnotify_group and hold a reference for the group returned.
@@ -109,6 +112,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
@@ -137,6 +140,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
return group;
}
@ -141,10 +149,10 @@ index d16b62c..53e45b6 100644
int fsnotify_fasync(int fd, struct file *file, int on)
{
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index fc0df44..8175f3c 100644
index 6043306..fdb50e4 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -109,6 +109,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
mark->free_mark(mark);
}
}
@ -152,7 +160,7 @@ index fc0df44..8175f3c 100644
/* Calculate mask of events for a list of marks */
u32 fsnotify_recalc_mask(struct hlist_head *head)
@@ -208,6 +209,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
@@ -230,6 +231,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
mutex_unlock(&group->mark_mutex);
fsnotify_free_mark(mark);
}
@ -160,7 +168,7 @@ index fc0df44..8175f3c 100644
void fsnotify_destroy_marks(struct hlist_head *head, spinlock_t *lock)
{
@@ -392,6 +394,7 @@ err:
@@ -415,6 +417,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark,
return ret;
}
@ -168,27 +176,27 @@ index fc0df44..8175f3c 100644
int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
struct inode *inode, struct vfsmount *mnt, int allow_dups)
@@ -492,6 +495,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
@@ -521,6 +524,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
atomic_set(&mark->refcnt, 1);
mark->free_mark = free_mark;
}
+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
static int fsnotify_mark_destroy(void *ignored)
{
/*
* Destroy all marks in destroy_list, waits for SRCU period to finish before
diff --git a/fs/open.c b/fs/open.c
index b6f1e96..e59c51b 100644
index 9921f70..80d94c0 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
mutex_unlock(&dentry->d_inode->i_mutex);
inode_unlock(dentry->d_inode);
return ret;
}
+EXPORT_SYMBOL_GPL(do_truncate);
long vfs_truncate(struct path *path, loff_t length)
long vfs_truncate(const struct path *path, loff_t length)
{
@@ -678,6 +679,7 @@ int open_check_o_direct(struct file *f)
@@ -695,6 +696,7 @@ int open_check_o_direct(struct file *f)
}
return 0;
}
@ -197,10 +205,10 @@ index b6f1e96..e59c51b 100644
static int do_dentry_open(struct file *f,
struct inode *inode,
diff --git a/fs/read_write.c b/fs/read_write.c
index fd0414e..0a28933 100644
index 670b365..f9f8bb1 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -504,6 +504,7 @@ vfs_readf_t vfs_readf(struct file *file)
@@ -525,6 +525,7 @@ vfs_readf_t vfs_readf(struct file *file)
return new_sync_read;
return ERR_PTR(-ENOSYS);
}
@ -208,7 +216,7 @@ index fd0414e..0a28933 100644
vfs_writef_t vfs_writef(struct file *file)
{
@@ -515,6 +516,7 @@ vfs_writef_t vfs_writef(struct file *file)
@@ -536,6 +537,7 @@ vfs_writef_t vfs_writef(struct file *file)
return new_sync_write;
return ERR_PTR(-ENOSYS);
}
@ -217,10 +225,10 @@ index fd0414e..0a28933 100644
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
{
diff --git a/fs/splice.c b/fs/splice.c
index 30a091d..b0ade1f 100644
index 178acc0..d1569fa 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1123,6 +1123,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
@@ -870,6 +870,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return splice_write(pipe, out, ppos, len, flags);
}
@ -228,7 +236,7 @@ index 30a091d..b0ade1f 100644
/*
* Attempt to initiate a splice from a file to a pipe.
@@ -1149,6 +1150,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
@@ -899,6 +900,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return splice_read(in, ppos, pipe, len, flags);
}
@ -236,32 +244,44 @@ index 30a091d..b0ade1f 100644
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/fs/sync.c b/fs/sync.c
index 7a5fa3f..c9b9d46 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -38,6 +38,7 @@ int __sync_filesystem(struct super_block *sb, int wait)
sb->s_op->sync_fs(sb, wait);
return __sync_blockdev(sb->s_bdev, wait);
}
+EXPORT_SYMBOL_GPL(__sync_filesystem);
/*
* Write out and wait upon all dirty data associated with this
diff --git a/fs/xattr.c b/fs/xattr.c
index 9b932b9..0c317c4 100644
index 7e3317c..88910fe 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
@@ -296,6 +296,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
*xattr_value = value;
return error;
}
+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
/* Compare an extended attribute value with the given value */
int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name,
ssize_t
__vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
diff --git a/kernel/task_work.c b/kernel/task_work.c
index 53fa971..bce3211 100644
index d513051..e056d54 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -118,3 +118,4 @@ void task_work_run(void)
@@ -119,3 +119,4 @@ void task_work_run(void)
} while (work);
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff --git a/security/commoncap.c b/security/commoncap.c
index 1832cf7..646e9b2 100644
index 8df676f..6b5cc07 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1053,12 +1053,14 @@ int cap_mmap_addr(unsigned long addr)
@@ -1061,12 +1061,14 @@ int cap_mmap_addr(unsigned long addr)
}
return ret;
}
@ -297,58 +317,58 @@ index 03c1652..f88c84b 100644
int devcgroup_inode_mknod(int mode, dev_t dev)
{
diff --git a/security/security.c b/security/security.c
index 46f405c..bc8514e 100644
index f825304..8dd441d 100644
--- a/security/security.c
+++ b/security/security.c
@@ -433,6 +433,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
@@ -443,6 +443,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
+EXPORT_SYMBOL_GPL(security_path_rmdir);
int security_path_unlink(struct path *dir, struct dentry *dentry)
int security_path_unlink(const struct path *dir, struct dentry *dentry)
{
@@ -449,6 +450,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
@@ -459,6 +460,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
+EXPORT_SYMBOL_GPL(security_path_symlink);
int security_path_link(struct dentry *old_dentry, struct path *new_dir,
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
struct dentry *new_dentry)
@@ -457,6 +459,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
@@ -467,6 +469,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
+EXPORT_SYMBOL_GPL(security_path_link);
int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
struct path *new_dir, struct dentry *new_dentry,
@@ -484,6 +487,7 @@ int security_path_truncate(struct path *path)
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
const struct path *new_dir, struct dentry *new_dentry,
@@ -494,6 +497,7 @@ int security_path_truncate(const struct path *path)
return 0;
return call_int_hook(path_truncate, 0, path);
}
+EXPORT_SYMBOL_GPL(security_path_truncate);
int security_path_chmod(struct path *path, umode_t mode)
int security_path_chmod(const struct path *path, umode_t mode)
{
@@ -491,6 +495,7 @@ int security_path_chmod(struct path *path, umode_t mode)
@@ -501,6 +505,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
+EXPORT_SYMBOL_GPL(security_path_chmod);
int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
{
@@ -498,6 +503,7 @@ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
@@ -508,6 +513,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
+EXPORT_SYMBOL_GPL(security_path_chown);
int security_path_chroot(struct path *path)
int security_path_chroot(const struct path *path)
{
@@ -583,6 +589,7 @@ int security_inode_readlink(struct dentry *dentry)
@@ -593,6 +599,7 @@ int security_inode_readlink(struct dentry *dentry)
return 0;
return call_int_hook(inode_readlink, 0, dentry);
}
@ -356,7 +376,7 @@ index 46f405c..bc8514e 100644
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
bool rcu)
@@ -598,6 +605,7 @@ int security_inode_permission(struct inode *inode, int mask)
@@ -608,6 +615,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
@ -364,7 +384,7 @@ index 46f405c..bc8514e 100644
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
@@ -736,6 +744,7 @@ int security_file_permission(struct file *file, int mask)
@@ -779,6 +787,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
@ -372,7 +392,7 @@ index 46f405c..bc8514e 100644
int security_file_alloc(struct file *file)
{
@@ -795,6 +804,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
@@ -838,6 +847,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
return ret;
return ima_file_mmap(file, prot);
}

View File

@ -0,0 +1,402 @@
aufs4.10 standalone patch
diff --git a/fs/dcache.c b/fs/dcache.c
index 8ca5f09..b1ff5be 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1272,6 +1272,7 @@ void d_walk(struct dentry *parent, void *data,
seq = 1;
goto again;
}
+EXPORT_SYMBOL_GPL(d_walk);
struct check_mount {
struct vfsmount *mnt;
@@ -2864,6 +2865,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
write_sequnlock(&rename_lock);
}
+EXPORT_SYMBOL_GPL(d_exchange);
/**
* d_ancestor - search for an ancestor
diff --git a/fs/exec.c b/fs/exec.c
index e579466..2566b16 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -104,6 +104,7 @@ bool path_noexec(const struct path *path)
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
}
+EXPORT_SYMBOL_GPL(path_noexec);
#ifdef CONFIG_USELIB
/*
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 9f07008..d60b682 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -82,6 +82,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
out:
return error;
}
+EXPORT_SYMBOL_GPL(setfl);
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff --git a/fs/file_table.c b/fs/file_table.c
index 6d982b5..9a3c6c8 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -147,6 +147,7 @@ struct file *get_empty_filp(void)
}
return ERR_PTR(-ENFILE);
}
+EXPORT_SYMBOL_GPL(get_empty_filp);
/**
* alloc_file - allocate and initialize a 'struct file'
@@ -258,6 +259,7 @@ void flush_delayed_fput(void)
{
delayed_fput(NULL);
}
+EXPORT_SYMBOL_GPL(flush_delayed_fput);
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
@@ -300,6 +302,7 @@ void __fput_sync(struct file *file)
}
EXPORT_SYMBOL(fput);
+EXPORT_SYMBOL_GPL(__fput_sync);
void put_filp(struct file *file)
{
@@ -308,6 +311,7 @@ void put_filp(struct file *file)
file_free(file);
}
}
+EXPORT_SYMBOL_GPL(put_filp);
void __init files_init(void)
{
diff --git a/fs/inode.c b/fs/inode.c
index 9a9ba3a..a3a18d8 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1651,6 +1651,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
return update_time(inode, time, flags);
}
+EXPORT_SYMBOL_GPL(update_time);
/**
* touch_atime - update the access time
diff --git a/fs/namespace.c b/fs/namespace.c
index 487ba30..642069d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -462,6 +462,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
+EXPORT_SYMBOL_GPL(__mnt_drop_write);
/**
* mnt_drop_write - give up write access to a mount
@@ -1872,6 +1873,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
+EXPORT_SYMBOL_GPL(iterate_mounts);
static void cleanup_group_ids(struct mount *mnt, struct mount *end)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
index fbe3cbe..bdfc61e 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -22,6 +22,7 @@
#include <linux/srcu.h>
#include <linux/rculist.h>
#include <linux/wait.h>
+#include <linux/module.h>
#include <linux/fsnotify_backend.h>
#include "fsnotify.h"
@@ -100,6 +101,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
{
atomic_inc(&group->refcnt);
}
+EXPORT_SYMBOL_GPL(fsnotify_get_group);
/*
* Drop a reference to a group. Free it if it's through.
@@ -109,6 +111,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
if (atomic_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group);
}
+EXPORT_SYMBOL_GPL(fsnotify_put_group);
/*
* Create a new fsnotify_group and hold a reference for the group returned.
@@ -137,6 +140,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
return group;
}
+EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
int fsnotify_fasync(int fd, struct file *file, int on)
{
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 6043306..fdb50e4 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
mark->free_mark(mark);
}
}
+EXPORT_SYMBOL_GPL(fsnotify_put_mark);
/* Calculate mask of events for a list of marks */
u32 fsnotify_recalc_mask(struct hlist_head *head)
@@ -230,6 +231,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
mutex_unlock(&group->mark_mutex);
fsnotify_free_mark(mark);
}
+EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
void fsnotify_destroy_marks(struct hlist_head *head, spinlock_t *lock)
{
@@ -415,6 +417,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark,
return ret;
}
+EXPORT_SYMBOL_GPL(fsnotify_add_mark);
int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
struct inode *inode, struct vfsmount *mnt, int allow_dups)
@@ -521,6 +524,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
atomic_set(&mark->refcnt, 1);
mark->free_mark = free_mark;
}
+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
/*
* Destroy all marks in destroy_list, waits for SRCU period to finish before
diff --git a/fs/open.c b/fs/open.c
index 9921f70..80d94c0 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
inode_unlock(dentry->d_inode);
return ret;
}
+EXPORT_SYMBOL_GPL(do_truncate);
long vfs_truncate(const struct path *path, loff_t length)
{
@@ -695,6 +696,7 @@ int open_check_o_direct(struct file *f)
}
return 0;
}
+EXPORT_SYMBOL_GPL(open_check_o_direct);
static int do_dentry_open(struct file *f,
struct inode *inode,
diff --git a/fs/read_write.c b/fs/read_write.c
index 670b365..f9f8bb1 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -525,6 +525,7 @@ vfs_readf_t vfs_readf(struct file *file)
return new_sync_read;
return ERR_PTR(-ENOSYS);
}
+EXPORT_SYMBOL_GPL(vfs_readf);
vfs_writef_t vfs_writef(struct file *file)
{
@@ -536,6 +537,7 @@ vfs_writef_t vfs_writef(struct file *file)
return new_sync_write;
return ERR_PTR(-ENOSYS);
}
+EXPORT_SYMBOL_GPL(vfs_writef);
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
{
diff --git a/fs/splice.c b/fs/splice.c
index 178acc0..d1569fa 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -870,6 +870,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return splice_write(pipe, out, ppos, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_from);
/*
* Attempt to initiate a splice from a file to a pipe.
@@ -899,6 +900,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return splice_read(in, ppos, pipe, len, flags);
}
+EXPORT_SYMBOL_GPL(do_splice_to);
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/fs/sync.c b/fs/sync.c
index 7a5fa3f..c9b9d46 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -38,6 +38,7 @@ int __sync_filesystem(struct super_block *sb, int wait)
sb->s_op->sync_fs(sb, wait);
return __sync_blockdev(sb->s_bdev, wait);
}
+EXPORT_SYMBOL_GPL(__sync_filesystem);
/*
* Write out and wait upon all dirty data associated with this
diff --git a/fs/xattr.c b/fs/xattr.c
index 7e3317c..88910fe 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -296,6 +296,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
*xattr_value = value;
return error;
}
+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
ssize_t
__vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
diff --git a/kernel/task_work.c b/kernel/task_work.c
index d513051..e056d54 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -119,3 +119,4 @@ void task_work_run(void)
} while (work);
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff --git a/security/commoncap.c b/security/commoncap.c
index 8df676f..6b5cc07 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1061,12 +1061,14 @@ int cap_mmap_addr(unsigned long addr)
}
return ret;
}
+EXPORT_SYMBOL_GPL(cap_mmap_addr);
int cap_mmap_file(struct file *file, unsigned long reqprot,
unsigned long prot, unsigned long flags)
{
return 0;
}
+EXPORT_SYMBOL_GPL(cap_mmap_file);
#ifdef CONFIG_SECURITY
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 03c1652..f88c84b 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -7,6 +7,7 @@
#include <linux/device_cgroup.h>
#include <linux/cgroup.h>
#include <linux/ctype.h>
+#include <linux/export.h>
#include <linux/list.h>
#include <linux/uaccess.h>
#include <linux/seq_file.h>
@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct inode *inode, int mask)
return __devcgroup_check_permission(type, imajor(inode), iminor(inode),
access);
}
+EXPORT_SYMBOL_GPL(__devcgroup_inode_permission);
int devcgroup_inode_mknod(int mode, dev_t dev)
{
diff --git a/security/security.c b/security/security.c
index f825304..8dd441d 100644
--- a/security/security.c
+++ b/security/security.c
@@ -443,6 +443,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
+EXPORT_SYMBOL_GPL(security_path_rmdir);
int security_path_unlink(const struct path *dir, struct dentry *dentry)
{
@@ -459,6 +460,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
+EXPORT_SYMBOL_GPL(security_path_symlink);
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
struct dentry *new_dentry)
@@ -467,6 +469,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
+EXPORT_SYMBOL_GPL(security_path_link);
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
const struct path *new_dir, struct dentry *new_dentry,
@@ -494,6 +497,7 @@ int security_path_truncate(const struct path *path)
return 0;
return call_int_hook(path_truncate, 0, path);
}
+EXPORT_SYMBOL_GPL(security_path_truncate);
int security_path_chmod(const struct path *path, umode_t mode)
{
@@ -501,6 +505,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
+EXPORT_SYMBOL_GPL(security_path_chmod);
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
{
@@ -508,6 +513,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
+EXPORT_SYMBOL_GPL(security_path_chown);
int security_path_chroot(const struct path *path)
{
@@ -593,6 +599,7 @@ int security_inode_readlink(struct dentry *dentry)
return 0;
return call_int_hook(inode_readlink, 0, dentry);
}
+EXPORT_SYMBOL_GPL(security_inode_readlink);
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
bool rcu)
@@ -608,6 +615,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
+EXPORT_SYMBOL_GPL(security_inode_permission);
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
@@ -779,6 +787,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
+EXPORT_SYMBOL_GPL(security_file_permission);
int security_file_alloc(struct file *file)
{
@@ -838,6 +847,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
return ret;
return ima_file_mmap(file, prot);
}
+EXPORT_SYMBOL_GPL(security_mmap_file);
int security_mmap_addr(unsigned long addr)
{

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
--- linux-3.16/include/linux/printk.h.old 2014-08-04 18:48:30.686043266 +0200
+++ linux-3.16/include/linux/printk.h 2014-08-04 18:48:47.706218528 +0200
@@ -37,7 +37,7 @@
#define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */
-#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
+#define CONSOLE_LOGLEVEL_DEFAULT 4 /* anything MORE serious than KERN_DEBUG */
#define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
#define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
CONFIG_AUFS_FS=m
CONFIG_AUFS_BRANCH_MAX_127=y
# CONFIG_AUFS_BRANCH_MAX_511 is not set
# CONFIG_AUFS_BRANCH_MAX_1023 is not set
# CONFIG_AUFS_BRANCH_MAX_32767 is not set
CONFIG_AUFS_SBILIST=y
CONFIG_AUFS_HNOTIFY=y
CONFIG_AUFS_HFSNOTIFY=y
CONFIG_AUFS_EXPORT=y
CONFIG_AUFS_INO_T_64=y
# CONFIG_AUFS_FHSM is not set
# CONFIG_AUFS_XATTR is not set
CONFIG_AUFS_RDU=y
CONFIG_AUFS_SHWH=y
CONFIG_AUFS_BR_RAMFS=y
CONFIG_AUFS_BR_FUSE=y
CONFIG_AUFS_POLL=y
CONFIG_AUFS_BR_HFSPLUS=y
CONFIG_AUFS_BDEV_LOOP=y
# CONFIG_AUFS_DEBUG is not set

View File

@ -0,0 +1,36 @@
#!/bin/bash
rm -Rf aufs4-standalone
# clone the aufs repository to the local disk
git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone
cd aufs4-standalone
git branch -r
git checkout origin/aufs4.10
# modify what you want
# and after
# create the patch with the directories: fs, include and Documentation
rm -v $(find . -type f -name '*.orig')
grep -qse 'EXPORT_SYMBOL(' aufs4-standalone.patch && \
sed -i-old -e 's|EXPORT_SYMBOL(|EXPORT_SYMBOL_GPL(|' aufs4-standalone.patch
rm -rf ../tmp/linux-4.10
mkdir -p ../tmp/linux-4.10
cp -a fs ../tmp/linux-4.10
cp -a include ../tmp/linux-4.10
cp -a Documentation ../tmp/linux-4.10
rm ../tmp/linux-4.10/include/uapi/linux/Kbuild
cd ../tmp
diff -Naur null linux-4.10 | filterdiff | \
sed -e 's|null\(/include/uapi/linux/Kbuild\)|linux-4.10-old\1|;s|^--- null.*|--- /dev/null|;\|linux-4.10/include/uapi/linux/Kbuild|,${\|@@ -0,0 +1 @@|,$d}' \
| bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-4.10/include/uapi/linux/aufs_type.h).patch.bz2
mv *.bz2 $OLDPWD
cd $OLDPWD
mv *patch* ..
cd ..
rm -rf tmp aufs4-standalone
# the patch is created in ../tmp
# the other patches needed to compile are in the base directory

View File

@ -0,0 +1,113 @@
commit 5a420e61e39862c7c3356080eddb23dfe4ccadb7
Author: Tom Gundersen <teg@jklm.no>
Date: Sun Jan 26 17:00:32 2014 +0100
Input: i8042 - fix PNP modaliases when both aux and kdb are enabled
Commit 78551277e4 exposed the PNP modaliases for the i8042 module. However,
when both the aux and the kbd drivers are enabled the aux entries would
override the kdb ones.
Refactor the device_id lists, and unconditionally attempt to load the driver
if either a kdb or aux devices is present.
Signed-off-by: Tom Gundersen <teg@jklm.no>
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 0ec9abb..dbc6958 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -747,25 +747,27 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
return 0;
}
-static struct pnp_device_id pnp_kbd_devids[] = {
- { .id = "PNP0300", .driver_data = 0 },
- { .id = "PNP0301", .driver_data = 0 },
- { .id = "PNP0302", .driver_data = 0 },
- { .id = "PNP0303", .driver_data = 0 },
- { .id = "PNP0304", .driver_data = 0 },
- { .id = "PNP0305", .driver_data = 0 },
- { .id = "PNP0306", .driver_data = 0 },
- { .id = "PNP0309", .driver_data = 0 },
- { .id = "PNP030a", .driver_data = 0 },
- { .id = "PNP030b", .driver_data = 0 },
- { .id = "PNP0320", .driver_data = 0 },
- { .id = "PNP0343", .driver_data = 0 },
- { .id = "PNP0344", .driver_data = 0 },
- { .id = "PNP0345", .driver_data = 0 },
+#define KBD_DEVIDS \
+ { .id = "PNP0300", .driver_data = 0 }, \
+ { .id = "PNP0301", .driver_data = 0 }, \
+ { .id = "PNP0302", .driver_data = 0 }, \
+ { .id = "PNP0303", .driver_data = 0 }, \
+ { .id = "PNP0304", .driver_data = 0 }, \
+ { .id = "PNP0305", .driver_data = 0 }, \
+ { .id = "PNP0306", .driver_data = 0 }, \
+ { .id = "PNP0309", .driver_data = 0 }, \
+ { .id = "PNP030a", .driver_data = 0 }, \
+ { .id = "PNP030b", .driver_data = 0 }, \
+ { .id = "PNP0320", .driver_data = 0 }, \
+ { .id = "PNP0343", .driver_data = 0 }, \
+ { .id = "PNP0344", .driver_data = 0 }, \
+ { .id = "PNP0345", .driver_data = 0 }, \
{ .id = "CPQA0D7", .driver_data = 0 },
+
+static struct pnp_device_id pnp_kbd_devids[] = {
+ KBD_DEVIDS
{ .id = "", },
};
-MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
static struct pnp_driver i8042_pnp_kbd_driver = {
.name = "i8042 kbd",
@@ -773,21 +775,23 @@ static struct pnp_driver i8042_pnp_kbd_driver = {
.probe = i8042_pnp_kbd_probe,
};
-static struct pnp_device_id pnp_aux_devids[] = {
- { .id = "AUI0200", .driver_data = 0 },
- { .id = "FJC6000", .driver_data = 0 },
- { .id = "FJC6001", .driver_data = 0 },
- { .id = "PNP0f03", .driver_data = 0 },
- { .id = "PNP0f0b", .driver_data = 0 },
- { .id = "PNP0f0e", .driver_data = 0 },
- { .id = "PNP0f12", .driver_data = 0 },
- { .id = "PNP0f13", .driver_data = 0 },
- { .id = "PNP0f19", .driver_data = 0 },
- { .id = "PNP0f1c", .driver_data = 0 },
+#define AUX_DEVIDS \
+ { .id = "AUI0200", .driver_data = 0 }, \
+ { .id = "FJC6000", .driver_data = 0 }, \
+ { .id = "FJC6001", .driver_data = 0 }, \
+ { .id = "PNP0f03", .driver_data = 0 }, \
+ { .id = "PNP0f0b", .driver_data = 0 }, \
+ { .id = "PNP0f0e", .driver_data = 0 }, \
+ { .id = "PNP0f12", .driver_data = 0 }, \
+ { .id = "PNP0f13", .driver_data = 0 }, \
+ { .id = "PNP0f19", .driver_data = 0 }, \
+ { .id = "PNP0f1c", .driver_data = 0 }, \
{ .id = "SYN0801", .driver_data = 0 },
+
+static struct pnp_device_id pnp_aux_devids[] = {
+ AUX_DEVIDS
{ .id = "", },
};
-MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
static struct pnp_driver i8042_pnp_aux_driver = {
.name = "i8042 aux",
@@ -795,6 +799,13 @@ static struct pnp_driver i8042_pnp_aux_driver = {
.probe = i8042_pnp_aux_probe,
};
+static struct pnp_device_id pnp_kdb_aux_devids[] = {
+ KBD_DEVIDS
+ AUX_DEVIDS
+ { .id = "", },
+};
+MODULE_DEVICE_TABLE(pnp, pnp_kdb_aux_devids);
+
static void i8042_pnp_exit(void)
{
if (i8042_pnp_kbd_registered) {

View File

@ -1,19 +1,19 @@
aufs4.4 lockdep patch
aufs4.10 lockdep patch
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index c57e424..4153563 100644
index 1e327bb..0345cbf 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -29,7 +29,7 @@ extern int lock_stat;
*/
#define XXX_LOCK_USAGE_STATES (1+3*4)
@@ -16,7 +16,7 @@ struct lockdep_map;
extern int prove_locking;
extern int lock_stat;
-#define MAX_LOCKDEP_SUBCLASSES 8UL
+#define MAX_LOCKDEP_SUBCLASSES (8UL + 4)
/*
* NR_LOCKDEP_CACHING_CLASSES ... Number of classes
@@ -203,7 +203,7 @@ struct lock_chain {
#ifdef CONFIG_LOCKDEP
@@ -205,7 +205,7 @@ struct lock_chain {
u64 chain_key;
};
@ -23,27 +23,25 @@ index c57e424..4153563 100644
* Subtract one because we offset hlock->class_idx by 1 in order
* to make 0 mean no class. This avoids overflowing the class_idx
diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h
index 51c4b24..fba7557 100644
index c2b8849..9c8f717 100644
--- a/kernel/locking/lockdep_internals.h
+++ b/kernel/locking/lockdep_internals.h
@@ -54,9 +54,9 @@ enum {
* table (if it's not there yet), and we check it for lock order
* conflicts and deadlocks.
*/
@@ -66,15 +66,15 @@ enum {
#define MAX_LOCKDEP_CHAINS_BITS 15
#define MAX_STACK_TRACE_ENTRIES 262144UL
#else
-#define MAX_LOCKDEP_ENTRIES 32768UL
+#define MAX_LOCKDEP_ENTRIES (32768UL << 5)
-#define MAX_LOCKDEP_CHAINS_BITS 16
+#define MAX_LOCKDEP_CHAINS_BITS (16 + 5)
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
@@ -65,7 +65,7 @@ enum {
/*
* Stack-trace: tightly packed array of stack backtrace
* addresses. Protected by the hash_lock.
*/
-#define MAX_STACK_TRACE_ENTRIES 524288UL
+#define MAX_STACK_TRACE_ENTRIES (524288UL << 5)
#endif
extern struct list_head all_lock_classes;
extern struct lock_chain lock_chains[];
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)

View File

@ -3,248 +3,222 @@
# Packagers: milisarge
name=kernel-lts
version=4.4.27
_srcname=linux-4.4
release=3
_kernelname=${name#linux}
_basekernel=4.10
version=4.10.9
release=1
_version=${version:0:3}
alias=(linux-lts)
# Virtualbox
vb_version=5.1.8
[ "`uname -m`" == "i686" ] && _VBARCH=x86
[ "`uname -m`" == "x86_64" ] && _VBARCH=amd64
# Broadcom
wl_version=6.30.223.271
_wlarch=_64
source=(\
http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_version}.tar.xz
https://www.kernel.org/pub/linux/kernel/v4.x/patch-$version.xz
https://sourceforge.net/projects/kaosx/files/sources/virtualbox-modules/vbox-kernel-module-src-${vb_version}.tar.xz
http://www.broadcom.com/docs/linux_sta/hybrid-v35${_wlarch}-nodebug-pcoem-${wl_version//./_}.tar.gz
broadcom-wl.modprobe.d broadcom-wl.license.patch wl_linux.c.patch
aufs4-loopback.patch
aufs4-base.patch
aufs4-mmap.patch
aufs4-standalone.patch
aufs4-kbuild.patch
aufs4.4-20160912.patch
lockdep-debug.patch
tmpfs-idr.patch
vfs-ino.patch
aufs_type.h
$name.config_64
virtualbox.conf
virtualbox-modules-depmod.patch
https://github.com/milisarge/aufs/archive/master.tar.gz)
build(){
cd linux-${_version}
cp -r $SRC/aufs-master $SRC/fs/
if [ -f $SRC/patch-$version.xz ]; then
xz -d -c $SRC/patch-$version.xz | patch -Np1
fi
#aufs patches for Live:
patch -p1 -i "${SRC}/aufs4.4-20160912.patch"
patch -p1 -i "${SRC}/aufs4-base.patch"
patch -p1 -i "${SRC}/aufs4-kbuild.patch"
patch -p1 -i "${SRC}/aufs4-loopback.patch"
patch -p1 -i "${SRC}/aufs4-mmap.patch"
patch -p1 -i "${SRC}/aufs4-standalone.patch"
patch -p1 -i "${SRC}/lockdep-debug.patch"
patch -p1 -i "${SRC}/tmpfs-idr.patch"
patch -p1 -i "${SRC}/vfs-ino.patch"
make mrproper
cp $SRC/kernel-lts.config_64 ./.config
make
cp .config $SRC/$name.config_64
## Modules
#
# Kernel modules
cd $SRC/linux-${_version}
make INSTALL_MOD_PATH=$PKG modules_install
KERNEL_VERSION="${version}-milis-lts"
# Module broadcom is broken on 32 bits machine
if [ "$PKGMK_ARCH" == "x86_64" ]; then
cd $SRC
bsdtar xf $DERLEME_KAYNAKDIZIN/hybrid-v35${_wlarch}-nodebug-pcoem-${wl_version//./_}.tar.gz
patch -p1 -i broadcom-wl.license.patch
patch -p1 -i wl_linux.c.patch
sed -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" \
-i src/wl/sys/wl_linux.c
BUILD_NOPEDANTIC=1 make -C $SRC/linux-${_version} M=`pwd`
install -m 0644 -D wl.ko $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/wl.ko
install -Dm644 broadcom-wl.modprobe.d $PKG/etc/modprobe.d/broadcom-wl.conf
fi
for i in *.ko
do
install -D -m0644 $i $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/$i
done
# Module virtualbox
cd vbox-kernel-module-src-5.1.8
patch -p0 -i $SRC/virtualbox-modules-depmod.patch
KERNELRELEASE=${version}
KERN_DIR=$SRC/linux-${_version} make
mkdir -p $PKG/etc/sysconfig/modules.d
install -D -m644 $SRC/virtualbox.conf $PKG/etc/sysconfig/modules.d/virtualbox.conf
for i in *.ko
do
install -D -m0644 $i $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/$i
done
# depmod needed
depmod -b $PKG -a ${KERNEL_VERSION}
install -D -m 644 $SRC/aufs_type.h "${PKG}/usr/include/linux/aufs_type.h"
# Install config and kernel files
cd $SRC/linux-${_version}
mkdir -p $PKG/boot
cp System.map $PKG/boot/System_64.map-$version
cp .config $PKG/boot/config_64-$version
cp arch/x86_64/boot/bzImage $PKG/boot/kernel-$version
#kaynak basliklarin ayarlanmasi
KARCH=x86
cd "${SRC}/${_srcname}"
install -D -m644 Makefile \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Makefile"
install -D -m644 kernel/Makefile \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/kernel/Makefile"
install -D -m644 .config \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/.config"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include"
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
media net pcmcia scsi soc sound trace uapi video xen; do
cp -a include/${i} "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/"
done
# copy arch includes for external modules
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/x86"
cp -a arch/x86/include "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
cp -a scripts "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
# fix permissions on scripts dir
chmod og-w -R "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/scripts"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/.tmp_versions"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/"
cp arch/${KARCH}/kernel/asm-offsets.s "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/kernel/"
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/md"
cp drivers/md/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/md"
# add inotify.h
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/linux"
cp include/linux/inotify.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/linux/"
# add wireless headers
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/net/mac80211/"
cp net/mac80211/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-core"
cp drivers/media/dvb-core/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/config/dvb/"
cp include/config/dvb/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
cp drivers/media/dvb-frontends/lgdt330x.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/i2c/"
cp drivers/media/i2c/msp3400-driver.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/i2c/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/usb/dvb-usb"
cp drivers/media/usb/dvb-usb/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/usb/dvb-usb/"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends"
cp drivers/media/dvb-frontends/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/tuners"
cp drivers/media/tuners/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/fs/xfs"
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/mm"
# removed in 3.17 series
# cp fs/xfs/xfs_sb.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in $(find . -name "Kconfig*"); do
mkdir -p "${PKG}"/usr/lib/modules/${KERNEL_VERSION}/build/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/${i}"
done
# add objtool for external module building and enabled VALIDATION_STACK option
if [ -f tools/objtool/objtool ]; then
mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/tools/objtool"
cp -a tools/objtool/objtool ${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/tools/objtool/
fi
chown -R root.root "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
find "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${PKG}"/usr/lib/modules/${KERNEL_VERSION}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
# remove a files already in linux-docs package
rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.recursion-issue-01"
rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.recursion-issue-02"
rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.select-break"
source=(http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.10.tar.xz
http://www.kernel.org/pub/linux/kernel/v4.x/patch-${version}.xz
config
aufs patches
aufs4-loopback.patch
aufs4-base.patch
aufs4-mmap.patch
aufs4-standalone.patch
aufs4-kbuild.patch
aufs4.patch
config.aufs
lockdep-debug.patch
tmpfs-idr.patch
vfs-ino.patch
change-default-console-loglevel.patch
i8042-fix-aliases.patch)
build() {
cd "${SRC}/linux-${_basekernel}"
# Firmware are in linux-firmware
rm -rf $PKG/lib/firmware
# güncel kernel yama
patch -p1 -i "${SRC}/patch-${version}"
patch -p1 -i "${SRC}/i8042-fix-aliases.patch"
#çalışan sistem aufs yamaları
patch -p1 -i "${SRC}/aufs4.patch"
patch -p1 -i "${SRC}/aufs4-base.patch"
patch -p1 -i "${SRC}/aufs4-kbuild.patch"
patch -p1 -i "${SRC}/aufs4-loopback.patch"
patch -p1 -i "${SRC}/aufs4-mmap.patch"
patch -p1 -i "${SRC}/aufs4-standalone.patch"
patch -p1 -i "${SRC}/lockdep-debug.patch"
patch -p1 -i "${SRC}/tmpfs-idr.patch"
patch -p1 -i "${SRC}/vfs-ino.patch"
cat "${SRC}/config" > ./.config
cat "${SRC}/config.aufs" >> ./.config
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# set extraversion to release
sed -ri "s|^(EXTRAVERSION =).*|\1 -${release}|" Makefile
cd "${SRC}/linux-${_basekernel}"
export KBUILD_BUILD_USER="milisarge"
export KBUILD_BUILD_HOST="`uname -m`.milislinux.org"
# get kernel version
make prepare
# rewrite configuration
yes "" | make config >/dev/null
# build!
make ${MAKEFLAGS} bzImage modules
KARCH=x86
# get kernel version
_kernver="$(make kernelrelease)"
mkdir -p "${PKG}"/{lib/modules,lib/firmware,boot}
make INSTALL_MOD_PATH="${PKG}" modules_install
cp arch/$KARCH/boot/bzImage "${PKG}/boot/vmlinuz-${name}"
# add vmlinux
install -D -m644 vmlinux "${PKG}/usr/src/linux-${_kernver}/vmlinux"
# remove build and source links
rm -f "${PKG}"/lib/modules/${_kernver}/{source,build}
# remove the firmware
rm -rf "${PKG}/lib/firmware"
# gzip -9 all modules to save 100MB of space
find "${PKG}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname:-}" "${PKG}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
mkdir -p "${PKG}/lib/modules/extramodules-${_basekernel}${_kernelname:-}"
echo "${_kernver}" > "${PKG}/lib/modules/extramodules-${_basekernel}${_kernelname:-}/version"
#linux-headers
install -dm755 "${PKG}/lib/modules/${_kernver}"
cd "${PKG}/lib/modules/${_kernver}"
ln -sf ../../../usr/src/linux-${_kernver} build
cd "${SRC}/linux-${_basekernel}"
install -D -m644 Makefile \
"${PKG}/usr/src/linux-${_kernver}/Makefile"
install -D -m644 kernel/Makefile \
"${PKG}/usr/src/linux-${_kernver}/kernel/Makefile"
install -D -m644 .config \
"${PKG}/usr/src/linux-${_kernver}/.config"
mkdir -p "${PKG}/usr/src/linux-${_kernver}/include"
for i in acpi asm-generic config crypto drm generated linux math-emu \
media net pcmcia scsi sound trace uapi video xen; do
cp -a include/${i} "${PKG}/usr/src/linux-${_kernver}/include/"
done
# copy arch includes for external modules
mkdir -p "${PKG}/usr/src/linux-${_kernver}/arch/x86"
cp -a arch/x86/include "${PKG}/usr/src/linux-${_kernver}/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${PKG}/usr/src/linux-${_kernver}"
cp -a scripts "${PKG}/usr/src/linux-${_kernver}"
# fix permissions on scripts dir
chmod og-w -R "${PKG}/usr/src/linux-${_kernver}/scripts"
mkdir -p "${PKG}/usr/src/linux-${_kernver}/.tmp_versions"
mkdir -p "${PKG}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${PKG}/usr/src/linux-${_kernver}/arch/${KARCH}/"
cp arch/${KARCH}/kernel/asm-offsets.s "${PKG}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
# add headers for lirc package
# pci
for i in bt8xx cx88 saa7134; do
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/pci/${i}"
cp -a drivers/media/pci/${i}/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/pci/${i}"
done
# usb
for i in cpia2 em28xx pwc; do
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/${i}"
cp -a drivers/media/usb/${i}/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/${i}"
done
# i2c
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c"
cp drivers/media/i2c/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/"
for i in cx25840; do
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/${i}"
cp -a drivers/media/i2c/${i}/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/${i}"
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${PKG}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/md"
cp drivers/md/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/md"
# add inotify.h
mkdir -p "${PKG}/usr/src/linux-${_kernver}/include/linux"
cp include/linux/inotify.h "${PKG}/usr/src/linux-${_kernver}/include/linux/"
# add wireless headers
mkdir -p "${PKG}/usr/src/linux-${_kernver}/net/mac80211/"
cp net/mac80211/*.h "${PKG}/usr/src/linux-${_kernver}/net/mac80211/"
# add dvb headers for external modules
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-core"
cp drivers/media/dvb-core/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-core/"
# and...
mkdir -p "${PKG}/usr/src/linux-${_kernver}/include/config/dvb/"
cp include/config/dvb/*.h "${PKG}/usr/src/linux-${_kernver}/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
cp drivers/media/dvb-frontends/lgdt330x.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
cp drivers/media/i2c/msp3400-driver.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/"
# add dvb headers
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb"
cp drivers/media/usb/dvb-usb/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb/"
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends"
cp drivers/media/dvb-frontends/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/tuners"
cp drivers/media/tuners/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${PKG}/usr/src/linux-${_kernver}/fs/xfs/libxfs"
mkdir -p "${PKG}/usr/src/linux-${_kernver}/mm"
cp fs/xfs/libxfs/xfs_sb.h "${PKG}/usr/src/linux-${_kernver}/fs/xfs/libxfs/xfs_sb.h"
#aufs4-util need
sed -i "s:__user::g" "${PKG}/usr/src/linux-${_kernver}/include/uapi/linux/aufs_type.h"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "${PKG}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${PKG}/usr/src/linux-${_kernver}/${i}"
done
chown -R root.root "${PKG}/usr/src/linux-${_kernver}"
find "${PKG}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${PKG}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
rm -rf "${PKG}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
}

View File

@ -1,8 +1,8 @@
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 50777b5..f9c6b3d 100644
index ff078e7..1edb519 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -26,10 +26,13 @@ struct shmem_inode_info {
@@ -24,10 +24,13 @@ struct shmem_inode_info {
};
struct shmem_sb_info {
@ -16,13 +16,13 @@ index 50777b5..f9c6b3d 100644
+ int max_inodes; /* How many inodes are allowed */
+ int free_inodes; /* How many are left for allocation */
spinlock_t stat_lock; /* Serialize shmem_sb_info changes */
kuid_t uid; /* Mount uid for root directory */
kgid_t gid; /* Mount gid for root directory */
umode_t mode; /* Mount mode for root directory */
unsigned char huge; /* Whether to try for hugepages */
diff --git a/mm/shmem.c b/mm/shmem.c
index 2afcdbb..4d81c75 100644
index 3a7587a..ee08dfd 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -112,9 +112,13 @@ static unsigned long shmem_default_max_blocks(void)
@@ -104,9 +104,13 @@ static unsigned long shmem_default_max_blocks(void)
return totalram_pages / 2;
}
@ -38,15 +38,7 @@ index 2afcdbb..4d81c75 100644
}
#endif
@@ -610,6 +614,7 @@ static int shmem_setattr(struct dentry *dentry, struct iattr *attr)
static void shmem_evict_inode(struct inode *inode)
{
struct shmem_inode_info *info = SHMEM_I(inode);
+ struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
if (inode->i_mapping->a_ops == &shmem_aops) {
shmem_unacct_size(info->flags, inode->i_size);
@@ -625,6 +630,11 @@ static void shmem_evict_inode(struct inode *inode)
@@ -1052,6 +1056,11 @@ static void shmem_evict_inode(struct inode *inode)
simple_xattrs_free(&info->xattrs);
WARN_ON(inode->i_blocks);
@ -58,7 +50,7 @@ index 2afcdbb..4d81c75 100644
shmem_free_inode(inode->i_sb);
clear_inode(inode);
}
@@ -1418,13 +1428,13 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
@@ -2120,13 +2129,13 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
struct inode *inode;
struct shmem_inode_info *info;
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
@ -72,8 +64,8 @@ index 2afcdbb..4d81c75 100644
- inode->i_ino = get_next_ino();
inode_init_owner(inode, dir, mode);
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -1465,6 +1475,25 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
@@ -2168,6 +2177,25 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
mpol_shared_policy_init(&info->policy, NULL);
break;
}
@ -99,7 +91,7 @@ index 2afcdbb..4d81c75 100644
} else
shmem_free_inode(sb);
return inode;
@@ -2682,8 +2711,7 @@ static struct dentry *shmem_get_parent(struct dentry *child)
@@ -3240,8 +3268,7 @@ static struct dentry *shmem_get_parent(struct dentry *child)
static int shmem_match(struct inode *ino, void *vfh)
{
__u32 *fh = vfh;
@ -109,7 +101,7 @@ index 2afcdbb..4d81c75 100644
return ino->i_ino == inum && fh[0] == ino->i_generation;
}
@@ -2694,14 +2722,11 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
@@ -3252,14 +3279,11 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
struct dentry *dentry = NULL;
u64 inum;
@ -127,7 +119,7 @@ index 2afcdbb..4d81c75 100644
if (inode) {
dentry = d_find_alias(inode);
iput(inode);
@@ -2713,30 +2738,15 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
@@ -3271,30 +3295,15 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
static int shmem_encode_fh(struct inode *inode, __u32 *fh, int *len,
struct inode *parent)
{
@ -161,7 +153,7 @@ index 2afcdbb..4d81c75 100644
return 1;
}
@@ -2801,7 +2811,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,
@@ -3358,7 +3367,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,
goto bad_val;
} else if (!strcmp(this_char,"nr_inodes")) {
sbinfo->max_inodes = memparse(value, &rest);
@ -170,7 +162,7 @@ index 2afcdbb..4d81c75 100644
goto bad_val;
} else if (!strcmp(this_char,"mode")) {
if (remount)
@@ -2854,7 +2864,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
@@ -3423,7 +3432,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
struct shmem_sb_info config = *sbinfo;
@ -179,16 +171,16 @@ index 2afcdbb..4d81c75 100644
int error = -EINVAL;
config.mpol = NULL;
@@ -2902,7 +2912,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
@@ -3472,7 +3481,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
seq_printf(seq, ",size=%luk",
sbinfo->max_blocks << (PAGE_CACHE_SHIFT - 10));
sbinfo->max_blocks << (PAGE_SHIFT - 10));
if (sbinfo->max_inodes != shmem_default_max_inodes())
- seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes);
+ seq_printf(seq, ",nr_inodes=%d", sbinfo->max_inodes);
if (sbinfo->mode != (S_IRWXUGO | S_ISVTX))
seq_printf(seq, ",mode=%03ho", sbinfo->mode);
if (!uid_eq(sbinfo->uid, GLOBAL_ROOT_UID))
@@ -2991,6 +3001,8 @@ static void shmem_put_super(struct super_block *sb)
@@ -3566,6 +3575,8 @@ static void shmem_put_super(struct super_block *sb)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
@ -197,7 +189,7 @@ index 2afcdbb..4d81c75 100644
percpu_counter_destroy(&sbinfo->used_blocks);
mpol_put(sbinfo->mpol);
kfree(sbinfo);
@@ -3009,6 +3021,8 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
@@ -3584,6 +3595,8 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
if (!sbinfo)
return -ENOMEM;
@ -206,7 +198,7 @@ index 2afcdbb..4d81c75 100644
sbinfo->mode = S_IRWXUGO | S_ISVTX;
sbinfo->uid = current_fsuid();
sbinfo->gid = current_fsgid();
@@ -3112,6 +3126,15 @@ static void shmem_destroy_inodecache(void)
@@ -3691,6 +3704,15 @@ static void shmem_destroy_inodecache(void)
kmem_cache_destroy(shmem_inode_cachep);
}
@ -222,11 +214,11 @@ index 2afcdbb..4d81c75 100644
static const struct address_space_operations shmem_aops = {
.writepage = shmem_writepage,
.set_page_dirty = __set_page_dirty_no_writeback,
@@ -3248,6 +3271,7 @@ int __init shmem_init(void)
printk(KERN_ERR "Could not kern_mount tmpfs\n");
@@ -3823,6 +3845,7 @@ int __init shmem_init(void)
pr_err("Could not kern_mount tmpfs\n");
goto out1;
}
+ shmem_no_idr(shm_mnt->mnt_sb);
return 0;
out1:
#ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
if (has_transparent_hugepage() && shmem_huge < SHMEM_HUGE_DENY)

View File

@ -1,8 +1,8 @@
diff --git a/fs/inode.c b/fs/inode.c
index 1be5f90..b6678aa 100644
index 88110fd..64a2f22 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -844,6 +844,8 @@ unsigned int get_next_ino(void)
@@ -855,6 +855,8 @@ unsigned int get_next_ino(void)
unsigned int *p = &get_cpu_var(last_ino);
unsigned int res = *p;
@ -11,7 +11,7 @@ index 1be5f90..b6678aa 100644
#ifdef CONFIG_SMP
if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
static atomic_t shared_last_ino;
@@ -856,7 +858,7 @@ unsigned int get_next_ino(void)
@@ -867,7 +869,7 @@ unsigned int get_next_ino(void)
res++;
/* get_next_ino should not provide a 0 inode number */
if (unlikely(!res))