The patch titled fs: convert simple fs to new truncate has been removed from the -mm tree. Its filename was fs-convert-simple-fs-to-new-truncate.patch This patch was dropped because an updated version will be merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: fs: convert simple fs to new truncate From: Nick Piggin <npiggin@xxxxxxx> Convert simple filesystems: ramfs, configfs, sysfs to new truncate sequence. Signed-off-by: Nick Piggin <npiggin@xxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: Dave Kleikamp <shaggy@xxxxxxxxxxxxxxxxxx> Cc: Chris Mason <chris.mason@xxxxxxxxxx> Cc: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> Cc: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx> Cc: Miklos Szeredi <miklos@xxxxxxxxxx> Cc: Trond Myklebust <trond.myklebust@xxxxxxxxxx> Cc: Steven French <sfrench@xxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/configfs/inode.c | 11 ++++++++--- fs/ramfs/file-mmu.c | 2 ++ fs/ramfs/file-nommu.c | 8 +++++--- fs/sysfs/inode.c | 7 ++----- 4 files changed, 17 insertions(+), 11 deletions(-) diff -puN fs/configfs/inode.c~fs-convert-simple-fs-to-new-truncate fs/configfs/inode.c --- a/fs/configfs/inode.c~fs-convert-simple-fs-to-new-truncate +++ a/fs/configfs/inode.c @@ -57,6 +57,7 @@ static struct backing_dev_info configfs_ }; static const struct inode_operations configfs_inode_operations ={ + .new_truncate = 1, .setattr = configfs_setattr, }; @@ -77,9 +78,13 @@ int configfs_setattr(struct dentry * den if (error) return error; - error = inode_setattr(inode, iattr); - if (error) - return error; + if (iattr->ia_valid & ATTR_SIZE) { + error = simple_setsize(inode, iattr->ia_size); + if (error) + return error; + } + + generic_setattr(inode, iattr); if (!sd_iattr) { /* setting attributes for the first time, allocate now */ diff -puN fs/ramfs/file-mmu.c~fs-convert-simple-fs-to-new-truncate fs/ramfs/file-mmu.c --- a/fs/ramfs/file-mmu.c~fs-convert-simple-fs-to-new-truncate +++ a/fs/ramfs/file-mmu.c @@ -50,5 +50,7 @@ const struct file_operations ramfs_file_ }; const struct inode_operations ramfs_file_inode_operations = { + .new_truncate = 1, + .setattr = simple_setattr, .getattr = simple_getattr, }; diff -puN fs/ramfs/file-nommu.c~fs-convert-simple-fs-to-new-truncate fs/ramfs/file-nommu.c --- a/fs/ramfs/file-nommu.c~fs-convert-simple-fs-to-new-truncate +++ a/fs/ramfs/file-nommu.c @@ -48,6 +48,7 @@ const struct file_operations ramfs_file_ }; const struct inode_operations ramfs_file_inode_operations = { + .new_truncate = 1, .setattr = ramfs_nommu_setattr, .getattr = simple_getattr, }; @@ -169,7 +170,7 @@ static int ramfs_nommu_resize(struct ino return ret; } - ret = vmtruncate(inode, newsize); + ret = simple_setsize(inode, newsize); return ret; } @@ -192,7 +193,8 @@ static int ramfs_nommu_setattr(struct de /* pick out size-changing events */ if (ia->ia_valid & ATTR_SIZE) { - loff_t size = i_size_read(inode); + loff_t size = inode->i_size; + if (ia->ia_size != size) { ret = ramfs_nommu_resize(inode, ia->ia_size, size); if (ret < 0 || ia->ia_valid == ATTR_SIZE) @@ -205,7 +207,7 @@ static int ramfs_nommu_setattr(struct de } } - ret = inode_setattr(inode, ia); + generic_setattr(inode, ia); out: ia->ia_valid = old_ia_valid; return ret; diff -puN fs/sysfs/inode.c~fs-convert-simple-fs-to-new-truncate fs/sysfs/inode.c --- a/fs/sysfs/inode.c~fs-convert-simple-fs-to-new-truncate +++ a/fs/sysfs/inode.c @@ -37,6 +37,7 @@ static struct backing_dev_info sysfs_bac }; static const struct inode_operations sysfs_inode_operations ={ + .new_truncate = 1, .setattr = sysfs_setattr, .setxattr = sysfs_setxattr, }; @@ -82,11 +83,7 @@ int sysfs_setattr(struct dentry * dentry if (error) return error; - iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */ - - error = inode_setattr(inode, iattr); - if (error) - return error; + generic_setattr(inode, iattr); if (!sd_attrs) { /* setting attributes for the first time, allocate now */ _ Patches currently in -mm which might be from npiggin@xxxxxxx are origin.patch linux-next.patch fs-remove-unneeded-dcache_unhashed-tricks.patch fs-improve-remountro-vs-buffercache-coherency.patch fs-convert-simple-fs-to-new-truncate.patch tmpfs-convert-to-use-the-new-truncate-convention.patch ext2-convert-to-use-the-new-truncate-convention.patch ext2-convert-to-use-the-new-truncate-convention-fix.patch fat-convert-to-use-the-new-truncate-convention.patch btrfs-convert-to-use-the-new-truncate-convention.patch jfs-convert-to-use-the-new-truncate-convention.patch udf-convert-to-use-the-new-truncate-convention.patch minix-convert-to-use-the-new-truncate-convention.patch reiser4.patch fs-symlink-write_begin-allocation-context-fix-reiser4-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html