mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
Merge pull request #3543 from ceph/wip-hints
librados: rename NOREUSE to NOCACHE Reviewed-by: Josh Durgin <jdurgin@redhat.com> Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
commit
7237933f6c
@ -418,7 +418,7 @@ enum {
|
||||
CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL = 0x8, /* the op is sequential */
|
||||
CEPH_OSD_OP_FLAG_FADVISE_WILLNEED = 0x10,/* data will be accessed in the near future */
|
||||
CEPH_OSD_OP_FLAG_FADVISE_DONTNEED = 0x20,/* data will not be accessed in the near future */
|
||||
CEPH_OSD_OP_FLAG_FADVISE_NOREUSE = 0x40, /* data will be accessed only once by this client */
|
||||
CEPH_OSD_OP_FLAG_FADVISE_NOCACHE = 0x40, /* data will be accessed only once by this client */
|
||||
};
|
||||
|
||||
#define EOLDSNAPC 85 /* ORDERSNAP flag set; writer has old snapc*/
|
||||
|
@ -74,12 +74,12 @@ enum {
|
||||
LIBRADOS_OP_FLAG_FADVISE_RANDOM = 0x4,
|
||||
// indicate read/write op sequential
|
||||
LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL = 0x8,
|
||||
// indicate read/write data will be accessed in the near future
|
||||
// indicate read/write data will be accessed in the near future (by someone)
|
||||
LIBRADOS_OP_FLAG_FADVISE_WILLNEED = 0x10,
|
||||
// indicate read/write data will not accessed int the near future
|
||||
// indicate read/write data will not accessed in the near future (by anyone)
|
||||
LIBRADOS_OP_FLAG_FADVISE_DONTNEED = 0x20,
|
||||
// indicate read/write data will not accessed just once by this client
|
||||
LIBRADOS_OP_FLAG_FADVISE_NOREUSE = 0x40,
|
||||
// indicate read/write data will not accessed again (by *this* client)
|
||||
LIBRADOS_OP_FLAG_FADVISE_NOCACHE = 0x40,
|
||||
};
|
||||
|
||||
#if __GNUC__ >= 4
|
||||
|
@ -222,7 +222,7 @@ namespace librados
|
||||
OP_FADVISE_SEQUENTIAL = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL,
|
||||
OP_FADVISE_WILLNEED = LIBRADOS_OP_FLAG_FADVISE_WILLNEED,
|
||||
OP_FADVISE_DONTNEED = LIBRADOS_OP_FLAG_FADVISE_DONTNEED,
|
||||
OP_FADVISE_NOREUSE = LIBRADOS_OP_FLAG_FADVISE_NOREUSE,
|
||||
OP_FADVISE_NOCACHE = LIBRADOS_OP_FLAG_FADVISE_NOCACHE,
|
||||
};
|
||||
|
||||
class CEPH_RADOS_API ObjectOperationCompletion {
|
||||
|
@ -98,8 +98,8 @@ static void set_op_flags(::ObjectOperation *o, int flags)
|
||||
rados_flags |= CEPH_OSD_OP_FLAG_FADVISE_WILLNEED;
|
||||
if (flags & LIBRADOS_OP_FLAG_FADVISE_DONTNEED)
|
||||
rados_flags |= CEPH_OSD_OP_FLAG_FADVISE_DONTNEED;
|
||||
if (flags & LIBRADOS_OP_FLAG_FADVISE_NOREUSE)
|
||||
rados_flags |= CEPH_OSD_OP_FLAG_FADVISE_NOREUSE;
|
||||
if (flags & LIBRADOS_OP_FLAG_FADVISE_NOCACHE)
|
||||
rados_flags |= CEPH_OSD_OP_FLAG_FADVISE_NOCACHE;
|
||||
o->set_last_op_flags(rados_flags);
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ const char * ceph_osd_op_flag_name(unsigned flag)
|
||||
case CEPH_OSD_OP_FLAG_FADVISE_DONTNEED:
|
||||
name = "fadvise_dontneed";
|
||||
break;
|
||||
case CEPH_OSD_OP_FLAG_FADVISE_NOREUSE:
|
||||
name = "fadvise_noreuse";
|
||||
case CEPH_OSD_OP_FLAG_FADVISE_NOCACHE:
|
||||
name = "fadvise_nocache";
|
||||
break;
|
||||
default:
|
||||
name = "???";
|
||||
|
@ -2624,7 +2624,7 @@ TEST(LibRadosAioEC, RoundTripWriteFullPP2)
|
||||
bl.append(buf);
|
||||
|
||||
op.write_full(bl);
|
||||
op.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOREUSE);
|
||||
op.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOCACHE);
|
||||
ioctx.aio_operate("test_obj", my_completion1.get(), &op);
|
||||
{
|
||||
TestAlarm alarm;
|
||||
@ -2636,7 +2636,7 @@ TEST(LibRadosAioEC, RoundTripWriteFullPP2)
|
||||
bl.clear();
|
||||
ObjectReadOperation op1;
|
||||
op1.read(0, sizeof(buf), &bl, NULL);
|
||||
op1.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOREUSE|LIBRADOS_OP_FLAG_FADVISE_RANDOM);
|
||||
op1.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOCACHE|LIBRADOS_OP_FLAG_FADVISE_RANDOM);
|
||||
ioctx.aio_operate("test_obj", my_completion2.get(), &op1, 0);
|
||||
{
|
||||
TestAlarm alarm;
|
||||
|
@ -100,7 +100,7 @@ TEST(LibRadosCWriteOps, Write) {
|
||||
op = rados_create_write_op();
|
||||
ASSERT_TRUE(op);
|
||||
rados_write_op_write_full(op, "ceph", 4);
|
||||
rados_write_op_set_flags(op, LIBRADOS_OP_FLAG_FADVISE_NOREUSE);
|
||||
rados_write_op_set_flags(op, LIBRADOS_OP_FLAG_FADVISE_NOCACHE);
|
||||
ASSERT_EQ(0, rados_write_op_operate(op, ioctx, "test", NULL, 0));
|
||||
ASSERT_EQ(4, rados_read(ioctx, "test", hi, 4, 0));
|
||||
rados_release_write_op(op);
|
||||
|
@ -256,7 +256,7 @@ TEST_F(LibRadosIoPP, RoundTripPP2)
|
||||
|
||||
ObjectReadOperation read;
|
||||
read.read(0, bl.length(), NULL, NULL);
|
||||
read.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOREUSE|LIBRADOS_OP_FLAG_FADVISE_RANDOM);
|
||||
read.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOCACHE|LIBRADOS_OP_FLAG_FADVISE_RANDOM);
|
||||
ASSERT_EQ(0, ioctx.operate("foo", &read, &bl));
|
||||
ASSERT_EQ(0, memcmp(bl.c_str(), "ceph", 4));
|
||||
}
|
||||
@ -327,7 +327,7 @@ TEST_F(LibRadosIoPP, WriteFullRoundTripPP2)
|
||||
bl.append("ceph");
|
||||
ObjectWriteOperation write;
|
||||
write.write_full(bl);
|
||||
write.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOREUSE);
|
||||
write.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_NOCACHE);
|
||||
ASSERT_EQ(0, ioctx.operate("foo", &write));
|
||||
|
||||
ObjectReadOperation read;
|
||||
|
@ -843,7 +843,7 @@ TEST_F(TestLibRBD, TestIOWithIOHint)
|
||||
|
||||
for (i = 0; i < 5; ++i)
|
||||
ASSERT_PASSED(write_test_data, image, test_data, TEST_IO_SIZE * i,
|
||||
TEST_IO_SIZE, LIBRADOS_OP_FLAG_FADVISE_NOREUSE);
|
||||
TEST_IO_SIZE, LIBRADOS_OP_FLAG_FADVISE_NOCACHE);
|
||||
|
||||
for (i = 5; i < 10; ++i)
|
||||
ASSERT_PASSED(aio_write_test_data, image, test_data, TEST_IO_SIZE * i,
|
||||
@ -879,7 +879,7 @@ TEST_F(TestLibRBD, TestIOWithIOHint)
|
||||
ASSERT_EQ(-EINVAL, rbd_read(image, info.size, 1, test_data));
|
||||
// reading through end returns amount up to end
|
||||
ASSERT_EQ(10, rbd_read2(image, info.size - 10, 100, test_data,
|
||||
LIBRADOS_OP_FLAG_FADVISE_NOREUSE));
|
||||
LIBRADOS_OP_FLAG_FADVISE_NOCACHE));
|
||||
// writing through end returns amount up to end
|
||||
ASSERT_EQ(10, rbd_write2(image, info.size - 10, 100, test_data,
|
||||
LIBRADOS_OP_FLAG_FADVISE_DONTNEED));
|
||||
@ -1099,7 +1099,7 @@ TEST_F(TestLibRBD, TestIOPPWithIOHint)
|
||||
|
||||
for (i = 0; i < 5; ++i)
|
||||
ASSERT_PASSED(write_test_data, image, test_data, strlen(test_data) * i,
|
||||
LIBRADOS_OP_FLAG_FADVISE_NOREUSE);
|
||||
LIBRADOS_OP_FLAG_FADVISE_NOCACHE);
|
||||
|
||||
for (i = 5; i < 10; ++i)
|
||||
ASSERT_PASSED(aio_write_test_data, image, test_data, strlen(test_data) * i,
|
||||
|
Loading…
Reference in New Issue
Block a user