diff mbox series

iomap: Export iomap_page_create and iomap_set_range_uptodate

Message ID 20191210102916.842-1-agruenba@redhat.com (mailing list archive)
State New, archived
Headers show
Series iomap: Export iomap_page_create and iomap_set_range_uptodate | expand

Commit Message

Andreas Gruenbacher Dec. 10, 2019, 10:29 a.m. UTC
These two functions are needed by filesystems for converting inline
("stuffed") inodes into non-inline inodes.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/iomap/buffered-io.c | 6 ++++--
 include/linux/iomap.h  | 5 +++++
 2 files changed, 9 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong Dec. 10, 2019, 8:32 p.m. UTC | #1
On Tue, Dec 10, 2019 at 11:29:16AM +0100, Andreas Gruenbacher wrote:
> These two functions are needed by filesystems for converting inline
> ("stuffed") inodes into non-inline inodes.
> 
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>

Looks fine to me... this is a 5.6 change, correct?

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/iomap/buffered-io.c | 6 ++++--
>  include/linux/iomap.h  | 5 +++++
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 828444e14d09..e8f6d7ba4e3c 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -41,7 +41,7 @@ static inline struct iomap_page *to_iomap_page(struct page *page)
>  
>  static struct bio_set iomap_ioend_bioset;
>  
> -static struct iomap_page *
> +struct iomap_page *
>  iomap_page_create(struct inode *inode, struct page *page)
>  {
>  	struct iomap_page *iop = to_iomap_page(page);
> @@ -64,6 +64,7 @@ iomap_page_create(struct inode *inode, struct page *page)
>  	SetPagePrivate(page);
>  	return iop;
>  }
> +EXPORT_SYMBOL(iomap_page_create);
>  
>  static void
>  iomap_page_release(struct page *page)
> @@ -164,7 +165,7 @@ iomap_iop_set_range_uptodate(struct page *page, unsigned off, unsigned len)
>  	spin_unlock_irqrestore(&iop->uptodate_lock, flags);
>  }
>  
> -static void
> +void
>  iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len)
>  {
>  	if (PageError(page))
> @@ -175,6 +176,7 @@ iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len)
>  	else
>  		SetPageUptodate(page);
>  }
> +EXPORT_SYMBOL(iomap_set_range_uptodate);
>  
>  static void
>  iomap_read_finish(struct iomap_page *iop, struct page *page)
> diff --git a/include/linux/iomap.h b/include/linux/iomap.h
> index 8b09463dae0d..b00f9bc396b1 100644
> --- a/include/linux/iomap.h
> +++ b/include/linux/iomap.h
> @@ -13,6 +13,7 @@
>  struct address_space;
>  struct fiemap_extent_info;
>  struct inode;
> +struct iomap_page;
>  struct iomap_writepage_ctx;
>  struct iov_iter;
>  struct kiocb;
> @@ -152,6 +153,10 @@ loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length,
>  		unsigned flags, const struct iomap_ops *ops, void *data,
>  		iomap_actor_t actor);
>  
> +struct iomap_page *iomap_page_create(struct inode *inode, struct page *page);
> +void iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len);
> +
> +
>  ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
>  		const struct iomap_ops *ops);
>  int iomap_readpage(struct page *page, const struct iomap_ops *ops);
> -- 
> 2.20.1
>
Andreas Grünbacher Dec. 10, 2019, 8:39 p.m. UTC | #2
Am Di., 10. Dez. 2019 um 21:33 Uhr schrieb Darrick J. Wong
<darrick.wong@oracle.com>:
> On Tue, Dec 10, 2019 at 11:29:16AM +0100, Andreas Gruenbacher wrote:
> > These two functions are needed by filesystems for converting inline
> > ("stuffed") inodes into non-inline inodes.
> >
> > Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
>
> Looks fine to me... this is a 5.6 change, correct?

Yes, so there's still plenty of time to get things in place until
then. I'd like to hear from Christoph if he has any objections. In any
case, this patch isn't going to break anything.

