You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07: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:
+5
-13
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user