aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 20:37:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 20:37:43 -0400
commit5f56886521d6ddd3648777fae44d82382dd8c87f (patch)
treeaa0db6331cdb01c23f1884439840aadd31bbcca4 /include/linux
parentf1e9a236e5ddab6c349611ee86f54291916f226c (diff)
parente2a8b0a779787314eca1061308a8182e6c5bfabd (diff)
Merge branch 'akpm' (incoming from Andrew)
Merge third batch of fixes from Andrew Morton: "Most of the rest. I still have two large patchsets against AIO and IPC, but they're a bit stuck behind other trees and I'm about to vanish for six days. - random fixlets - inotify - more of the MM queue - show_stack() cleanups - DMI update - kthread/workqueue things - compat cleanups - epoll udpates - binfmt updates - nilfs2 - hfs - hfsplus - ptrace - kmod - coredump - kexec - rbtree - pids - pidns - pps - semaphore tweaks - some w1 patches - relay updates - core Kconfig changes - sysrq tweaks" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (109 commits) Documentation/sysrq: fix inconstistent help message of sysrq key ethernet/emac/sysrq: fix inconstistent help message of sysrq key sparc/sysrq: fix inconstistent help message of sysrq key powerpc/xmon/sysrq: fix inconstistent help message of sysrq key ARM/etm/sysrq: fix inconstistent help message of sysrq key power/sysrq: fix inconstistent help message of sysrq key kgdb/sysrq: fix inconstistent help message of sysrq key lib/decompress.c: fix initconst notifier-error-inject: fix module names in Kconfig kernel/sys.c: make prctl(PR_SET_MM) generally available UAPI: remove empty Kbuild files menuconfig: print more info for symbol without prompts init/Kconfig: re-order CONFIG_EXPERT options to fix menuconfig display kconfig menu: move Virtualization drivers near other virtualization options Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS relay: use macro PAGE_ALIGN instead of FIX_SIZE kernel/relay.c: move FIX_SIZE macro into relay.c kernel/relay.c: remove unused function argument actor drivers/w1/slaves/w1_ds2760.c: fix the error handling in w1_ds2760_add_slave() drivers/w1/slaves/w1_ds2781.c: fix the error handling in w1_ds2781_add_slave() ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cleancache.h4
-rw-r--r--include/linux/dmi.h2
-rw-r--r--include/linux/frontswap.h36
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kmod.h17
-rw-r--r--include/linux/kthread.h1
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/pid_namespace.h4
-rw-r--r--include/linux/printk.h15
-rw-r--r--include/linux/relay.h3
-rw-r--r--include/linux/sched.h19
-rw-r--r--include/linux/smp.h1
-rw-r--r--include/linux/string_helpers.h58
-rw-r--r--include/linux/workqueue.h5
15 files changed, 109 insertions, 62 deletions
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h
index 42e55deee757..4ce9056b31a8 100644
--- a/include/linux/cleancache.h
+++ b/include/linux/cleancache.h
@@ -33,7 +33,7 @@ struct cleancache_ops {
33 void (*invalidate_fs)(int); 33 void (*invalidate_fs)(int);
34}; 34};
35 35
36extern struct cleancache_ops 36extern struct cleancache_ops *
37 cleancache_register_ops(struct cleancache_ops *ops); 37 cleancache_register_ops(struct cleancache_ops *ops);
38extern void __cleancache_init_fs(struct super_block *); 38extern void __cleancache_init_fs(struct super_block *);
39extern void __cleancache_init_shared_fs(char *, struct super_block *); 39extern void __cleancache_init_shared_fs(char *, struct super_block *);
@@ -42,9 +42,9 @@ extern void __cleancache_put_page(struct page *);
42extern void __cleancache_invalidate_page(struct address_space *, struct page *); 42extern void __cleancache_invalidate_page(struct address_space *, struct page *);
43extern void __cleancache_invalidate_inode(struct address_space *); 43extern void __cleancache_invalidate_inode(struct address_space *);
44extern void __cleancache_invalidate_fs(struct super_block *); 44extern void __cleancache_invalidate_fs(struct super_block *);
45extern int cleancache_enabled;
46 45
47#ifdef CONFIG_CLEANCACHE 46#ifdef CONFIG_CLEANCACHE
47#define cleancache_enabled (1)
48static inline bool cleancache_fs_enabled(struct page *page) 48static inline bool cleancache_fs_enabled(struct page *page)
49{ 49{
50 return page->mapping->host->i_sb->cleancache_poolid >= 0; 50 return page->mapping->host->i_sb->cleancache_poolid >= 0;
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index f156cca25ad0..b6eb7a05d58e 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -99,6 +99,7 @@ extern const char * dmi_get_system_info(int field);
99extern const struct dmi_device * dmi_find_device(int type, const char *name, 99extern const struct dmi_device * dmi_find_device(int type, const char *name,
100 const struct dmi_device *from); 100 const struct dmi_device *from);
101extern void dmi_scan_machine(void); 101extern void dmi_scan_machine(void);
102extern void dmi_set_dump_stack_arch_desc(void);
102extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); 103extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
103extern int dmi_name_in_vendors(const char *str); 104extern int dmi_name_in_vendors(const char *str);
104extern int dmi_name_in_serial(const char *str); 105extern int dmi_name_in_serial(const char *str);
@@ -114,6 +115,7 @@ static inline const char * dmi_get_system_info(int field) { return NULL; }
114static inline const struct dmi_device * dmi_find_device(int type, const char *name, 115static inline const struct dmi_device * dmi_find_device(int type, const char *name,
115 const struct dmi_device *from) { return NULL; } 116 const struct dmi_device *from) { return NULL; }
116static inline void dmi_scan_machine(void) { return; } 117static inline void dmi_scan_machine(void) { return; }
118static inline void dmi_set_dump_stack_arch_desc(void) { }
117static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) 119static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
118{ 120{
119 if (yearp) 121 if (yearp)
diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h
index 30442547b9e6..8293262401de 100644
--- a/include/linux/frontswap.h
+++ b/include/linux/frontswap.h
@@ -14,7 +14,7 @@ struct frontswap_ops {
14}; 14};
15 15
16extern bool frontswap_enabled; 16extern bool frontswap_enabled;
17extern struct frontswap_ops 17extern struct frontswap_ops *
18 frontswap_register_ops(struct frontswap_ops *ops); 18 frontswap_register_ops(struct frontswap_ops *ops);
19extern void frontswap_shrink(unsigned long); 19extern void frontswap_shrink(unsigned long);
20extern unsigned long frontswap_curr_pages(void); 20extern unsigned long frontswap_curr_pages(void);
@@ -22,33 +22,19 @@ extern void frontswap_writethrough(bool);
22#define FRONTSWAP_HAS_EXCLUSIVE_GETS 22#define FRONTSWAP_HAS_EXCLUSIVE_GETS
23extern void frontswap_tmem_exclusive_gets(bool); 23extern void frontswap_tmem_exclusive_gets(bool);
24 24
25extern void __frontswap_init(unsigned type); 25extern bool __frontswap_test(struct swap_info_struct *, pgoff_t);
26extern void __frontswap_init(unsigned type, unsigned long *map);
26extern int __frontswap_store(struct page *page); 27extern int __frontswap_store(struct page *page);
27extern int __frontswap_load(struct page *page); 28extern int __frontswap_load(struct page *page);
28extern void __frontswap_invalidate_page(unsigned, pgoff_t); 29extern void __frontswap_invalidate_page(unsigned, pgoff_t);
29extern void __frontswap_invalidate_area(unsigned); 30extern void __frontswap_invalidate_area(unsigned);
30 31
31#ifdef CONFIG_FRONTSWAP 32#ifdef CONFIG_FRONTSWAP
33#define frontswap_enabled (1)
32 34
33static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset) 35static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset)
34{ 36{
35 bool ret = false; 37 return __frontswap_test(sis, offset);
36
37 if (frontswap_enabled && sis->frontswap_map)
38 ret = test_bit(offset, sis->frontswap_map);
39 return ret;
40}
41
42static inline void frontswap_set(struct swap_info_struct *sis, pgoff_t offset)
43{
44 if (frontswap_enabled && sis->frontswap_map)
45 set_bit(offset, sis->frontswap_map);
46}
47
48static inline void frontswap_clear(struct swap_info_struct *sis, pgoff_t offset)
49{
50 if (frontswap_enabled && sis->frontswap_map)
51 clear_bit(offset, sis->frontswap_map);
52} 38}
53 39
54static inline void frontswap_map_set(struct swap_info_struct *p, 40static inline void frontswap_map_set(struct swap_info_struct *p,
@@ -71,14 +57,6 @@ static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset)
71 return false; 57 return false;
72} 58}
73 59
74static inline void frontswap_set(struct swap_info_struct *sis, pgoff_t offset)
75{
76}
77
78static inline void frontswap_clear(struct swap_info_struct *sis, pgoff_t offset)
79{
80}
81
82static inline void frontswap_map_set(struct swap_info_struct *p, 60static inline void frontswap_map_set(struct swap_info_struct *p,
83 unsigned long *map) 61 unsigned long *map)
84{ 62{
@@ -120,10 +98,10 @@ static inline void frontswap_invalidate_area(unsigned type)
120 __frontswap_invalidate_area(type); 98 __frontswap_invalidate_area(type);
121} 99}
122 100
123static inline void frontswap_init(unsigned type) 101static inline void frontswap_init(unsigned type, unsigned long *map)
124{ 102{
125 if (frontswap_enabled) 103 if (frontswap_enabled)
126 __frontswap_init(type); 104 __frontswap_init(type, map);
127} 105}
128 106
129#endif /* _LINUX_FRONTSWAP_H */ 107#endif /* _LINUX_FRONTSWAP_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2c28271ab9d4..17d8b1596215 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -675,9 +675,11 @@ static inline loff_t i_size_read(const struct inode *inode)
675static inline void i_size_write(struct inode *inode, loff_t i_size) 675static inline void i_size_write(struct inode *inode, loff_t i_size)
676{ 676{
677#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 677#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
678 preempt_disable();
678 write_seqcount_begin(&inode->i_size_seqcount); 679 write_seqcount_begin(&inode->i_size_seqcount);
679 inode->i_size = i_size; 680 inode->i_size = i_size;
680 write_seqcount_end(&inode->i_size_seqcount); 681 write_seqcount_end(&inode->i_size_seqcount);
682 preempt_enable();
681#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT) 683#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
682 preempt_disable(); 684 preempt_disable();
683 inode->i_size = i_size; 685 inode->i_size = i_size;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2dac79c39199..6d1844f393c0 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -798,6 +798,4 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
798# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 798# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
799#endif 799#endif
800 800
801extern int do_sysinfo(struct sysinfo *info);
802
803#endif 801#endif
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 5398d5807075..0555cc66a15b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -67,16 +67,15 @@ struct subprocess_info {
67}; 67};
68 68
69extern int 69extern int
70call_usermodehelper_fns(char *path, char **argv, char **envp, int wait, 70call_usermodehelper(char *path, char **argv, char **envp, int wait);
71 int (*init)(struct subprocess_info *info, struct cred *new),
72 void (*cleanup)(struct subprocess_info *), void *data);
73 71
74static inline int 72extern struct subprocess_info *
75call_usermodehelper(char *path, char **argv, char **envp, int wait) 73call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask,
76{ 74 int (*init)(struct subprocess_info *info, struct cred *new),
77 return call_usermodehelper_fns(path, argv, envp, wait, 75 void (*cleanup)(struct subprocess_info *), void *data);
78 NULL, NULL, NULL); 76
79} 77extern int
78call_usermodehelper_exec(struct subprocess_info *info, int wait);
80 79
81extern struct ctl_table usermodehelper_table[]; 80extern struct ctl_table usermodehelper_table[];
82 81
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 8d816646f766..7dcef3317689 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -43,6 +43,7 @@ bool kthread_should_stop(void);
43bool kthread_should_park(void); 43bool kthread_should_park(void);
44bool kthread_freezable_should_stop(bool *was_frozen); 44bool kthread_freezable_should_stop(bool *was_frozen);
45void *kthread_data(struct task_struct *k); 45void *kthread_data(struct task_struct *k);
46void *probe_kthread_data(struct task_struct *k);
46int kthread_park(struct task_struct *k); 47int kthread_park(struct task_struct *k);
47void kthread_unpark(struct task_struct *k); 48void kthread_unpark(struct task_struct *k);
48void kthread_parkme(void); 49void kthread_parkme(void);
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 73817af8b480..85c31a8e2904 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -137,7 +137,7 @@ enum mem_add_context { BOOT, HOTPLUG };
137#define register_hotmemory_notifier(nb) register_memory_notifier(nb) 137#define register_hotmemory_notifier(nb) register_memory_notifier(nb)
138#define unregister_hotmemory_notifier(nb) unregister_memory_notifier(nb) 138#define unregister_hotmemory_notifier(nb) unregister_memory_notifier(nb)
139#else 139#else
140#define hotplug_memory_notifier(fn, pri) (0) 140#define hotplug_memory_notifier(fn, pri) ({ 0; })
141/* These aren't inline functions due to a GCC bug. */ 141/* These aren't inline functions due to a GCC bug. */
142#define register_hotmemory_notifier(nb) ({ (void)(nb); 0; }) 142#define register_hotmemory_notifier(nb) ({ (void)(nb); 0; })
143#define unregister_hotmemory_notifier(nb) ({ (void)(nb); }) 143#define unregister_hotmemory_notifier(nb) ({ (void)(nb); })
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 215e5e3dda10..8ac32836690e 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -13,7 +13,9 @@ struct pidmap {
13 void *page; 13 void *page;
14}; 14};
15 15
16#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) 16#define BITS_PER_PAGE (PAGE_SIZE * 8)
17#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1)
18#define PIDMAP_ENTRIES ((PID_MAX_LIMIT+BITS_PER_PAGE-1)/BITS_PER_PAGE)
17 19
18struct bsd_acct_struct; 20struct bsd_acct_struct;
19 21
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 4890fe62c011..6af944ab38f0 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -145,6 +145,9 @@ extern void wake_up_klogd(void);
145 145
146void log_buf_kexec_setup(void); 146void log_buf_kexec_setup(void);
147void __init setup_log_buf(int early); 147void __init setup_log_buf(int early);
148void dump_stack_set_arch_desc(const char *fmt, ...);
149void dump_stack_print_info(const char *log_lvl);
150void show_regs_print_info(const char *log_lvl);
148#else 151#else
149static inline __printf(1, 0) 152static inline __printf(1, 0)
150int vprintk(const char *s, va_list args) 153int vprintk(const char *s, va_list args)
@@ -182,6 +185,18 @@ static inline void log_buf_kexec_setup(void)
182static inline void setup_log_buf(int early) 185static inline void setup_log_buf(int early)
183{ 186{
184} 187}
188
189static inline void dump_stack_set_arch_desc(const char *fmt, ...)
190{
191}
192
193static inline void dump_stack_print_info(const char *log_lvl)
194{
195}
196
197static inline void show_regs_print_info(const char *log_lvl)
198{
199}
185#endif 200#endif
186 201
187extern void dump_stack(void) __cold; 202extern void dump_stack(void) __cold;
diff --git a/include/linux/relay.h b/include/linux/relay.h
index 91cacc34c159..d7c8359693c6 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -20,9 +20,6 @@
20#include <linux/poll.h> 20#include <linux/poll.h>
21#include <linux/kref.h> 21#include <linux/kref.h>
22 22
23/* Needs a _much_ better name... */
24#define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE)
25
26/* 23/*
27 * Tracks changes to rchan/rchan_buf structs 24 * Tracks changes to rchan/rchan_buf structs
28 */ 25 */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 54ddcb82cddf..6f950048b6e9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -626,6 +626,7 @@ struct signal_struct {
626#define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */ 626#define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */
627#define SIGNAL_STOP_CONTINUED 0x00000002 /* SIGCONT since WCONTINUED reap */ 627#define SIGNAL_STOP_CONTINUED 0x00000002 /* SIGCONT since WCONTINUED reap */
628#define SIGNAL_GROUP_EXIT 0x00000004 /* group exit in progress */ 628#define SIGNAL_GROUP_EXIT 0x00000004 /* group exit in progress */
629#define SIGNAL_GROUP_COREDUMP 0x00000008 /* coredump in progress */
629/* 630/*
630 * Pending notifications to parent. 631 * Pending notifications to parent.
631 */ 632 */
@@ -2248,27 +2249,18 @@ static inline void threadgroup_change_end(struct task_struct *tsk)
2248 * 2249 *
2249 * Lock the threadgroup @tsk belongs to. No new task is allowed to enter 2250 * Lock the threadgroup @tsk belongs to. No new task is allowed to enter
2250 * and member tasks aren't allowed to exit (as indicated by PF_EXITING) or 2251 * and member tasks aren't allowed to exit (as indicated by PF_EXITING) or
2251 * perform exec. This is useful for cases where the threadgroup needs to 2252 * change ->group_leader/pid. This is useful for cases where the threadgroup
2252 * stay stable across blockable operations. 2253 * needs to stay stable across blockable operations.
2253 * 2254 *
2254 * fork and exit paths explicitly call threadgroup_change_{begin|end}() for 2255 * fork and exit paths explicitly call threadgroup_change_{begin|end}() for
2255 * synchronization. While held, no new task will be added to threadgroup 2256 * synchronization. While held, no new task will be added to threadgroup
2256 * and no existing live task will have its PF_EXITING set. 2257 * and no existing live task will have its PF_EXITING set.
2257 * 2258 *
2258 * During exec, a task goes and puts its thread group through unusual 2259 * de_thread() does threadgroup_change_{begin|end}() when a non-leader
2259 * changes. After de-threading, exclusive access is assumed to resources 2260 * sub-thread becomes a new leader.
2260 * which are usually shared by tasks in the same group - e.g. sighand may
2261 * be replaced with a new one. Also, the exec'ing task takes over group
2262 * leader role including its pid. Exclude these changes while locked by
2263 * grabbing cred_guard_mutex which is used to synchronize exec path.
2264 */ 2261 */
2265static inline void threadgroup_lock(struct task_struct *tsk) 2262static inline void threadgroup_lock(struct task_struct *tsk)
2266{ 2263{
2267 /*
2268 * exec uses exit for de-threading nesting group_rwsem inside
2269 * cred_guard_mutex. Grab cred_guard_mutex first.
2270 */
2271 mutex_lock(&tsk->signal->cred_guard_mutex);
2272 down_write(&tsk->signal->group_rwsem); 2264 down_write(&tsk->signal->group_rwsem);
2273} 2265}
2274 2266
@@ -2281,7 +2273,6 @@ static inline void threadgroup_lock(struct task_struct *tsk)
2281static inline void threadgroup_unlock(struct task_struct *tsk) 2273static inline void threadgroup_unlock(struct task_struct *tsk)
2282{ 2274{
2283 up_write(&tsk->signal->group_rwsem); 2275 up_write(&tsk->signal->group_rwsem);
2284 mutex_unlock(&tsk->signal->cred_guard_mutex);
2285} 2276}
2286#else 2277#else
2287static inline void threadgroup_change_begin(struct task_struct *tsk) {} 2278static inline void threadgroup_change_begin(struct task_struct *tsk) {}
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 3e07a7df6478..e6564c1dc552 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -20,7 +20,6 @@ struct call_single_data {
20 smp_call_func_t func; 20 smp_call_func_t func;
21 void *info; 21 void *info;
22 u16 flags; 22 u16 flags;
23 u16 priv;
24}; 23};
25 24
26/* total number of cpus in this system (may exceed NR_CPUS) */ 25/* total number of cpus in this system (may exceed NR_CPUS) */
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index a3eb2f65b656..3eeee9672a4a 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -13,4 +13,62 @@ enum string_size_units {
13int string_get_size(u64 size, enum string_size_units units, 13int string_get_size(u64 size, enum string_size_units units,
14 char *buf, int len); 14 char *buf, int len);
15 15
16#define UNESCAPE_SPACE 0x01
17#define UNESCAPE_OCTAL 0x02
18#define UNESCAPE_HEX 0x04
19#define UNESCAPE_SPECIAL 0x08
20#define UNESCAPE_ANY \
21 (UNESCAPE_SPACE | UNESCAPE_OCTAL | UNESCAPE_HEX | UNESCAPE_SPECIAL)
22
23/**
24 * string_unescape - unquote characters in the given string
25 * @src: source buffer (escaped)
26 * @dst: destination buffer (unescaped)
27 * @size: size of the destination buffer (0 to unlimit)
28 * @flags: combination of the flags (bitwise OR):
29 * %UNESCAPE_SPACE:
30 * '\f' - form feed
31 * '\n' - new line
32 * '\r' - carriage return
33 * '\t' - horizontal tab
34 * '\v' - vertical tab
35 * %UNESCAPE_OCTAL:
36 * '\NNN' - byte with octal value NNN (1 to 3 digits)
37 * %UNESCAPE_HEX:
38 * '\xHH' - byte with hexadecimal value HH (1 to 2 digits)
39 * %UNESCAPE_SPECIAL:
40 * '\"' - double quote
41 * '\\' - backslash
42 * '\a' - alert (BEL)
43 * '\e' - escape
44 * %UNESCAPE_ANY:
45 * all previous together
46 *
47 * Returns amount of characters processed to the destination buffer excluding
48 * trailing '\0'.
49 *
50 * Because the size of the output will be the same as or less than the size of
51 * the input, the transformation may be performed in place.
52 *
53 * Caller must provide valid source and destination pointers. Be aware that
54 * destination buffer will always be NULL-terminated. Source string must be
55 * NULL-terminated as well.
56 */
57int string_unescape(char *src, char *dst, size_t size, unsigned int flags);
58
59static inline int string_unescape_inplace(char *buf, unsigned int flags)
60{
61 return string_unescape(buf, buf, 0, flags);
62}
63
64static inline int string_unescape_any(char *src, char *dst, size_t size)
65{
66 return string_unescape(src, dst, size, UNESCAPE_ANY);
67}
68
69static inline int string_unescape_any_inplace(char *buf)
70{
71 return string_unescape_any(buf, buf, 0);
72}
73
16#endif 74#endif
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 717975639378..623488fdc1f5 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -92,6 +92,9 @@ enum {
92 /* bit mask for work_busy() return values */ 92 /* bit mask for work_busy() return values */
93 WORK_BUSY_PENDING = 1 << 0, 93 WORK_BUSY_PENDING = 1 << 0,
94 WORK_BUSY_RUNNING = 1 << 1, 94 WORK_BUSY_RUNNING = 1 << 1,
95
96 /* maximum string length for set_worker_desc() */
97 WORKER_DESC_LEN = 24,
95}; 98};
96 99
97struct work_struct { 100struct work_struct {
@@ -447,6 +450,8 @@ extern void workqueue_set_max_active(struct workqueue_struct *wq,
447extern bool current_is_workqueue_rescuer(void); 450extern bool current_is_workqueue_rescuer(void);
448extern bool workqueue_congested(int cpu, struct workqueue_struct *wq); 451extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
449extern unsigned int work_busy(struct work_struct *work); 452extern unsigned int work_busy(struct work_struct *work);
453extern __printf(1, 2) void set_worker_desc(const char *fmt, ...);
454extern void print_worker_info(const char *log_lvl, struct task_struct *task);
450 455
451/** 456/**
452 * queue_work - queue work on a workqueue 457 * queue_work - queue work on a workqueue