summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2002-12-23 19:47:41 +1100
committerPaul Mackerras <paulus@samba.org>2002-12-23 19:47:41 +1100
commitaeb24f2986ff9471fd062e50815466b0c6415b52 (patch)
treef1015dc5aeeff1df6f7540b590f8084de0c6fa42 /include/linux
parentc261322433a7e8f2f0b0c2d1ff8af089e39d5597 (diff)
parent4e375211e20eff9ad5382e3bfe2e7408907fd971 (diff)
Merge samba.org:/home/paulus/kernel/linux-2.5
into samba.org:/home/paulus/kernel/for-linus-ppc
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/amigaffs.h10
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/dma-mapping.h17
-rw-r--r--include/linux/elf.h24
-rw-r--r--include/linux/ext3_fs_i.h21
-rw-r--r--include/linux/fb.h2
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/mmzone.h15
-rw-r--r--include/linux/nfs4.h3
-rw-r--r--include/linux/nfs_fs.h7
-rw-r--r--include/linux/nfs_xdr.h60
-rw-r--r--include/linux/pci.h99
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/sched.h11
-rw-r--r--include/linux/slab.h2
-rw-r--r--include/linux/swap.h6
17 files changed, 196 insertions, 87 deletions
diff --git a/include/linux/amigaffs.h b/include/linux/amigaffs.h
index 4c8df68e48e2..bde160f417fd 100644
--- a/include/linux/amigaffs.h
+++ b/include/linux/amigaffs.h
@@ -28,7 +28,7 @@ affs_set_blocksize(struct super_block *sb, int size)
static inline struct buffer_head *
affs_bread(struct super_block *sb, int block)
{
- pr_debug(KERN_DEBUG "affs_bread: %d\n", block);
+ pr_debug("affs_bread: %d\n", block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size)
return sb_bread(sb, block);
return NULL;
@@ -36,7 +36,7 @@ affs_bread(struct super_block *sb, int block)
static inline struct buffer_head *
affs_getblk(struct super_block *sb, int block)
{
- pr_debug(KERN_DEBUG "affs_getblk: %d\n", block);
+ pr_debug("affs_getblk: %d\n", block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size)
return sb_getblk(sb, block);
return NULL;
@@ -45,7 +45,7 @@ static inline struct buffer_head *
affs_getzeroblk(struct super_block *sb, int block)
{
struct buffer_head *bh;
- pr_debug(KERN_DEBUG "affs_getzeroblk: %d\n", block);
+ pr_debug("affs_getzeroblk: %d\n", block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) {
bh = sb_getblk(sb, block);
lock_buffer(bh);
@@ -60,7 +60,7 @@ static inline struct buffer_head *
affs_getemptyblk(struct super_block *sb, int block)
{
struct buffer_head *bh;
- pr_debug(KERN_DEBUG "affs_getemptyblk: %d\n", block);
+ pr_debug("affs_getemptyblk: %d\n", block);
if (block >= AFFS_SB(sb)->s_reserved && block < AFFS_SB(sb)->s_partition_size) {
bh = sb_getblk(sb, block);
wait_on_buffer(bh);
@@ -73,7 +73,7 @@ static inline void
affs_brelse(struct buffer_head *bh)
{
if (bh)
- pr_debug(KERN_DEBUG "affs_brelse: %ld\n", bh->b_blocknr);
+ pr_debug("affs_brelse: %ld\n", bh->b_blocknr);
brelse(bh);
}
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index e9d6251fa168..7fc917c13f32 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -22,6 +22,7 @@ enum bh_state_bits {
BH_New, /* Disk mapping was newly created by get_block */
BH_Async_Read, /* Is under end_buffer_async_read I/O */
BH_Async_Write, /* Is under end_buffer_async_write I/O */
+ BH_Delay, /* Buffer is not yet allocated on disk */
BH_Boundary, /* Block is followed by a discontiguity */
BH_PrivateStart,/* not a state bit, but the first bit available
@@ -105,6 +106,7 @@ BUFFER_FNS(Mapped, mapped)
BUFFER_FNS(New, new)
BUFFER_FNS(Async_Read, async_read)
BUFFER_FNS(Async_Write, async_write)
+BUFFER_FNS(Delay, delay);
BUFFER_FNS(Boundary, boundary)
#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
new file mode 100644
index 000000000000..9d88549ff2fc
--- /dev/null
+++ b/include/linux/dma-mapping.h
@@ -0,0 +1,17 @@
+#ifndef _ASM_LINUX_DMA_MAPPING_H
+#define _ASM_LINUX_DMA_MAPPING_H
+
+/* These definitions mirror those in pci.h, so they can be used
+ * interchangeably with their PCI_ counterparts */
+enum dma_data_direction {
+ DMA_BIDIRECTIONAL = 0,
+ DMA_TO_DEVICE = 1,
+ DMA_FROM_DEVICE = 2,
+ DMA_NONE = 3,
+};
+
+#include <asm/dma-mapping.h>
+
+#endif
+
+
diff --git a/include/linux/elf.h b/include/linux/elf.h
index f5702e3c7c20..2745227ff929 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -90,6 +90,9 @@ typedef __s64 Elf64_Sxword;
*/
#define EM_ALPHA 0x9026
+/* Bogus old v850 magic number, used by old tools. */
+#define EM_CYGNUS_V850 0x9080
+
/*
* This is the old interim value for S/390 architecture
*/
@@ -448,6 +451,27 @@ typedef struct {
/* Keep this the last entry. */
#define R_390_NUM 27
+/* x86-64 relocation types */
+#define R_X86_64_NONE 0 /* No reloc */
+#define R_X86_64_64 1 /* Direct 64 bit */
+#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
+#define R_X86_64_GOT32 3 /* 32 bit GOT entry */
+#define R_X86_64_PLT32 4 /* 32 bit PLT address */
+#define R_X86_64_COPY 5 /* Copy symbol at runtime */
+#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
+#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
+#define R_X86_64_RELATIVE 8 /* Adjust by program base */
+#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative
+ offset to GOT */
+#define R_X86_64_32 10 /* Direct 32 bit zero extended */
+#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
+#define R_X86_64_16 12 /* Direct 16 bit zero extended */
+#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
+#define R_X86_64_8 14 /* Direct 8 bit sign extended */
+#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
+
+#define R_X86_64_NUM 16
+
/* s390 relocations defined by the ABIs */
#define R_390_NONE 0 /* No reloc. */
#define R_390_8 1 /* Direct 8 bit. */
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index ec11e1ab01c5..02021676dd74 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -32,9 +32,30 @@ struct ext3_inode_info {
__u32 i_file_acl;
__u32 i_dir_acl;
__u32 i_dtime;
+
+ /*
+ * i_block_group is the number of the block group which contains
+ * this file's inode. Constant across the lifetime of the inode,
+ * it is ued for making block allocation decisions - we try to
+ * place a file's data blocks near its inode block, and new inodes
+ * near to their parent directory's inode.
+ */
__u32 i_block_group;
__u32 i_state; /* Dynamic state flags for ext3 */
+
+ /*
+ * i_next_alloc_block is the logical (file-relative) number of the
+ * most-recently-allocated block in this file. Yes, it is misnamed.
+ * We use this for detecting linearly ascending allocation requests.
+ */
__u32 i_next_alloc_block;
+
+ /*
+ * i_next_alloc_goal is the *physical* companion to i_next_alloc_block.
+ * it the the physical block number of the block which was most-recently
+ * allocated to this file. This give us the goal (target) for the next
+ * allocation when we detect linearly ascending requests.
+ */
__u32 i_next_alloc_goal;
#ifdef EXT3_PREALLOCATE
__u32 i_prealloc_block;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 0281509b85c8..23dd4c02ddec 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -412,9 +412,11 @@ struct fb_info {
#define fb_readb sbus_readb
#define fb_readw sbus_readw
#define fb_readl sbus_readl
+#define fb_readq sbus_readq
#define fb_writeb sbus_writeb
#define fb_writew sbus_writew
#define fb_writel sbus_writel
+#define fb_writeq sbus_writeq
#define fb_memset sbus_memset_io
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 8e093813e4f7..54bf03eaf3e7 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -18,6 +18,7 @@
#define __GFP_HIGHIO 0x80 /* Can start high mem physical IO? */
#define __GFP_FS 0x100 /* Can call down to low-level FS? */
#define __GFP_COLD 0x200 /* Cache-cold page required */
+#define __GFP_NOWARN 0x400 /* Suppress page allocation failure warning */
#define GFP_NOHIGHIO ( __GFP_WAIT | __GFP_IO)
#define GFP_NOIO ( __GFP_WAIT)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d9b8c5d9b55c..77bc3a1340ac 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -63,7 +63,7 @@
.prio = MAX_PRIO-20, \
.static_prio = MAX_PRIO-20, \
.policy = SCHED_NORMAL, \
- .cpus_allowed = -1, \
+ .cpus_allowed = ~0UL, \
.mm = NULL, \
.active_mm = &init_mm, \
.run_list = LIST_HEAD_INIT(tsk.run_list), \
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f286bf9aeefd..14ce2049de71 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -193,16 +193,6 @@ typedef struct pglist_data {
extern int numnodes;
extern struct pglist_data *pgdat_list;
-static inline int
-memclass(struct zone *pgzone, struct zone *classzone)
-{
- if (pgzone->zone_pgdat != classzone->zone_pgdat)
- return 0;
- if (pgzone > classzone)
- return 0;
- return 1;
-}
-
void get_zone_counts(unsigned long *active, unsigned long *inactive);
void build_all_zonelists(void);
void wakeup_kswapd(struct zone *zone);
@@ -335,11 +325,6 @@ static inline unsigned int num_online_memblks(void)
#define num_online_memblks() 1
#endif /* CONFIG_DISCONTIGMEM || CONFIG_NUMA */
-
-
-#define MAP_ALIGN(x) ((((x) % sizeof(struct page)) == 0) ? (x) : ((x) + \
- sizeof(struct page) - ((x) % sizeof(struct page))))
-
#endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _LINUX_MMZONE_H */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 36e71c8ed51e..7c0d596db02f 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -203,6 +203,9 @@ enum open_delegation_type4 {
enum {
NFSPROC4_CLNT_NULL = 0, /* Unused */
NFSPROC4_CLNT_COMPOUND, /* Soon to be unused */
+ NFSPROC4_CLNT_READ,
+ NFSPROC4_CLNT_WRITE,
+ NFSPROC4_CLNT_COMMIT,
};
#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 2673e32cc4ba..bc44563921f7 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -222,7 +222,7 @@ loff_t page_offset(struct page *page)
static inline
loff_t req_offset(struct nfs_page *req)
{
- return ((loff_t)req->wb_index) << PAGE_CACHE_SHIFT;
+ return (((loff_t)req->wb_index) << PAGE_CACHE_SHIFT) + req->wb_offset;
}
/*
@@ -295,8 +295,7 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
extern int nfs_writepages(struct address_space *, struct writeback_control *);
extern int nfs_flush_incompatible(struct file *file, struct page *page);
extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
-extern void nfs_writeback_done(struct rpc_task *task, int stable,
- unsigned int arg_count, unsigned int res_count);
+extern void nfs_writeback_done(struct rpc_task *task);
extern void nfs_writedata_release(struct rpc_task *task);
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
@@ -369,7 +368,7 @@ extern int nfs_readpage(struct file *, struct page *);
extern int nfs_readpages(struct file *, struct address_space *,
struct list_head *, unsigned);
extern int nfs_pagein_list(struct list_head *, int);
-extern void nfs_readpage_result(struct rpc_task *, unsigned int count, int eof);
+extern void nfs_readpage_result(struct rpc_task *);
extern void nfs_readdata_release(struct rpc_task *);
/*
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index af914e160fc6..2b96e1e5aa97 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -35,6 +35,7 @@ struct nfs_fattr {
struct timespec atime;
struct timespec mtime;
struct timespec ctime;
+ __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
__u64 change_attr; /* NFSv4 change attribute */
__u64 pre_change_attr;/* pre-op NFSv4 change attribute */
unsigned long timestamp;
@@ -346,12 +347,6 @@ struct nfs4_close {
u32 cl_seqid; /* request */
};
-struct nfs4_commit {
- u64 co_start; /* request */
- u32 co_len; /* request */
- struct nfs_writeverf * co_verifier; /* response */
-};
-
struct nfs4_create {
u32 cr_ftype; /* request */
union { /* request */
@@ -422,15 +417,6 @@ struct nfs4_putfh {
struct nfs_fh * pf_fhandle; /* request */
};
-struct nfs4_read {
- u64 rd_offset; /* request */
- u32 rd_length; /* request */
- u32 *rd_eof; /* response */
- u32 *rd_bytes_read; /* response */
- struct page ** rd_pages; /* zero-copy data */
- unsigned int rd_pgbase; /* zero-copy data */
-};
-
struct nfs4_readdir {
u64 rd_cookie; /* request */
nfs4_verifier rd_req_verifier; /* request */
@@ -476,22 +462,11 @@ struct nfs4_setclientid {
struct nfs4_client * sc_state; /* response */
};
-struct nfs4_write {
- u64 wr_offset; /* request */
- u32 wr_stable_how; /* request */
- u32 wr_len; /* request */
- u32 * wr_bytes_written; /* response */
- struct nfs_writeverf * wr_verf; /* response */
- struct page ** wr_pages; /* zero-copy data */
- unsigned int wr_pgbase; /* zero-copy data */
-};
-
struct nfs4_op {
u32 opnum;
union {
struct nfs4_access access;
struct nfs4_close close;
- struct nfs4_commit commit;
struct nfs4_create create;
struct nfs4_getattr getattr;
struct nfs4_getfh getfh;
@@ -500,7 +475,6 @@ struct nfs4_op {
struct nfs4_open open;
struct nfs4_open_confirm open_confirm;
struct nfs4_putfh putfh;
- struct nfs4_read read;
struct nfs4_readdir readdir;
struct nfs4_readlink readlink;
struct nfs4_remove remove;
@@ -509,7 +483,6 @@ struct nfs4_op {
struct nfs4_setattr setattr;
struct nfs4_setclientid setclientid;
struct nfs4_client * setclientid_confirm;
- struct nfs4_write write;
} u;
};
@@ -548,20 +521,11 @@ struct nfs_read_data {
struct nfs_fattr fattr; /* fattr storage */
struct list_head pages; /* Coalesced read requests */
struct page *pagevec[NFS_READ_MAXIOV];
- union {
- struct {
- struct nfs_readargs args;
- struct nfs_readres res;
- } v3; /* also v2 */
+ struct nfs_readargs args;
+ struct nfs_readres res;
#ifdef CONFIG_NFS_V4
- struct {
- struct nfs4_compound compound;
- struct nfs4_op ops[3];
- u32 res_count;
- u32 res_eof;
- } v4;
+ unsigned long timestamp; /* For lease renewal */
#endif
- } u;
};
struct nfs_write_data {
@@ -572,21 +536,11 @@ struct nfs_write_data {
struct nfs_writeverf verf;
struct list_head pages; /* Coalesced requests we wish to flush */
struct page *pagevec[NFS_WRITE_MAXIOV];
- union {
- struct {
- struct nfs_writeargs args; /* argument struct */
- struct nfs_writeres res; /* result struct */
- } v3;
+ struct nfs_writeargs args; /* argument struct */
+ struct nfs_writeres res; /* result struct */
#ifdef CONFIG_NFS_V4
- struct {
- struct nfs4_compound compound;
- struct nfs4_op ops[3];
- u32 arg_count;
- u32 arg_stable;
- u32 res_count;
- } v4;
+ unsigned long timestamp; /* For lease renewal */
#endif
- } u;
};
/*
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 557b17d959c1..3fa241545729 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -558,8 +558,16 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
/* Generic PCI functions used internally */
int pci_bus_exists(const struct list_head *list, int nr);
-struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
-struct pci_bus *pci_alloc_primary_bus(int bus);
+struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
+static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
+{
+ return pci_scan_bus_parented(NULL, bus, ops, sysdata);
+}
+struct pci_bus *pci_alloc_primary_bus_parented(struct device * parent, int bus);
+static inline struct pci_bus *pci_alloc_primary_bus(int bus)
+{
+ return pci_alloc_primary_bus_parented(NULL, bus);
+}
struct pci_dev *pci_scan_slot(struct pci_dev *temp);
int pci_proc_attach_device(struct pci_dev *dev);
int pci_proc_detach_device(struct pci_dev *dev);
@@ -826,5 +834,92 @@ extern int pci_pci_problems;
#define PCIPCI_VIAETBF 8
#define PCIPCI_VSFX 16
+#include <linux/dma-mapping.h>
+
+/* If you define PCI_NEW_DMA_COMPAT_API it means you support the new DMA API
+ * and you want the pci_ DMA API to be implemented using it.
+ */
+#if defined(PCI_NEW_DMA_COMPAT_API) && defined(CONFIG_PCI)
+
+/* note pci_set_dma_mask isn't here, since it's a public function
+ * exported from drivers/pci, use dma_supported instead */
+
+static inline int
+pci_dma_supported(struct pci_dev *hwdev, u64 mask)
+{
+ return dma_supported(&hwdev->dev, mask);
+}
+
+static inline void *
+pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+ dma_addr_t *dma_handle)
+{
+ return dma_alloc_coherent(&hwdev->dev, size, dma_handle);
+}
+
+static inline void
+pci_free_consistent(struct pci_dev *hwdev, size_t size,
+ void *vaddr, dma_addr_t dma_handle)
+{
+ dma_free_coherent(&hwdev->dev, size, vaddr, dma_handle);
+}
+
+static inline dma_addr_t
+pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
+{
+ return dma_map_single(&hwdev->dev, ptr, size, (enum dma_data_direction)direction);
+}
+
+static inline void
+pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
+ size_t size, int direction)
+{
+ dma_unmap_single(&hwdev->dev, dma_addr, size, (enum dma_data_direction)direction);
+}
+
+static inline dma_addr_t
+pci_map_page(struct pci_dev *hwdev, struct page *page,
+ unsigned long offset, size_t size, int direction)
+{
+ return dma_map_page(&hwdev->dev, page, offset, size, (enum dma_data_direction)direction);
+}
+
+static inline void
+pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
+ size_t size, int direction)
+{
+ dma_unmap_page(&hwdev->dev, dma_address, size, (enum dma_data_direction)direction);
+}
+
+static inline int
+pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
+ int nents, int direction)
+{
+ return dma_map_sg(&hwdev->dev, sg, nents, (enum dma_data_direction)direction);
+}
+
+static inline void
+pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
+ int nents, int direction)
+{
+ dma_unmap_sg(&hwdev->dev, sg, nents, (enum dma_data_direction)direction);
+}
+
+static inline void
+pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle,
+ size_t size, int direction)
+{
+ dma_sync_single(&hwdev->dev, dma_handle, size, (enum dma_data_direction)direction);
+}
+
+static inline void
+pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg,
+ int nelems, int direction)
+{
+ dma_sync_sg(&hwdev->dev, sg, nelems, (enum dma_data_direction)direction);
+}
+
+#endif
+
#endif /* __KERNEL__ */
#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 4f90ff1ccbe8..1befa5e1830b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -410,6 +410,7 @@
#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469
#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d
#define PCI_DEVICE_ID_AMD_8151_0 0x7454
+#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450
#define PCI_VENDOR_ID_TRIDENT 0x1023
#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d0726cb87145..7c3bbfc255ed 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -419,13 +419,12 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_MEMALLOC 0x00000800 /* Allocating memory */
#define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */
#define PF_FLUSHER 0x00002000 /* responsible for disk writeback */
-#define PF_NOWARN 0x00004000 /* debug: don't warn if alloc fails */
-#define PF_FREEZE 0x00008000 /* this task should be frozen for suspend */
-#define PF_IOTHREAD 0x00010000 /* this thread is needed for doing I/O to swap */
-#define PF_FROZEN 0x00020000 /* frozen for system suspend */
-#define PF_FSTRANS 0x00040000 /* inside a filesystem transaction */
-#define PF_KSWAPD 0x00080000 /* I am kswapd */
+#define PF_FREEZE 0x00004000 /* this task should be frozen for suspend */
+#define PF_IOTHREAD 0x00008000 /* this thread is needed for doing I/O to swap */
+#define PF_FROZEN 0x00010000 /* frozen for system suspend */
+#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
+#define PF_KSWAPD 0x00040000 /* I am kswapd */
/*
* Ptrace flags
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 3a5a6d576f93..997bc710bfb0 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -23,7 +23,7 @@ typedef struct kmem_cache_s kmem_cache_t;
#define SLAB_KERNEL GFP_KERNEL
#define SLAB_DMA GFP_DMA
-#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS)
+#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS|__GFP_COLD|__GFP_NOWARN)
#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */
/* flags to pass to kmem_cache_create().
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c635f392d6c1..9ab02098aad5 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -7,6 +7,7 @@
#include <linux/linkage.h>
#include <linux/mmzone.h>
#include <linux/list.h>
+#include <linux/sched.h>
#include <asm/atomic.h>
#include <asm/page.h>
@@ -14,6 +15,11 @@
#define SWAP_FLAG_PRIO_MASK 0x7fff
#define SWAP_FLAG_PRIO_SHIFT 0
+static inline int current_is_kswapd(void)
+{
+ return current->flags & PF_KSWAPD;
+}
+
/*
* MAX_SWAPFILES defines the maximum number of swaptypes: things which can
* be swapped to. The swap type and the offset into that swap type are