file.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) file.c (67c0496e87d193b8356d2af49ab95e8a1b954b3c)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * fs/kernfs/file.c - kernfs file implementation
4 *
5 * Copyright (c) 2001-3 Patrick Mochel
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org>
8 */

--- 878 unchanged lines hidden (view full) ---

887 struct qstr name;
888
889 /*
890 * We want fsnotify_modify() on @kn but as the
891 * modifications aren't originating from userland don't
892 * have the matching @file available. Look up the inodes
893 * and generate the events manually.
894 */
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * fs/kernfs/file.c - kernfs file implementation
4 *
5 * Copyright (c) 2001-3 Patrick Mochel
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org>
8 */

--- 878 unchanged lines hidden (view full) ---

887 struct qstr name;
888
889 /*
890 * We want fsnotify_modify() on @kn but as the
891 * modifications aren't originating from userland don't
892 * have the matching @file available. Look up the inodes
893 * and generate the events manually.
894 */
895 inode = ilookup(info->sb, kn->id.ino);
895 inode = ilookup(info->sb, kernfs_ino(kn));
896 if (!inode)
897 continue;
898
899 name = (struct qstr)QSTR_INIT(kn->name, strlen(kn->name));
900 parent = kernfs_get_parent(kn);
901 if (parent) {
902 struct inode *p_inode;
903
896 if (!inode)
897 continue;
898
899 name = (struct qstr)QSTR_INIT(kn->name, strlen(kn->name));
900 parent = kernfs_get_parent(kn);
901 if (parent) {
902 struct inode *p_inode;
903
904 p_inode = ilookup(info->sb, parent->id.ino);
904 p_inode = ilookup(info->sb, kernfs_ino(parent));
905 if (p_inode) {
906 fsnotify(p_inode, FS_MODIFY | FS_EVENT_ON_CHILD,
907 inode, FSNOTIFY_EVENT_INODE, &name, 0);
908 iput(p_inode);
909 }
910
911 kernfs_put(parent);
912 }

--- 124 unchanged lines hidden ---
905 if (p_inode) {
906 fsnotify(p_inode, FS_MODIFY | FS_EVENT_ON_CHILD,
907 inode, FSNOTIFY_EVENT_INODE, &name, 0);
908 iput(p_inode);
909 }
910
911 kernfs_put(parent);
912 }

--- 124 unchanged lines hidden ---