fsnotify.c (9385a84d7e1f658bb2d96ab798393e4b16268aaa) | fsnotify.c (ebb3b47e37a4ccef33e6388589a21a5c23d6b40b) |
---|---|
1/* 2 * Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2, or (at your option) 7 * any later version. 8 * --- 27 unchanged lines hidden (view full) --- 36} 37EXPORT_SYMBOL_GPL(__fsnotify_inode_delete); 38 39void __fsnotify_vfsmount_delete(struct vfsmount *mnt) 40{ 41 fsnotify_clear_marks_by_mount(mnt); 42} 43 | 1/* 2 * Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2, or (at your option) 7 * any later version. 8 * --- 27 unchanged lines hidden (view full) --- 36} 37EXPORT_SYMBOL_GPL(__fsnotify_inode_delete); 38 39void __fsnotify_vfsmount_delete(struct vfsmount *mnt) 40{ 41 fsnotify_clear_marks_by_mount(mnt); 42} 43 |
44/** 45 * fsnotify_unmount_inodes - an sb is unmounting. handle any watched inodes. 46 * @sb: superblock being unmounted. 47 * 48 * Called during unmount with no locks held, so needs to be safe against 49 * concurrent modifiers. We temporarily drop sb->s_inode_list_lock and CAN block. 50 */ 51void fsnotify_unmount_inodes(struct super_block *sb) 52{ 53 struct inode *inode, *iput_inode = NULL; 54 55 spin_lock(&sb->s_inode_list_lock); 56 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { 57 /* 58 * We cannot __iget() an inode in state I_FREEING, 59 * I_WILL_FREE, or I_NEW which is fine because by that point 60 * the inode cannot have any associated watches. 61 */ 62 spin_lock(&inode->i_lock); 63 if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) { 64 spin_unlock(&inode->i_lock); 65 continue; 66 } 67 68 /* 69 * If i_count is zero, the inode cannot have any watches and 70 * doing an __iget/iput with MS_ACTIVE clear would actually 71 * evict all inodes with zero i_count from icache which is 72 * unnecessarily violent and may in fact be illegal to do. 73 */ 74 if (!atomic_read(&inode->i_count)) { 75 spin_unlock(&inode->i_lock); 76 continue; 77 } 78 79 __iget(inode); 80 spin_unlock(&inode->i_lock); 81 spin_unlock(&sb->s_inode_list_lock); 82 83 if (iput_inode) 84 iput(iput_inode); 85 86 /* for each watch, send FS_UNMOUNT and then remove it */ 87 fsnotify(inode, FS_UNMOUNT, inode, FSNOTIFY_EVENT_INODE, NULL, 0); 88 89 fsnotify_inode_delete(inode); 90 91 iput_inode = inode; 92 93 spin_lock(&sb->s_inode_list_lock); 94 } 95 spin_unlock(&sb->s_inode_list_lock); 96 97 if (iput_inode) 98 iput(iput_inode); 99} 100 |
|
44/* 45 * Given an inode, first check if we care what happens to our children. Inotify 46 * and dnotify both tell their parents about events. If we care about any event 47 * on a child we run all of our children and set a dentry flag saying that the 48 * parent cares. Thus when an event happens on a child it can quickly tell if 49 * if there is a need to find a parent and send the event to the parent. 50 */ 51void __fsnotify_update_child_dentry_flags(struct inode *inode) --- 281 unchanged lines hidden --- | 101/* 102 * Given an inode, first check if we care what happens to our children. Inotify 103 * and dnotify both tell their parents about events. If we care about any event 104 * on a child we run all of our children and set a dentry flag saying that the 105 * parent cares. Thus when an event happens on a child it can quickly tell if 106 * if there is a need to find a parent and send the event to the parent. 107 */ 108void __fsnotify_update_child_dentry_flags(struct inode *inode) --- 281 unchanged lines hidden --- |