diff mbox series

[v2,1/5] ceph: make ceph_uninline_data take inode pointer

Message ID 20190711184136.19779-2-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series ceph: fix races when uninlining data | expand

Commit Message

Jeff Layton July 11, 2019, 6:41 p.m. UTC
It only uses the file to get to the inode, and all of the callers
have a pointer to the inode already.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/addr.c  | 5 ++---
 fs/ceph/file.c  | 4 ++--
 fs/ceph/super.h | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index e078cc55b989..859d2cbfeccb 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1547,7 +1547,7 @@  static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
 			lock_page(page);
 			locked_page = page;
 		}
-		err = ceph_uninline_data(vma->vm_file, locked_page);
+		err = ceph_uninline_data(inode, locked_page);
 		if (locked_page)
 			unlock_page(locked_page);
 		if (err < 0)
@@ -1663,9 +1663,8 @@  void ceph_fill_inline_data(struct inode *inode, struct page *locked_page,
 	}
 }
 
-int ceph_uninline_data(struct file *filp, struct page *locked_page)
+int ceph_uninline_data(struct inode *inode, struct page *locked_page)
 {
-	struct inode *inode = file_inode(filp);
 	struct ceph_inode_info *ci = ceph_inode(inode);
 	struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
 	struct ceph_osd_request *req;
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 82af4a3c714d..7bb090fa99d3 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1439,7 +1439,7 @@  static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	inode_inc_iversion_raw(inode);
 
 	if (ci->i_inline_version != CEPH_INLINE_NONE) {
-		err = ceph_uninline_data(file, NULL);
+		err = ceph_uninline_data(inode, NULL);
 		if (err < 0)
 			goto out;
 	}
@@ -1763,7 +1763,7 @@  static long ceph_fallocate(struct file *file, int mode,
 	}
 
 	if (ci->i_inline_version != CEPH_INLINE_NONE) {
-		ret = ceph_uninline_data(file, NULL);
+		ret = ceph_uninline_data(inode, NULL);
 		if (ret < 0)
 			goto unlock;
 	}
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 4196f30e5bdc..dd2a242d5d22 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -1070,7 +1070,7 @@  extern void ceph_put_fmode(struct ceph_inode_info *ci, int mode);
 /* addr.c */
 extern const struct address_space_operations ceph_aops;
 extern int ceph_mmap(struct file *file, struct vm_area_struct *vma);
-extern int ceph_uninline_data(struct file *filp, struct page *locked_page);
+extern int ceph_uninline_data(struct inode *inode, struct page *locked_page);
 extern int ceph_pool_perm_check(struct ceph_inode_info *ci, int need);
 extern void ceph_pool_perm_destroy(struct ceph_mds_client* mdsc);