From: Omar Sandoval Date: Fri, 11 May 2018 20:13:29 +0000 (-0700) Subject: Btrfs: update stale comments referencing vmtruncate() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d1342aadbd9fcc82fd6e24c7f0443a43fe4714c7;p=openwrt%2Fstaging%2Fblogic.git Btrfs: update stale comments referencing vmtruncate() Commit a41ad394a03b ("Btrfs: convert to the new truncate sequence") changed btrfs_setsize() to call truncate_setsize() instead of vmtruncate() but didn't update the comment above it. truncate_setsize() never fails (the IS_SWAPFILE() check happens elsewhere), so remove the comment. Additionally, the comment above btrfs_page_mkwrite() references vmtruncate(), but truncate_setsize() does the size write and page locking now. Signed-off-by: Omar Sandoval Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index cbcda4e296f8..a1d352fbe647 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5369,7 +5369,6 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr) if (ret) return ret; - /* we don't support swapfiles, so vmtruncate shouldn't fail */ truncate_setsize(inode, newsize); /* Disable nonlocked read DIO to avoid the end less truncate */ @@ -9044,8 +9043,8 @@ again: * * We are not allowed to take the i_mutex here so we have to play games to * protect against truncate races as the page could now be beyond EOF. Because - * vmtruncate() writes the inode size before removing pages, once we have the - * page lock we can determine safely if the page is beyond EOF. If it is not + * truncate_setsize() writes the inode size before removing pages, once we have + * the page lock we can determine safely if the page is beyond EOF. If it is not * beyond EOF, then the page is guaranteed safe against truncation until we * unlock the page. */