master - callbacks: Miscellaneous fixes for recent changes
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e869a52cc4e0a65f00c8d3f40cf94b6989e60871 Commit: e869a52cc4e0a65f00c8d3f40cf94b6989e60871 Parent: e727da6cf111b07b302c08ed479336e4994635b0 Author: Alasdair G Kergon <[email protected]> AuthorDate: Mon Jan 22 15:41:11 2018 +0000 Committer: Alasdair G Kergon <[email protected]> CommitterDate: Tue Feb 6 01:09:39 2018 +0000
callbacks: Miscellaneous fixes for recent changes
--- lib/device/dev-io.c | 2 +- lib/format1/format1.c | 2 +- lib/format1/lvm1-label.c | 2 +- lib/format_pool/format_pool.c | 2 +- lib/format_text/text_label.c | 2 +- lib/label/label.c | 7 +++++-- 6 files changed, 10 insertions(+), 7 deletions(-)
lib/device/dev-io.c +1 -1
@@ -154,7 +154,7 @@ static int _io(struct device_buffer *devbuf, unsigned ioflags) }if (!devbuf->buf && !(devbuf->malloc_address = devbuf->buf =dm_malloc_aligned ((size_t ) devbuf->where.size,0 ))) { -log_error ("Bounce buffer malloc failed" ); +log_error ("I/O buffer malloc failed" );return 0 ; }
lib/format1/format1.c +1 -1
@@ -182,7 +182,7 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid, struct metadata_area *mda __attribute__((unused)), struct cached_vg_fmtdata **vg_fmtdata __attribute__((unused)), unsigned *use_previous_vg __attribute__((unused)), - int single_device __attribute__((unused))) + int single_device __attribute__((unused)), unsigned ioflags) {struct volume_group *vg;struct disk_list *dl;
lib/format1/lvm1-label.c +1 -1
@@ -60,7 +60,7 @@ static int _lvm1_read(struct labeller *l, struct device *dev, void *buf, unsignestruct pv_disk *pvd = (struct pv_disk *) buf;struct vg_disk vgd;struct lvmcache_info *info; -struct label *label; +struct label *label =NULL ;const char *vgid =FMT_LVM1_ORPHAN_VG_NAME ;const char *vgname =FMT_LVM1_ORPHAN_VG_NAME ;unsigned exported =0 ;
lib/format_pool/format_pool.c +1 -1
@@ -103,7 +103,7 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid, struct metadata_area *mda __attribute__((unused)), struct cached_vg_fmtdata **vg_fmtdata __attribute__((unused)), unsigned *use_previous_vg __attribute__((unused)), - int single_device __attribute__((unused)), int ioflags) + int single_device __attribute__((unused)), unsigned ioflags) {struct volume_group *vg;struct user_subpool *usp;
lib/format_text/text_label.c +1 -1
@@ -551,7 +551,7 @@ out: bad:if (read_label_callback_fn) -read_label_callback_fn (1 , ioflags, read_label_callback_context, label); +read_label_callback_fn (1 , ioflags, read_label_callback_context,NULL );return 0 ; }
lib/label/label.c +5 -2
@@ -156,7 +156,7 @@ out: stack;if (flp->process_label_data_fn) - flp->process_label_data_fn (0 , ioflags, flp->process_label_data_context,NULL ); + flp->process_label_data_fn (!flp->ret, ioflags, flp->process_label_data_context,NULL ); }static void _find_labeller (int failed,unsigned ioflags,void *context,const void *data)
@@ -362,7 +362,10 @@ static int _label_read(struct device *dev, uint64_t scan_sector, struct label **return 0 ; } -return flp->ret; +if (process_label_data_fn) +return 1 ; +else +return flp->ret; }/* result may be NULL if caller doesn't need it */