History

Merge branch 'akpm' (Andrew's incoming - part two)

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 ...

Linus Torvalds committed 15 years ago

Commit 092f4c52 parents 80c2861 c1e2ee270 files · +4909 −1035Browse files

Showing the changes to include/linux (12 of 70 files). Show all

Unified · Split

12 files
  1. include/linux/aio.h +1 −0
  2. include/linux/cgroup.h +1 −1
  3. include/linux/dma-mapping.h +10 −0
  4. include/linux/magic.h +5 −5
  5. include/linux/memcontrol.h +24 −20
  6. include/linux/mm.h +33 −34
  7. include/linux/mm_types.h +17 −4
  8. include/linux/pps-gpio.h +32 −0
  9. include/linux/rio_ids.h +1 −0
  10. include/linux/sem.h +6 −43
  11. include/linux/sysctl.h +22 −0
  12. include/linux/utsname.h +16 −0
include/linux/aio.h+1−0
@@ -117,6 +117,7 @@ struct kiocb { · 116 unmodified lines
117117
118118 struct list_head ki_list; /* the aio core uses this
119119 * for cancellation */
120+ struct list_head ki_batch; /* batch allocation */
120121
121122 /*
122123 * If the aio_resfd field of the userspace iocb is not zero,
include/linux/cgroup.h+1−1
@@ -516,7 +516,7 @@ struct cgroup_subsys { · 515 unmodified lines
516516 struct list_head sibling;
517517 /* used when use_id == true */
518518 struct idr idr;
519− spinlock_t id_lock;
519+ rwlock_t id_lock;
520520
521521 /* should be defined only by modular subsystems */
522522 struct module *module;
include/linux/dma-mapping.h+10−0
@@ -1,6 +1,7 @@
11 #ifndef _LINUX_DMA_MAPPING_H
22 #define _LINUX_DMA_MAPPING_H
33
4+#include <linux/string.h>
45 #include <linux/device.h>
56 #include <linux/err.h>
67 #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
117118 return -EIO;
118119 }
119120
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+
120130 #ifdef CONFIG_HAS_DMA
121131 static inline int dma_get_cache_alignment(void)
122132 {
include/linux/magic.h+5−5
@@ -30,11 +30,11 @@ · 29 unmodified lines
3030 #define ANON_INODE_FS_MAGIC 0x09041934
3131 #define PSTOREFS_MAGIC 0x6165676C
3232
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 */
3838
3939 #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
4040 #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
include/linux/memcontrol.h+24−20
@@ -78,8 +78,8 @@ extern void mem_cgroup_uncharge_end(void); · 77 unmodified lines
7878 extern void mem_cgroup_uncharge_page(struct page *page);
7979 extern void mem_cgroup_uncharge_cache_page(struct page *page);
8080
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);
8383
8484 extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
8585 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
8888 static inline
8989 int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
9090 {
91− struct mem_cgroup *mem;
91+ struct mem_cgroup *memcg;
9292 rcu_read_lock();
93− mem = mem_cgroup_from_task(rcu_dereference((mm)->owner));
93+ memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner));
9494 rcu_read_unlock();
95− return cgroup == mem;
95+ return cgroup == memcg;
9696 }
9797
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);
9999
100100 extern int
101101 mem_cgroup_prepare_migration(struct page *page,
102102 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,
104104 struct page *oldpage, struct page *newpage, bool migration_ok);
105105
106106 /*
107107 * For memory reclaim.
108108 */
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);
111113 int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
112114 unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
113115 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
148150 unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
149151 gfp_t gfp_mask,
150152 unsigned long *total_scanned);
151−u64 mem_cgroup_get_limit(struct mem_cgroup *mem);
153+u64 mem_cgroup_get_limit(struct mem_cgroup *memcg);
152154
153155 void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
154156 #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
244246 return NULL;
245247 }
246248
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)
248251 {
249252 return 1;
250253 }
251254
252255 static inline int task_in_mem_cgroup(struct task_struct *task,
253− const struct mem_cgroup *mem)
256+ const struct mem_cgroup *memcg)
254257 {
255258 return 1;
256259 }
257260
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)
259263 {
260264 return NULL;
261265 }
@@ -267,22 +271,22 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage, · 5 unmodified lines
267271 return 0;
268272 }
269273
270−static inline void mem_cgroup_end_migration(struct mem_cgroup *mem,
274+static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg,
271275 struct page *oldpage, struct page *newpage, bool migration_ok)
272276 {
273277 }
274278
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)
276280 {
277281 return 0;
278282 }
279283
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,
281285 int priority)
282286 {
283287 }
284288
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,
286290 int priority)
287291 {
288292 }
@@ -293,13 +297,13 @@ static inline bool mem_cgroup_disabled(void) · 4 unmodified lines
293297 }
294298
295299 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)
297301 {
298302 return 1;
299303 }
300304
301305 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)
303307 {
304308 return 1;
305309 }
@@ -348,7 +352,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, · 42 unmodified lines
348352 }
349353
350354 static inline
351−u64 mem_cgroup_get_limit(struct mem_cgroup *mem)
355+u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
352356 {
353357 return 0;
354358 }
include/linux/mm.h+33−34
@@ -356,36 +356,50 @@ static inline struct page *compound_head(struct page *page) · 355 unmodified lines
356356 return page;
357357 }
358358
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+
359374 static inline int page_count(struct page *page)
360375 {
361376 return atomic_read(&compound_head(page)->_count);
362377 }
363378
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+
364392 static inline void get_page(struct page *page)
365393 {
394+ if (unlikely(PageTail(page)))
395+ if (likely(__get_page_tail(page)))
396+ return;
366397 /*
367398 * 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.
373400 */
374− VM_BUG_ON(atomic_read(&page->_count) < !PageTail(page));
401+ VM_BUG_ON(atomic_read(&page->_count) <= 0);
375402 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− }
389403 }
390404
391405 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
803817 return page->index;
804818 }
805819
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−
821820 /*
822821 * Return true if this page is mapped into pagetables.
823822 */
include/linux/mm_types.h+17−4
@@ -62,10 +62,23 @@ struct page { · 61 unmodified lines
6262 struct {
6363
6464 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;
6982
7083 struct {
7184 unsigned inuse:16;
include/linux/pps-gpio.h+32−0
@@ -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
include/linux/rio_ids.h+1−0
@@ -39,5 +39,6 @@ · 38 unmodified lines
3939 #define RIO_DID_IDTCPS1616 0x0379
4040 #define RIO_DID_IDTVPS1616 0x0377
4141 #define RIO_DID_IDTSPS1616 0x0378
42+#define RIO_DID_TSI721 0x80ab
4243
4344 #endif /* LINUX_RIO_IDS_H */
include/linux/sem.h+6−43
@@ -83,13 +83,6 @@ struct seminfo { · 82 unmodified lines
8383
8484 struct task_struct;
8585
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−
9386 /* One sem_array data structure for each set of semaphores in the system. */
9487 struct sem_array {
9588 struct kern_ipc_perm ____cacheline_aligned_in_smp
@@ -103,51 +96,21 @@ struct sem_array { · 7 unmodified lines
10396 int complex_count; /* pending complex operations */
10497 };
10598
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
140100
141101 struct sysv_sem {
142102 struct sem_undo_list *undo_list;
143103 };
144104
145−#ifdef CONFIG_SYSVIPC
146−
147105 extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
148106 extern void exit_sem(struct task_struct *tsk);
149107
150108 #else
109+
110+struct sysv_sem {
111+ /* empty */
112+};
113+
151114 static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
152115 {
153116 return 0;
include/linux/sysctl.h+22−0
@@ -931,6 +931,7 @@ enum · 930 unmodified lines
931931 #ifdef __KERNEL__
932932 #include <linux/list.h>
933933 #include <linux/rcupdate.h>
934+#include <linux/wait.h>
934935
935936 /* For the /proc/sys support */
936937 struct ctl_table;
@@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int, · 74 unmodified lines
10111012 * cover common cases.
10121013 */
10131014
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+
10141035 /* A sysctl table is an array of struct ctl_table: */
10151036 struct ctl_table
10161037 {
@@ -1021,6 +1042,7 @@ struct ctl_table · 4 unmodified lines
10211042 struct ctl_table *child;
10221043 struct ctl_table *parent; /* Automatically set */
10231044 proc_handler *proc_handler; /* Callback for text formatting */
1045+ struct ctl_table_poll *poll;
10241046 void *extra1;
10251047 void *extra2;
10261048 };
include/linux/utsname.h+16−0
@@ -37,6 +37,14 @@ struct new_utsname { · 36 unmodified lines
3737 #include <linux/nsproxy.h>
3838 #include <linux/err.h>
3939
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+
4048 struct user_namespace;
4149 extern struct user_namespace init_user_ns;
4250
@@ -80,6 +88,14 @@ static inline struct uts_namespace *copy_utsname(unsigned long flags, · 37 unmodified lines
8088 }
8189 #endif
8290
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+
8399 static inline struct new_utsname *utsname(void)
84100 {
85101 return &current->nsproxy->uts_ns->name;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t