Thanks,
Andreas
Darrick J. Wong Dec. 10, 2019, 9:25 p.m. UTC | #3
On Tue, Dec 10, 2019 at 09:39:31PM +0100, Andreas Grünbacher wrote:
> Am Di., 10. Dez. 2019 um 21:33 Uhr schrieb Darrick J. Wong
> <darrick.wong@oracle.com>:
> > On Tue, Dec 10, 2019 at 11:29:16AM +0100, Andreas Gruenbacher wrote:
> > > These two functions are needed by filesystems for converting inline
> > > ("stuffed") inodes into non-inline inodes.
> > >
> > > Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> >
> > Looks fine to me... this is a 5.6 change, correct?
> 
> Yes, so there's still plenty of time to get things in place until
> then. I'd like to hear from Christoph if he has any objections. In any
> case, this patch isn't going to break anything.

By the way, the other symbols in fs/iomap/ are all EXPORT_SYMBOL_GPL.
Does gfs2/RH/anyone have a particular requirement for EXPORT_SYMBOL, or
could we make the new exports _GPL to match the rest?

--D

> Thanks,
> Andreas
Andreas Grünbacher Dec. 10, 2019, 9:27 p.m. UTC | #4
Am Di., 10. Dez. 2019 um 22:25 Uhr schrieb Darrick J. Wong
<darrick.wong@oracle.com>:
> On Tue, Dec 10, 2019 at 09:39:31PM +0100, Andreas Grünbacher wrote:
> > Am Di., 10. Dez. 2019 um 21:33 Uhr schrieb Darrick J. Wong
> > <darrick.wong@oracle.com>:
> > > On Tue, Dec 10, 2019 at 11:29:16AM +0100, Andreas Gruenbacher wrote:
> > > > These two functions are needed by filesystems for converting inline
> > > > ("stuffed") inodes into non-inline inodes.
> > > >
> > > > Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> > >
> > > Looks fine to me... this is a 5.6 change, correct?
> >
> > Yes, so there's still plenty of time to get things in place until
> > then. I'd like to hear from Christoph if he has any objections. In any
> > case, this patch isn't going to break anything.
>
> By the way, the other symbols in fs/iomap/ are all EXPORT_SYMBOL_GPL.
> Does gfs2/RH/anyone have a particular requirement for EXPORT_SYMBOL, or
> could we make the new exports _GPL to match the rest?

I don't mind EXPORT_SYMBOL_GPL.

Thanks,
Andreas
Christoph Hellwig Dec. 12, 2019, 9:55 a.m. UTC | #5
At very least this needs to be a EXPORT_SYMBOL_GPL in sent in a series
with the actual user.  But I'm not all that happy about exporting such
low-level helpers.  Can't we come up with a useful higher level
primitive instead?
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 828444e14d09..e8f6d7ba4e3c 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -41,7 +41,7 @@  static inline struct iomap_page *to_iomap_page(struct page *page)
 
 static struct bio_set iomap_ioend_bioset;
 
-static struct iomap_page *
+struct iomap_page *
 iomap_page_create(struct inode *inode, struct page *page)
 {
 	struct iomap_page *iop = to_iomap_page(page);
@@ -64,6 +64,7 @@  iomap_page_create(struct inode *inode, struct page *page)
 	SetPagePrivate(page);
 	return iop;
 }
+EXPORT_SYMBOL(iomap_page_create);
 
 static void
 iomap_page_release(struct page *page)
@@ -164,7 +165,7 @@  iomap_iop_set_range_uptodate(struct page *page, unsigned off, unsigned len)
 	spin_unlock_irqrestore(&iop->uptodate_lock, flags);
 }
 
-static void
+void
 iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len)
 {
 	if (PageError(page))
@@ -175,6 +176,7 @@  iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len)
 	else
 		SetPageUptodate(page);
 }
+EXPORT_SYMBOL(iomap_set_range_uptodate);
 
 static void
 iomap_read_finish(struct iomap_page *iop, struct page *page)
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 8b09463dae0d..b00f9bc396b1 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -13,6 +13,7 @@ 
 struct address_space;
 struct fiemap_extent_info;
 struct inode;
+struct iomap_page;
 struct iomap_writepage_ctx;
 struct iov_iter;
 struct kiocb;
@@ -152,6 +153,10 @@  loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length,
 		unsigned flags, const struct iomap_ops *ops, void *data,
 		iomap_actor_t actor);
 
+struct iomap_page *iomap_page_create(struct inode *inode, struct page *page);
+void iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len);
+
+
 ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
 		const struct iomap_ops *ops);
 int iomap_readpage(struct page *page, const struct iomap_ops *ops);