mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
truncate: use new helpers
Update some fs code to make use of new helper functions introduced in the previous patch. Should be no significant change in behaviour (except CIFS now calls send_sig under i_lock, via inode_newsize_ok). Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Miklos Szeredi <miklos@szeredi.hu> Cc: linux-nfs@vger.kernel.org Cc: Trond.Myklebust@netapp.com Cc: linux-cifs-client@lists.samba.org Cc: sfrench@samba.org Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
25d9e2d152
commit
c08d3b0e33
7 changed files with 33 additions and 125 deletions
10
fs/buffer.c
10
fs/buffer.c
|
@ -2239,16 +2239,10 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
|
|||
struct address_space *mapping = inode->i_mapping;
|
||||
struct page *page;
|
||||
void *fsdata;
|
||||
unsigned long limit;
|
||||
int err;
|
||||
|
||||
err = -EFBIG;
|
||||
limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
|
||||
if (limit != RLIM_INFINITY && size > (loff_t)limit) {
|
||||
send_sig(SIGXFSZ, current, 0);
|
||||
goto out;
|
||||
}
|
||||
if (size > inode->i_sb->s_maxbytes)
|
||||
err = inode_newsize_ok(inode, size);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = pagecache_write_begin(NULL, mapping, size, 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue