[PATCH 1/8] sysfs: notify file on deactivation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Notify file on deactivation so that the pollers get event when the
polled file dies, which is very easy to implement with sd based
interface.

Signed-off-by: Tejun Heo <[email protected]>
---
 fs/sysfs/dir.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index a74ca4a..d50d3ac 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -245,6 +245,10 @@ static void sysfs_deactivate(struct sysfs_dirent *sd)
 	 */
 	v = atomic_add_return(SD_DEACTIVATED_BIAS, &sd->s_active);
 
+	/* file is dying, notify pollers */
+	if (sysfs_type(sd) == SYSFS_FILE)
+		sysfs_notify_file(sd);
+
 	if (v != SD_DEACTIVATED_BIAS)
 		wait_for_completion(&wait);
 
-- 
1.5.0.3


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux