Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
sysfs: Allow sysfs_notify_dirent to be called from interrupt context.
sysfs: Allow sysfs_move_dir(..., NULL) again.

+10 -7
+2 -1
fs/sysfs/dir.c
··· 894 894 895 895 mutex_lock(&sysfs_rename_mutex); 896 896 BUG_ON(!sd->s_parent); 897 - new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : &sysfs_root; 897 + new_parent_sd = (new_parent_kobj && new_parent_kobj->sd) ? 898 + new_parent_kobj->sd : &sysfs_root; 898 899 899 900 error = 0; 900 901 if (sd->s_parent == new_parent_sd)
+8 -6
fs/sysfs/file.c
··· 268 268 struct sysfs_open_dirent *od, *new_od = NULL; 269 269 270 270 retry: 271 - spin_lock(&sysfs_open_dirent_lock); 271 + spin_lock_irq(&sysfs_open_dirent_lock); 272 272 273 273 if (!sd->s_attr.open && new_od) { 274 274 sd->s_attr.open = new_od; ··· 281 281 list_add_tail(&buffer->list, &od->buffers); 282 282 } 283 283 284 - spin_unlock(&sysfs_open_dirent_lock); 284 + spin_unlock_irq(&sysfs_open_dirent_lock); 285 285 286 286 if (od) { 287 287 kfree(new_od); ··· 315 315 struct sysfs_buffer *buffer) 316 316 { 317 317 struct sysfs_open_dirent *od = sd->s_attr.open; 318 + unsigned long flags; 318 319 319 - spin_lock(&sysfs_open_dirent_lock); 320 + spin_lock_irqsave(&sysfs_open_dirent_lock, flags); 320 321 321 322 list_del(&buffer->list); 322 323 if (atomic_dec_and_test(&od->refcnt)) ··· 325 324 else 326 325 od = NULL; 327 326 328 - spin_unlock(&sysfs_open_dirent_lock); 327 + spin_unlock_irqrestore(&sysfs_open_dirent_lock, flags); 329 328 330 329 kfree(od); 331 330 } ··· 457 456 void sysfs_notify_dirent(struct sysfs_dirent *sd) 458 457 { 459 458 struct sysfs_open_dirent *od; 459 + unsigned long flags; 460 460 461 - spin_lock(&sysfs_open_dirent_lock); 461 + spin_lock_irqsave(&sysfs_open_dirent_lock, flags); 462 462 463 463 od = sd->s_attr.open; 464 464 if (od) { ··· 467 465 wake_up_interruptible(&od->poll); 468 466 } 469 467 470 - spin_unlock(&sysfs_open_dirent_lock); 468 + spin_unlock_irqrestore(&sysfs_open_dirent_lock, flags); 471 469 } 472 470 EXPORT_SYMBOL_GPL(sysfs_notify_dirent); 473 471