[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] ios: Pass "flags" to handler_normalize as an argument.
From: |
Egeyar Bagcioglu |
Subject: |
[PATCH 3/3] ios: Pass "flags" to handler_normalize as an argument. |
Date: |
Sat, 11 Jul 2020 18:07:26 +0200 |
... so that poke can later pass a flag to ios to distinguish stream
files from regular files.
2020-05-10 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_handler_normalize): Add
parameter "flags".
* libpoke/ios-dev-mem.c (ios_dev_mem_handler_normalize): Likewise.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_handler_normalize): Likewise.
* libpoke/ios-dev.h (struct ios_dev_if): Add parameter "flags" to
handler_normalize.
* libpoke/ios.c (ios_open): Pass "flags" to handler_normalize.
---
libpoke/ios-dev-file.c | 2 +-
libpoke/ios-dev-mem.c | 2 +-
libpoke/ios-dev-nbd.c | 2 +-
libpoke/ios-dev.h | 2 +-
libpoke/ios.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libpoke/ios-dev-file.c b/libpoke/ios-dev-file.c
index 68b2dc39..f7bed531 100644
--- a/libpoke/ios-dev-file.c
+++ b/libpoke/ios-dev-file.c
@@ -41,7 +41,7 @@ struct ios_dev_file
};
static char *
-ios_dev_file_handler_normalize (const char *handler)
+ios_dev_file_handler_normalize (const char *handler, uint64_t flags)
{
char *newhandler;
IOS_FILE_HANDLER_NORMALIZE (handler, newhandler);
diff --git a/libpoke/ios-dev-mem.c b/libpoke/ios-dev-mem.c
index 56c3d42b..f4babd64 100644
--- a/libpoke/ios-dev-mem.c
+++ b/libpoke/ios-dev-mem.c
@@ -36,7 +36,7 @@ struct ios_dev_mem
#define MEM_STEP (512 * 8)
static char *
-ios_dev_mem_handler_normalize (const char *handler)
+ios_dev_mem_handler_normalize (const char *handler, uint64_t flags)
{
if (handler[0] == '*' && handler[strlen (handler) - 1] == '*')
return strdup (handler);
diff --git a/libpoke/ios-dev-nbd.c b/libpoke/ios-dev-nbd.c
index 9ed1834e..e75de2b4 100644
--- a/libpoke/ios-dev-nbd.c
+++ b/libpoke/ios-dev-nbd.c
@@ -45,7 +45,7 @@ startswith (const char *str, const char *prefix)
}
static char *
-ios_dev_nbd_handler_normalize (const char *handler)
+ios_dev_nbd_handler_normalize (const char *handler, uint64_t flags)
{
if (startswith (handler, "nbd://")
|| startswith (handler, "nbd+unix://"))
diff --git a/libpoke/ios-dev.h b/libpoke/ios-dev.h
index d6b269aa..2000152e 100644
--- a/libpoke/ios-dev.h
+++ b/libpoke/ios-dev.h
@@ -46,7 +46,7 @@ struct ios_dev_if
device spec by this backend, and if so, return its normalized
form (caller will free). If not, return NULL. */
- char *(*handler_normalize) (const char *handler);
+ char *(*handler_normalize) (const char *handler, uint64_t flags);
/* Open a device using the provided HANDLER. Return the opened
device, or NULL if there was an error. In case of invalid flags,
diff --git a/libpoke/ios.c b/libpoke/ios.c
index 36fc88e4..38dd0472 100644
--- a/libpoke/ios.c
+++ b/libpoke/ios.c
@@ -134,7 +134,7 @@ ios_open (const char *handler, uint64_t flags, int set_cur)
handler. */
for (dev_if = ios_dev_ifs; *dev_if; ++dev_if)
{
- io->handler = (*dev_if)->handler_normalize (handler);
+ io->handler = (*dev_if)->handler_normalize (handler, flags);
if (io->handler)
break;
}
--
2.25.4
- [PATCH 1/3] ios: Introduce ios_flush and ios_dev_<...>_flush., Egeyar Bagcioglu, 2020/07/11
- [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Egeyar Bagcioglu, 2020/07/11
- Re: [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Jose E. Marchesi, 2020/07/12
- Re: [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Egeyar Bagcioglu, 2020/07/12
- Re: [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Egeyar Bagcioglu, 2020/07/13
- Re: [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Jose E. Marchesi, 2020/07/13
- Re: [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Jose E. Marchesi, 2020/07/13
- Re: [PATCH 2/3] ios: Move file name normalization logic into ios-dev.h, Egeyar Bagcioglu, 2020/07/14
[PATCH 3/3] ios: Pass "flags" to handler_normalize as an argument.,
Egeyar Bagcioglu <=
Re: [PATCH 1/3] ios: Introduce ios_flush and ios_dev_<...>_flush., Jose E. Marchesi, 2020/07/12