less confusing block file names
v2 cover less confusing block file names
Based on a suggestion here:
https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg00350.html
v1 was here, and got some R-b but also some discussion:
https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg04618.html
Since then:
patch 1: pick different filename and overhaul commit message, no R-b applied
patch 2: minor merge context conflict due to patch 1, but R-b applies
Eric Blake (2):
block: Rename raw_bsd to raw-format.c
block: rename raw-{posix,win32} to file-*.c
include/block/block_int.h | 2 +-
block/{raw-posix.c => file-posix.c} | 0
block/{raw-win32.c => file-win32.c} | 0
block/gluster.c | 4 ++--
block/{raw_bsd.c => raw-format.c} | 2 +-
MAINTAINERS | 6 +++---
block/Makefile.objs | 6 +++---
block/trace-events | 4 ++--
configure | 2 +-
9 files changed, 13 insertions(+), 13 deletions(-)
rename block/{raw-posix.c => file-posix.c} (100%)
rename block/{raw-win32.c => file-win32.c} (100%)
rename block/{raw_bsd.c => raw-format.c} (99%)Signature · 1 line
2.7.4
PATCH v2 1/2 block: Rename raw_bsd to raw-format.c
Given that we have raw-win32.c and raw-posix.c, my initial guess at raw_bsd.c was that it was for dealing with raw files using code specific to the BSD operating system (beyond what raw-posix could do). Not so - this name was chosen back in commit e1c66c6 to distinguish that it was a BSD licensed file, in contrast to the then-existing raw.c with an unclear and potentially unusable license. But since it has been more than three years since the rewrite, it's time to pick a more useful name for this file to avoid this type of confusion to future contributors that don't know the backstory, as none of our other files are named solely by the license they use.
In reality, this file deals with the raw format, which is useful with any number of protocols, while raw-{win32,posix} deal with the file protocol (and in turn, that protocol is not limited to use with the raw format). So rename raw_bsd to raw-format.c. We could have also used the shorter name raw.c, except that collides with the earlier use of that filename for a different license, and it's better to be safe than risk license pollution.
The next patch will also rename raw-win32.c and raw-posix.c to further distinguish the difference in roles.
It doesn't hurt that this gets rid of an underscore in the filename, thereby making tab-completion on 'ra<TAB>' easier (now I don't have to type the shift key, which slows things down :)
---
v2: rename to raw-format.c, rather than plain raw.c.
---
block/{raw_bsd.c => raw-format.c} | 2 +-
MAINTAINERS | 2 +-
block/Makefile.objs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
rename block/{raw_bsd.c => raw-format.c} (99%)block/raw-format.c renamed from block/raw_bsd.c +1 -1
@@ -1,4 +1,4 @@ -/* BlockDriver implementation for "raw" +/* BlockDriver implementation for "raw" format driver * * Copyright (C) 2010-2016 Red Hat, Inc. * Copyright (C) 2010, Blue Swirl <[email protected]>
MAINTAINERS +1 -1
@@ -1677,7 +1677,7 @@ F: block/linux-aio.c F: include/block/raw-aio.h F: block/raw-posix.c F: block/raw-win32.c -F: block/raw_bsd.c +F: block/raw-format.c F: block/win32-aio.c qcow2
block/Makefile.objs +1 -1
@@ -1,4 +1,4 @@ -block-obj-y += raw_bsd.o qcow.o vdi.o vmdk.o cloop.o bochs.o vpc.o vvfat.o dmg.o +block-obj-y += raw-format.o qcow.o vdi.o vmdk.o cloop.o bochs.o vpc.o vvfat.o dmg.o block-obj-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o block-obj-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o block-obj-y += qed-check.o
Signature · 1 line
2.7.4
PATCH v2 2/2 block: rename raw-{posix, win32} to file-*.c
In reply to Eric BlakeThese files deal with the file protocol, not the raw format (the file protocol is often used with other formats, and the raw format is not forced to use the file protocol). Rename things to make it a bit easier to follow.
---
v2: rebase, fix commit message
---
include/block/block_int.h | 2 +-
block/{raw-posix.c => file-posix.c} | 0
block/{raw-win32.c => file-win32.c} | 0
block/gluster.c | 4 ++--
MAINTAINERS | 4 ++--
block/Makefile.objs | 4 ++--
block/trace-events | 4 ++--
configure | 2 +-
8 files changed, 10 insertions(+), 10 deletions(-)
rename block/{raw-posix.c => file-posix.c} (100%)
rename block/{raw-win32.c => file-win32.c} (100%)include/block/block_int.h +1 -1
@@ -186,7 +186,7 @@ struct BlockDriver {/* * Flushes all data that was already written to the OS all the way down to -* the disk (for example raw-posix calls fsync()). +* the disk (for example file-posix.c calls fsync()). */ int coroutine_fn (*bdrv_co_flush_to_disk)(BlockDriverState *bs);
block/file-posix.c renamed from block/raw-posix.c +0 -0
block/file-win32.c renamed from block/raw-win32.c +0 -0
block/gluster.c +2 -2
@@ -1172,7 +1172,7 @@ static int qemu_gluster_has_zero_init(BlockDriverState *bs)* If @start is in a trailing hole or beyond EOF, return -ENXIO. * If we can't find out, return a negative errno other than -ENXIO. * -* (Shamefully copied from raw-posix.c, only miniscule adaptions.) +* (Shamefully copied from file-posix.c, only miniscule adaptions.) */ static int find_allocation (BlockDriverState *bs,off_t start,off_t *data,off_t *hole)
@@ -1262,7 +1262,7 @@ static int find_allocation(BlockDriverState *bs, off_t start,* 'nb_sectors' is the max value 'pnum' should be set to. If nb_sectors goes * beyond the end of the disk image it will be clamped. * -* (Based on raw_co_get_block_status() from raw-posix.c.) +* (Based on raw_co_get_block_status() from file-posix.c.) */ static int64_t coroutine_fn qemu_gluster_co_get_block_status( BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum,
MAINTAINERS +2 -2
@@ -1675,9 +1675,9 @@ L: [email protected] S: Supported F: block/linux-aio.c F: include/block/raw-aio.h -F: block/raw-posix.c -F: block/raw-win32.c F: block/raw-format.c +F: block/file-posix.c +F: block/file-win32.c F: block/win32-aio.c qcow2
block/Makefile.objs +2 -2
@@ -6,8 +6,8 @@ block-obj-y += vhdx.o vhdx-endian.o vhdx-log.o block-obj-y += quorum.o block-obj-y += parallels.o blkdebug.o blkverify.o blkreplay.o block-obj-y += block-backend.o snapshot.o qapi.o -block-obj-$(CONFIG_WIN32) += raw-win32.o win32-aio.o -block-obj-$(CONFIG_POSIX) += raw-posix.o +block-obj-$(CONFIG_WIN32) += file-win32.o win32-aio.o +block-obj-$(CONFIG_POSIX) += file-posix.o block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o block-obj-y += null.o mirror.o commit.o io.o block-obj-y += throttle-groups.o
block/trace-events +2 -2
@@ -54,8 +54,8 @@ qmp_block_job_complete(void *job) "job %p" block_job_cb(void *bs, void *job, int ret) "bs %p job %p ret %d" qmp_block_stream(void *bs, void *job) "bs %p job %p" -# block/raw-win32.c -# block/raw-posix.c +# block/file-win32.c +# block/file-posix.c paio_submit_co(int64_t offset, int count, int type) "offset %"PRId64" count %d type %d" paio_submit(void *acb, void *opaque, int64_t offset, int count, int type) "acb %p opaque %p offset %"PRId64" count %d type %d"
configure +1 -1
@@ -2730,7 +2730,7 @@ if compile_prog "" "" ; then fi ########################################## -# xfsctl() probe, used for raw-posix +# xfsctl() probe, used for file-posix.c if test "$xfs" != "no" ; then cat > $TMPC << EOF #include <stddef.h> /* NULL */
Signature · 1 line
2.7.4
Quoted 15 lines · Eric Blake
Based on a suggestion here:
https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg00350.htmlv1 was here, and got some R-b but also some discussion:
https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg04618.htmlSince then:
patch 1: pick different filename and overhaul commit message, no R-b applied
patch 2: minor merge context conflict due to patch 1, but R-b appliesEric Blake (2):
block: Renameraw_bsdtoraw-format.c
block: rename raw-{posix,win32} to file-*.c
Quoted 14 lines
include/block/block_int.h | 2 +-
block/{raw-posix.c => file-posix.c} | 0
block/{raw-win32.c => file-win32.c} | 0
block/gluster.c | 4 ++--
block/{raw_bsd.c => raw-format.c} | 2 +-
MAINTAINERS | 6 +++---
block/Makefile.objs | 6 +++---
block/trace-events | 4 ++--
configure | 2 +-
9 files changed, 13 insertions(+), 13 deletions(-)
rename block/{raw-posix.c => file-posix.c} (100%)
rename block/{raw-win32.c => file-win32.c} (100%)
rename block/{raw_bsd.c => raw-format.c} (99%)series
Thanks!
Laszlo