mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm/fs: remove truncate_range
Remove vmtruncate_range(), and remove the truncate_range method from struct inode_operations: only tmpfs ever supported it, and tmpfs has now converted over to using the fallocate method of file_operations. Update Documentation accordingly, adding (setlease and) fallocate lines. And while we're in mm.h, remove duplicate declarations of shmem_lock() and shmem_file_setup(): everyone is now using the ones in shmem_fs.h. Based-on-patch-by: Cong Wang <[email protected]> Signed-off-by: Hugh Dickins <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Cong Wang <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3f31d07571
commit
17cf28afea
7 changed files with 8 additions and 39 deletions
|
|
@ -602,31 +602,6 @@ int vmtruncate(struct inode *inode, loff_t newsize)
|
|||
}
|
||||
EXPORT_SYMBOL(vmtruncate);
|
||||
|
||||
int vmtruncate_range(struct inode *inode, loff_t lstart, loff_t lend)
|
||||
{
|
||||
struct address_space *mapping = inode->i_mapping;
|
||||
loff_t holebegin = round_up(lstart, PAGE_SIZE);
|
||||
loff_t holelen = 1 + lend - holebegin;
|
||||
|
||||
/*
|
||||
* If the underlying filesystem is not going to provide
|
||||
* a way to truncate a range of blocks (punch a hole) -
|
||||
* we should return failure right now.
|
||||
*/
|
||||
if (!inode->i_op->truncate_range)
|
||||
return -ENOSYS;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
inode_dio_wait(inode);
|
||||
unmap_mapping_range(mapping, holebegin, holelen, 1);
|
||||
inode->i_op->truncate_range(inode, lstart, lend);
|
||||
/* unmap again to remove racily COWed private pages */
|
||||
unmap_mapping_range(mapping, holebegin, holelen, 1);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* truncate_pagecache_range - unmap and remove pagecache that is hole-punched
|
||||
* @inode: inode
|
||||
|
|
|
|||
Loading…
Reference in a new issue