Skip to contentSkip to conversation

calling dm_io

DISCUSSION Mikulas Patocka 1 participant 1 message Nov 13, 2012 1 message not in the archive Device mapper

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mikulas Patocka

author maintainer
#1 lore raw

It doesn't seem to matter if you use REQ_FLUSH or WRITE_FLUSH, but for consistency, you can apply this patch.

Quoted 50 lines · Alasdair G Kergon

We use a mixture of REQ_FLUSH and WRITE_FLUSH in dm.

fs.h:#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)

Could you do a quick check that we always use the right one in the right places?

Alasdair

----- Forwarded message from "Kasatkin, Dmitry" <[email protected]> -----

Date: Thu, 8 Nov 2012 19:51:36 +0200
From: "Kasatkin, Dmitry" <[email protected]>
Subject: Re: [dm-devel] calling dm_io
To: device-mapper development <[email protected]>

Quoted 6 lines · Alasdair G Kergon
Quoted 2 lines · Dmitry

So it expects caller to initialize notify.fn, but in couple of places it is not done when allocating on stack...

As far as I can see it is initialised where it needs to be.

Quoted 8 lines
Quoted 4 lines
      struct dm_io_request io_req = {
              ....,
              .notify.fn = NULL,
      };

(Struct members not listed explicitly are initialised according to the same rules used for initialising static variables. IOW a pointer is initialised to NULL.)

oh. indeed.

dm_bufio_issue_flush() uses REQ_FLUSH, but all other places in the kernel use WRITE_FLUSH...
Should dm_bufio_issue_flush() also use WRITE_FLUSH?

- Dmitry

Quoted 7 lines

Alasdair

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Quoted 7 lines

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

----- End forwarded message -----

dm-bufio: use WRITE_FLUSH instead of REQ_FLUSH

Use WRITE_FLUSH instead of REQ_FLUSH to make it consistent with the rest of the kernel. There is no functional change - the kernel accepts either WRITE_FLUSH or REQ_FLUSH.

---
 drivers/md/dm-bufio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-bufio.c +1 -1
Index: linux-3.6.6-fast/drivers/md/dm-bufio.c
===================================================================
@@ -1194,7 +1194,7 @@ EXPORT_SYMBOL_GPL(dm_bufio_write_dirty_b
 int dm_bufio_issue_flush(struct dm_bufio_client *c)
 {
 	struct dm_io_request io_req = {
-		.bi_rw = REQ_FLUSH,
+		.bi_rw = WRITE_FLUSH,
 		.mem.type = DM_IO_KMEM,
 		.mem.ptr.addr = NULL,
 		.client = c->dm_io,