Line
Link Here
|
0 |
-- a/MAINTAINERS |
0 |
++ b/MAINTAINERS |
Lines 1880-1885
F: include/linux/audit.h
Link Here
|
1880 |
F: include/uapi/linux/audit.h |
1880 |
F: include/uapi/linux/audit.h |
1881 |
F: kernel/audit* |
1881 |
F: kernel/audit* |
1882 |
|
1882 |
|
|
|
1883 |
AUFS (advanced multi layered unification filesystem) FILESYSTEM |
1884 |
M: "J. R. Okajima" <hooanon05g@gmail.com> |
1885 |
L: linux-unionfs@vger.kernel.org |
1886 |
L: aufs-users@lists.sourceforge.net (members only) |
1887 |
W: http://aufs.sourceforge.net |
1888 |
T: git://github.com/sfjro/aufs4-linux.git |
1889 |
S: Supported |
1890 |
F: Documentation/filesystems/aufs/ |
1891 |
F: Documentation/ABI/testing/debugfs-aufs |
1892 |
F: Documentation/ABI/testing/sysfs-aufs |
1893 |
F: fs/aufs/ |
1894 |
F: include/uapi/linux/aufs_type.h |
1895 |
|
1883 |
AUXILIARY DISPLAY DRIVERS |
1896 |
AUXILIARY DISPLAY DRIVERS |
1884 |
M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
1897 |
M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
1885 |
W: http://miguelojeda.es/auxdisplay.htm |
1898 |
W: http://miguelojeda.es/auxdisplay.htm |
1886 |
-- a/drivers/block/loop.c |
1899 |
++ b/drivers/block/loop.c |
Lines 540-545
static inline int is_loop_device(struct file *file)
Link Here
|
540 |
return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; |
540 |
return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; |
541 |
} |
541 |
} |
542 |
|
542 |
|
|
|
543 |
/* |
544 |
* for AUFS |
545 |
* no get/put for file. |
546 |
*/ |
547 |
struct file *loop_backing_file(struct super_block *sb) |
548 |
{ |
549 |
struct file *ret; |
550 |
struct loop_device *l; |
551 |
|
552 |
ret = NULL; |
553 |
if (MAJOR(sb->s_dev) == LOOP_MAJOR) { |
554 |
l = sb->s_bdev->bd_disk->private_data; |
555 |
ret = l->lo_backing_file; |
556 |
} |
557 |
return ret; |
558 |
} |
559 |
EXPORT_SYMBOL(loop_backing_file); |
560 |
|
543 |
/* loop sysfs attributes */ |
561 |
/* loop sysfs attributes */ |
544 |
|
562 |
|
545 |
static ssize_t loop_attr_show(struct device *dev, char *page, |
563 |
static ssize_t loop_attr_show(struct device *dev, char *page, |
546 |
-- b/fs/dcache.c |
564 |
++ b/fs/dcache.c |
Lines 1164-1170
Link Here
|
1164 |
* |
1164 |
* |
1165 |
* The @enter() and @finish() callbacks are called with d_lock held. |
1165 |
* The @enter() and @finish() callbacks are called with d_lock held. |
1166 |
*/ |
1166 |
*/ |
1167 |
static void d_walk(struct dentry *parent, void *data, |
1167 |
void d_walk(struct dentry *parent, void *data, |
1168 |
enum d_walk_ret (*enter)(void *, struct dentry *), |
1168 |
enum d_walk_ret (*enter)(void *, struct dentry *), |
1169 |
void (*finish)(void *)) |
1169 |
void (*finish)(void *)) |
1170 |
{ |
1170 |
{ |
Lines 1269-1274
Link Here
|
1269 |
seq = 1; |
1269 |
seq = 1; |
1270 |
goto again; |
1270 |
goto again; |
1271 |
} |
1271 |
} |
|
|
1272 |
EXPORT_SYMBOL(d_walk); |
1272 |
|
1273 |
|
1273 |
/* |
1274 |
/* |
1274 |
* Search for at least 1 mount point in the dentry's subdirs. |
1275 |
* Search for at least 1 mount point in the dentry's subdirs. |
1275 |
-- b/fs/read_write.c |
1276 |
++ b/fs/read_write.c |
Lines 494-499
Link Here
|
494 |
} |
494 |
} |
495 |
EXPORT_SYMBOL(__vfs_write); |
495 |
EXPORT_SYMBOL(__vfs_write); |
496 |
|
496 |
|
|
|
497 |
vfs_readf_t vfs_readf(struct file *file) |
498 |
{ |
499 |
const struct file_operations *fop = file->f_op; |
500 |
|
501 |
if (fop->read) |
502 |
return fop->read; |
503 |
if (fop->read_iter) |
504 |
return new_sync_read; |
505 |
return ERR_PTR(-ENOSYS); |
506 |
} |
507 |
EXPORT_SYMBOL(vfs_readf); |
508 |
|
509 |
vfs_writef_t vfs_writef(struct file *file) |
510 |
{ |
511 |
const struct file_operations *fop = file->f_op; |
512 |
|
513 |
if (fop->write) |
514 |
return fop->write; |
515 |
if (fop->write_iter) |
516 |
return new_sync_write; |
517 |
return ERR_PTR(-ENOSYS); |
518 |
} |
519 |
EXPORT_SYMBOL(vfs_writef); |
520 |
|
497 |
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) |
521 |
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) |
498 |
{ |
522 |
{ |
499 |
mm_segment_t old_fs; |
523 |
mm_segment_t old_fs; |
500 |
-- b/fs/splice.c |
524 |
++ b/fs/splice.c |
Lines 1101-1108
Link Here
|
1101 |
/* |
1101 |
/* |
1102 |
* Attempt to initiate a splice from pipe to file. |
1102 |
* Attempt to initiate a splice from pipe to file. |
1103 |
*/ |
1103 |
*/ |
1104 |
static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, |
1104 |
long do_splice_from(struct pipe_inode_info *pipe, struct file *out, |
1105 |
loff_t *ppos, size_t len, unsigned int flags) |
1105 |
loff_t *ppos, size_t len, unsigned int flags) |
1106 |
{ |
1106 |
{ |
1107 |
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, |
1107 |
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, |
1108 |
loff_t *, size_t, unsigned int); |
1108 |
loff_t *, size_t, unsigned int); |
Lines 1114-1126
Link Here
|
1114 |
|
1114 |
|
1115 |
return splice_write(pipe, out, ppos, len, flags); |
1115 |
return splice_write(pipe, out, ppos, len, flags); |
1116 |
} |
1116 |
} |
|
|
1117 |
EXPORT_SYMBOL(do_splice_from); |
1117 |
|
1118 |
|
1118 |
/* |
1119 |
/* |
1119 |
* Attempt to initiate a splice from a file to a pipe. |
1120 |
* Attempt to initiate a splice from a file to a pipe. |
1120 |
*/ |
1121 |
*/ |
1121 |
static long do_splice_to(struct file *in, loff_t *ppos, |
1122 |
long do_splice_to(struct file *in, loff_t *ppos, |
1122 |
struct pipe_inode_info *pipe, size_t len, |
1123 |
struct pipe_inode_info *pipe, size_t len, |
1123 |
unsigned int flags) |
1124 |
unsigned int flags) |
1124 |
{ |
1125 |
{ |
1125 |
ssize_t (*splice_read)(struct file *, loff_t *, |
1126 |
ssize_t (*splice_read)(struct file *, loff_t *, |
1126 |
struct pipe_inode_info *, size_t, unsigned int); |
1127 |
struct pipe_inode_info *, size_t, unsigned int); |
Lines 1140-1145
Link Here
|
1140 |
|
1141 |
|
1141 |
return splice_read(in, ppos, pipe, len, flags); |
1142 |
return splice_read(in, ppos, pipe, len, flags); |
1142 |
} |
1143 |
} |
|
|
1144 |
EXPORT_SYMBOL(do_splice_to); |
1143 |
|
1145 |
|
1144 |
/** |
1146 |
/** |
1145 |
* splice_direct_to_actor - splices data directly between two non-pipes |
1147 |
* splice_direct_to_actor - splices data directly between two non-pipes |
1146 |
-- a/include/linux/file.h |
1148 |
++ b/include/linux/file.h |
Lines 19-24
struct dentry;
Link Here
|
19 |
struct path; |
19 |
struct path; |
20 |
extern struct file *alloc_file(struct path *, fmode_t mode, |
20 |
extern struct file *alloc_file(struct path *, fmode_t mode, |
21 |
const struct file_operations *fop); |
21 |
const struct file_operations *fop); |
|
|
22 |
extern struct file *get_empty_filp(void); |
22 |
|
23 |
|
23 |
static inline void fput_light(struct file *file, int fput_needed) |
24 |
static inline void fput_light(struct file *file, int fput_needed) |
24 |
{ |
25 |
{ |
25 |
-- a/include/linux/fs.h |
26 |
++ b/include/linux/fs.h |
Lines 1649-1654
ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
Link Here
|
1649 |
struct iovec *fast_pointer, |
1649 |
struct iovec *fast_pointer, |
1650 |
struct iovec **ret_pointer); |
1650 |
struct iovec **ret_pointer); |
1651 |
|
1651 |
|
|
|
1652 |
typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *); |
1653 |
typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t, |
1654 |
loff_t *); |
1655 |
vfs_readf_t vfs_readf(struct file *file); |
1656 |
vfs_writef_t vfs_writef(struct file *file); |
1657 |
|
1652 |
extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *); |
1658 |
extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *); |
1653 |
extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *); |
1659 |
extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *); |
1654 |
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1660 |
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1655 |
-- a/include/linux/splice.h |
1661 |
++ b/include/linux/splice.h |
Lines 83-86
extern void splice_shrink_spd(struct splice_pipe_desc *);
Link Here
|
83 |
extern void spd_release_page(struct splice_pipe_desc *, unsigned int); |
83 |
extern void spd_release_page(struct splice_pipe_desc *, unsigned int); |
84 |
|
84 |
|
85 |
extern const struct pipe_buf_operations page_cache_pipe_buf_ops; |
85 |
extern const struct pipe_buf_operations page_cache_pipe_buf_ops; |
|
|
86 |
|
87 |
extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, |
88 |
loff_t *ppos, size_t len, unsigned int flags); |
89 |
extern long do_splice_to(struct file *in, loff_t *ppos, |
90 |
struct pipe_inode_info *pipe, size_t len, |
91 |
unsigned int flags); |
86 |
#endif |
92 |
#endif |
87 |
-- a/fs/file_table.c |
93 |
++ b/fs/file_table.c |
Lines 147-152
over:
Link Here
|
147 |
} |
147 |
} |
148 |
return ERR_PTR(-ENFILE); |
148 |
return ERR_PTR(-ENFILE); |
149 |
} |
149 |
} |
|
|
150 |
EXPORT_SYMBOL(get_empty_filp); |
150 |
|
151 |
|
151 |
/** |
152 |
/** |
152 |
* alloc_file - allocate and initialize a 'struct file' |
153 |
* alloc_file - allocate and initialize a 'struct file' |
Lines 308-313
void put_filp(struct file *file)
Link Here
|
308 |
file_free(file); |
309 |
file_free(file); |
309 |
} |
310 |
} |
310 |
} |
311 |
} |
|
|
312 |
EXPORT_SYMBOL(put_filp); |
311 |
|
313 |
|
312 |
void __init files_init(unsigned long mempages) |
314 |
void __init files_init(unsigned long mempages) |
313 |
{ |
315 |
{ |
314 |
-- a/fs/inode.c |
316 |
++ b/fs/inode.c |
Lines 58-63
static struct hlist_head *inode_hashtable __read_mostly;
Link Here
|
58 |
static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock); |
58 |
static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock); |
59 |
|
59 |
|
60 |
__cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock); |
60 |
__cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock); |
|
|
61 |
EXPORT_SYMBOL(inode_sb_list_lock); |
61 |
|
62 |
|
62 |
/* |
63 |
/* |
63 |
* Empty aops. Can be used for the cases where the user does not |
64 |
* Empty aops. Can be used for the cases where the user does not |
64 |
-- a/fs/namespace.c |
65 |
++ b/fs/namespace.c |
Lines 463-468
void __mnt_drop_write(struct vfsmount *mnt)
Link Here
|
463 |
mnt_dec_writers(real_mount(mnt)); |
463 |
mnt_dec_writers(real_mount(mnt)); |
464 |
preempt_enable(); |
464 |
preempt_enable(); |
465 |
} |
465 |
} |
|
|
466 |
EXPORT_SYMBOL_GPL(__mnt_drop_write); |
466 |
|
467 |
|
467 |
/** |
468 |
/** |
468 |
* mnt_drop_write - give up write access to a mount |
469 |
* mnt_drop_write - give up write access to a mount |
Lines 1768-1773
int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
Link Here
|
1768 |
} |
1769 |
} |
1769 |
return 0; |
1770 |
return 0; |
1770 |
} |
1771 |
} |
|
|
1772 |
EXPORT_SYMBOL(iterate_mounts); |
1771 |
|
1773 |
|
1772 |
static void cleanup_group_ids(struct mount *mnt, struct mount *end) |
1774 |
static void cleanup_group_ids(struct mount *mnt, struct mount *end) |
1773 |
{ |
1775 |
{ |
1774 |
-- a/fs/notify/group.c |
1776 |
++ b/fs/notify/group.c |
Lines 22-27
Link Here
|
22 |
#include <linux/srcu.h> |
22 |
#include <linux/srcu.h> |
23 |
#include <linux/rculist.h> |
23 |
#include <linux/rculist.h> |
24 |
#include <linux/wait.h> |
24 |
#include <linux/wait.h> |
|
|
25 |
#include <linux/module.h> |
25 |
|
26 |
|
26 |
#include <linux/fsnotify_backend.h> |
27 |
#include <linux/fsnotify_backend.h> |
27 |
#include "fsnotify.h" |
28 |
#include "fsnotify.h" |
Lines 72-77
void fsnotify_get_group(struct fsnotify_group *group)
Link Here
|
72 |
{ |
73 |
{ |
73 |
atomic_inc(&group->refcnt); |
74 |
atomic_inc(&group->refcnt); |
74 |
} |
75 |
} |
|
|
76 |
EXPORT_SYMBOL(fsnotify_get_group); |
75 |
|
77 |
|
76 |
/* |
78 |
/* |
77 |
* Drop a reference to a group. Free it if it's through. |
79 |
* Drop a reference to a group. Free it if it's through. |
Lines 81-86
void fsnotify_put_group(struct fsnotify_group *group)
Link Here
|
81 |
if (atomic_dec_and_test(&group->refcnt)) |
83 |
if (atomic_dec_and_test(&group->refcnt)) |
82 |
fsnotify_final_destroy_group(group); |
84 |
fsnotify_final_destroy_group(group); |
83 |
} |
85 |
} |
|
|
86 |
EXPORT_SYMBOL(fsnotify_put_group); |
84 |
|
87 |
|
85 |
/* |
88 |
/* |
86 |
* Create a new fsnotify_group and hold a reference for the group returned. |
89 |
* Create a new fsnotify_group and hold a reference for the group returned. |
Lines 109-114
struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
Link Here
|
109 |
|
112 |
|
110 |
return group; |
113 |
return group; |
111 |
} |
114 |
} |
|
|
115 |
EXPORT_SYMBOL(fsnotify_alloc_group); |
112 |
|
116 |
|
113 |
int fsnotify_fasync(int fd, struct file *file, int on) |
117 |
int fsnotify_fasync(int fd, struct file *file, int on) |
114 |
{ |
118 |
{ |
115 |
-- a/fs/notify/mark.c |
119 |
++ b/fs/notify/mark.c |
Lines 109-114
void fsnotify_put_mark(struct fsnotify_mark *mark)
Link Here
|
109 |
mark->free_mark(mark); |
109 |
mark->free_mark(mark); |
110 |
} |
110 |
} |
111 |
} |
111 |
} |
|
|
112 |
EXPORT_SYMBOL(fsnotify_put_mark); |
112 |
|
113 |
|
113 |
/* Calculate mask of events for a list of marks */ |
114 |
/* Calculate mask of events for a list of marks */ |
114 |
u32 fsnotify_recalc_mask(struct hlist_head *head) |
115 |
u32 fsnotify_recalc_mask(struct hlist_head *head) |
Lines 202-207
void fsnotify_destroy_mark(struct fsnotify_mark *mark,
Link Here
|
202 |
fsnotify_destroy_mark_locked(mark, group); |
203 |
fsnotify_destroy_mark_locked(mark, group); |
203 |
mutex_unlock(&group->mark_mutex); |
204 |
mutex_unlock(&group->mark_mutex); |
204 |
} |
205 |
} |
|
|
206 |
EXPORT_SYMBOL(fsnotify_destroy_mark); |
205 |
|
207 |
|
206 |
/* |
208 |
/* |
207 |
* Destroy all marks in the given list. The marks must be already detached from |
209 |
* Destroy all marks in the given list. The marks must be already detached from |
Lines 376-381
err:
Link Here
|
376 |
|
378 |
|
377 |
return ret; |
379 |
return ret; |
378 |
} |
380 |
} |
|
|
381 |
EXPORT_SYMBOL(fsnotify_add_mark); |
379 |
|
382 |
|
380 |
int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, |
383 |
int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, |
381 |
struct inode *inode, struct vfsmount *mnt, int allow_dups) |
384 |
struct inode *inode, struct vfsmount *mnt, int allow_dups) |
Lines 455-460
void fsnotify_init_mark(struct fsnotify_mark *mark,
Link Here
|
455 |
atomic_set(&mark->refcnt, 1); |
458 |
atomic_set(&mark->refcnt, 1); |
456 |
mark->free_mark = free_mark; |
459 |
mark->free_mark = free_mark; |
457 |
} |
460 |
} |
|
|
461 |
EXPORT_SYMBOL(fsnotify_init_mark); |
458 |
|
462 |
|
459 |
static int fsnotify_mark_destroy(void *ignored) |
463 |
static int fsnotify_mark_destroy(void *ignored) |
460 |
{ |
464 |
{ |
461 |
-- a/fs/open.c |
465 |
++ b/fs/open.c |
Lines 62-67
int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
Link Here
|
62 |
mutex_unlock(&dentry->d_inode->i_mutex); |
62 |
mutex_unlock(&dentry->d_inode->i_mutex); |
63 |
return ret; |
63 |
return ret; |
64 |
} |
64 |
} |
|
|
65 |
EXPORT_SYMBOL(do_truncate); |
65 |
|
66 |
|
66 |
long vfs_truncate(struct path *path, loff_t length) |
67 |
long vfs_truncate(struct path *path, loff_t length) |
67 |
{ |
68 |
{ |
Lines 676-681
int open_check_o_direct(struct file *f)
Link Here
|
676 |
} |
677 |
} |
677 |
return 0; |
678 |
return 0; |
678 |
} |
679 |
} |
|
|
680 |
EXPORT_SYMBOL(open_check_o_direct); |
679 |
|
681 |
|
680 |
static int do_dentry_open(struct file *f, |
682 |
static int do_dentry_open(struct file *f, |
681 |
int (*open)(struct inode *, struct file *), |
683 |
int (*open)(struct inode *, struct file *), |
682 |
-- a/fs/xattr.c |
684 |
++ b/fs/xattr.c |
Lines 207-212
vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
Link Here
|
207 |
*xattr_value = value; |
207 |
*xattr_value = value; |
208 |
return error; |
208 |
return error; |
209 |
} |
209 |
} |
|
|
210 |
EXPORT_SYMBOL(vfs_getxattr_alloc); |
210 |
|
211 |
|
211 |
/* Compare an extended attribute value with the given value */ |
212 |
/* Compare an extended attribute value with the given value */ |
212 |
int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, |
213 |
int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, |
213 |
-- a/security/commoncap.c |
214 |
++ b/security/commoncap.c |
Lines 975-983
int cap_mmap_addr(unsigned long addr)
Link Here
|
975 |
} |
975 |
} |
976 |
return ret; |
976 |
return ret; |
977 |
} |
977 |
} |
|
|
978 |
EXPORT_SYMBOL(cap_mmap_addr); |
978 |
|
979 |
|
979 |
int cap_mmap_file(struct file *file, unsigned long reqprot, |
980 |
int cap_mmap_file(struct file *file, unsigned long reqprot, |
980 |
unsigned long prot, unsigned long flags) |
981 |
unsigned long prot, unsigned long flags) |
981 |
{ |
982 |
{ |
982 |
return 0; |
983 |
return 0; |
983 |
} |
984 |
} |
984 |
-- a/security/device_cgroup.c |
985 |
EXPORT_SYMBOL(cap_mmap_file); |
|
|
986 |
++ b/security/device_cgroup.c |
Lines 7-12
Link Here
|
7 |
#include <linux/device_cgroup.h> |
7 |
#include <linux/device_cgroup.h> |
8 |
#include <linux/cgroup.h> |
8 |
#include <linux/cgroup.h> |
9 |
#include <linux/ctype.h> |
9 |
#include <linux/ctype.h> |
|
|
10 |
#include <linux/export.h> |
10 |
#include <linux/list.h> |
11 |
#include <linux/list.h> |
11 |
#include <linux/uaccess.h> |
12 |
#include <linux/uaccess.h> |
12 |
#include <linux/seq_file.h> |
13 |
#include <linux/seq_file.h> |
Lines 849-854
int __devcgroup_inode_permission(struct inode *inode, int mask)
Link Here
|
849 |
return __devcgroup_check_permission(type, imajor(inode), iminor(inode), |
850 |
return __devcgroup_check_permission(type, imajor(inode), iminor(inode), |
850 |
access); |
851 |
access); |
851 |
} |
852 |
} |
|
|
853 |
EXPORT_SYMBOL(__devcgroup_inode_permission); |
852 |
|
854 |
|
853 |
int devcgroup_inode_mknod(int mode, dev_t dev) |
855 |
int devcgroup_inode_mknod(int mode, dev_t dev) |
854 |
{ |
856 |
{ |
855 |
-- a/security/security.c |
857 |
++ b/security/security.c |
Lines 430-435
int security_path_rmdir(struct path *dir, struct dentry *dentry)
Link Here
|
430 |
return 0; |
430 |
return 0; |
431 |
return security_ops->path_rmdir(dir, dentry); |
431 |
return security_ops->path_rmdir(dir, dentry); |
432 |
} |
432 |
} |
|
|
433 |
EXPORT_SYMBOL(security_path_rmdir); |
433 |
|
434 |
|
434 |
int security_path_unlink(struct path *dir, struct dentry *dentry) |
435 |
int security_path_unlink(struct path *dir, struct dentry *dentry) |
435 |
{ |
436 |
{ |
Lines 446-451
int security_path_symlink(struct path *dir, struct dentry *dentry,
Link Here
|
446 |
return 0; |
447 |
return 0; |
447 |
return security_ops->path_symlink(dir, dentry, old_name); |
448 |
return security_ops->path_symlink(dir, dentry, old_name); |
448 |
} |
449 |
} |
|
|
450 |
EXPORT_SYMBOL(security_path_symlink); |
449 |
|
451 |
|
450 |
int security_path_link(struct dentry *old_dentry, struct path *new_dir, |
452 |
int security_path_link(struct dentry *old_dentry, struct path *new_dir, |
451 |
struct dentry *new_dentry) |
453 |
struct dentry *new_dentry) |
Lines 454-459
int security_path_link(struct dentry *old_dentry, struct path *new_dir,
Link Here
|
454 |
return 0; |
456 |
return 0; |
455 |
return security_ops->path_link(old_dentry, new_dir, new_dentry); |
457 |
return security_ops->path_link(old_dentry, new_dir, new_dentry); |
456 |
} |
458 |
} |
|
|
459 |
EXPORT_SYMBOL(security_path_link); |
457 |
|
460 |
|
458 |
int security_path_rename(struct path *old_dir, struct dentry *old_dentry, |
461 |
int security_path_rename(struct path *old_dir, struct dentry *old_dentry, |
459 |
struct path *new_dir, struct dentry *new_dentry, |
462 |
struct path *new_dir, struct dentry *new_dentry, |
Lines 481-486
int security_path_truncate(struct path *path)
Link Here
|
481 |
return 0; |
484 |
return 0; |
482 |
return security_ops->path_truncate(path); |
485 |
return security_ops->path_truncate(path); |
483 |
} |
486 |
} |
|
|
487 |
EXPORT_SYMBOL(security_path_truncate); |
484 |
|
488 |
|
485 |
int security_path_chmod(struct path *path, umode_t mode) |
489 |
int security_path_chmod(struct path *path, umode_t mode) |
486 |
{ |
490 |
{ |
Lines 488-493
int security_path_chmod(struct path *path, umode_t mode)
Link Here
|
488 |
return 0; |
492 |
return 0; |
489 |
return security_ops->path_chmod(path, mode); |
493 |
return security_ops->path_chmod(path, mode); |
490 |
} |
494 |
} |
|
|
495 |
EXPORT_SYMBOL(security_path_chmod); |
491 |
|
496 |
|
492 |
int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) |
497 |
int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) |
493 |
{ |
498 |
{ |
Lines 495-500
int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
Link Here
|
495 |
return 0; |
500 |
return 0; |
496 |
return security_ops->path_chown(path, uid, gid); |
501 |
return security_ops->path_chown(path, uid, gid); |
497 |
} |
502 |
} |
|
|
503 |
EXPORT_SYMBOL(security_path_chown); |
498 |
|
504 |
|
499 |
int security_path_chroot(struct path *path) |
505 |
int security_path_chroot(struct path *path) |
500 |
{ |
506 |
{ |
Lines 580-585
int security_inode_readlink(struct dentry *dentry)
Link Here
|
580 |
return 0; |
586 |
return 0; |
581 |
return security_ops->inode_readlink(dentry); |
587 |
return security_ops->inode_readlink(dentry); |
582 |
} |
588 |
} |
|
|
589 |
EXPORT_SYMBOL(security_inode_readlink); |
583 |
|
590 |
|
584 |
int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) |
591 |
int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) |
585 |
{ |
592 |
{ |
Lines 594-599
int security_inode_permission(struct inode *inode, int mask)
Link Here
|
594 |
return 0; |
601 |
return 0; |
595 |
return security_ops->inode_permission(inode, mask); |
602 |
return security_ops->inode_permission(inode, mask); |
596 |
} |
603 |
} |
|
|
604 |
EXPORT_SYMBOL(security_inode_permission); |
597 |
|
605 |
|
598 |
int security_inode_setattr(struct dentry *dentry, struct iattr *attr) |
606 |
int security_inode_setattr(struct dentry *dentry, struct iattr *attr) |
599 |
{ |
607 |
{ |
Lines 716-721
int security_file_permission(struct file *file, int mask)
Link Here
|
716 |
|
724 |
|
717 |
return fsnotify_perm(file, mask); |
725 |
return fsnotify_perm(file, mask); |
718 |
} |
726 |
} |
|
|
727 |
EXPORT_SYMBOL(security_file_permission); |
719 |
|
728 |
|
720 |
int security_file_alloc(struct file *file) |
729 |
int security_file_alloc(struct file *file) |
721 |
{ |
730 |
{ |
Lines 775-780
int security_mmap_file(struct file *file, unsigned long prot,
Link Here
|
775 |
return ret; |
784 |
return ret; |
776 |
return ima_file_mmap(file, prot); |
785 |
return ima_file_mmap(file, prot); |
777 |
} |
786 |
} |
|
|
787 |
EXPORT_SYMBOL(security_mmap_file); |
778 |
|
788 |
|
779 |
int security_mmap_addr(unsigned long addr) |
789 |
int security_mmap_addr(unsigned long addr) |
780 |
{ |
790 |
{ |
781 |
-- a/fs/buffer.c |
791 |
++ b/fs/buffer.c |
Lines 2450-2456
int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
Link Here
|
2450 |
* Update file times before taking page lock. We may end up failing the |
2450 |
* Update file times before taking page lock. We may end up failing the |
2451 |
* fault so this update may be superfluous but who really cares... |
2451 |
* fault so this update may be superfluous but who really cares... |
2452 |
*/ |
2452 |
*/ |
2453 |
file_update_time(vma->vm_file); |
2453 |
vma_file_update_time(vma); |
2454 |
|
2454 |
|
2455 |
ret = __block_page_mkwrite(vma, vmf, get_block); |
2455 |
ret = __block_page_mkwrite(vma, vmf, get_block); |
2456 |
sb_end_pagefault(sb); |
2456 |
sb_end_pagefault(sb); |
2457 |
-- a/fs/proc/base.c |
2457 |
++ b/fs/proc/base.c |
Lines 1744-1750
static int proc_map_files_get_link(struct dentry *dentry, struct path *path)
Link Here
|
1744 |
down_read(&mm->mmap_sem); |
1744 |
down_read(&mm->mmap_sem); |
1745 |
vma = find_exact_vma(mm, vm_start, vm_end); |
1745 |
vma = find_exact_vma(mm, vm_start, vm_end); |
1746 |
if (vma && vma->vm_file) { |
1746 |
if (vma && vma->vm_file) { |
1747 |
*path = vma->vm_file->f_path; |
1747 |
*path = vma_pr_or_file(vma)->f_path; |
1748 |
path_get(path); |
1748 |
path_get(path); |
1749 |
rc = 0; |
1749 |
rc = 0; |
1750 |
} |
1750 |
} |
1751 |
-- a/fs/proc/nommu.c |
1751 |
++ b/fs/proc/nommu.c |
Lines 45-51
static int nommu_region_show(struct seq_file *m, struct vm_region *region)
Link Here
|
45 |
file = region->vm_file; |
45 |
file = region->vm_file; |
46 |
|
46 |
|
47 |
if (file) { |
47 |
if (file) { |
48 |
struct inode *inode = file_inode(region->vm_file); |
48 |
struct inode *inode; |
|
|
49 |
|
50 |
file = vmr_pr_or_file(region); |
51 |
inode = file_inode(file); |
49 |
dev = inode->i_sb->s_dev; |
52 |
dev = inode->i_sb->s_dev; |
50 |
ino = inode->i_ino; |
53 |
ino = inode->i_ino; |
51 |
} |
54 |
} |
52 |
-- a/fs/proc/task_mmu.c |
55 |
++ b/fs/proc/task_mmu.c |
Lines 279-285
show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
Link Here
|
279 |
const char *name = NULL; |
279 |
const char *name = NULL; |
280 |
|
280 |
|
281 |
if (file) { |
281 |
if (file) { |
282 |
struct inode *inode = file_inode(vma->vm_file); |
282 |
struct inode *inode; |
|
|
283 |
|
284 |
file = vma_pr_or_file(vma); |
285 |
inode = file_inode(file); |
283 |
dev = inode->i_sb->s_dev; |
286 |
dev = inode->i_sb->s_dev; |
284 |
ino = inode->i_ino; |
287 |
ino = inode->i_ino; |
285 |
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; |
288 |
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; |
Lines 1479-1485
static int show_numa_map(struct seq_file *m, void *v, int is_pid)
Link Here
|
1479 |
struct proc_maps_private *proc_priv = &numa_priv->proc_maps; |
1482 |
struct proc_maps_private *proc_priv = &numa_priv->proc_maps; |
1480 |
struct vm_area_struct *vma = v; |
1483 |
struct vm_area_struct *vma = v; |
1481 |
struct numa_maps *md = &numa_priv->md; |
1484 |
struct numa_maps *md = &numa_priv->md; |
1482 |
struct file *file = vma->vm_file; |
1485 |
struct file *file = vma_pr_or_file(vma); |
1483 |
struct mm_struct *mm = vma->vm_mm; |
1486 |
struct mm_struct *mm = vma->vm_mm; |
1484 |
struct mm_walk walk = { |
1487 |
struct mm_walk walk = { |
1485 |
.hugetlb_entry = gather_hugetlb_stats, |
1488 |
.hugetlb_entry = gather_hugetlb_stats, |
1486 |
-- a/fs/proc/task_nommu.c |
1489 |
++ b/fs/proc/task_nommu.c |
Lines 160-166
static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
Link Here
|
160 |
file = vma->vm_file; |
160 |
file = vma->vm_file; |
161 |
|
161 |
|
162 |
if (file) { |
162 |
if (file) { |
163 |
struct inode *inode = file_inode(vma->vm_file); |
163 |
struct inode *inode; |
|
|
164 |
|
165 |
file = vma_pr_or_file(vma); |
166 |
inode = file_inode(file); |
164 |
dev = inode->i_sb->s_dev; |
167 |
dev = inode->i_sb->s_dev; |
165 |
ino = inode->i_ino; |
168 |
ino = inode->i_ino; |
166 |
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; |
169 |
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; |
167 |
-- a/include/linux/mm.h |
170 |
++ b/include/linux/mm.h |
Lines 1172-1177
static inline int fixup_user_fault(struct task_struct *tsk,
Link Here
|
1172 |
} |
1172 |
} |
1173 |
#endif |
1173 |
#endif |
1174 |
|
1174 |
|
|
|
1175 |
extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); |
1176 |
extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], |
1177 |
int); |
1178 |
extern void vma_do_get_file(struct vm_area_struct *, const char[], int); |
1179 |
extern void vma_do_fput(struct vm_area_struct *, const char[], int); |
1180 |
|
1181 |
#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \ |
1182 |
__LINE__) |
1183 |
#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \ |
1184 |
__LINE__) |
1185 |
#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) |
1186 |
#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) |
1187 |
|
1188 |
#ifndef CONFIG_MMU |
1189 |
extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int); |
1190 |
extern void vmr_do_fput(struct vm_region *, const char[], int); |
1191 |
|
1192 |
#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \ |
1193 |
__LINE__) |
1194 |
#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) |
1195 |
#endif /* !CONFIG_MMU */ |
1196 |
|
1175 |
extern ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, size_t len, int write); |
1197 |
extern ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, size_t len, int write); |
1176 |
extern ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr, |
1198 |
extern ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr, |
1177 |
void *buf, size_t len, int write); |
1199 |
void *buf, size_t len, int write); |
1178 |
-- a/include/linux/mm_types.h |
1200 |
++ b/include/linux/mm_types.h |
Lines 241-246
struct vm_region {
Link Here
|
241 |
unsigned long vm_top; /* region allocated to here */ |
241 |
unsigned long vm_top; /* region allocated to here */ |
242 |
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ |
242 |
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ |
243 |
struct file *vm_file; /* the backing file or NULL */ |
243 |
struct file *vm_file; /* the backing file or NULL */ |
|
|
244 |
struct file *vm_prfile; /* the virtual backing file or NULL */ |
244 |
|
245 |
|
245 |
int vm_usage; /* region usage count (access under nommu_region_sem) */ |
246 |
int vm_usage; /* region usage count (access under nommu_region_sem) */ |
246 |
bool vm_icache_flushed : 1; /* true if the icache has been flushed for |
247 |
bool vm_icache_flushed : 1; /* true if the icache has been flushed for |
Lines 305-310
struct vm_area_struct {
Link Here
|
305 |
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE |
306 |
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE |
306 |
units, *not* PAGE_CACHE_SIZE */ |
307 |
units, *not* PAGE_CACHE_SIZE */ |
307 |
struct file * vm_file; /* File we map to (can be NULL). */ |
308 |
struct file * vm_file; /* File we map to (can be NULL). */ |
|
|
309 |
struct file *vm_prfile; /* shadow of vm_file */ |
308 |
void * vm_private_data; /* was vm_pte (shared mem) */ |
310 |
void * vm_private_data; /* was vm_pte (shared mem) */ |
309 |
|
311 |
|
310 |
#ifndef CONFIG_MMU |
312 |
#ifndef CONFIG_MMU |
311 |
-- a/kernel/fork.c |
313 |
++ b/kernel/fork.c |
Lines 456-462
static struct vm_area_struct *dup_vma(struct mm_struct *mm, struct mm_struct *oldmm, struct vm_area_struct *mpnt)
Link Here
|
456 |
struct inode *inode = file_inode(file); |
456 |
struct inode *inode = file_inode(file); |
457 |
struct address_space *mapping = file->f_mapping; |
457 |
struct address_space *mapping = file->f_mapping; |
458 |
|
458 |
|
459 |
get_file(file); |
459 |
vma_get_file(tmp); |
460 |
if (tmp->vm_flags & VM_DENYWRITE) |
460 |
if (tmp->vm_flags & VM_DENYWRITE) |
461 |
atomic_dec(&inode->i_writecount); |
461 |
atomic_dec(&inode->i_writecount); |
462 |
i_mmap_lock_write(mapping); |
462 |
i_mmap_lock_write(mapping); |
463 |
-- a/mm/Makefile |
463 |
++ b/mm/Makefile |
Lines 21-27
obj-y := filemap.o mempool.o oom_kill.o \
Link Here
|
21 |
mm_init.o mmu_context.o percpu.o slab_common.o \ |
21 |
mm_init.o mmu_context.o percpu.o slab_common.o \ |
22 |
compaction.o vmacache.o \ |
22 |
compaction.o vmacache.o \ |
23 |
interval_tree.o list_lru.o workingset.o \ |
23 |
interval_tree.o list_lru.o workingset.o \ |
24 |
debug.o $(mmu-y) |
24 |
prfile.o debug.o $(mmu-y) |
25 |
|
25 |
|
26 |
obj-y += init-mm.o |
26 |
obj-y += init-mm.o |
27 |
|
27 |
|
28 |
-- a/mm/filemap.c |
28 |
++ b/mm/filemap.c |
Lines 2062-2068
int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
Link Here
|
2062 |
int ret = VM_FAULT_LOCKED; |
2062 |
int ret = VM_FAULT_LOCKED; |
2063 |
|
2063 |
|
2064 |
sb_start_pagefault(inode->i_sb); |
2064 |
sb_start_pagefault(inode->i_sb); |
2065 |
file_update_time(vma->vm_file); |
2065 |
vma_file_update_time(vma); |
2066 |
lock_page(page); |
2066 |
lock_page(page); |
2067 |
if (page->mapping != inode->i_mapping) { |
2067 |
if (page->mapping != inode->i_mapping) { |
2068 |
unlock_page(page); |
2068 |
unlock_page(page); |
2069 |
-- a/mm/madvise.c |
2069 |
++ b/mm/madvise.c |
Lines 320-331
static long madvise_remove(struct vm_area_struct *vma,
Link Here
|
320 |
* vma's reference to the file) can go away as soon as we drop |
320 |
* vma's reference to the file) can go away as soon as we drop |
321 |
* mmap_sem. |
321 |
* mmap_sem. |
322 |
*/ |
322 |
*/ |
323 |
get_file(f); |
323 |
vma_get_file(vma); |
324 |
up_read(¤t->mm->mmap_sem); |
324 |
up_read(¤t->mm->mmap_sem); |
325 |
error = vfs_fallocate(f, |
325 |
error = vfs_fallocate(f, |
326 |
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, |
326 |
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, |
327 |
offset, end - start); |
327 |
offset, end - start); |
328 |
fput(f); |
328 |
vma_fput(vma); |
329 |
down_read(¤t->mm->mmap_sem); |
329 |
down_read(¤t->mm->mmap_sem); |
330 |
return error; |
330 |
return error; |
331 |
} |
331 |
} |
332 |
-- a/mm/memory.c |
332 |
++ b/mm/memory.c |
Lines 2034-2040
static inline int wp_page_reuse(struct mm_struct *mm,
Link Here
|
2034 |
} |
2034 |
} |
2035 |
|
2035 |
|
2036 |
if (!page_mkwrite) |
2036 |
if (!page_mkwrite) |
2037 |
file_update_time(vma->vm_file); |
2037 |
vma_file_update_time(vma); |
2038 |
} |
2038 |
} |
2039 |
|
2039 |
|
2040 |
return VM_FAULT_WRITE; |
2040 |
return VM_FAULT_WRITE; |
2041 |
-- a/mm/mmap.c |
2041 |
++ b/mm/mmap.c |
Lines 274-280
static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
Link Here
|
274 |
if (vma->vm_ops && vma->vm_ops->close) |
274 |
if (vma->vm_ops && vma->vm_ops->close) |
275 |
vma->vm_ops->close(vma); |
275 |
vma->vm_ops->close(vma); |
276 |
if (vma->vm_file) |
276 |
if (vma->vm_file) |
277 |
fput(vma->vm_file); |
277 |
vma_fput(vma); |
278 |
mpol_put(vma_policy(vma)); |
278 |
mpol_put(vma_policy(vma)); |
279 |
kmem_cache_free(vm_area_cachep, vma); |
279 |
kmem_cache_free(vm_area_cachep, vma); |
280 |
return next; |
280 |
return next; |
Lines 886-892
again: remove_next = 1 + (end > next->vm_end);
Link Here
|
886 |
if (remove_next) { |
886 |
if (remove_next) { |
887 |
if (file) { |
887 |
if (file) { |
888 |
uprobe_munmap(next, next->vm_start, next->vm_end); |
888 |
uprobe_munmap(next, next->vm_start, next->vm_end); |
889 |
fput(file); |
889 |
vma_fput(vma); |
890 |
} |
890 |
} |
891 |
if (next->anon_vma) |
891 |
if (next->anon_vma) |
892 |
anon_vma_merge(vma, next); |
892 |
anon_vma_merge(vma, next); |
Lines 1671-1678
out:
Link Here
|
1671 |
return addr; |
1671 |
return addr; |
1672 |
|
1672 |
|
1673 |
unmap_and_free_vma: |
1673 |
unmap_and_free_vma: |
|
|
1674 |
vma_fput(vma); |
1674 |
vma->vm_file = NULL; |
1675 |
vma->vm_file = NULL; |
1675 |
fput(file); |
|
|
1676 |
|
1676 |
|
1677 |
/* Undo any partial mapping done by a device driver. */ |
1677 |
/* Undo any partial mapping done by a device driver. */ |
1678 |
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); |
1678 |
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); |
Lines 2473-2479
static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
Link Here
|
2473 |
goto out_free_mpol; |
2473 |
goto out_free_mpol; |
2474 |
|
2474 |
|
2475 |
if (new->vm_file) |
2475 |
if (new->vm_file) |
2476 |
get_file(new->vm_file); |
2476 |
vma_get_file(new); |
2477 |
|
2477 |
|
2478 |
if (new->vm_ops && new->vm_ops->open) |
2478 |
if (new->vm_ops && new->vm_ops->open) |
2479 |
new->vm_ops->open(new); |
2479 |
new->vm_ops->open(new); |
Lines 2492-2498
static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
Link Here
|
2492 |
if (new->vm_ops && new->vm_ops->close) |
2492 |
if (new->vm_ops && new->vm_ops->close) |
2493 |
new->vm_ops->close(new); |
2493 |
new->vm_ops->close(new); |
2494 |
if (new->vm_file) |
2494 |
if (new->vm_file) |
2495 |
fput(new->vm_file); |
2495 |
vma_fput(new); |
2496 |
out_free_mpol: |
2496 |
out_free_mpol: |
2497 |
mpol_put(vma_policy(new)); |
2497 |
mpol_put(vma_policy(new)); |
2498 |
out_free_vma: |
2498 |
out_free_vma: |
Lines 2635-2641
SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
Link Here
|
2635 |
struct vm_area_struct *vma; |
2635 |
struct vm_area_struct *vma; |
2636 |
unsigned long populate = 0; |
2636 |
unsigned long populate = 0; |
2637 |
unsigned long ret = -EINVAL; |
2637 |
unsigned long ret = -EINVAL; |
2638 |
struct file *file; |
|
|
2639 |
|
2638 |
|
2640 |
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. " |
2639 |
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. " |
2641 |
"See Documentation/vm/remap_file_pages.txt.\n", |
2640 |
"See Documentation/vm/remap_file_pages.txt.\n", |
Lines 2679-2688
SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
Link Here
|
2679 |
munlock_vma_pages_range(vma, start, start + size); |
2678 |
munlock_vma_pages_range(vma, start, start + size); |
2680 |
} |
2679 |
} |
2681 |
|
2680 |
|
2682 |
file = get_file(vma->vm_file); |
2681 |
vma_get_file(vma); |
2683 |
ret = do_mmap_pgoff(vma->vm_file, start, size, |
2682 |
ret = do_mmap_pgoff(vma->vm_file, start, size, |
2684 |
prot, flags, pgoff, &populate); |
2683 |
prot, flags, pgoff, &populate); |
2685 |
fput(file); |
2684 |
vma_fput(vma); |
2686 |
out: |
2685 |
out: |
2687 |
up_write(&mm->mmap_sem); |
2686 |
up_write(&mm->mmap_sem); |
2688 |
if (populate) |
2687 |
if (populate) |
Lines 2949-2955
struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
Link Here
|
2949 |
if (anon_vma_clone(new_vma, vma)) |
2948 |
if (anon_vma_clone(new_vma, vma)) |
2950 |
goto out_free_mempol; |
2949 |
goto out_free_mempol; |
2951 |
if (new_vma->vm_file) |
2950 |
if (new_vma->vm_file) |
2952 |
get_file(new_vma->vm_file); |
2951 |
vma_get_file(new_vma); |
2953 |
if (new_vma->vm_ops && new_vma->vm_ops->open) |
2952 |
if (new_vma->vm_ops && new_vma->vm_ops->open) |
2954 |
new_vma->vm_ops->open(new_vma); |
2953 |
new_vma->vm_ops->open(new_vma); |
2955 |
vma_link(mm, new_vma, prev, rb_link, rb_parent); |
2954 |
vma_link(mm, new_vma, prev, rb_link, rb_parent); |
2956 |
-- a/mm/msync.c |
2955 |
++ b/mm/msync.c |
Lines 84-93
SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
Link Here
|
84 |
start = vma->vm_end; |
84 |
start = vma->vm_end; |
85 |
if ((flags & MS_SYNC) && file && |
85 |
if ((flags & MS_SYNC) && file && |
86 |
(vma->vm_flags & VM_SHARED)) { |
86 |
(vma->vm_flags & VM_SHARED)) { |
87 |
get_file(file); |
87 |
vma_get_file(vma); |
88 |
up_read(&mm->mmap_sem); |
88 |
up_read(&mm->mmap_sem); |
89 |
error = vfs_fsync_range(file, fstart, fend, 1); |
89 |
error = vfs_fsync_range(file, fstart, fend, 1); |
90 |
fput(file); |
90 |
vma_fput(vma); |
91 |
if (error || start >= end) |
91 |
if (error || start >= end) |
92 |
goto out; |
92 |
goto out; |
93 |
down_read(&mm->mmap_sem); |
93 |
down_read(&mm->mmap_sem); |
94 |
-- a/mm/nommu.c |
94 |
++ b/mm/nommu.c |
Lines 693-699
static void __put_nommu_region(struct vm_region *region)
Link Here
|
693 |
up_write(&nommu_region_sem); |
693 |
up_write(&nommu_region_sem); |
694 |
|
694 |
|
695 |
if (region->vm_file) |
695 |
if (region->vm_file) |
696 |
fput(region->vm_file); |
696 |
vmr_fput(region); |
697 |
|
697 |
|
698 |
/* IO memory and memory shared directly out of the pagecache |
698 |
/* IO memory and memory shared directly out of the pagecache |
699 |
* from ramfs/tmpfs mustn't be released here */ |
699 |
* from ramfs/tmpfs mustn't be released here */ |
Lines 858-864
static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
Link Here
|
858 |
if (vma->vm_ops && vma->vm_ops->close) |
858 |
if (vma->vm_ops && vma->vm_ops->close) |
859 |
vma->vm_ops->close(vma); |
859 |
vma->vm_ops->close(vma); |
860 |
if (vma->vm_file) |
860 |
if (vma->vm_file) |
861 |
fput(vma->vm_file); |
861 |
vma_fput(vma); |
862 |
put_nommu_region(vma->vm_region); |
862 |
put_nommu_region(vma->vm_region); |
863 |
kmem_cache_free(vm_area_cachep, vma); |
863 |
kmem_cache_free(vm_area_cachep, vma); |
864 |
} |
864 |
} |
Lines 1398-1404
unsigned long do_mmap_pgoff(struct file *file,
Link Here
|
1398 |
goto error_just_free; |
1398 |
goto error_just_free; |
1399 |
} |
1399 |
} |
1400 |
} |
1400 |
} |
1401 |
fput(region->vm_file); |
1401 |
vmr_fput(region); |
1402 |
kmem_cache_free(vm_region_jar, region); |
1402 |
kmem_cache_free(vm_region_jar, region); |
1403 |
region = pregion; |
1403 |
region = pregion; |
1404 |
result = start; |
1404 |
result = start; |
Lines 1474-1483
error_just_free:
Link Here
|
1474 |
up_write(&nommu_region_sem); |
1474 |
up_write(&nommu_region_sem); |
1475 |
error: |
1475 |
error: |
1476 |
if (region->vm_file) |
1476 |
if (region->vm_file) |
1477 |
fput(region->vm_file); |
1477 |
vmr_fput(region); |
1478 |
kmem_cache_free(vm_region_jar, region); |
1478 |
kmem_cache_free(vm_region_jar, region); |
1479 |
if (vma->vm_file) |
1479 |
if (vma->vm_file) |
1480 |
fput(vma->vm_file); |
1480 |
vma_fput(vma); |
1481 |
kmem_cache_free(vm_area_cachep, vma); |
1481 |
kmem_cache_free(vm_area_cachep, vma); |
1482 |
kleave(" = %d", ret); |
1482 |
kleave(" = %d", ret); |
1483 |
return ret; |
1483 |
return ret; |
1484 |
-- /dev/null |
1484 |
++ b/mm/prfile.c |
Line 0
Link Here
|
|
|
1 |
/* |
2 |
* Mainly for aufs which mmap(2) diffrent file and wants to print different path |
3 |
* in /proc/PID/maps. |
4 |
* Call these functions via macros defined in linux/mm.h. |
5 |
* |
6 |
* See Documentation/filesystems/aufs/design/06mmap.txt |
7 |
* |
8 |
* Copyright (c) 2014 Junjro R. Okajima |
9 |
* Copyright (c) 2014 Ian Campbell |
10 |
*/ |
11 |
|
12 |
#include <linux/mm.h> |
13 |
#include <linux/file.h> |
14 |
#include <linux/fs.h> |
15 |
|
16 |
/* #define PRFILE_TRACE */ |
17 |
static inline void prfile_trace(struct file *f, struct file *pr, |
18 |
const char func[], int line, const char func2[]) |
19 |
{ |
20 |
#ifdef PRFILE_TRACE |
21 |
if (pr) |
22 |
pr_info("%s:%d: %s, %p\n", func, line, func2, |
23 |
f ? (char *)f->f_path.dentry->d_name.name : "(null)"); |
24 |
#endif |
25 |
} |
26 |
|
27 |
void vma_do_file_update_time(struct vm_area_struct *vma, const char func[], |
28 |
int line) |
29 |
{ |
30 |
struct file *f = vma->vm_file, *pr = vma->vm_prfile; |
31 |
|
32 |
prfile_trace(f, pr, func, line, __func__); |
33 |
file_update_time(f); |
34 |
if (f && pr) |
35 |
file_update_time(pr); |
36 |
} |
37 |
|
38 |
struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[], |
39 |
int line) |
40 |
{ |
41 |
struct file *f = vma->vm_file, *pr = vma->vm_prfile; |
42 |
|
43 |
prfile_trace(f, pr, func, line, __func__); |
44 |
return (f && pr) ? pr : f; |
45 |
} |
46 |
|
47 |
void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line) |
48 |
{ |
49 |
struct file *f = vma->vm_file, *pr = vma->vm_prfile; |
50 |
|
51 |
prfile_trace(f, pr, func, line, __func__); |
52 |
get_file(f); |
53 |
if (f && pr) |
54 |
get_file(pr); |
55 |
} |
56 |
|
57 |
void vma_do_fput(struct vm_area_struct *vma, const char func[], int line) |
58 |
{ |
59 |
struct file *f = vma->vm_file, *pr = vma->vm_prfile; |
60 |
|
61 |
prfile_trace(f, pr, func, line, __func__); |
62 |
fput(f); |
63 |
if (f && pr) |
64 |
fput(pr); |
65 |
} |
66 |
|
67 |
#ifndef CONFIG_MMU |
68 |
struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[], |
69 |
int line) |
70 |
{ |
71 |
struct file *f = region->vm_file, *pr = region->vm_prfile; |
72 |
|
73 |
prfile_trace(f, pr, func, line, __func__); |
74 |
return (f && pr) ? pr : f; |
75 |
} |
76 |
|
77 |
void vmr_do_fput(struct vm_region *region, const char func[], int line) |
78 |
{ |
79 |
struct file *f = region->vm_file, *pr = region->vm_prfile; |
80 |
|
81 |
prfile_trace(f, pr, func, line, __func__); |
82 |
fput(f); |
83 |
if (f && pr) |
84 |
fput(pr); |
85 |
} |
86 |
#endif /* !CONFIG_MMU */ |