All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Michal.Plsek@seznam.cz>
To: ceph-devel@vger.kernel.org
Subject: Re: ceph kernel client orientation
Date: Wed, 20 May 2020 09:36:07 +0200 (CEST)	[thread overview]
Message-ID: <da.cjLX.3v4GDfOKIZE.1UnDtd@seznam.cz> (raw)
In-Reply-To: CAOi1vP9HvJd-Cdm4TnfEjNN-PooZCAPBwANpS88UfinkhJuUsg@mail.gmail.com

Thanks for swift answer.

(This is my usage in librbd.cc)

Basically there is a folder with symmetric keys used for block encryption, one key for one disk in some pool. For identification of key I need (pool_id, disk_id) of block. I am temporarily saving key to librbd::ImageCtx structure, so I don't have to get it from file every time. I use this key to encrypt/decrypt block data. Encrypt/decrypt is primitive, I'm not gonna mention it here, but it is done over the data provided by functions rbd_read() and rbd_write().

If you could point how to edit rbd.c content to achieve similar behaviour, I would be much obliged.

M.



---------- Původní e-mail ----------

Od: Ilya Dryomov <idryomov@gmail.com>

Komu: Michal.Plsek@seznam.cz

Datum: 19. 5. 2020 16:36:05

Předmět: Re: ceph kernel client orientation

On Tue, May 19, 2020 at 3:44 PM <Michal.Plsek@seznam.cz> wrote:

>

> Hello,

>

> I am trying to get to functions responsible for reading/writing to/opening RBD blocks in ceph client kernel module (alternatives to librbd’s rbd_read(), rbd_write() etc.). I presume it should be located somewhere around drivers/block/, but until now I’ve been without luck. My idea is to edit these functions, rebuild the ceph kernel ‘rbd’ module and replace it. Since comments are pretty much missing everywhere, it would be nice to narrow my searching area.

>

> If you know anything about it, please let me know. Thanks, M.



Hi Michal,



Everything is in drivers/block/rbd.c.  The entry point is

rbd_queue_rq(), this is where all rbd requests are dispatched from.

After setting up where data is to be written from (for writes) or read

to (for reads), the details specific to each type of request (read,

write, discard or zeroout) are handled in __rbd_img_fill_request()

and then later on the respective state machine is kicked off.



The job of the state machine is to submit requests to the OSDs and

handle replies from the OSDs.  As in librbd, satisfying a single

user I/O request can require sending multiple OSDs requests, in some

cases sequentially.



Unfortunately, there is no one function to edit.  I might be able

to help more if you explain what you are trying to achieve.



Thanks,



                Ilya

  reply	other threads:[~2020-05-20  7:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 13:43 ceph kernel client orientation Michal.Plsek
2020-05-19 14:36 ` Ilya Dryomov
2020-05-20  7:36   ` Michal.Plsek [this message]
2020-05-21 13:15     ` Ilya Dryomov
2020-05-21 16:37     ` Michal.Plsek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da.cjLX.3v4GDfOKIZE.1UnDtd@seznam.cz \
    --to=michal.plsek@seznam.cz \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.