Re: [PATCH] mm for fs: add truncate_pagecache_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 23 Mar 2012 13:46:35 -0700 (PDT)
Hugh Dickins <hughd@xxxxxxxxxx> wrote:

> +/**
> + * truncate_pagecache_range - unmap and remove pagecache that is hole-punched
> + * @inode: inode
> + * @lstart: offset of beginning of hole
> + * @lend: offset of last byte of hole
> + *
> + * This function should typically be called before the filesystem
> + * releases resources associated with the freed range (eg. deallocates
> + * blocks). This way, pagecache will always stay logically coherent
> + * with on-disk format, and the filesystem would not have to deal with
> + * situations such as writepage being called for a page that has already
> + * had its underlying blocks deallocated.
> + */

--- a/mm/truncate.c~mm-for-fs-add-truncate_pagecache_range-fix
+++ a/mm/truncate.c
@@ -639,6 +639,9 @@ int vmtruncate_range(struct inode *inode
  * with on-disk format, and the filesystem would not have to deal with
  * situations such as writepage being called for a page that has already
  * had its underlying blocks deallocated.
+ *
+ * Must be called with inode->i_mapping->i_mutex held.
+ * Takes inode->i_mapping->i_mmap_mutex.
  */
 void truncate_pagecache_range(struct inode *inode, loff_t lstart, loff_t lend)
 {

yes?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]