Commit d1342aad authored by Omar Sandoval's avatar Omar Sandoval Committed by David Sterba

Btrfs: update stale comments referencing vmtruncate()

Commit a41ad394 ("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: default avatarOmar Sandoval <osandov@fb.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c442793e
...@@ -5369,7 +5369,6 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr) ...@@ -5369,7 +5369,6 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
if (ret) if (ret)
return ret; return ret;
/* we don't support swapfiles, so vmtruncate shouldn't fail */
truncate_setsize(inode, newsize); truncate_setsize(inode, newsize);
/* Disable nonlocked read DIO to avoid the end less truncate */ /* Disable nonlocked read DIO to avoid the end less truncate */
...@@ -9044,8 +9043,8 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset, ...@@ -9044,8 +9043,8 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,
* *
* We are not allowed to take the i_mutex here so we have to play games to * 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 * 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 * truncate_setsize() writes the inode size before removing pages, once we have
* page lock we can determine safely if the page is beyond EOF. If it is not * 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 * beyond EOF, then the page is guaranteed safe against truncation until we
* unlock the page. * unlock the page.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment