diff mbox series

[U-Boot,v3,1/4] fs: export fs_close()

Message ID 20191004030523.21579-2-takahiro.akashi@linaro.org
State Superseded
Delegated to: Heinrich Schuchardt
Headers show
Series efi_loader: disk: install FILE_SYSTEM_PROTOCOL to whole disk | expand

Commit Message

AKASHI Takahiro Oct. 4, 2019, 3:05 a.m. UTC
This function is always paired with either fs_set_blk_desc() or
fs_set_blk_desc_with_part(). So just export it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 fs/fs.c      | 2 +-
 include/fs.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Heinrich Schuchardt Oct. 4, 2019, 6:53 p.m. UTC | #1
On 10/4/19 5:05 AM, AKASHI Takahiro wrote:
> This function is always paired with either fs_set_blk_desc() or
> fs_set_blk_desc_with_part(). So just export it.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>  fs/fs.c      | 2 +-
>  include/fs.h | 7 +++++++
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fs.c b/fs/fs.c
> index d8a4ced4698e..64ba25fea8bf 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -389,7 +389,7 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part)
>  	return -1;
>  }
>
> -static void fs_close(void)
> +void fs_close(void)
>  {
>  	struct fstype_info *info = fs_get_info(fs_type);
>
> diff --git a/include/fs.h b/include/fs.h
> index 7601b0343bcd..5a1244d57fd2 100644
> --- a/include/fs.h
> +++ b/include/fs.h
> @@ -37,6 +37,13 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
>   */
>  int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
>
> +/**
> + * fs_close() - Unset current block device and partition
> + *
> + * Should be paired with either fs_set_blk_dev() or fs_set_dev_with_part()

This "paired" implies that one should call one of the name functions
afterwards which may not be necessary. I would suggest:

"fs_close() closes the connection to a file system which opened with
either fs_set_blk_dev() or fs_set_dev_with_part(). Many file functions
implicitly call fs_close(), e.g. fs_closedir(), fs_exist(), fs_ln(),
fs_ls(), fs_mkdir(), fs_read(), fs_size(), fs_write(), fs_unlink()."

Best regards

Heinrich Schuchardt

> + */
> +void fs_close(void);
> +
>  /**
>   * fs_get_type_name() - Get type of current filesystem
>   *
>
AKASHI Takahiro Oct. 7, 2019, 2:08 a.m. UTC | #2
On Fri, Oct 04, 2019 at 08:53:00PM +0200, Heinrich Schuchardt wrote:
> On 10/4/19 5:05 AM, AKASHI Takahiro wrote:
> > This function is always paired with either fs_set_blk_desc() or
> > fs_set_blk_desc_with_part(). So just export it.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> >  fs/fs.c      | 2 +-
> >  include/fs.h | 7 +++++++
> >  2 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/fs.c b/fs/fs.c
> > index d8a4ced4698e..64ba25fea8bf 100644
> > --- a/fs/fs.c
> > +++ b/fs/fs.c
> > @@ -389,7 +389,7 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part)
> >  	return -1;
> >  }
> >
> > -static void fs_close(void)
> > +void fs_close(void)
> >  {
> >  	struct fstype_info *info = fs_get_info(fs_type);
> >
> > diff --git a/include/fs.h b/include/fs.h
> > index 7601b0343bcd..5a1244d57fd2 100644
> > --- a/include/fs.h
> > +++ b/include/fs.h
> > @@ -37,6 +37,13 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
> >   */
> >  int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
> >
> > +/**
> > + * fs_close() - Unset current block device and partition
> > + *
> > + * Should be paired with either fs_set_blk_dev() or fs_set_dev_with_part()
> 
> This "paired" implies that one should call one of the name functions
> afterwards which may not be necessary. I would suggest:
> 
> "fs_close() closes the connection to a file system which opened with
> either fs_set_blk_dev() or fs_set_dev_with_part(). Many file functions
> implicitly call fs_close(), e.g. fs_closedir(), fs_exist(), fs_ln(),
> fs_ls(), fs_mkdir(), fs_read(), fs_size(), fs_write(), fs_unlink()."

Okay.

-Takahiro Akashi


> Best regards
> 
> Heinrich Schuchardt
> 
> > + */
> > +void fs_close(void);
> > +
> >  /**
> >   * fs_get_type_name() - Get type of current filesystem
> >   *
> >
>
diff mbox series

Patch

diff --git a/fs/fs.c b/fs/fs.c
index d8a4ced4698e..64ba25fea8bf 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -389,7 +389,7 @@  int fs_set_blk_dev_with_part(struct blk_desc *desc, int part)
 	return -1;
 }
 
-static void fs_close(void)
+void fs_close(void)
 {
 	struct fstype_info *info = fs_get_info(fs_type);
 
diff --git a/include/fs.h b/include/fs.h
index 7601b0343bcd..5a1244d57fd2 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -37,6 +37,13 @@  int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
  */
 int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
 
+/**
+ * fs_close() - Unset current block device and partition
+ *
+ * Should be paired with either fs_set_blk_dev() or fs_set_dev_with_part()
+ */
+void fs_close(void);
+
 /**
  * fs_get_type_name() - Get type of current filesystem
  *