]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librados: rename NOREUSE to NOCACHE 3543/head
authorSage Weil <sage@redhat.com>
Thu, 29 Jan 2015 21:00:15 +0000 (13:00 -0800)
committerSage Weil <sage@redhat.com>
Thu, 29 Jan 2015 21:00:15 +0000 (13:00 -0800)
commit89bd6b1324b25a5ef3ca21f159e73dffd8acb065
treef9ba9bff4ccc006dfd1a56374d0681c17350c271
parentcd2491a10a6fe7f338a7ba86d95b051d1cb95391
librados: rename NOREUSE to NOCACHE

As far as I can tell, the posix_fadvise() distinction between WONTNEED and
NOREUSE is subtle: one says I won't access the data, and the other says
I will access it one more time and then not access it.  That is, the
distinction is about time.  This thread seems to confirm this
interpretation:

 https://lkml.org/lkml/2011/6/27/44

Since we are attaching hints to the IO operations themselves, this
distinction doesn't make much sense for us.  (Backends should be careful
about which hint they use; or rather, they should use WONTNEED *after*
doing the IO since NOREUSE is presenting a no-op in Linux.)

However, we want to make a totally different distinction:

 WONTNEED - nobody will access this -> drop it from the cache
 NOCACHE  - *i* won't access this again -> don't let me affect your caching
            decisions or the working set you're maintaining for other
            clients.

The NOCACHE name is made-up and distinct from NOREUSE only so that it is
different from POSIX and doesn't introduce confusion for people familiar
with the POSIX meaning.  Perhaps a more accurate name would be IWONTNEED
but that is only one character apart and too error-prone IMO.

Signed-off-by: Sage Weil <sage@redhat.com>
src/include/rados.h
src/include/rados/librados.h
src/include/rados/librados.hpp
src/librados/librados.cc
src/osd/osd_types.cc
src/test/librados/aio.cc
src/test/librados/c_write_operations.cc
src/test/librados/io.cc
src/test/librbd/test_librbd.cc