]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: stop passing IOContext to image dispatch write methods
authorIlya Dryomov <idryomov@gmail.com>
Tue, 13 Jun 2023 11:36:02 +0000 (13:36 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 2 Jul 2023 12:00:35 +0000 (14:00 +0200)
commit17bb979aaca3d53de47b80bec85c8fe6cee76115
tree81256030f39ae5988bbf11d055eb867b981ef952
parenta92c533e56e65906e34a3a61e2af0f66c23d2954
librbd: stop passing IOContext to image dispatch write methods

This is a major footgun since any value passed e.g. at the API layer
may be stale by the time we get to object dispatch.  All callers are
passing the IOContext returned by get_data_io_context() for their
ImageCtx anyway, highlighting that the parameter is fictitious.

Only the read method can meaningfully take IOContext.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 584f865ae116185087176715ced014b625f04e82)

Conflicts:
src/librbd/api/Io.cc [ commit 37057ba2f6bb ("librbd: pass
  image_extents to create_{discard,write_same}()") and ImageArea
  support not in pacific ]
src/librbd/cache/ImageWriteback.cc [ ditto ]
src/librbd/io/ImageDispatchSpec.h [ ditto ]
src/librbd/crypto/luks/FormatRequest.cc [ ImageArea support not
  in pacific ]
src/test/librbd/io/test_mock_ImageRequest.cc [ ditto ]
src/test/librbd/journal/test_mock_Replay.cc [ ditto ]
src/librbd/crypto/luks/FlattenRequest.cc [ commit 84601d68a74f
  ("librbd/crypto: add format-specific flattening operation")
  not in pacific ]
26 files changed:
src/librbd/api/Io.cc
src/librbd/cache/ImageWriteback.cc
src/librbd/cache/WriteLogImageDispatch.cc
src/librbd/cache/WriteLogImageDispatch.h
src/librbd/crypto/CryptoImageDispatch.h
src/librbd/crypto/luks/FormatRequest.cc
src/librbd/exclusive_lock/ImageDispatch.cc
src/librbd/exclusive_lock/ImageDispatch.h
src/librbd/io/ImageDispatch.cc
src/librbd/io/ImageDispatch.h
src/librbd/io/ImageDispatchInterface.h
src/librbd/io/ImageDispatchSpec.h
src/librbd/io/ImageDispatcher.cc
src/librbd/io/QosImageDispatch.cc
src/librbd/io/QosImageDispatch.h
src/librbd/io/QueueImageDispatch.cc
src/librbd/io/QueueImageDispatch.h
src/librbd/io/RefreshImageDispatch.cc
src/librbd/io/RefreshImageDispatch.h
src/librbd/io/WriteBlockImageDispatch.cc
src/librbd/io/WriteBlockImageDispatch.h
src/librbd/migration/ImageDispatch.cc
src/librbd/migration/ImageDispatch.h
src/test/librbd/io/test_mock_ImageRequest.cc
src/test/librbd/journal/test_mock_Replay.cc
src/test/librbd/mock/io/MockImageDispatch.h