@@ -54,14 +54,14 @@ fill_read(struct dentry *dentry, char *buffer, loff_t off, size_t count)
5454 int rc ;
5555
5656 /* need attr_sd for attr, its parent for kobj */
57- if (!sysfs_get_active_two (attr_sd ))
57+ if (!sysfs_get_active (attr_sd ))
5858 return - ENODEV ;
5959
6060 rc = - EIO ;
6161 if (attr -> read )
6262 rc = attr -> read (kobj , attr , buffer , off , count );
6363
64- sysfs_put_active_two (attr_sd );
64+ sysfs_put_active (attr_sd );
6565
6666 return rc ;
6767}
@@ -125,14 +125,14 @@ flush_write(struct dentry *dentry, char *buffer, loff_t offset, size_t count)
125125 int rc ;
126126
127127 /* need attr_sd for attr, its parent for kobj */
128- if (!sysfs_get_active_two (attr_sd ))
128+ if (!sysfs_get_active (attr_sd ))
129129 return - ENODEV ;
130130
131131 rc = - EIO ;
132132 if (attr -> write )
133133 rc = attr -> write (kobj , attr , buffer , offset , count );
134134
135- sysfs_put_active_two (attr_sd );
135+ sysfs_put_active (attr_sd );
136136
137137 return rc ;
138138}
@@ -184,12 +184,12 @@ static void bin_vma_open(struct vm_area_struct *vma)
184184 if (!bb -> vm_ops || !bb -> vm_ops -> open )
185185 return ;
186186
187- if (!sysfs_get_active_two (attr_sd ))
187+ if (!sysfs_get_active (attr_sd ))
188188 return ;
189189
190190 bb -> vm_ops -> open (vma );
191191
192- sysfs_put_active_two (attr_sd );
192+ sysfs_put_active (attr_sd );
193193}
194194
195195static void bin_vma_close (struct vm_area_struct * vma )
@@ -201,12 +201,12 @@ static void bin_vma_close(struct vm_area_struct *vma)
201201 if (!bb -> vm_ops || !bb -> vm_ops -> close )
202202 return ;
203203
204- if (!sysfs_get_active_two (attr_sd ))
204+ if (!sysfs_get_active (attr_sd ))
205205 return ;
206206
207207 bb -> vm_ops -> close (vma );
208208
209- sysfs_put_active_two (attr_sd );
209+ sysfs_put_active (attr_sd );
210210}
211211
212212static int bin_fault (struct vm_area_struct * vma , struct vm_fault * vmf )
@@ -219,12 +219,12 @@ static int bin_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
219219 if (!bb -> vm_ops || !bb -> vm_ops -> fault )
220220 return VM_FAULT_SIGBUS ;
221221
222- if (!sysfs_get_active_two (attr_sd ))
222+ if (!sysfs_get_active (attr_sd ))
223223 return VM_FAULT_SIGBUS ;
224224
225225 ret = bb -> vm_ops -> fault (vma , vmf );
226226
227- sysfs_put_active_two (attr_sd );
227+ sysfs_put_active (attr_sd );
228228 return ret ;
229229}
230230
@@ -241,12 +241,12 @@ static int bin_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
241241 if (!bb -> vm_ops -> page_mkwrite )
242242 return 0 ;
243243
244- if (!sysfs_get_active_two (attr_sd ))
244+ if (!sysfs_get_active (attr_sd ))
245245 return VM_FAULT_SIGBUS ;
246246
247247 ret = bb -> vm_ops -> page_mkwrite (vma , vmf );
248248
249- sysfs_put_active_two (attr_sd );
249+ sysfs_put_active (attr_sd );
250250 return ret ;
251251}
252252
@@ -261,12 +261,12 @@ static int bin_access(struct vm_area_struct *vma, unsigned long addr,
261261 if (!bb -> vm_ops || !bb -> vm_ops -> access )
262262 return - EINVAL ;
263263
264- if (!sysfs_get_active_two (attr_sd ))
264+ if (!sysfs_get_active (attr_sd ))
265265 return - EINVAL ;
266266
267267 ret = bb -> vm_ops -> access (vma , addr , buf , len , write );
268268
269- sysfs_put_active_two (attr_sd );
269+ sysfs_put_active (attr_sd );
270270 return ret ;
271271}
272272
@@ -281,12 +281,12 @@ static int bin_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
281281 if (!bb -> vm_ops || !bb -> vm_ops -> set_policy )
282282 return 0 ;
283283
284- if (!sysfs_get_active_two (attr_sd ))
284+ if (!sysfs_get_active (attr_sd ))
285285 return - EINVAL ;
286286
287287 ret = bb -> vm_ops -> set_policy (vma , new );
288288
289- sysfs_put_active_two (attr_sd );
289+ sysfs_put_active (attr_sd );
290290 return ret ;
291291}
292292
@@ -301,12 +301,12 @@ static struct mempolicy *bin_get_policy(struct vm_area_struct *vma,
301301 if (!bb -> vm_ops || !bb -> vm_ops -> get_policy )
302302 return vma -> vm_policy ;
303303
304- if (!sysfs_get_active_two (attr_sd ))
304+ if (!sysfs_get_active (attr_sd ))
305305 return vma -> vm_policy ;
306306
307307 pol = bb -> vm_ops -> get_policy (vma , addr );
308308
309- sysfs_put_active_two (attr_sd );
309+ sysfs_put_active (attr_sd );
310310 return pol ;
311311}
312312
@@ -321,12 +321,12 @@ static int bin_migrate(struct vm_area_struct *vma, const nodemask_t *from,
321321 if (!bb -> vm_ops || !bb -> vm_ops -> migrate )
322322 return 0 ;
323323
324- if (!sysfs_get_active_two (attr_sd ))
324+ if (!sysfs_get_active (attr_sd ))
325325 return 0 ;
326326
327327 ret = bb -> vm_ops -> migrate (vma , from , to , flags );
328328
329- sysfs_put_active_two (attr_sd );
329+ sysfs_put_active (attr_sd );
330330 return ret ;
331331}
332332#endif
@@ -356,7 +356,7 @@ static int mmap(struct file *file, struct vm_area_struct *vma)
356356
357357 /* need attr_sd for attr, its parent for kobj */
358358 rc = - ENODEV ;
359- if (!sysfs_get_active_two (attr_sd ))
359+ if (!sysfs_get_active (attr_sd ))
360360 goto out_unlock ;
361361
362362 rc = - EINVAL ;
@@ -384,7 +384,7 @@ static int mmap(struct file *file, struct vm_area_struct *vma)
384384 bb -> vm_ops = vma -> vm_ops ;
385385 vma -> vm_ops = & bin_vm_ops ;
386386out_put :
387- sysfs_put_active_two (attr_sd );
387+ sysfs_put_active (attr_sd );
388388out_unlock :
389389 mutex_unlock (& bb -> mutex );
390390
@@ -399,7 +399,7 @@ static int open(struct inode * inode, struct file * file)
399399 int error ;
400400
401401 /* binary file operations requires both @sd and its parent */
402- if (!sysfs_get_active_two (attr_sd ))
402+ if (!sysfs_get_active (attr_sd ))
403403 return - ENODEV ;
404404
405405 error = - EACCES ;
@@ -426,11 +426,11 @@ static int open(struct inode * inode, struct file * file)
426426 mutex_unlock (& sysfs_bin_lock );
427427
428428 /* open succeeded, put active references */
429- sysfs_put_active_two (attr_sd );
429+ sysfs_put_active (attr_sd );
430430 return 0 ;
431431
432432 err_out :
433- sysfs_put_active_two (attr_sd );
433+ sysfs_put_active (attr_sd );
434434 kfree (bb );
435435 return error ;
436436}
0 commit comments