aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 22:02:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 22:02:39 -0400
commitbbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (patch)
tree12b2bb4202b05f6ae6a43c6ce830a0472043dbe5 /include
parent8e204874db000928e37199c2db82b7eb8966cc3c (diff)
parent5a9a43646cf709312d71eca71cef90ad802f28f9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits) vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp isofs: Remove global fs lock jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory fix IN_DELETE_SELF on overwriting rename() on ramfs et.al. mm/truncate.c: fix build for CONFIG_BLOCK not enabled fs:update the NOTE of the file_operations structure Remove dead code in dget_parent() AFS: Fix silly characters in a comment switch d_add_ci() to d_splice_alias() in "found negative" case as well simplify gfs2_lookup() jfs_lookup(): don't bother with . or .. get rid of useless dget_parent() in btrfs rename() and link() get rid of useless dget_parent() in fs/btrfs/ioctl.c fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers drivers: fix up various ->llseek() implementations fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek Ext4: handle SEEK_HOLE/SEEK_DATA generically Btrfs: implement our own ->llseek fs: add SEEK_HOLE and SEEK_DATA flags reiserfs: make reiserfs default to barrier=flush ... Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new shrinker callout for the inode cache, that clashed with the xfs code to start the periodic workers later.
Diffstat (limited to 'include')
-rw-r--r--include/linux/anon_inodes.h2
-rw-r--r--include/linux/atomic.h26
-rw-r--r--include/linux/binfmts.h1
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fs.h100
-rw-r--r--include/linux/generic_acl.h2
-rw-r--r--include/linux/mm.h39
-rw-r--r--include/linux/mnt_namespace.h1
-rw-r--r--include/linux/namei.h5
-rw-r--r--include/linux/nfs_fs.h6
-rw-r--r--include/linux/nsproxy.h1
-rw-r--r--include/linux/reiserfs_xattr.h4
-rw-r--r--include/linux/rwsem.h10
-rw-r--r--include/linux/security.h9
-rw-r--r--include/linux/seq_file.h1
-rw-r--r--include/linux/shrinker.h42
-rw-r--r--include/trace/events/vmscan.h77
19 files changed, 245 insertions, 94 deletions
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h
index 69a21e0ebd33..8013a45242fe 100644
--- a/include/linux/anon_inodes.h
+++ b/include/linux/anon_inodes.h
@@ -8,6 +8,8 @@
8#ifndef _LINUX_ANON_INODES_H 8#ifndef _LINUX_ANON_INODES_H
9#define _LINUX_ANON_INODES_H 9#define _LINUX_ANON_INODES_H
10 10
11struct file_operations;
12
11struct file *anon_inode_getfile(const char *name, 13struct file *anon_inode_getfile(const char *name,
12 const struct file_operations *fops, 14 const struct file_operations *fops,
13 void *priv, int flags); 15 void *priv, int flags);
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index ee456c79b0e6..bc6615d4132b 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -34,6 +34,32 @@ static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
34} 34}
35#endif 35#endif
36 36
37#ifndef atomic_inc_unless_negative
38static inline int atomic_inc_unless_negative(atomic_t *p)
39{
40 int v, v1;
41 for (v = 0; v >= 0; v = v1) {
42 v1 = atomic_cmpxchg(p, v, v + 1);
43 if (likely(v1 == v))
44 return 1;
45 }
46 return 0;
47}
48#endif
49
50#ifndef atomic_dec_unless_positive
51static inline int atomic_dec_unless_positive(atomic_t *p)
52{
53 int v, v1;
54 for (v = 0; v <= 0; v = v1) {
55 v1 = atomic_cmpxchg(p, v, v - 1);
56 if (likely(v1 == v))
57 return 1;
58 }
59 return 0;
60}
61#endif
62
37#ifndef CONFIG_ARCH_HAS_ATOMIC_OR 63#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
38static inline void atomic_or(int i, atomic_t *v) 64static inline void atomic_or(int i, atomic_t *v)
39{ 65{
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 8845613fd7e3..fd88a3945aa1 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -111,6 +111,7 @@ extern int __must_check remove_arg_zero(struct linux_binprm *);
111extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); 111extern int search_binary_handler(struct linux_binprm *, struct pt_regs *);
112extern int flush_old_exec(struct linux_binprm * bprm); 112extern int flush_old_exec(struct linux_binprm * bprm);
113extern void setup_new_exec(struct linux_binprm * bprm); 113extern void setup_new_exec(struct linux_binprm * bprm);
114extern void would_dump(struct linux_binprm *, struct file *);
114 115
115extern int suid_dumpable; 116extern int suid_dumpable;
116#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 117#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 19d90a55541d..3f22d8d6d8a3 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -216,6 +216,7 @@ struct dentry_operations {
216#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ 216#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
217#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ 217#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
218#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ 218#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */
219#define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */
219#define DCACHE_MANAGED_DENTRY \ 220#define DCACHE_MANAGED_DENTRY \
220 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 221 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
221 222
@@ -416,7 +417,12 @@ static inline bool d_mountpoint(struct dentry *dentry)
416 return dentry->d_flags & DCACHE_MOUNTED; 417 return dentry->d_flags & DCACHE_MOUNTED;
417} 418}
418 419
419extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 420static inline bool d_need_lookup(struct dentry *dentry)
421{
422 return dentry->d_flags & DCACHE_NEED_LOOKUP;
423}
424
425extern void d_clear_need_lookup(struct dentry *dentry);
420 426
421extern int sysctl_vfs_cache_pressure; 427extern int sysctl_vfs_cache_pressure;
422 428
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5e06acf95d0f..0c473fd79acb 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -877,7 +877,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
877extern void ext3_htree_free_dir_info(struct dir_private_info *p); 877extern void ext3_htree_free_dir_info(struct dir_private_info *p);
878 878
879/* fsync.c */ 879/* fsync.c */
880extern int ext3_sync_file(struct file *, int); 880extern int ext3_sync_file(struct file *, loff_t, loff_t, int);
881 881
882/* hash.c */ 882/* hash.c */
883extern int ext3fs_dirhash(const char *name, int len, struct 883extern int ext3fs_dirhash(const char *name, int len, struct
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 6a8274877171..1d6836c498dd 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1043,7 +1043,8 @@ extern void fb_deferred_io_open(struct fb_info *info,
1043 struct inode *inode, 1043 struct inode *inode,
1044 struct file *file); 1044 struct file *file);
1045extern void fb_deferred_io_cleanup(struct fb_info *info); 1045extern void fb_deferred_io_cleanup(struct fb_info *info);
1046extern int fb_deferred_io_fsync(struct file *file, int datasync); 1046extern int fb_deferred_io_fsync(struct file *file, loff_t start,
1047 loff_t end, int datasync);
1047 1048
1048static inline bool fb_be_math(struct fb_info *info) 1049static inline bool fb_be_math(struct fb_info *info)
1049{ 1050{
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b5b979247863..b224dc468a23 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -32,7 +32,9 @@
32#define SEEK_SET 0 /* seek relative to beginning of file */ 32#define SEEK_SET 0 /* seek relative to beginning of file */
33#define SEEK_CUR 1 /* seek relative to current file position */ 33#define SEEK_CUR 1 /* seek relative to current file position */
34#define SEEK_END 2 /* seek relative to end of file */ 34#define SEEK_END 2 /* seek relative to end of file */
35#define SEEK_MAX SEEK_END 35#define SEEK_DATA 3 /* seek to the next data */
36#define SEEK_HOLE 4 /* seek to the next hole */
37#define SEEK_MAX SEEK_HOLE
36 38
37struct fstrim_range { 39struct fstrim_range {
38 __u64 start; 40 __u64 start;
@@ -63,6 +65,7 @@ struct inodes_stat_t {
63#define MAY_ACCESS 16 65#define MAY_ACCESS 16
64#define MAY_OPEN 32 66#define MAY_OPEN 32
65#define MAY_CHDIR 64 67#define MAY_CHDIR 64
68#define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */
66 69
67/* 70/*
68 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond 71 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
@@ -392,8 +395,9 @@ struct inodes_stat_t {
392#include <linux/semaphore.h> 395#include <linux/semaphore.h>
393#include <linux/fiemap.h> 396#include <linux/fiemap.h>
394#include <linux/rculist_bl.h> 397#include <linux/rculist_bl.h>
398#include <linux/shrinker.h>
399#include <linux/atomic.h>
395 400
396#include <asm/atomic.h>
397#include <asm/byteorder.h> 401#include <asm/byteorder.h>
398 402
399struct export_operations; 403struct export_operations;
@@ -777,7 +781,7 @@ struct inode {
777 struct timespec i_ctime; 781 struct timespec i_ctime;
778 blkcnt_t i_blocks; 782 blkcnt_t i_blocks;
779 unsigned short i_bytes; 783 unsigned short i_bytes;
780 struct rw_semaphore i_alloc_sem; 784 atomic_t i_dio_count;
781 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 785 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
782 struct file_lock *i_flock; 786 struct file_lock *i_flock;
783 struct address_space *i_mapping; 787 struct address_space *i_mapping;
@@ -1396,6 +1400,11 @@ struct super_block {
1396 struct list_head s_dentry_lru; /* unused dentry lru */ 1400 struct list_head s_dentry_lru; /* unused dentry lru */
1397 int s_nr_dentry_unused; /* # of dentry on lru */ 1401 int s_nr_dentry_unused; /* # of dentry on lru */
1398 1402
1403 /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */
1404 spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp;
1405 struct list_head s_inode_lru; /* unused inode lru */
1406 int s_nr_inodes_unused; /* # of inodes on lru */
1407
1399 struct block_device *s_bdev; 1408 struct block_device *s_bdev;
1400 struct backing_dev_info *s_bdi; 1409 struct backing_dev_info *s_bdi;
1401 struct mtd_info *s_mtd; 1410 struct mtd_info *s_mtd;
@@ -1438,8 +1447,14 @@ struct super_block {
1438 * Saved pool identifier for cleancache (-1 means none) 1447 * Saved pool identifier for cleancache (-1 means none)
1439 */ 1448 */
1440 int cleancache_poolid; 1449 int cleancache_poolid;
1450
1451 struct shrinker s_shrink; /* per-sb shrinker handle */
1441}; 1452};
1442 1453
1454/* superblock cache pruning functions */
1455extern void prune_icache_sb(struct super_block *sb, int nr_to_scan);
1456extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan);
1457
1443extern struct timespec current_fs_time(struct super_block *sb); 1458extern struct timespec current_fs_time(struct super_block *sb);
1444 1459
1445/* 1460/*
@@ -1490,7 +1505,6 @@ extern void dentry_unhash(struct dentry *dentry);
1490/* 1505/*
1491 * VFS file helper functions. 1506 * VFS file helper functions.
1492 */ 1507 */
1493extern int file_permission(struct file *, int);
1494extern void inode_init_owner(struct inode *inode, const struct inode *dir, 1508extern void inode_init_owner(struct inode *inode, const struct inode *dir,
1495 mode_t mode); 1509 mode_t mode);
1496/* 1510/*
@@ -1538,11 +1552,6 @@ struct block_device_operations;
1538#define HAVE_COMPAT_IOCTL 1 1552#define HAVE_COMPAT_IOCTL 1
1539#define HAVE_UNLOCKED_IOCTL 1 1553#define HAVE_UNLOCKED_IOCTL 1
1540 1554
1541/*
1542 * NOTE:
1543 * all file operations except setlease can be called without
1544 * the big kernel lock held in all filesystems.
1545 */
1546struct file_operations { 1555struct file_operations {
1547 struct module *owner; 1556 struct module *owner;
1548 loff_t (*llseek) (struct file *, loff_t, int); 1557 loff_t (*llseek) (struct file *, loff_t, int);
@@ -1558,7 +1567,7 @@ struct file_operations {
1558 int (*open) (struct inode *, struct file *); 1567 int (*open) (struct inode *, struct file *);
1559 int (*flush) (struct file *, fl_owner_t id); 1568 int (*flush) (struct file *, fl_owner_t id);
1560 int (*release) (struct inode *, struct file *); 1569 int (*release) (struct inode *, struct file *);
1561 int (*fsync) (struct file *, int datasync); 1570 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1562 int (*aio_fsync) (struct kiocb *, int datasync); 1571 int (*aio_fsync) (struct kiocb *, int datasync);
1563 int (*fasync) (int, struct file *, int); 1572 int (*fasync) (int, struct file *, int);
1564 int (*lock) (struct file *, int, struct file_lock *); 1573 int (*lock) (struct file *, int, struct file_lock *);
@@ -1573,13 +1582,11 @@ struct file_operations {
1573 loff_t len); 1582 loff_t len);
1574}; 1583};
1575 1584
1576#define IPERM_FLAG_RCU 0x0001
1577
1578struct inode_operations { 1585struct inode_operations {
1579 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 1586 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
1580 void * (*follow_link) (struct dentry *, struct nameidata *); 1587 void * (*follow_link) (struct dentry *, struct nameidata *);
1581 int (*permission) (struct inode *, int, unsigned int); 1588 int (*permission) (struct inode *, int);
1582 int (*check_acl)(struct inode *, int, unsigned int); 1589 int (*check_acl)(struct inode *, int);
1583 1590
1584 int (*readlink) (struct dentry *, char __user *,int); 1591 int (*readlink) (struct dentry *, char __user *,int);
1585 void (*put_link) (struct dentry *, struct nameidata *, void *); 1592 void (*put_link) (struct dentry *, struct nameidata *, void *);
@@ -1645,6 +1652,8 @@ struct super_operations {
1645 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1652 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1646#endif 1653#endif
1647 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1654 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1655 int (*nr_cached_objects)(struct super_block *);
1656 void (*free_cached_objects)(struct super_block *, int);
1648}; 1657};
1649 1658
1650/* 1659/*
@@ -1693,6 +1702,10 @@ struct super_operations {
1693 * set during data writeback, and cleared with a wakeup 1702 * set during data writeback, and cleared with a wakeup
1694 * on the bit address once it is done. 1703 * on the bit address once it is done.
1695 * 1704 *
1705 * I_REFERENCED Marks the inode as recently references on the LRU list.
1706 *
1707 * I_DIO_WAKEUP Never set. Only used as a key for wait_on_bit().
1708 *
1696 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1709 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1697 */ 1710 */
1698#define I_DIRTY_SYNC (1 << 0) 1711#define I_DIRTY_SYNC (1 << 0)
@@ -1706,6 +1719,8 @@ struct super_operations {
1706#define __I_SYNC 7 1719#define __I_SYNC 7
1707#define I_SYNC (1 << __I_SYNC) 1720#define I_SYNC (1 << __I_SYNC)
1708#define I_REFERENCED (1 << 8) 1721#define I_REFERENCED (1 << 8)
1722#define __I_DIO_WAKEUP 9
1723#define I_DIO_WAKEUP (1 << I_DIO_WAKEUP)
1709 1724
1710#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1725#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1711 1726
@@ -1816,7 +1831,6 @@ struct file_system_type {
1816 struct lock_class_key i_lock_key; 1831 struct lock_class_key i_lock_key;
1817 struct lock_class_key i_mutex_key; 1832 struct lock_class_key i_mutex_key;
1818 struct lock_class_key i_mutex_dir_key; 1833 struct lock_class_key i_mutex_dir_key;
1819 struct lock_class_key i_alloc_sem_key;
1820}; 1834};
1821 1835
1822extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, 1836extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
@@ -1837,6 +1851,8 @@ void kill_litter_super(struct super_block *sb);
1837void deactivate_super(struct super_block *sb); 1851void deactivate_super(struct super_block *sb);
1838void deactivate_locked_super(struct super_block *sb); 1852void deactivate_locked_super(struct super_block *sb);
1839int set_anon_super(struct super_block *s, void *data); 1853int set_anon_super(struct super_block *s, void *data);
1854int get_anon_bdev(dev_t *);
1855void free_anon_bdev(dev_t);
1840struct super_block *sget(struct file_system_type *type, 1856struct super_block *sget(struct file_system_type *type,
1841 int (*test)(struct super_block *,void *), 1857 int (*test)(struct super_block *,void *),
1842 int (*set)(struct super_block *,void *), 1858 int (*set)(struct super_block *,void *),
@@ -2188,16 +2204,38 @@ extern sector_t bmap(struct inode *, sector_t);
2188#endif 2204#endif
2189extern int notify_change(struct dentry *, struct iattr *); 2205extern int notify_change(struct dentry *, struct iattr *);
2190extern int inode_permission(struct inode *, int); 2206extern int inode_permission(struct inode *, int);
2191extern int generic_permission(struct inode *, int, unsigned int, 2207extern int generic_permission(struct inode *, int);
2192 int (*check_acl)(struct inode *, int, unsigned int));
2193 2208
2194static inline bool execute_ok(struct inode *inode) 2209static inline bool execute_ok(struct inode *inode)
2195{ 2210{
2196 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); 2211 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode);
2197} 2212}
2198 2213
2199extern int get_write_access(struct inode *); 2214/*
2200extern int deny_write_access(struct file *); 2215 * get_write_access() gets write permission for a file.
2216 * put_write_access() releases this write permission.
2217 * This is used for regular files.
2218 * We cannot support write (and maybe mmap read-write shared) accesses and
2219 * MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode
2220 * can have the following values:
2221 * 0: no writers, no VM_DENYWRITE mappings
2222 * < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist
2223 * > 0: (i_writecount) users are writing to the file.
2224 *
2225 * Normally we operate on that counter with atomic_{inc,dec} and it's safe
2226 * except for the cases where we don't hold i_writecount yet. Then we need to
2227 * use {get,deny}_write_access() - these functions check the sign and refuse
2228 * to do the change if sign is wrong.
2229 */
2230static inline int get_write_access(struct inode *inode)
2231{
2232 return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -ETXTBSY;
2233}
2234static inline int deny_write_access(struct file *file)
2235{
2236 struct inode *inode = file->f_path.dentry->d_inode;
2237 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY;
2238}
2201static inline void put_write_access(struct inode * inode) 2239static inline void put_write_access(struct inode * inode)
2202{ 2240{
2203 atomic_dec(&inode->i_writecount); 2241 atomic_dec(&inode->i_writecount);
@@ -2317,7 +2355,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2317/* fs/block_dev.c */ 2355/* fs/block_dev.c */
2318extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2356extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2319 unsigned long nr_segs, loff_t pos); 2357 unsigned long nr_segs, loff_t pos);
2320extern int blkdev_fsync(struct file *filp, int datasync); 2358extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2359 int datasync);
2321 2360
2322/* fs/splice.c */ 2361/* fs/splice.c */
2323extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2362extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2368,6 +2407,8 @@ enum {
2368}; 2407};
2369 2408
2370void dio_end_io(struct bio *bio, int error); 2409void dio_end_io(struct bio *bio, int error);
2410void inode_dio_wait(struct inode *inode);
2411void inode_dio_done(struct inode *inode);
2371 2412
2372ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 2413ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2373 struct block_device *bdev, const struct iovec *iov, loff_t offset, 2414 struct block_device *bdev, const struct iovec *iov, loff_t offset,
@@ -2375,14 +2416,17 @@ ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2375 dio_submit_t submit_io, int flags); 2416 dio_submit_t submit_io, int flags);
2376 2417
2377static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 2418static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2378 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2419 struct inode *inode, const struct iovec *iov, loff_t offset,
2379 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2420 unsigned long nr_segs, get_block_t get_block)
2380 dio_iodone_t end_io)
2381{ 2421{
2382 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2422 return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
2383 nr_segs, get_block, end_io, NULL, 2423 offset, nr_segs, get_block, NULL, NULL,
2384 DIO_LOCKING | DIO_SKIP_HOLES); 2424 DIO_LOCKING | DIO_SKIP_HOLES);
2385} 2425}
2426#else
2427static inline void inode_dio_wait(struct inode *inode)
2428{
2429}
2386#endif 2430#endif
2387 2431
2388extern const struct file_operations generic_ro_fops; 2432extern const struct file_operations generic_ro_fops;
@@ -2432,6 +2476,8 @@ extern struct super_block *get_active_super(struct block_device *bdev);
2432extern struct super_block *user_get_super(dev_t); 2476extern struct super_block *user_get_super(dev_t);
2433extern void drop_super(struct super_block *sb); 2477extern void drop_super(struct super_block *sb);
2434extern void iterate_supers(void (*)(struct super_block *, void *), void *); 2478extern void iterate_supers(void (*)(struct super_block *, void *), void *);
2479extern void iterate_supers_type(struct file_system_type *,
2480 void (*)(struct super_block *, void *), void *);
2435 2481
2436extern int dcache_dir_open(struct inode *, struct file *); 2482extern int dcache_dir_open(struct inode *, struct file *);
2437extern int dcache_dir_close(struct inode *, struct file *); 2483extern int dcache_dir_close(struct inode *, struct file *);
@@ -2444,7 +2490,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *);
2444extern int simple_unlink(struct inode *, struct dentry *); 2490extern int simple_unlink(struct inode *, struct dentry *);
2445extern int simple_rmdir(struct inode *, struct dentry *); 2491extern int simple_rmdir(struct inode *, struct dentry *);
2446extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2492extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
2447extern int noop_fsync(struct file *, int); 2493extern int noop_fsync(struct file *, loff_t, loff_t, int);
2448extern int simple_empty(struct dentry *); 2494extern int simple_empty(struct dentry *);
2449extern int simple_readpage(struct file *file, struct page *page); 2495extern int simple_readpage(struct file *file, struct page *page);
2450extern int simple_write_begin(struct file *file, struct address_space *mapping, 2496extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@ -2469,7 +2515,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2469extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, 2515extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2470 const void __user *from, size_t count); 2516 const void __user *from, size_t count);
2471 2517
2472extern int generic_file_fsync(struct file *, int); 2518extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
2473 2519
2474extern int generic_check_addressable(unsigned, u64); 2520extern int generic_check_addressable(unsigned, u64);
2475 2521
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
index 0437e377b555..574bea4013b6 100644
--- a/include/linux/generic_acl.h
+++ b/include/linux/generic_acl.h
@@ -10,6 +10,6 @@ extern const struct xattr_handler generic_acl_default_handler;
10 10
11int generic_acl_init(struct inode *, struct inode *); 11int generic_acl_init(struct inode *, struct inode *);
12int generic_acl_chmod(struct inode *); 12int generic_acl_chmod(struct inode *);
13int generic_check_acl(struct inode *inode, int mask, unsigned int flags); 13int generic_check_acl(struct inode *inode, int mask);
14 14
15#endif /* LINUX_GENERIC_ACL_H */ 15#endif /* LINUX_GENERIC_ACL_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c70a326b8f26..8a45ad22a170 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -15,6 +15,7 @@
15#include <linux/range.h> 15#include <linux/range.h>
16#include <linux/pfn.h> 16#include <linux/pfn.h>
17#include <linux/bit_spinlock.h> 17#include <linux/bit_spinlock.h>
18#include <linux/shrinker.h>
18 19
19struct mempolicy; 20struct mempolicy;
20struct anon_vma; 21struct anon_vma;
@@ -1121,44 +1122,6 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
1121} 1122}
1122#endif 1123#endif
1123 1124
1124/*
1125 * This struct is used to pass information from page reclaim to the shrinkers.
1126 * We consolidate the values for easier extention later.
1127 */
1128struct shrink_control {
1129 gfp_t gfp_mask;
1130
1131 /* How many slab objects shrinker() should scan and try to reclaim */
1132 unsigned long nr_to_scan;
1133};
1134
1135/*
1136 * A callback you can register to apply pressure to ageable caches.
1137 *
1138 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
1139 * and a 'gfpmask'. It should look through the least-recently-used
1140 * 'nr_to_scan' entries and attempt to free them up. It should return
1141 * the number of objects which remain in the cache. If it returns -1, it means
1142 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
1143 *
1144 * The 'gfpmask' refers to the allocation we are currently trying to
1145 * fulfil.
1146 *
1147 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
1148 * querying the cache size, so a fastpath for that case is appropriate.
1149 */
1150struct shrinker {
1151 int (*shrink)(struct shrinker *, struct shrink_control *sc);
1152 int seeks; /* seeks to recreate an obj */
1153
1154 /* These are for internal use */
1155 struct list_head list;
1156 long nr; /* objs pending delete */
1157};
1158#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
1159extern void register_shrinker(struct shrinker *);
1160extern void unregister_shrinker(struct shrinker *);
1161
1162int vma_wants_writenotify(struct vm_area_struct *vma); 1125int vma_wants_writenotify(struct vm_area_struct *vma);
1163 1126
1164extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, 1127extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 0b89efc6f215..29304855652d 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -18,7 +18,6 @@ struct proc_mounts {
18 struct seq_file m; /* must be the first element */ 18 struct seq_file m; /* must be the first element */
19 struct mnt_namespace *ns; 19 struct mnt_namespace *ns;
20 struct path root; 20 struct path root;
21 int event;
22}; 21};
23 22
24struct fs_struct; 23struct fs_struct;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index eba45ea10298..76fe2c62ae71 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -48,7 +48,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
48 */ 48 */
49#define LOOKUP_FOLLOW 0x0001 49#define LOOKUP_FOLLOW 0x0001
50#define LOOKUP_DIRECTORY 0x0002 50#define LOOKUP_DIRECTORY 0x0002
51#define LOOKUP_CONTINUE 0x0004
52 51
53#define LOOKUP_PARENT 0x0010 52#define LOOKUP_PARENT 0x0010
54#define LOOKUP_REVAL 0x0020 53#define LOOKUP_REVAL 0x0020
@@ -75,9 +74,11 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *);
75 74
76extern int kern_path(const char *, unsigned, struct path *); 75extern int kern_path(const char *, unsigned, struct path *);
77 76
77extern struct dentry *kern_path_create(int, const char *, struct path *, int);
78extern struct dentry *user_path_create(int, const char __user *, struct path *, int);
78extern int kern_path_parent(const char *, struct nameidata *); 79extern int kern_path_parent(const char *, struct nameidata *);
79extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 80extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
80 const char *, unsigned int, struct nameidata *); 81 const char *, unsigned int, struct path *);
81 82
82extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, 83extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
83 int (*open)(struct inode *, struct file *)); 84 int (*open)(struct inode *, struct file *));
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 1b93b9c60e55..8b579beb6358 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -85,7 +85,7 @@ struct nfs_lock_context {
85struct nfs4_state; 85struct nfs4_state;
86struct nfs_open_context { 86struct nfs_open_context {
87 struct nfs_lock_context lock_context; 87 struct nfs_lock_context lock_context;
88 struct path path; 88 struct dentry *dentry;
89 struct rpc_cred *cred; 89 struct rpc_cred *cred;
90 struct nfs4_state *state; 90 struct nfs4_state *state;
91 fmode_t mode; 91 fmode_t mode;
@@ -360,7 +360,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
363extern int nfs_permission(struct inode *, int, unsigned int); 363extern int nfs_permission(struct inode *, int);
364extern int nfs_open(struct inode *, struct file *); 364extern int nfs_open(struct inode *, struct file *);
365extern int nfs_release(struct inode *, struct file *); 365extern int nfs_release(struct inode *, struct file *);
366extern int nfs_attribute_timeout(struct inode *inode); 366extern int nfs_attribute_timeout(struct inode *inode);
@@ -372,7 +372,7 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
372extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 372extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
373extern void put_nfs_open_context(struct nfs_open_context *ctx); 373extern void put_nfs_open_context(struct nfs_open_context *ctx);
374extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 374extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
375extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode); 375extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode);
376extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 376extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
377extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 377extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
378extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 378extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 50d20aba57d3..cc37a55ad004 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -68,6 +68,7 @@ void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
68void free_nsproxy(struct nsproxy *ns); 68void free_nsproxy(struct nsproxy *ns);
69int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, 69int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
70 struct fs_struct *); 70 struct fs_struct *);
71int __init nsproxy_cache_init(void);
71 72
72static inline void put_nsproxy(struct nsproxy *ns) 73static inline void put_nsproxy(struct nsproxy *ns)
73{ 74{
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 6deef5dc95fb..57958c0e1d38 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -41,10 +41,11 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
41int reiserfs_lookup_privroot(struct super_block *sb); 41int reiserfs_lookup_privroot(struct super_block *sb);
42int reiserfs_delete_xattrs(struct inode *inode); 42int reiserfs_delete_xattrs(struct inode *inode);
43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); 43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
44int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); 44int reiserfs_permission(struct inode *inode, int mask);
45 45
46#ifdef CONFIG_REISERFS_FS_XATTR 46#ifdef CONFIG_REISERFS_FS_XATTR
47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
48int reiserfs_check_acl(struct inode *inode, int mask);
48ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, 49ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name,
49 void *buffer, size_t size); 50 void *buffer, size_t size);
50int reiserfs_setxattr(struct dentry *dentry, const char *name, 51int reiserfs_setxattr(struct dentry *dentry, const char *name,
@@ -122,6 +123,7 @@ static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
122#define reiserfs_setxattr NULL 123#define reiserfs_setxattr NULL
123#define reiserfs_listxattr NULL 124#define reiserfs_listxattr NULL
124#define reiserfs_removexattr NULL 125#define reiserfs_removexattr NULL
126#define reiserfs_check_acl NULL
125 127
126static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 128static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
127{ 129{
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index a8afe9cd000c..77950dfa0a9e 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -124,19 +124,9 @@ extern void downgrade_write(struct rw_semaphore *sem);
124 */ 124 */
125extern void down_read_nested(struct rw_semaphore *sem, int subclass); 125extern void down_read_nested(struct rw_semaphore *sem, int subclass);
126extern void down_write_nested(struct rw_semaphore *sem, int subclass); 126extern void down_write_nested(struct rw_semaphore *sem, int subclass);
127/*
128 * Take/release a lock when not the owner will release it.
129 *
130 * [ This API should be avoided as much as possible - the
131 * proper abstraction for this case is completions. ]
132 */
133extern void down_read_non_owner(struct rw_semaphore *sem);
134extern void up_read_non_owner(struct rw_semaphore *sem);
135#else 127#else
136# define down_read_nested(sem, subclass) down_read(sem) 128# define down_read_nested(sem, subclass) down_read(sem)
137# define down_write_nested(sem, subclass) down_write(sem) 129# define down_write_nested(sem, subclass) down_write(sem)
138# define down_read_non_owner(sem) down_read(sem)
139# define up_read_non_owner(sem) up_read(sem)
140#endif 130#endif
141 131
142#endif /* _LINUX_RWSEM_H */ 132#endif /* _LINUX_RWSEM_H */
diff --git a/include/linux/security.h b/include/linux/security.h
index 8ce59ef3e5af..ebd2a53a3d07 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1456,7 +1456,7 @@ struct security_operations {
1456 struct inode *new_dir, struct dentry *new_dentry); 1456 struct inode *new_dir, struct dentry *new_dentry);
1457 int (*inode_readlink) (struct dentry *dentry); 1457 int (*inode_readlink) (struct dentry *dentry);
1458 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); 1458 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
1459 int (*inode_permission) (struct inode *inode, int mask, unsigned flags); 1459 int (*inode_permission) (struct inode *inode, int mask);
1460 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); 1460 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
1461 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); 1461 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
1462 int (*inode_setxattr) (struct dentry *dentry, const char *name, 1462 int (*inode_setxattr) (struct dentry *dentry, const char *name,
@@ -1720,7 +1720,6 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
1720int security_inode_readlink(struct dentry *dentry); 1720int security_inode_readlink(struct dentry *dentry);
1721int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); 1721int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1722int security_inode_permission(struct inode *inode, int mask); 1722int security_inode_permission(struct inode *inode, int mask);
1723int security_inode_exec_permission(struct inode *inode, unsigned int flags);
1724int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1723int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1725int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1724int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1726int security_inode_setxattr(struct dentry *dentry, const char *name, 1725int security_inode_setxattr(struct dentry *dentry, const char *name,
@@ -2113,12 +2112,6 @@ static inline int security_inode_permission(struct inode *inode, int mask)
2113 return 0; 2112 return 0;
2114} 2113}
2115 2114
2116static inline int security_inode_exec_permission(struct inode *inode,
2117 unsigned int flags)
2118{
2119 return 0;
2120}
2121
2122static inline int security_inode_setattr(struct dentry *dentry, 2115static inline int security_inode_setattr(struct dentry *dentry,
2123 struct iattr *attr) 2116 struct iattr *attr)
2124{ 2117{
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 03c0232b4169..be720cd2038d 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -23,6 +23,7 @@ struct seq_file {
23 u64 version; 23 u64 version;
24 struct mutex lock; 24 struct mutex lock;
25 const struct seq_operations *op; 25 const struct seq_operations *op;
26 int poll_event;
26 void *private; 27 void *private;
27}; 28};
28 29
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
new file mode 100644
index 000000000000..790651b4e5ba
--- /dev/null
+++ b/include/linux/shrinker.h
@@ -0,0 +1,42 @@
1#ifndef _LINUX_SHRINKER_H
2#define _LINUX_SHRINKER_H
3
4/*
5 * This struct is used to pass information from page reclaim to the shrinkers.
6 * We consolidate the values for easier extention later.
7 */
8struct shrink_control {
9 gfp_t gfp_mask;
10
11 /* How many slab objects shrinker() should scan and try to reclaim */
12 unsigned long nr_to_scan;
13};
14
15/*
16 * A callback you can register to apply pressure to ageable caches.
17 *
18 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
19 * and a 'gfpmask'. It should look through the least-recently-used
20 * 'nr_to_scan' entries and attempt to free them up. It should return
21 * the number of objects which remain in the cache. If it returns -1, it means
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
23 *
24 * The 'gfpmask' refers to the allocation we are currently trying to
25 * fulfil.
26 *
27 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
28 * querying the cache size, so a fastpath for that case is appropriate.
29 */
30struct shrinker {
31 int (*shrink)(struct shrinker *, struct shrink_control *sc);
32 int seeks; /* seeks to recreate an obj */
33 long batch; /* reclaim batch size, 0 = default */
34
35 /* These are for internal use */
36 struct list_head list;
37 long nr; /* objs pending delete */
38};
39#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
40extern void register_shrinker(struct shrinker *);
41extern void unregister_shrinker(struct shrinker *);
42#endif
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index b2c33bd955fa..36851f7f13da 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -179,6 +179,83 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_re
179 TP_ARGS(nr_reclaimed) 179 TP_ARGS(nr_reclaimed)
180); 180);
181 181
182TRACE_EVENT(mm_shrink_slab_start,
183 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
184 long nr_objects_to_shrink, unsigned long pgs_scanned,
185 unsigned long lru_pgs, unsigned long cache_items,
186 unsigned long long delta, unsigned long total_scan),
187
188 TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs,
189 cache_items, delta, total_scan),
190
191 TP_STRUCT__entry(
192 __field(struct shrinker *, shr)
193 __field(void *, shrink)
194 __field(long, nr_objects_to_shrink)
195 __field(gfp_t, gfp_flags)
196 __field(unsigned long, pgs_scanned)
197 __field(unsigned long, lru_pgs)
198 __field(unsigned long, cache_items)
199 __field(unsigned long long, delta)
200 __field(unsigned long, total_scan)
201 ),
202
203 TP_fast_assign(
204 __entry->shr = shr;
205 __entry->shrink = shr->shrink;
206 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
207 __entry->gfp_flags = sc->gfp_mask;
208 __entry->pgs_scanned = pgs_scanned;
209 __entry->lru_pgs = lru_pgs;
210 __entry->cache_items = cache_items;
211 __entry->delta = delta;
212 __entry->total_scan = total_scan;
213 ),
214
215 TP_printk("%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
216 __entry->shrink,
217 __entry->shr,
218 __entry->nr_objects_to_shrink,
219 show_gfp_flags(__entry->gfp_flags),
220 __entry->pgs_scanned,
221 __entry->lru_pgs,
222 __entry->cache_items,
223 __entry->delta,
224 __entry->total_scan)
225);
226
227TRACE_EVENT(mm_shrink_slab_end,
228 TP_PROTO(struct shrinker *shr, int shrinker_retval,
229 long unused_scan_cnt, long new_scan_cnt),
230
231 TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt),
232
233 TP_STRUCT__entry(
234 __field(struct shrinker *, shr)
235 __field(void *, shrink)
236 __field(long, unused_scan)
237 __field(long, new_scan)
238 __field(int, retval)
239 __field(long, total_scan)
240 ),
241
242 TP_fast_assign(
243 __entry->shr = shr;
244 __entry->shrink = shr->shrink;
245 __entry->unused_scan = unused_scan_cnt;
246 __entry->new_scan = new_scan_cnt;
247 __entry->retval = shrinker_retval;
248 __entry->total_scan = new_scan_cnt - unused_scan_cnt;
249 ),
250
251 TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
252 __entry->shrink,
253 __entry->shr,
254 __entry->unused_scan,
255 __entry->new_scan,
256 __entry->total_scan,
257 __entry->retval)
258);
182 259
183DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, 260DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
184 261