All of lore.kernel.org
 help / color / mirror / Atom feed
* last_index variable in btrfs_buffered_write function
@ 2011-07-11 16:56 João Eduardo Luís
  2011-07-11 19:38 ` Mitch Harder
  0 siblings, 1 reply; 4+ messages in thread
From: João Eduardo Luís @ 2011-07-11 16:56 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

Hello.

Am I reading the code the wrong way, or is the 'last_index' variable in '__btrfs_buffered_write()' (and previously used in 'btrfs_file_aio_write()') irrelevant? 

It appears to just be used in 'prepare_pages()', passed as an argument, but never actually used by this function.

Furthermore, I'm not sure what is intended with this variable, but if the idea is to assign it with the  last page in the range, then I would say that instead of

> last_index = (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT;

it should be

>  last_index = (pos + iov_iter_count(i) - 1) >> PAGE_CACHE_SHIFT;

Then again, I may be missing something.

Cheers.

---
João Eduardo Luís
gpg key: 477C26E5 from pool.keyserver.eu 






[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-12 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 16:56 last_index variable in btrfs_buffered_write function João Eduardo Luís
2011-07-11 19:38 ` Mitch Harder
2011-07-12 14:11   ` Chris Mason
2011-07-12 19:43     ` Mitch Harder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.