diff options
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 3d3519146..00b0daf7e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -10,6 +10,7 @@ #include <linux/file.h> #include <linux/uio.h> #include <linux/smp_lock.h> +#include <linux/dnotify.h> #include <asm/uaccess.h> @@ -132,6 +133,9 @@ asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count) ret = read(file, buf, count, &file->f_pos); } } + if (ret > 0) + inode_dir_notify(file->f_dentry->d_parent->d_inode, + DN_ACCESS); fput(file); } return ret; @@ -156,6 +160,9 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count) ret = write(file, buf, count, &file->f_pos); } } + if (ret > 0) + inode_dir_notify(file->f_dentry->d_parent->d_inode, + DN_MODIFY); fput(file); } return ret; @@ -257,6 +264,10 @@ out: if (iov != iovstack) kfree(iov); out_nofree: + /* VERIFY_WRITE actually means a read, as we write to user space */ + if ((ret + (type == VERIFY_WRITE)) > 0) + inode_dir_notify(file->f_dentry->d_parent->d_inode, + (type == VERIFY_WRITE) ? DN_MODIFY : DN_ACCESS); return ret; } @@ -327,6 +338,8 @@ asmlinkage ssize_t sys_pread(unsigned int fd, char * buf, if (pos < 0) goto out; ret = read(file, buf, count, &pos); + if (ret > 0) + inode_dir_notify(file->f_dentry->d_parent->d_inode, DN_ACCESS); out: fput(file); bad_file: @@ -357,6 +370,8 @@ asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf, goto out; ret = write(file, buf, count, &pos); + if (ret > 0) + inode_dir_notify(file->f_dentry->d_parent->d_inode, DN_MODIFY); out: fput(file); bad_file: |