1 #ifndef _LINUX_SCHED_MM_H
2 #define _LINUX_SCHED_MM_H
4 #define PF_MEMALLOC 0x00000800 /* Allocating memory */
5 #define PF_MEMALLOC_NOFS 0x00040000 /* All allocation requests will inherit GFP_NOFS */
7 static inline unsigned int memalloc_nofs_save(void)
9 unsigned int flags = current->flags & PF_MEMALLOC_NOFS;
10 current->flags |= PF_MEMALLOC_NOFS;
14 static inline void memalloc_nofs_restore(unsigned int flags)
16 current->flags = (current->flags & ~PF_MEMALLOC_NOFS) | flags;
19 static inline unsigned int memalloc_noreclaim_save(void)
21 unsigned int flags = current->flags & PF_MEMALLOC;
22 current->flags |= PF_MEMALLOC;
26 static inline void memalloc_noreclaim_restore(unsigned int flags)
28 current->flags = (current->flags & ~PF_MEMALLOC) | flags;
31 #endif /* _LINUX_SCHED_MM_H */