Skip to contentSkip to conversation

mm: drop vmtruncate

PATCH In review Marco Stornelli 2 participants 3 messages Nov 3, 2012 – Nov 16, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 20/21 mm: drop vmtruncate

Removed vmtruncate

---
 include/linux/mm.h |    1 -
 mm/truncate.c      |   23 -----------------------
 2 files changed, 0 insertions(+), 24 deletions(-)
include/linux/mm.h +0 -1
index fa06804..95f70bb 100644
@@ -977,7 +977,6 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
 
 extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new);
 extern void truncate_setsize(struct inode *inode, loff_t newsize);
-extern int vmtruncate(struct inode *inode, loff_t offset);
 void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
 int truncate_inode_page(struct address_space *mapping, struct page *page);
 int generic_error_remove_page(struct address_space *mapping, struct page *page);
mm/truncate.c +0 -23
index d51ce92..c75b736 100644
@@ -577,29 +577,6 @@ void truncate_setsize(struct inode *inode, loff_t newsize)
 EXPORT_SYMBOL(truncate_setsize);
 
 /**
- * vmtruncate - unmap mappings "freed" by truncate() syscall
- * @inode: inode of the file used
- * @newsize: file offset to start truncating
- *
- * This function is deprecated and truncate_setsize or truncate_pagecache
- * should be used instead, together with filesystem specific block truncation.
- */
-int vmtruncate(struct inode *inode, loff_t newsize)
-{
-	int error;
-
-	error = inode_newsize_ok(inode, newsize);
-	if (error)
-		return error;
-
-	truncate_setsize(inode, newsize);
-	if (inode->i_op->truncate)
-		inode->i_op->truncate(inode);
-	return 0;
-}
-EXPORT_SYMBOL(vmtruncate);
-
-/**
  * truncate_pagecache_range - unmap and remove pagecache that is hole-punched
  * @inode: inode
  * @lstart: offset of beginning of hole
Signature · 7 lines
1.7.3.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw
Quoted 1 line · Marco Stornelli

Removed vmtruncate

Hi Marco,

Could you explain me why vmtruncate need remove? What's the problem and how to substitute it?

Regards,
Jaegeuk

Quoted 43 lines
---
  include/linux/mm.h |    1 -
  mm/truncate.c      |   23 -----------------------
  2 files changed, 0 insertions(+), 24 deletions(-)
include/linux/mm.h +0 -1
index fa06804..95f70bb 100644
@@ -977,7 +977,6 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
 
  extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new);
  extern void truncate_setsize(struct inode *inode, loff_t newsize);
-extern int vmtruncate(struct inode *inode, loff_t offset);
  void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
  int truncate_inode_page(struct address_space *mapping, struct page *page);
  int generic_error_remove_page(struct address_space *mapping, struct page *page);
mm/truncate.c +0 -16
index d51ce92..c75b736 100644
@@ -577,29 +577,6 @@ void truncate_setsize(struct inode *inode, loff_t newsize)
  EXPORT_SYMBOL(truncate_setsize);
 
  /**
- * vmtruncate - unmap mappings "freed" by truncate() syscall
- * @inode: inode of the file used
- * @newsize: file offset to start truncating
- *
- * This function is deprecated and truncate_setsize or truncate_pagecache
- * should be used instead, together with filesystem specific block truncation.
- */
-int vmtruncate(struct inode *inode, loff_t newsize)
-{
-	int error;
-
-	error = inode_newsize_ok(inode, newsize);
-	if (error)
-		return error;
-
-	truncate_setsize(inode, newsize);

mm/truncate.c void truncate_setsize(struct inode *inode, loff_t newsize) · line 582

Quoted 10 lines
mm/truncate.c +0 -7
-	if (inode->i_op->truncate)
-		inode->i_op->truncate(inode);
-	return 0;
-}
-EXPORT_SYMBOL(vmtruncate);
-
-/**
   * truncate_pagecache_range - unmap and remove pagecache that is hole-punched
   * @inode: inode
   * @lstart: offset of beginning of hole

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw

2012/11/16 Jaegeuk Hanse <[email protected]>:

Quoted 5 lines · Marco Stornelli
Quoted 2 lines

Removed vmtruncate

Quoted 8 lines

Hi Marco,

Could you explain me why vmtruncate need remove? What's the problem and how to substitute it?

Regards,
Jaegeuk

vmtruncate is a deprecated function so it'd be better to remove it. The truncate sequence is changed for several reasons. The documentation is clear: "This function is deprecated and truncate_setsize or truncate_pagecache should be used instead, together with filesystem specific block truncation." In addition, we can remove the truncate callback from the inode struct saving 4/8 bytes.

Marco

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>