diff options
Diffstat (limited to 'fs/adfs')
| -rw-r--r-- | fs/adfs/Kconfig | 4 | ||||
| -rw-r--r-- | fs/adfs/inode.c | 15 | 
2 files changed, 12 insertions, 7 deletions
| diff --git a/fs/adfs/Kconfig b/fs/adfs/Kconfig index e55182a74605..c5a7787dd5e9 100644 --- a/fs/adfs/Kconfig +++ b/fs/adfs/Kconfig @@ -1,6 +1,6 @@  config ADFS_FS -	tristate "ADFS file system support (EXPERIMENTAL)" -	depends on BLOCK && EXPERIMENTAL +	tristate "ADFS file system support" +	depends on BLOCK  	help  	  The Acorn Disc Filing System is the standard file system of the  	  RiscOS operating system which runs on Acorn's ARM-based Risc PC diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index e9bad5093a3f..5f95d1ed9c6d 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -45,6 +45,14 @@ static int adfs_readpage(struct file *file, struct page *page)  	return block_read_full_page(page, adfs_get_block);  } +static void adfs_write_failed(struct address_space *mapping, loff_t to) +{ +	struct inode *inode = mapping->host; + +	if (to > inode->i_size) +		truncate_pagecache(inode, to, inode->i_size); +} +  static int adfs_write_begin(struct file *file, struct address_space *mapping,  			loff_t pos, unsigned len, unsigned flags,  			struct page **pagep, void **fsdata) @@ -55,11 +63,8 @@ static int adfs_write_begin(struct file *file, struct address_space *mapping,  	ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,  				adfs_get_block,  				&ADFS_I(mapping->host)->mmu_private); -	if (unlikely(ret)) { -		loff_t isize = mapping->host->i_size; -		if (pos + len > isize) -			vmtruncate(mapping->host, isize); -	} +	if (unlikely(ret)) +		adfs_write_failed(mapping, pos + len);  	return ret;  } |