diff options
author | npiggin@suse.de <npiggin@suse.de> | 2009-08-21 02:35:06 +1000 |
---|---|---|
committer | al <al@dizzy.pdmi.ras.ru> | 2009-09-24 08:41:47 -0400 |
commit | c08d3b0e33edce28e9cfa7b64f7fe5bdeeb29248 (patch) | |
tree | 6c161cc57a2873e6f91335113192a99531901cd8 /fs/ramfs/file-nommu.c | |
parent | 25d9e2d15286281ec834b829a4aaf8969011f1cd (diff) | |
download | op-kernel-dev-c08d3b0e33edce28e9cfa7b64f7fe5bdeeb29248.zip op-kernel-dev-c08d3b0e33edce28e9cfa7b64f7fe5bdeeb29248.tar.gz |
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>
Diffstat (limited to 'fs/ramfs/file-nommu.c')
-rw-r--r-- | fs/ramfs/file-nommu.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 11f0c06..32fae40 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -69,14 +69,11 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) /* make various checks */ order = get_order(newsize); if (unlikely(order >= MAX_ORDER)) - goto too_big; + return -EFBIG; - limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; - if (limit != RLIM_INFINITY && newsize > limit) - goto fsize_exceeded; - - if (newsize > inode->i_sb->s_maxbytes) - goto too_big; + ret = inode_newsize_ok(inode, newsize); + if (ret) + return ret; i_size_write(inode, newsize); @@ -118,12 +115,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) return 0; - fsize_exceeded: - send_sig(SIGXFSZ, current, 0); - too_big: - return -EFBIG; - - add_error: +add_error: while (loop < npages) __free_page(pages + loop++); return ret; |