* [LTP] [PATCH 0/2] tst_find_backing_dev() fixes
@ 2022-11-10 17:52 Petr Vorel
2022-11-10 17:52 ` [LTP] [PATCH 1/2] lib/tst_device: Remove unused count_match_len() Petr Vorel
2022-11-10 17:52 ` [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc Petr Vorel
0 siblings, 2 replies; 6+ messages in thread
From: Petr Vorel @ 2022-11-10 17:52 UTC (permalink / raw)
To: ltp; +Cc: Alessandro Carminati, Yang Xu, Richard Palethorpe
Hi,
"tst_find_backing_dev: fix stat fails /dev/root" patchset needs cleanup
of left unused function and strange wording in docs. Although fixes are
trivial, sending in case I overlooked something.
Also, the Btrfs part deserves putting into its own function;
code now has too long lines, too many indents, function is too long.
Kind regards,
Petr
https://lore.kernel.org/ltp/20221026140408.471609-1-alessandro.carminati@gmail.com/
https://patchwork.ozlabs.org/project/ltp/list/?series=327409&state=*
Petr Vorel (2):
lib/tst_device: Remove unused count_match_len()
doc/c-test-api.txt: Improve tst_find_backing_dev() doc
doc/c-test-api.txt | 9 +++------
lib/tst_device.c | 10 ----------
2 files changed, 3 insertions(+), 16 deletions(-)
--
2.38.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] lib/tst_device: Remove unused count_match_len()
2022-11-10 17:52 [LTP] [PATCH 0/2] tst_find_backing_dev() fixes Petr Vorel
@ 2022-11-10 17:52 ` Petr Vorel
2022-11-14 10:23 ` Richard Palethorpe
2022-11-10 17:52 ` [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc Petr Vorel
1 sibling, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2022-11-10 17:52 UTC (permalink / raw)
To: ltp; +Cc: Alessandro Carminati, Yang Xu, Richard Palethorpe
Fixes: e1b1ae66b ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,
obviously correct, but not merging it without ack there are changes and
function is actually needed.
Kind regards,
Petr
lib/tst_device.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/lib/tst_device.c b/lib/tst_device.c
index db5c2ab8f..48d7e3ab6 100644
--- a/lib/tst_device.c
+++ b/lib/tst_device.c
@@ -510,16 +510,6 @@ unsigned long tst_dev_bytes_written(const char *dev)
return dev_bytes_written;
}
-static int count_match_len(const char *first, const char *second)
-{
- int len = 0;
-
- while (*first && *first++ == *second++)
- len++;
-
- return len;
-}
-
__attribute__((nonnull))
void tst_find_backing_dev(const char *path, char *dev)
{
--
2.38.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc
2022-11-10 17:52 [LTP] [PATCH 0/2] tst_find_backing_dev() fixes Petr Vorel
2022-11-10 17:52 ` [LTP] [PATCH 1/2] lib/tst_device: Remove unused count_match_len() Petr Vorel
@ 2022-11-10 17:52 ` Petr Vorel
2022-11-14 10:25 ` Richard Palethorpe
1 sibling, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2022-11-10 17:52 UTC (permalink / raw)
To: ltp; +Cc: Alessandro Carminati, Yang Xu, Richard Palethorpe
Doc added in 606903cf8 was too complicated. Also there was repeating
sentence, typo 'unevent'.
While at it, fix also 'voud' typo from 9343d0486.
Fixes: 606903cf8 ("c-test-api: Documentation updated")
Fixes: 9343d0486 ("tst_device: Add new api tst_find_backing_dev(path, dev)")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
doc/c-test-api.txt | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt
index 8844d9f2f..834a342fd 100644
--- a/doc/c-test-api.txt
+++ b/doc/c-test-api.txt
@@ -1075,12 +1075,9 @@ is created for that intention.
void tst_find_backing_dev(const char *path, char *dev);
-------------------------------------------------------------------------------
-This function finds the block dev that this path belongs to, it uses stat function
-to get the major/minor number of the path.
-This function finds the block dev that this path belongs to, it uses the unevent
-file in sysfs to find the device name. It needs to discriminate between btrfs
-and not btrfs. For non btrfs filesystems it uses the minor, major numbers. For
-btrfs it uses the fs uuid.
+This function finds the block dev that this path belongs to, using uevent in sysfs.
+For Btrfs it uses '/sys/fs/btrfs/UUID/devices/DEV_NAME/uevent'; for other
+filesystems it uses '/sys/dev/block/MAJOR:MINOR/uevent'.
[source,c]
-------------------------------------------------------------------------------
--
2.38.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/2] lib/tst_device: Remove unused count_match_len()
2022-11-10 17:52 ` [LTP] [PATCH 1/2] lib/tst_device: Remove unused count_match_len() Petr Vorel
@ 2022-11-14 10:23 ` Richard Palethorpe
0 siblings, 0 replies; 6+ messages in thread
From: Richard Palethorpe @ 2022-11-14 10:23 UTC (permalink / raw)
To: Petr Vorel; +Cc: Yang Xu, Alessandro Carminati, ltp
Hello,
Petr Vorel <pvorel@suse.cz> writes:
> Fixes: e1b1ae66b ("tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent")
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Yup, my mistake.
Acked-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
> Hi,
>
> obviously correct, but not merging it without ack there are changes and
> function is actually needed.
>
> Kind regards,
> Petr
>
> lib/tst_device.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/lib/tst_device.c b/lib/tst_device.c
> index db5c2ab8f..48d7e3ab6 100644
> --- a/lib/tst_device.c
> +++ b/lib/tst_device.c
> @@ -510,16 +510,6 @@ unsigned long tst_dev_bytes_written(const char *dev)
> return dev_bytes_written;
> }
>
> -static int count_match_len(const char *first, const char *second)
> -{
> - int len = 0;
> -
> - while (*first && *first++ == *second++)
> - len++;
> -
> - return len;
> -}
> -
> __attribute__((nonnull))
> void tst_find_backing_dev(const char *path, char *dev)
> {
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc
2022-11-10 17:52 ` [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc Petr Vorel
@ 2022-11-14 10:25 ` Richard Palethorpe
2022-11-14 15:09 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Richard Palethorpe @ 2022-11-14 10:25 UTC (permalink / raw)
To: Petr Vorel; +Cc: Yang Xu, Alessandro Carminati, ltp
Hello,
Petr Vorel <pvorel@suse.cz> writes:
> Doc added in 606903cf8 was too complicated. Also there was repeating
> sentence, typo 'unevent'.
>
> While at it, fix also 'voud' typo from 9343d0486.
>
> Fixes: 606903cf8 ("c-test-api: Documentation updated")
> Fixes: 9343d0486 ("tst_device: Add new api tst_find_backing_dev(path, dev)")
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Thanks
Acked-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
> doc/c-test-api.txt | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt
> index 8844d9f2f..834a342fd 100644
> --- a/doc/c-test-api.txt
> +++ b/doc/c-test-api.txt
> @@ -1075,12 +1075,9 @@ is created for that intention.
> void tst_find_backing_dev(const char *path, char *dev);
> -------------------------------------------------------------------------------
>
> -This function finds the block dev that this path belongs to, it uses stat function
> -to get the major/minor number of the path.
> -This function finds the block dev that this path belongs to, it uses the unevent
> -file in sysfs to find the device name. It needs to discriminate between btrfs
> -and not btrfs. For non btrfs filesystems it uses the minor, major numbers. For
> -btrfs it uses the fs uuid.
> +This function finds the block dev that this path belongs to, using uevent in sysfs.
> +For Btrfs it uses '/sys/fs/btrfs/UUID/devices/DEV_NAME/uevent'; for other
> +filesystems it uses '/sys/dev/block/MAJOR:MINOR/uevent'.
>
> [source,c]
> -------------------------------------------------------------------------------
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc
2022-11-14 10:25 ` Richard Palethorpe
@ 2022-11-14 15:09 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-11-14 15:09 UTC (permalink / raw)
To: Richard Palethorpe; +Cc: Yang Xu, Alessandro Carminati, ltp
Hi Richard,
thanks for your review, merged!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-14 15:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-10 17:52 [LTP] [PATCH 0/2] tst_find_backing_dev() fixes Petr Vorel
2022-11-10 17:52 ` [LTP] [PATCH 1/2] lib/tst_device: Remove unused count_match_len() Petr Vorel
2022-11-14 10:23 ` Richard Palethorpe
2022-11-10 17:52 ` [LTP] [PATCH 2/2] doc/c-test-api.txt: Improve tst_find_backing_dev() doc Petr Vorel
2022-11-14 10:25 ` Richard Palethorpe
2022-11-14 15:09 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox