diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-12-09 11:09:45 +0000 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-01-20 20:12:41 -0500 |
commit | c3c8149b3552b6656ded9ac86d53072f74771ba7 (patch) | |
tree | 9f8b790d61c436d3a022c73bdba74be0414ac191 /fs/adfs/dir.c | |
parent | 90011c7ad999c9565a5c97704cd5bda151ebe447 (diff) | |
download | linux-c3c8149b3552b6656ded9ac86d53072f74771ba7.tar.bz2 |
fs/adfs: dir: add helper to mark directory buffers dirty
Provide a helper for marking directory buffers dirty so they get
written back to disk.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs/dir.c')
-rw-r--r-- | fs/adfs/dir.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 882377e86041..e8aafc65d545 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -157,6 +157,15 @@ static int adfs_dir_read_inode(struct super_block *sb, struct inode *inode, return ret; } +static void adfs_dir_mark_dirty(struct adfs_dir *dir) +{ + unsigned int i; + + /* Mark the buffers dirty */ + for (i = 0; i < dir->nr_buffers; i++) + mark_buffer_dirty(dir->bhs[i]); +} + static int adfs_dir_sync(struct adfs_dir *dir) { int err = 0; @@ -280,6 +289,9 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj, int wait) ret = ops->update(&dir, obj); write_unlock(&adfs_dir_lock); + if (ret == 0) + adfs_dir_mark_dirty(&dir); + if (wait) { int err = adfs_dir_sync(&dir); if (!ret) |