* [PATCH 20/21] mm: drop vmtruncate
@ 2012-11-03 9:32 Marco Stornelli
2012-11-16 6:39 ` Jaegeuk Hanse
0 siblings, 1 reply; 5+ messages in thread
From: Marco Stornelli @ 2012-11-03 9:32 UTC (permalink / raw)
To: Linux FS Devel; +Cc: linux-mm, linux-kernel
Removed vmtruncate
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---
include/linux/mm.h | 1 -
mm/truncate.c | 23 -----------------------
2 files changed, 0 insertions(+), 24 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index fa06804..95f70bb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -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);
diff --git a/mm/truncate.c b/mm/truncate.c
index d51ce92..c75b736 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -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
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 20/21] mm: drop vmtruncate
2012-11-03 9:32 [PATCH 20/21] mm: drop vmtruncate Marco Stornelli
@ 2012-11-16 6:39 ` Jaegeuk Hanse
2012-11-16 7:45 ` Marco Stornelli
0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Hanse @ 2012-11-16 6:39 UTC (permalink / raw)
To: Marco Stornelli; +Cc: Linux FS Devel, linux-mm, linux-kernel
On 11/03/2012 05:32 PM, Marco Stornelli wrote:
> Removed vmtruncate
Hi Marco,
Could you explain me why vmtruncate need remove? What's the problem and
how to substitute it?
Regards,
Jaegeuk
>
> Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
> ---
> include/linux/mm.h | 1 -
> mm/truncate.c | 23 -----------------------
> 2 files changed, 0 insertions(+), 24 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index fa06804..95f70bb 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -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);
> diff --git a/mm/truncate.c b/mm/truncate.c
> index d51ce92..c75b736 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 20/21] mm: drop vmtruncate
2012-11-16 6:39 ` Jaegeuk Hanse
@ 2012-11-16 7:45 ` Marco Stornelli
0 siblings, 0 replies; 5+ messages in thread
From: Marco Stornelli @ 2012-11-16 7:45 UTC (permalink / raw)
To: Jaegeuk Hanse; +Cc: Linux FS Devel, linux-mm, linux-kernel
2012/11/16 Jaegeuk Hanse <jaegeuk.hanse@gmail.com>:
> On 11/03/2012 05:32 PM, Marco Stornelli wrote:
>>
>> Removed vmtruncate
>
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 20/21] mm: drop vmtruncate
@ 2012-12-15 11:00 Marco Stornelli
0 siblings, 0 replies; 5+ messages in thread
From: Marco Stornelli @ 2012-12-15 11:00 UTC (permalink / raw)
To: Linux FS Devel
Cc: Paul E. McKenney, David Howells, Thomas Gleixner,
Marco Stornelli, Michael Kerrisk, linux-mm, linux-kernel
Removed vmtruncate
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---
include/linux/mm.h | 1 -
mm/truncate.c | 23 -----------------------
2 files changed, 0 insertions(+), 24 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4af4f0b..6c93b79 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -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);
diff --git a/mm/truncate.c b/mm/truncate.c
index d51ce92..c75b736 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -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
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 20/21] mm: drop vmtruncate
@ 2012-10-20 12:30 Marco Stornelli
0 siblings, 0 replies; 5+ messages in thread
From: Marco Stornelli @ 2012-10-20 12:30 UTC (permalink / raw)
To: Linux FS Devel; +Cc: linux-mm, linux-kernel
Removed vmtruncate
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---
include/linux/mm.h | 1 -
mm/truncate.c | 23 -----------------------
2 files changed, 0 insertions(+), 24 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index fa06804..95f70bb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -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);
diff --git a/mm/truncate.c b/mm/truncate.c
index d51ce92..c75b736 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -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
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-12-15 11:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-03 9:32 [PATCH 20/21] mm: drop vmtruncate Marco Stornelli
2012-11-16 6:39 ` Jaegeuk Hanse
2012-11-16 7:45 ` Marco Stornelli
-- strict thread matches above, loose matches on Subject: below --
2012-12-15 11:00 Marco Stornelli
2012-10-20 12:30 Marco Stornelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).