Skip to contentSkip to conversation

small trivial patches

PATCH Applied Frediano Ziglio 3 participants 6 messages Jul 27, 2011 – Jul 29, 2011 Block layer

lore
Share & tools
lore
#0 lore raw

cover small trivial patches

Minor fixes and improves

Frediano Ziglio (3):
block: removed unused function
block: typo fix
aio: always check paio_init result

 block.c           |   13 -------------
 block.h           |    2 --
 block/raw-posix.c |   13 ++++++-------
 3 files changed, 6 insertions(+), 22 deletions(-)
#1 lore raw

PATCH 1/3 block: removed unused function

---
 block.c |   13 -------------
 block.h |    2 --
 2 files changed, 0 insertions(+), 15 deletions(-)
block.c +0 -13
index 9549b9e..b2d3983 100644
@@ -1108,19 +1108,6 @@ int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset,
     return 0;
 }
 
-/*
- * Writes to the file and ensures that no writes are reordered across this
- * request (acts as a barrier)
- *
- * Returns 0 on success, -errno in error cases.
- */
-int bdrv_write_sync(BlockDriverState *bs, int64_t sector_num,
-    const uint8_t *buf, int nb_sectors)
-{
-    return bdrv_pwrite_sync(bs, BDRV_SECTOR_SIZE * sector_num,
-        buf, BDRV_SECTOR_SIZE * nb_sectors);
-}
-
 /**
  * Truncate file to 'offset' bytes (needed only for file protocols)
  */
block.h +0 -2
index 59cc410..e672bc6 100644
@@ -85,8 +85,6 @@ int bdrv_pwrite(BlockDriverState *bs, int64_t offset,
                 const void *buf, int count);
 int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset,
     const void *buf, int count);
-int bdrv_write_sync(BlockDriverState *bs, int64_t sector_num,
-    const uint8_t *buf, int nb_sectors);
 int bdrv_truncate(BlockDriverState *bs, int64_t offset);
 int64_t bdrv_getlength(BlockDriverState *bs);
 int64_t bdrv_get_allocated_file_size(BlockDriverState *bs);
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 block: typo fix

In reply to Frediano Ziglio
---
 block/raw-posix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/raw-posix.c +1 -1
index cd89c83..275b41e 100644
@@ -587,7 +587,7 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
 
     /*
      * If O_DIRECT is used the buffer needs to be aligned on a sector
-     * boundary.  Check if this is the case or telll the low-level
+     * boundary.  Check if this is the case or tell the low-level
      * driver that it needs to copy the buffer.
      */
     if (s->aligned_buf) {
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/3 aio: always check paio_init result

In reply to Frediano Ziglio
---
 block/raw-posix.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
block/raw-posix.c +5 -6
index 275b41e..3c6bd4b 100644
@@ -230,13 +230,15 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
         }
     }
 
+    /* We're falling back to POSIX AIO in some cases so init always */
+    if (paio_init() < 0) {
+        goto out_free_buf;
+    }
+
 #ifdef CONFIG_LINUX_AIO
     if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) ==
                       (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) {
 
-        /* We're falling back to POSIX AIO in some cases */
-        paio_init();
-
         s->aio_ctx = laio_init();
         if (!s->aio_ctx) {
             goto out_free_buf;
@@ -245,9 +247,6 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
     } else
 #endif
     {
-        if (paio_init() < 0) {
-            goto out_free_buf;
-        }
 #ifdef CONFIG_LINUX_AIO
         s->use_aio = 0;
 #endif
Signature · 1 line
1.7.1
Reviewed-by on the v1 series
#4 lore raw
In reply to Frediano Ziglio
Quoted 11 lines · Frediano Ziglio

Minor fixes and improves

Frediano Ziglio (3):
 block: removed unused function
 block: typo fix
 aio: always check paio_init result

 block.c           |   13 -------------
 block.h           |    2 --
 block/raw-posix.c |   13 ++++++-------

 3 files changed, 6 insertions(+), 22 deletions(-)

Please send block patches to Kevin even if they are trivial. The trivial-patches tree tries to stay out of the way of subsystems with an active maintainer.

Stefan

Applied
#5 lore raw
In reply to Frediano Ziglio

Am 27.07.2011 20:11, schrieb Frediano Ziglio:

Quoted 11 lines

Minor fixes and improves

Frediano Ziglio (3):
block: removed unused function
block: typo fix
aio: always check paio_init result

 block.c           |   13 -------------
 block.h           |    2 --
 block/raw-posix.c |   13 ++++++-------
 3 files changed, 6 insertions(+), 22 deletions(-)

Thanks, applied all to the block branch (and modified the commit log to say "raw-posix: ..." for patches 2 and 3)

Kevin