diff --git a/plugin/file_ops_readdir.c b/plugin/file_ops_readdir.c index 9926e7c..b85ae7f 100644 --- a/plugin/file_ops_readdir.c +++ b/plugin/file_ops_readdir.c @@ -632,6 +632,14 @@ int readdir_common(struct file *f /* dir tap_done(&tap); detach_fsdata(f); + /* try to update directory's atime */ + if (reiser4_grab_space(inode_file_plugin(inode)->estimate.update(inode), + BA_CAN_COMMIT) != 0) + warning("", "failed to update atime on readdir: %llu", + get_inode_oid(inode)); + else + update_atime(inode); + context_set_commit_async(ctx); reiser4_exit_context(ctx); diff --git a/super_ops.c b/super_ops.c index fe18006..f4b750b 100644 --- a/super_ops.c +++ b/super_ops.c @@ -156,6 +156,28 @@ static void reiser4_destroy_inode(struct } /** + * reiser4_dirty_inode - dirty_inode of super operations + * @inode: inode being dirtied + * + * Updates stat data. + */ +static void reiser4_dirty_inode(struct inode *inode) +{ + int result; + + if (!is_in_reiser4_context()) + return; + assert("", !IS_RDONLY(inode)); + assert("", (inode_file_plugin(inode)->estimate.update(inode) <= + get_current_context()->grabbed_blocks)); + + result = reiser4_update_sd(inode); + if (result) + warning("", "failed to dirty inode for %llu: %d", + get_inode_oid(inode), result); +} + +/** * reiser4_delete_inode - delete_inode of super operations * @inode: inode to delete * @@ -421,6 +443,7 @@ static int reiser4_show_options(struct s struct super_operations reiser4_super_operations = { .alloc_inode = reiser4_alloc_inode, .destroy_inode = reiser4_destroy_inode, + .dirty_inode = reiser4_dirty_inode, .delete_inode = reiser4_delete_inode, .put_super = reiser4_put_super, .write_super = reiser4_write_super, diff --git a/vfs_ops.c b/vfs_ops.c index 7adce84..64cc23d 100644 --- a/vfs_ops.c +++ b/vfs_ops.c @@ -53,11 +53,6 @@ #include -extern struct dentry_operations reiser4_dentry_operation; - - - - /* update inode stat-data by calling plugin */ int reiser4_update_sd(struct inode *object) { @@ -254,8 +249,6 @@ void reiser4_handle_error(void) } } - - struct dentry_operations reiser4_dentry_operations = { .d_revalidate = NULL, .d_hash = NULL, diff --git a/vfs_ops.h b/vfs_ops.h index 9ba968c..f1556a4 100644 --- a/vfs_ops.h +++ b/vfs_ops.h @@ -27,7 +27,7 @@ int reiser4_readpages(struct file *, str int reiser4_invalidatepage(struct page *, unsigned long offset); int reiser4_releasepage(struct page *, int gfp); -extern int reiser4_update_sd(struct inode *object); +extern int reiser4_update_sd(struct inode *); extern int reiser4_add_nlink(struct inode *, struct inode *, int); extern int reiser4_del_nlink(struct inode *, struct inode *, int); ======== end ========