/* * Directory content modification detection for Linux * * Copyright (C) 2004 Norbert Frese * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ #include #include #include #include /* * Report mtime of this dentry to dcontents_mtime of the parent directory. * Should get invoked inside file-write system calls. Take care that i_mtime * is set to the current time before this is invoked. */ void nonotify_parent(struct dentry *dentry) { struct dentry *parent; spin_lock(&dentry->d_lock); parent = dentry->d_parent; dget(parent); /* Assumption: This is faster than current_kernel_time(). If not - consider replacement */ parent->d_inode->i_dcontents_mtime = dentry->d_inode->i_mtime; dput(parent); spin_unlock(&dentry->d_lock); } EXPORT_SYMBOL_GPL(nonotify_parent);