Commit 966c7160 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov

ceph: make ceph_fill_inode non-static

Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 2ccb4546
...@@ -728,11 +728,11 @@ void ceph_fill_file_time(struct inode *inode, int issued, ...@@ -728,11 +728,11 @@ void ceph_fill_file_time(struct inode *inode, int issued,
* Populate an inode based on info from mds. May be called on new or * Populate an inode based on info from mds. May be called on new or
* existing inodes. * existing inodes.
*/ */
static int fill_inode(struct inode *inode, struct page *locked_page, int ceph_fill_inode(struct inode *inode, struct page *locked_page,
struct ceph_mds_reply_info_in *iinfo, struct ceph_mds_reply_info_in *iinfo,
struct ceph_mds_reply_dirfrag *dirinfo, struct ceph_mds_reply_dirfrag *dirinfo,
struct ceph_mds_session *session, int cap_fmode, struct ceph_mds_session *session, int cap_fmode,
struct ceph_cap_reservation *caps_reservation) struct ceph_cap_reservation *caps_reservation)
{ {
struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
struct ceph_mds_reply_inode *info = iinfo->in; struct ceph_mds_reply_inode *info = iinfo->in;
...@@ -749,7 +749,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ...@@ -749,7 +749,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
bool new_version = false; bool new_version = false;
bool fill_inline = false; bool fill_inline = false;
dout("fill_inode %p ino %llx.%llx v %llu had %llu\n", dout("%s %p ino %llx.%llx v %llu had %llu\n", __func__,
inode, ceph_vinop(inode), le64_to_cpu(info->version), inode, ceph_vinop(inode), le64_to_cpu(info->version),
ci->i_version); ci->i_version);
...@@ -770,7 +770,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ...@@ -770,7 +770,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
if (iinfo->xattr_len > 4) { if (iinfo->xattr_len > 4) {
xattr_blob = ceph_buffer_new(iinfo->xattr_len, GFP_NOFS); xattr_blob = ceph_buffer_new(iinfo->xattr_len, GFP_NOFS);
if (!xattr_blob) if (!xattr_blob)
pr_err("fill_inode ENOMEM xattr blob %d bytes\n", pr_err("%s ENOMEM xattr blob %d bytes\n", __func__,
iinfo->xattr_len); iinfo->xattr_len);
} }
...@@ -933,8 +933,9 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ...@@ -933,8 +933,9 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
spin_unlock(&ci->i_ceph_lock); spin_unlock(&ci->i_ceph_lock);
if (symlen != i_size_read(inode)) { if (symlen != i_size_read(inode)) {
pr_err("fill_inode %llx.%llx BAD symlink " pr_err("%s %llx.%llx BAD symlink "
"size %lld\n", ceph_vinop(inode), "size %lld\n", __func__,
ceph_vinop(inode),
i_size_read(inode)); i_size_read(inode));
i_size_write(inode, symlen); i_size_write(inode, symlen);
inode->i_blocks = calc_inode_blocks(symlen); inode->i_blocks = calc_inode_blocks(symlen);
...@@ -958,7 +959,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ...@@ -958,7 +959,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
inode->i_fop = &ceph_dir_fops; inode->i_fop = &ceph_dir_fops;
break; break;
default: default:
pr_err("fill_inode %llx.%llx BAD mode 0%o\n", pr_err("%s %llx.%llx BAD mode 0%o\n", __func__,
ceph_vinop(inode), inode->i_mode); ceph_vinop(inode), inode->i_mode);
} }
...@@ -1246,10 +1247,9 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req) ...@@ -1246,10 +1247,9 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
struct inode *dir = req->r_parent; struct inode *dir = req->r_parent;
if (dir) { if (dir) {
err = fill_inode(dir, NULL, err = ceph_fill_inode(dir, NULL, &rinfo->diri,
&rinfo->diri, rinfo->dirfrag, rinfo->dirfrag, session, -1,
session, -1, &req->r_caps_reservation);
&req->r_caps_reservation);
if (err < 0) if (err < 0)
goto done; goto done;
} else { } else {
...@@ -1314,14 +1314,14 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req) ...@@ -1314,14 +1314,14 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
goto done; goto done;
} }
err = fill_inode(in, req->r_locked_page, &rinfo->targeti, NULL, err = ceph_fill_inode(in, req->r_locked_page, &rinfo->targeti,
session, NULL, session,
(!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags) && (!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags) &&
!test_bit(CEPH_MDS_R_ASYNC, &req->r_req_flags) && !test_bit(CEPH_MDS_R_ASYNC, &req->r_req_flags) &&
rinfo->head->result == 0) ? req->r_fmode : -1, rinfo->head->result == 0) ? req->r_fmode : -1,
&req->r_caps_reservation); &req->r_caps_reservation);
if (err < 0) { if (err < 0) {
pr_err("fill_inode badness %p %llx.%llx\n", pr_err("ceph_fill_inode badness %p %llx.%llx\n",
in, ceph_vinop(in)); in, ceph_vinop(in));
if (in->i_state & I_NEW) if (in->i_state & I_NEW)
discard_new_inode(in); discard_new_inode(in);
...@@ -1508,10 +1508,11 @@ static int readdir_prepopulate_inodes_only(struct ceph_mds_request *req, ...@@ -1508,10 +1508,11 @@ static int readdir_prepopulate_inodes_only(struct ceph_mds_request *req,
dout("new_inode badness got %d\n", err); dout("new_inode badness got %d\n", err);
continue; continue;
} }
rc = fill_inode(in, NULL, &rde->inode, NULL, session, rc = ceph_fill_inode(in, NULL, &rde->inode, NULL, session,
-1, &req->r_caps_reservation); -1, &req->r_caps_reservation);
if (rc < 0) { if (rc < 0) {
pr_err("fill_inode badness on %p got %d\n", in, rc); pr_err("ceph_fill_inode badness on %p got %d\n",
in, rc);
err = rc; err = rc;
if (in->i_state & I_NEW) { if (in->i_state & I_NEW) {
ihold(in); ihold(in);
...@@ -1715,10 +1716,10 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, ...@@ -1715,10 +1716,10 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
} }
} }
ret = fill_inode(in, NULL, &rde->inode, NULL, session, ret = ceph_fill_inode(in, NULL, &rde->inode, NULL, session,
-1, &req->r_caps_reservation); -1, &req->r_caps_reservation);
if (ret < 0) { if (ret < 0) {
pr_err("fill_inode badness on %p\n", in); pr_err("ceph_fill_inode badness on %p\n", in);
if (d_really_is_negative(dn)) { if (d_really_is_negative(dn)) {
/* avoid calling iput_final() in mds /* avoid calling iput_final() in mds
* dispatch threads */ * dispatch threads */
......
...@@ -895,6 +895,9 @@ static inline bool __ceph_have_pending_cap_snap(struct ceph_inode_info *ci) ...@@ -895,6 +895,9 @@ static inline bool __ceph_have_pending_cap_snap(struct ceph_inode_info *ci)
} }
/* inode.c */ /* inode.c */
struct ceph_mds_reply_info_in;
struct ceph_mds_reply_dirfrag;
extern const struct inode_operations ceph_file_iops; extern const struct inode_operations ceph_file_iops;
extern struct inode *ceph_alloc_inode(struct super_block *sb); extern struct inode *ceph_alloc_inode(struct super_block *sb);
...@@ -910,6 +913,11 @@ extern void ceph_fill_file_time(struct inode *inode, int issued, ...@@ -910,6 +913,11 @@ extern void ceph_fill_file_time(struct inode *inode, int issued,
u64 time_warp_seq, struct timespec64 *ctime, u64 time_warp_seq, struct timespec64 *ctime,
struct timespec64 *mtime, struct timespec64 *mtime,
struct timespec64 *atime); struct timespec64 *atime);
extern int ceph_fill_inode(struct inode *inode, struct page *locked_page,
struct ceph_mds_reply_info_in *iinfo,
struct ceph_mds_reply_dirfrag *dirinfo,
struct ceph_mds_session *session, int cap_fmode,
struct ceph_cap_reservation *caps_reservation);
extern int ceph_fill_trace(struct super_block *sb, extern int ceph_fill_trace(struct super_block *sb,
struct ceph_mds_request *req); struct ceph_mds_request *req);
extern int ceph_readdir_prepopulate(struct ceph_mds_request *req, extern int ceph_readdir_prepopulate(struct ceph_mds_request *req,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment