aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/configfs/configfs_example_explicit.c
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/filesystems/configfs/configfs_example_explicit.c')
0 files changed, 0 insertions, 0 deletions
span>
e3f2ddeac718
ce2c6b53847a
34f192c6527f
34f192c6527f
9f96cb1e8bca
179c85ea53be
34f192c6527f
9f96cb1e8bca





34f192c6527f


3c5fd9c77d60

34f192c6527f
3c5fd9c77d60


9f96cb1e8bca
34f192c6527f
9f96cb1e8bca


34f192c6527f







3c5fd9c77d60




34f192c6527f





a0c1e9073ef7


34f192c6527f








ba46df984b8e
34f192c6527f

ba46df984b8e
34f192c6527f
c69e8d9c01db
34f192c6527f
a0c1e9073ef7


34f192c6527f





f409adf5b1db
228ebcbe634a
34f192c6527f


c69e8d9c01db
b0e77598f871







c69e8d9c01db

b0e77598f871
34f192c6527f
b0e77598f871
34f192c6527f
f409adf5b1db
34f192c6527f






f409adf5b1db
34f192c6527f



8f17d3a5049d
34f192c6527f
8f17d3a5049d
34f192c6527f
c19384b5b296

34f192c6527f
f0ede66fca23
34f192c6527f
cd689985cf49
4dc88029fd91

c19384b5b296
34f192c6527f
c19384b5b296
9741ef964dc8
c19384b5b296

f0ede66fca23
5a7780e725d1
c19384b5b296
34f192c6527f
4dc88029fd91

34f192c6527f

c19384b5b296
34f192c6527f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210









                                             
                          



                        





                                                                            
                                                                









                                            
                                                                 







                                                             








                                                                               
                                                                

                                                        
                                                    
                                   
               
 


                                   



                                                                 
                                                                       
                       








                                                                   
                                                   
                                                             
                       
 
                                                            
                                                                    
                  





                                                                        


                                                                  

                                                                              
 


                                                                
                       
                               


                                     







                                                            




                                                                        





                                                                       


                                   








                                           
                                                                   

                                                         
                                                    
                          
                                                         
 


                                   





                                                   
                                
                                           


                                        
                                       







                                                                              

                                                
                                                                      
                                        
   
                                             
                                  






                                                       
                          



                   
                                                                    
                                                                         
                         
 

                              
                     
                                      
 
                                                                  

                                                      
                                                    
                                       
                                         
                                       

                                          
                                      
                                                           
                        
         

                                                                

                                                   
                                                                
 
/*
 * linux/kernel/futex_compat.c
 *
 * Futex compatibililty routines.
 *
 * Copyright 2006, Red Hat, Inc., Ingo Molnar
 */

#include <linux/linkage.h>
#include <linux/compat.h>
#include <linux/nsproxy.h>
#include <linux/futex.h>

#include <asm/uaccess.h>


/*
 * Fetch a robust-list pointer. Bit 0 signals PI futexes:
 */
static inline int
fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
		   compat_uptr_t __user *head, unsigned int *pi)
{
	if (get_user(*uentry, head))
		return -EFAULT;

	*entry = compat_ptr((*uentry) & ~1);
	*pi = (unsigned int)(*uentry) & 1;

	return 0;
}

static void __user *futex_uaddr(struct robust_list __user *entry,
				compat_long_t futex_offset)
{
	compat_uptr_t base = ptr_to_compat(entry);
	void __user *uaddr = compat_ptr(base + futex_offset);

	return uaddr;
}

/*
 * Walk curr->robust_list (very carefully, it's a userspace list!)
 * and mark any locks found there dead, and notify any waiters.
 *
 * We silently return on any sign of list-walking problem.
 */
void compat_exit_robust_list(struct task_struct *curr)
{
	struct compat_robust_list_head __user *head = curr->compat_robust_list;
	struct robust_list __user *entry, *next_entry, *pending;
	unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
	unsigned int uninitialized_var(next_pi);
	compat_uptr_t uentry, next_uentry, upending;
	compat_long_t futex_offset;
	int rc;

	if (!futex_cmpxchg_enabled)
		return;

	/*
	 * Fetch the list head (which was registered earlier, via
	 * sys_set_robust_list()):
	 */
	if (fetch_robust_entry(&uentry, &entry, &head->list.next, &pi))
		return;
	/*
	 * Fetch the relative futex offset:
	 */
	if (get_user(futex_offset, &head->futex_offset))
		return;
	/*
	 * Fetch any possibly pending lock-add first, and handle it
	 * if it exists:
	 */
	if (fetch_robust_entry(&upending, &pending,
			       &head->list_op_pending, &pip))
		return;

	next_entry = NULL;	/* avoid warning with gcc */
	while (entry != (struct robust_list __user *) &head->list) {
		/*
		 * Fetch the next entry in the list before calling
		 * handle_futex_death:
		 */
		rc = fetch_robust_entry(&next_uentry, &next_entry,
			(compat_uptr_t __user *)&entry->next, &next_pi);
		/*