diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-14 10:08:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-14 10:08:57 +0200 |
commit | 9ef8638bd8c7e06bee087a04af7950cbc6123828 (patch) | |
tree | de145994dfe036dbd2d729c61e043f1a96cef25c /fs/affs/file.c | |
parent | 0de7511695680425aa1e6e1e1c7a7c24e6250491 (diff) | |
parent | 856deb866d16e29bd65952e0289066f6078af773 (diff) | |
download | linux-stable-9ef8638bd8c7e06bee087a04af7950cbc6123828.tar.gz linux-stable-9ef8638bd8c7e06bee087a04af7950cbc6123828.tar.bz2 linux-stable-9ef8638bd8c7e06bee087a04af7950cbc6123828.zip |
Merge 5.9-rc5 into driver-core-next
We need the driver core changes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/affs/file.c')
-rw-r--r-- | fs/affs/file.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c index a26a0f96c119..d91b0133d95d 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -429,6 +429,24 @@ static int affs_write_begin(struct file *file, struct address_space *mapping, return ret; } +static int affs_write_end(struct file *file, struct address_space *mapping, + loff_t pos, unsigned int len, unsigned int copied, + struct page *page, void *fsdata) +{ + struct inode *inode = mapping->host; + int ret; + + ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); + + /* Clear Archived bit on file writes, as AmigaOS would do */ + if (AFFS_I(inode)->i_protect & FIBF_ARCHIVED) { + AFFS_I(inode)->i_protect &= ~FIBF_ARCHIVED; + mark_inode_dirty(inode); + } + + return ret; +} + static sector_t _affs_bmap(struct address_space *mapping, sector_t block) { return generic_block_bmap(mapping,block,affs_get_block); @@ -438,7 +456,7 @@ const struct address_space_operations affs_aops = { .readpage = affs_readpage, .writepage = affs_writepage, .write_begin = affs_write_begin, - .write_end = generic_write_end, + .write_end = affs_write_end, .direct_IO = affs_direct_IO, .bmap = _affs_bmap }; @@ -795,6 +813,12 @@ done: if (tmp > inode->i_size) inode->i_size = AFFS_I(inode)->mmu_private = tmp; + /* Clear Archived bit on file writes, as AmigaOS would do */ + if (AFFS_I(inode)->i_protect & FIBF_ARCHIVED) { + AFFS_I(inode)->i_protect &= ~FIBF_ARCHIVED; + mark_inode_dirty(inode); + } + err_first_bh: unlock_page(page); put_page(page); |