Says Andrew: "60 patches. That's good enough for -rc1 I guess. I have quite a lot of detritus to be rechecked, work through maintainers, etc. - most of the remains of MM - rtc - various misc - cgroups - memcg - cpusets - procfs - ipc - rapidio - sysctl - pps - w1 - drivers/misc - aio" * akpm: (60 commits) memcg: replace ss->id_lock with a rwlock aio: allocate kiocbs in batches drivers/misc/vmw_balloon.c: fix typo in code comment drivers/misc/vmw_balloon.c: determine page allocation flag can_sleep outside loop w1: disable irqs in critical section drivers/w1/w1_int.c: multiple masters used same init_name drivers/power/ds2780_battery.c: fix deadlock upon insertion and removal drivers/power/ds2780_battery.c: add a nolock function to w1 interface drivers/power/ds2780_battery.c: create central point for calling w1 interface w1: ds2760 and ds2780, use ida for id and ida_simple_get() to get it pps gpio client: add missing dependency pps: new client driver using GPIO pps: default echo function include/linux/dma-mapping.h: add dma_zalloc_coherent() sysctl: make CONFIG_SYSCTL_SYSCALL default to n sysctl: add support for poll() RapidIO: documentation update drivers/net/rionet.c: fix ethernet address macros for LE platforms RapidIO: fix potential null deref in rio_setup_device() RapidIO: add mport driver for Tsi721 bridge ...
Showing the changes to include/linux (12 of 70 files). Show all
Unified · Split
| @@ -117,6 +117,7 @@ struct kiocb { · 116 unmodified lines | ||
| 117 | 117 | |
| 118 | 118 | struct list_head ki_list; /* the aio core uses this |
| 119 | 119 | * for cancellation */ |
| 120 | + struct list_head ki_batch; /* batch allocation */ | |
| 120 | 121 | |
| 121 | 122 | /* |
| 122 | 123 | * If the aio_resfd field of the userspace iocb is not zero, |
| @@ -516,7 +516,7 @@ struct cgroup_subsys { · 515 unmodified lines | ||
| 516 | 516 | struct list_head sibling; |
| 517 | 517 | /* used when use_id == true */ |
| 518 | 518 | struct idr idr; |
| 519 | − spinlock_t id_lock; | |
| 519 | + rwlock_t id_lock; | |
| 520 | 520 | |
| 521 | 521 | /* should be defined only by modular subsystems */ |
| 522 | 522 | struct module *module; |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | #ifndef _LINUX_DMA_MAPPING_H |
| 2 | 2 | #define _LINUX_DMA_MAPPING_H |
| 3 | 3 | |
| 4 | +#include <linux/string.h> | |
| 4 | 5 | #include <linux/device.h> |
| 5 | 6 | #include <linux/err.h> |
| 6 | 7 | #include <linux/dma-attrs.h> |
| @@ -117,6 +118,15 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) · 110 unmodified lines | ||
| 117 | 118 | return -EIO; |
| 118 | 119 | } |
| 119 | 120 | |
| 121 | +static inline void *dma_zalloc_coherent(struct device *dev, size_t size, | |
| 122 | + dma_addr_t *dma_handle, gfp_t flag) | |
| 123 | +{ | |
| 124 | + void *ret = dma_alloc_coherent(dev, size, dma_handle, flag); | |
| 125 | + if (ret) | |
| 126 | + memset(ret, 0, size); | |
| 127 | + return ret; | |
| 128 | +} | |
| 129 | + | |
| 120 | 130 | #ifdef CONFIG_HAS_DMA |
| 121 | 131 | static inline int dma_get_cache_alignment(void) |
| 122 | 132 | { |
| @@ -30,11 +30,11 @@ · 29 unmodified lines | ||
| 30 | 30 | #define ANON_INODE_FS_MAGIC 0x09041934 |
| 31 | 31 | #define PSTOREFS_MAGIC 0x6165676C |
| 32 | 32 | |
| 33 | −#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | |
| 34 | −#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | |
| 35 | −#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | |
| 36 | −#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | |
| 37 | −#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */ | |
| 33 | +#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ | |
| 34 | +#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ | |
| 35 | +#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2 fs, 14 char names */ | |
| 36 | +#define MINIX2_SUPER_MAGIC2 0x2478 /* minix v2 fs, 30 char names */ | |
| 37 | +#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */ | |
| 38 | 38 | |
| 39 | 39 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ |
| 40 | 40 | #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ |
| @@ -78,8 +78,8 @@ extern void mem_cgroup_uncharge_end(void); · 77 unmodified lines | ||
| 78 | 78 | extern void mem_cgroup_uncharge_page(struct page *page); |
| 79 | 79 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
| 80 | 80 | |
| 81 | −extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | |
| 82 | −int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | |
| 81 | +extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask); | |
| 82 | +int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); | |
| 83 | 83 | |
| 84 | 84 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
| 85 | 85 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
| @@ -88,26 +88,28 @@ extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); · 2 unmodified lines | ||
| 88 | 88 | static inline |
| 89 | 89 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
| 90 | 90 | { |
| 91 | − struct mem_cgroup *mem; | |
| 91 | + struct mem_cgroup *memcg; | |
| 92 | 92 | rcu_read_lock(); |
| 93 | − mem = mem_cgroup_from_task(rcu_dereference((mm)->owner)); | |
| 93 | + memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner)); | |
| 94 | 94 | rcu_read_unlock(); |
| 95 | − return cgroup == mem; | |
| 95 | + return cgroup == memcg; | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | −extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); | |
| 98 | +extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); | |
| 99 | 99 | |
| 100 | 100 | extern int |
| 101 | 101 | mem_cgroup_prepare_migration(struct page *page, |
| 102 | 102 | struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); |
| 103 | −extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | |
| 103 | +extern void mem_cgroup_end_migration(struct mem_cgroup *memcg, | |
| 104 | 104 | struct page *oldpage, struct page *newpage, bool migration_ok); |
| 105 | 105 | |
| 106 | 106 | /* |
| 107 | 107 | * For memory reclaim. |
| 108 | 108 | */ |
| 109 | −int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | |
| 110 | −int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | |
| 109 | +int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, | |
| 110 | + struct zone *zone); | |
| 111 | +int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, | |
| 112 | + struct zone *zone); | |
| 111 | 113 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
| 112 | 114 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, |
| 113 | 115 | int nid, int zid, unsigned int lrumask); |
| @@ -148,7 +150,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, · 34 unmodified lines | ||
| 148 | 150 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
| 149 | 151 | gfp_t gfp_mask, |
| 150 | 152 | unsigned long *total_scanned); |
| 151 | −u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | |
| 153 | +u64 mem_cgroup_get_limit(struct mem_cgroup *memcg); | |
| 152 | 154 | |
| 153 | 155 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); |
| 154 | 156 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| @@ -244,18 +246,20 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm · 89 unmodified lines | ||
| 244 | 246 | return NULL; |
| 245 | 247 | } |
| 246 | 248 | |
| 247 | −static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | |
| 249 | +static inline int mm_match_cgroup(struct mm_struct *mm, | |
| 250 | + struct mem_cgroup *memcg) | |
| 248 | 251 | { |
| 249 | 252 | return 1; |
| 250 | 253 | } |
| 251 | 254 | |
| 252 | 255 | static inline int task_in_mem_cgroup(struct task_struct *task, |
| 253 | − const struct mem_cgroup *mem) | |
| 256 | + const struct mem_cgroup *memcg) | |
| 254 | 257 | { |
| 255 | 258 | return 1; |
| 256 | 259 | } |
| 257 | 260 | |
| 258 | −static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) | |
| 261 | +static inline struct cgroup_subsys_state | |
| 262 | + *mem_cgroup_css(struct mem_cgroup *memcg) | |
| 259 | 263 | { |
| 260 | 264 | return NULL; |
| 261 | 265 | } |
| @@ -267,22 +271,22 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage, · 5 unmodified lines | ||
| 267 | 271 | return 0; |
| 268 | 272 | } |
| 269 | 273 | |
| 270 | −static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, | |
| 274 | +static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg, | |
| 271 | 275 | struct page *oldpage, struct page *newpage, bool migration_ok) |
| 272 | 276 | { |
| 273 | 277 | } |
| 274 | 278 | |
| 275 | −static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) | |
| 279 | +static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg) | |
| 276 | 280 | { |
| 277 | 281 | return 0; |
| 278 | 282 | } |
| 279 | 283 | |
| 280 | −static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | |
| 284 | +static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg, | |
| 281 | 285 | int priority) |
| 282 | 286 | { |
| 283 | 287 | } |
| 284 | 288 | |
| 285 | −static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | |
| 289 | +static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg, | |
| 286 | 290 | int priority) |
| 287 | 291 | { |
| 288 | 292 | } |
| @@ -293,13 +297,13 @@ static inline bool mem_cgroup_disabled(void) · 4 unmodified lines | ||
| 293 | 297 | } |
| 294 | 298 | |
| 295 | 299 | static inline int |
| 296 | −mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) | |
| 300 | +mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) | |
| 297 | 301 | { |
| 298 | 302 | return 1; |
| 299 | 303 | } |
| 300 | 304 | |
| 301 | 305 | static inline int |
| 302 | −mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | |
| 306 | +mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, struct zone *zone) | |
| 303 | 307 | { |
| 304 | 308 | return 1; |
| 305 | 309 | } |
| @@ -348,7 +352,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, · 42 unmodified lines | ||
| 348 | 352 | } |
| 349 | 353 | |
| 350 | 354 | static inline |
| 351 | −u64 mem_cgroup_get_limit(struct mem_cgroup *mem) | |
| 355 | +u64 mem_cgroup_get_limit(struct mem_cgroup *memcg) | |
| 352 | 356 | { |
| 353 | 357 | return 0; |
| 354 | 358 | } |
| @@ -356,36 +356,50 @@ static inline struct page *compound_head(struct page *page) · 355 unmodified lines | ||
| 356 | 356 | return page; |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | +/* | |
| 360 | + * The atomic page->_mapcount, starts from -1: so that transitions | |
| 361 | + * both from it and to it can be tracked, using atomic_inc_and_test | |
| 362 | + * and atomic_add_negative(-1). | |
| 363 | + */ | |
| 364 | +static inline void reset_page_mapcount(struct page *page) | |
| 365 | +{ | |
| 366 | + atomic_set(&(page)->_mapcount, -1); | |
| 367 | +} | |
| 368 | + | |
| 369 | +static inline int page_mapcount(struct page *page) | |
| 370 | +{ | |
| 371 | + return atomic_read(&(page)->_mapcount) + 1; | |
| 372 | +} | |
| 373 | + | |
| 359 | 374 | static inline int page_count(struct page *page) |
| 360 | 375 | { |
| 361 | 376 | return atomic_read(&compound_head(page)->_count); |
| 362 | 377 | } |
| 363 | 378 | |
| 379 | +static inline void get_huge_page_tail(struct page *page) | |
| 380 | +{ | |
| 381 | + /* | |
| 382 | + * __split_huge_page_refcount() cannot run | |
| 383 | + * from under us. | |
| 384 | + */ | |
| 385 | + VM_BUG_ON(page_mapcount(page) < 0); | |
| 386 | + VM_BUG_ON(atomic_read(&page->_count) != 0); | |
| 387 | + atomic_inc(&page->_mapcount); | |
| 388 | +} | |
| 389 | + | |
| 390 | +extern bool __get_page_tail(struct page *page); | |
| 391 | + | |
| 364 | 392 | static inline void get_page(struct page *page) |
| 365 | 393 | { |
| 394 | + if (unlikely(PageTail(page))) | |
| 395 | + if (likely(__get_page_tail(page))) | |
| 396 | + return; | |
| 366 | 397 | /* |
| 367 | 398 | * Getting a normal page or the head of a compound page |
| 368 | − * requires to already have an elevated page->_count. Only if | |
| 369 | − * we're getting a tail page, the elevated page->_count is | |
| 370 | − * required only in the head page, so for tail pages the | |
| 371 | − * bugcheck only verifies that the page->_count isn't | |
| 372 | − * negative. | |
| 399 | + * requires to already have an elevated page->_count. | |
| 373 | 400 | */ |
| 374 | − VM_BUG_ON(atomic_read(&page->_count) < !PageTail(page)); | |
| 401 | + VM_BUG_ON(atomic_read(&page->_count) <= 0); | |
| 375 | 402 | atomic_inc(&page->_count); |
| 376 | − /* | |
| 377 | − * Getting a tail page will elevate both the head and tail | |
| 378 | − * page->_count(s). | |
| 379 | − */ | |
| 380 | − if (unlikely(PageTail(page))) { | |
| 381 | − /* | |
| 382 | − * This is safe only because | |
| 383 | − * __split_huge_page_refcount can't run under | |
| 384 | − * get_page(). | |
| 385 | − */ | |
| 386 | − VM_BUG_ON(atomic_read(&page->first_page->_count) <= 0); | |
| 387 | − atomic_inc(&page->first_page->_count); | |
| 388 | − } | |
| 389 | 403 | } |
| 390 | 404 | |
| 391 | 405 | static inline struct page *virt_to_head_page(const void *x) |
| @@ -803,21 +817,6 @@ static inline pgoff_t page_index(struct page *page) · 411 unmodified lines | ||
| 803 | 817 | return page->index; |
| 804 | 818 | } |
| 805 | 819 | |
| 806 | −/* | |
| 807 | − * The atomic page->_mapcount, like _count, starts from -1: | |
| 808 | − * so that transitions both from it and to it can be tracked, | |
| 809 | − * using atomic_inc_and_test and atomic_add_negative(-1). | |
| 810 | − */ | |
| 811 | −static inline void reset_page_mapcount(struct page *page) | |
| 812 | −{ | |
| 813 | − atomic_set(&(page)->_mapcount, -1); | |
| 814 | −} | |
| 815 | − | |
| 816 | −static inline int page_mapcount(struct page *page) | |
| 817 | −{ | |
| 818 | − return atomic_read(&(page)->_mapcount) + 1; | |
| 819 | −} | |
| 820 | − | |
| 821 | 820 | /* |
| 822 | 821 | * Return true if this page is mapped into pagetables. |
| 823 | 822 | */ |
| @@ -62,10 +62,23 @@ struct page { · 61 unmodified lines | ||
| 62 | 62 | struct { |
| 63 | 63 | |
| 64 | 64 | union { |
| 65 | − atomic_t _mapcount; /* Count of ptes mapped in mms, | |
| 66 | − * to show when page is mapped | |
| 67 | − * & limit reverse map searches. | |
| 68 | − */ | |
| 65 | + /* | |
| 66 | + * Count of ptes mapped in | |
| 67 | + * mms, to show when page is | |
| 68 | + * mapped & limit reverse map | |
| 69 | + * searches. | |
| 70 | + * | |
| 71 | + * Used also for tail pages | |
| 72 | + * refcounting instead of | |
| 73 | + * _count. Tail pages cannot | |
| 74 | + * be mapped and keeping the | |
| 75 | + * tail page _count zero at | |
| 76 | + * all times guarantees | |
| 77 | + * get_page_unless_zero() will | |
| 78 | + * never succeed on tail | |
| 79 | + * pages. | |
| 80 | + */ | |
| 81 | + atomic_t _mapcount; | |
| 69 | 82 | |
| 70 | 83 | struct { |
| 71 | 84 | unsigned inuse:16; |
| @@ -0,0 +1,32 @@ | ||
| 1 | +/* | |
| 2 | + * pps-gpio.h -- PPS client for GPIOs | |
| 3 | + * | |
| 4 | + * | |
| 5 | + * Copyright (C) 2011 James Nuss <jamesnuss@nanometrics.ca> | |
| 6 | + * | |
| 7 | + * This program is free software; you can redistribute it and/or modify | |
| 8 | + * it under the terms of the GNU General Public License as published by | |
| 9 | + * the Free Software Foundation; either version 2 of the License, or | |
| 10 | + * (at your option) any later version. | |
| 11 | + * | |
| 12 | + * This program is distributed in the hope that it will be useful, | |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | + * GNU General Public License for more details. | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License | |
| 18 | + * along with this program; if not, write to the Free Software | |
| 19 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 20 | + */ | |
| 21 | + | |
| 22 | +#ifndef _PPS_GPIO_H | |
| 23 | +#define _PPS_GPIO_H | |
| 24 | + | |
| 25 | +struct pps_gpio_platform_data { | |
| 26 | + bool assert_falling_edge; | |
| 27 | + bool capture_clear; | |
| 28 | + unsigned int gpio_pin; | |
| 29 | + const char *gpio_label; | |
| 30 | +}; | |
| 31 | + | |
| 32 | +#endif | |
| @@ -39,5 +39,6 @@ · 38 unmodified lines | ||
| 39 | 39 | #define RIO_DID_IDTCPS1616 0x0379 |
| 40 | 40 | #define RIO_DID_IDTVPS1616 0x0377 |
| 41 | 41 | #define RIO_DID_IDTSPS1616 0x0378 |
| 42 | +#define RIO_DID_TSI721 0x80ab | |
| 42 | 43 | |
| 43 | 44 | #endif /* LINUX_RIO_IDS_H */ |
| @@ -83,13 +83,6 @@ struct seminfo { · 82 unmodified lines | ||
| 83 | 83 | |
| 84 | 84 | struct task_struct; |
| 85 | 85 | |
| 86 | −/* One semaphore structure for each semaphore in the system. */ | |
| 87 | −struct sem { | |
| 88 | − int semval; /* current value */ | |
| 89 | − int sempid; /* pid of last operation */ | |
| 90 | − struct list_head sem_pending; /* pending single-sop operations */ | |
| 91 | −}; | |
| 92 | − | |
| 93 | 86 | /* One sem_array data structure for each set of semaphores in the system. */ |
| 94 | 87 | struct sem_array { |
| 95 | 88 | struct kern_ipc_perm ____cacheline_aligned_in_smp |
| @@ -103,51 +96,21 @@ struct sem_array { · 7 unmodified lines | ||
| 103 | 96 | int complex_count; /* pending complex operations */ |
| 104 | 97 | }; |
| 105 | 98 | |
| 106 | −/* One queue for each sleeping process in the system. */ | |
| 107 | −struct sem_queue { | |
| 108 | − struct list_head simple_list; /* queue of pending operations */ | |
| 109 | − struct list_head list; /* queue of pending operations */ | |
| 110 | − struct task_struct *sleeper; /* this process */ | |
| 111 | − struct sem_undo *undo; /* undo structure */ | |
| 112 | − int pid; /* process id of requesting process */ | |
| 113 | − int status; /* completion status of operation */ | |
| 114 | − struct sembuf *sops; /* array of pending operations */ | |
| 115 | − int nsops; /* number of operations */ | |
| 116 | − int alter; /* does the operation alter the array? */ | |
| 117 | −}; | |
| 118 | − | |
| 119 | −/* Each task has a list of undo requests. They are executed automatically | |
| 120 | − * when the process exits. | |
| 121 | − */ | |
| 122 | −struct sem_undo { | |
| 123 | − struct list_head list_proc; /* per-process list: all undos from one process. */ | |
| 124 | − /* rcu protected */ | |
| 125 | − struct rcu_head rcu; /* rcu struct for sem_undo() */ | |
| 126 | − struct sem_undo_list *ulp; /* sem_undo_list for the process */ | |
| 127 | − struct list_head list_id; /* per semaphore array list: all undos for one array */ | |
| 128 | − int semid; /* semaphore set identifier */ | |
| 129 | − short * semadj; /* array of adjustments, one per semaphore */ | |
| 130 | −}; | |
| 131 | − | |
| 132 | −/* sem_undo_list controls shared access to the list of sem_undo structures | |
| 133 | − * that may be shared among all a CLONE_SYSVSEM task group. | |
| 134 | − */ | |
| 135 | −struct sem_undo_list { | |
| 136 | − atomic_t refcnt; | |
| 137 | − spinlock_t lock; | |
| 138 | − struct list_head list_proc; | |
| 139 | −}; | |
| 99 | +#ifdef CONFIG_SYSVIPC | |
| 140 | 100 | |
| 141 | 101 | struct sysv_sem { |
| 142 | 102 | struct sem_undo_list *undo_list; |
| 143 | 103 | }; |
| 144 | 104 | |
| 145 | −#ifdef CONFIG_SYSVIPC | |
| 146 | − | |
| 147 | 105 | extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); |
| 148 | 106 | extern void exit_sem(struct task_struct *tsk); |
| 149 | 107 | |
| 150 | 108 | #else |
| 109 | + | |
| 110 | +struct sysv_sem { | |
| 111 | + /* empty */ | |
| 112 | +}; | |
| 113 | + | |
| 151 | 114 | static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) |
| 152 | 115 | { |
| 153 | 116 | return 0; |
| @@ -931,6 +931,7 @@ enum · 930 unmodified lines | ||
| 931 | 931 | #ifdef __KERNEL__ |
| 932 | 932 | #include <linux/list.h> |
| 933 | 933 | #include <linux/rcupdate.h> |
| 934 | +#include <linux/wait.h> | |
| 934 | 935 | |
| 935 | 936 | /* For the /proc/sys support */ |
| 936 | 937 | struct ctl_table; |
| @@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int, · 74 unmodified lines | ||
| 1011 | 1012 | * cover common cases. |
| 1012 | 1013 | */ |
| 1013 | 1014 | |
| 1015 | +/* Support for userspace poll() to watch for changes */ | |
| 1016 | +struct ctl_table_poll { | |
| 1017 | + atomic_t event; | |
| 1018 | + wait_queue_head_t wait; | |
| 1019 | +}; | |
| 1020 | + | |
| 1021 | +static inline void *proc_sys_poll_event(struct ctl_table_poll *poll) | |
| 1022 | +{ | |
| 1023 | + return (void *)(unsigned long)atomic_read(&poll->event); | |
| 1024 | +} | |
| 1025 | + | |
| 1026 | +void proc_sys_poll_notify(struct ctl_table_poll *poll); | |
| 1027 | + | |
| 1028 | +#define __CTL_TABLE_POLL_INITIALIZER(name) { \ | |
| 1029 | + .event = ATOMIC_INIT(0), \ | |
| 1030 | + .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) } | |
| 1031 | + | |
| 1032 | +#define DEFINE_CTL_TABLE_POLL(name) \ | |
| 1033 | + struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name) | |
| 1034 | + | |
| 1014 | 1035 | /* A sysctl table is an array of struct ctl_table: */ |
| 1015 | 1036 | struct ctl_table |
| 1016 | 1037 | { |
| @@ -1021,6 +1042,7 @@ struct ctl_table · 4 unmodified lines | ||
| 1021 | 1042 | struct ctl_table *child; |
| 1022 | 1043 | struct ctl_table *parent; /* Automatically set */ |
| 1023 | 1044 | proc_handler *proc_handler; /* Callback for text formatting */ |
| 1045 | + struct ctl_table_poll *poll; | |
| 1024 | 1046 | void *extra1; |
| 1025 | 1047 | void *extra2; |
| 1026 | 1048 | }; |
| @@ -37,6 +37,14 @@ struct new_utsname { · 36 unmodified lines | ||
| 37 | 37 | #include <linux/nsproxy.h> |
| 38 | 38 | #include <linux/err.h> |
| 39 | 39 | |
| 40 | +enum uts_proc { | |
| 41 | + UTS_PROC_OSTYPE, | |
| 42 | + UTS_PROC_OSRELEASE, | |
| 43 | + UTS_PROC_VERSION, | |
| 44 | + UTS_PROC_HOSTNAME, | |
| 45 | + UTS_PROC_DOMAINNAME, | |
| 46 | +}; | |
| 47 | + | |
| 40 | 48 | struct user_namespace; |
| 41 | 49 | extern struct user_namespace init_user_ns; |
| 42 | 50 | |
| @@ -80,6 +88,14 @@ static inline struct uts_namespace *copy_utsname(unsigned long flags, · 37 unmodified lines | ||
| 80 | 88 | } |
| 81 | 89 | #endif |
| 82 | 90 | |
| 91 | +#ifdef CONFIG_PROC_SYSCTL | |
| 92 | +extern void uts_proc_notify(enum uts_proc proc); | |
| 93 | +#else | |
| 94 | +static inline void uts_proc_notify(enum uts_proc proc) | |
| 95 | +{ | |
| 96 | +} | |
| 97 | +#endif | |
| 98 | + | |
| 83 | 99 | static inline struct new_utsname *utsname(void) |
| 84 | 100 | { |
| 85 | 101 | return ¤t->nsproxy->uts_ns->name; |