Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: rename _to_client() to _to_fs_client()

We need to covert the inode to ceph_client in the following commit,
and will add one new helper for that, here we rename the old helper
to _fs_client().

Link: https://tracker.ceph.com/issues/61590
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Xiubo Li and committed by
Ilya Dryomov
5995d90d 197b7d79

+95 -95
+10 -10
fs/ceph/addr.c
··· 229 229 static bool ceph_netfs_clamp_length(struct netfs_io_subrequest *subreq) 230 230 { 231 231 struct inode *inode = subreq->rreq->inode; 232 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 232 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 233 233 struct ceph_inode_info *ci = ceph_inode(inode); 234 234 u64 objno, objoff; 235 235 u32 xlen; ··· 244 244 static void finish_netfs_read(struct ceph_osd_request *req) 245 245 { 246 246 struct inode *inode = req->r_inode; 247 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 247 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 248 248 struct ceph_osd_data *osd_data = osd_req_op_extent_osd_data(req, 0); 249 249 struct netfs_io_subrequest *subreq = req->r_priv; 250 250 struct ceph_osd_req_op *op = &req->r_ops[0]; ··· 348 348 struct netfs_io_request *rreq = subreq->rreq; 349 349 struct inode *inode = rreq->inode; 350 350 struct ceph_inode_info *ci = ceph_inode(inode); 351 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 351 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 352 352 struct ceph_osd_request *req = NULL; 353 353 struct ceph_vino vino = ceph_vino(inode); 354 354 struct iov_iter iter; ··· 658 658 struct folio *folio = page_folio(page); 659 659 struct inode *inode = page->mapping->host; 660 660 struct ceph_inode_info *ci = ceph_inode(inode); 661 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 661 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 662 662 struct ceph_snap_context *snapc, *oldest; 663 663 loff_t page_off = page_offset(page); 664 664 int err; ··· 803 803 ihold(inode); 804 804 805 805 if (wbc->sync_mode == WB_SYNC_NONE && 806 - ceph_inode_to_client(inode)->write_congested) 806 + ceph_inode_to_fs_client(inode)->write_congested) 807 807 return AOP_WRITEPAGE_ACTIVATE; 808 808 809 809 wait_on_page_fscache(page); ··· 836 836 int rc = req->r_result; 837 837 struct ceph_snap_context *snapc = req->r_snapc; 838 838 struct address_space *mapping = inode->i_mapping; 839 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 839 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 840 840 unsigned int len = 0; 841 841 bool remove_page; 842 842 ··· 926 926 { 927 927 struct inode *inode = mapping->host; 928 928 struct ceph_inode_info *ci = ceph_inode(inode); 929 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 929 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 930 930 struct ceph_vino vino = ceph_vino(inode); 931 931 pgoff_t index, start_index, end = -1; 932 932 struct ceph_snap_context *snapc = NULL, *last_snapc = NULL, *pgsnapc; ··· 1823 1823 { 1824 1824 struct inode *inode = file_inode(file); 1825 1825 struct ceph_inode_info *ci = ceph_inode(inode); 1826 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 1826 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 1827 1827 struct ceph_osd_request *req = NULL; 1828 1828 struct ceph_cap_flush *prealloc_cf = NULL; 1829 1829 struct folio *folio = NULL; ··· 1977 1977 static int __ceph_pool_perm_get(struct ceph_inode_info *ci, 1978 1978 s64 pool, struct ceph_string *pool_ns) 1979 1979 { 1980 - struct ceph_fs_client *fsc = ceph_inode_to_client(&ci->netfs.inode); 1980 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(&ci->netfs.inode); 1981 1981 struct ceph_mds_client *mdsc = fsc->mdsc; 1982 1982 struct ceph_osd_request *rd_req = NULL, *wr_req = NULL; 1983 1983 struct rb_node **p, *parent; ··· 2168 2168 return 0; 2169 2169 } 2170 2170 2171 - if (ceph_test_mount_opt(ceph_inode_to_client(inode), 2171 + if (ceph_test_mount_opt(ceph_inode_to_fs_client(inode), 2172 2172 NOPOOLPERM)) 2173 2173 return 0; 2174 2174
+1 -1
fs/ceph/cache.c
··· 15 15 void ceph_fscache_register_inode_cookie(struct inode *inode) 16 16 { 17 17 struct ceph_inode_info *ci = ceph_inode(inode); 18 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 18 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 19 19 20 20 /* No caching for filesystem? */ 21 21 if (!fsc->fscache)
+20 -20
fs/ceph/caps.c
··· 635 635 unsigned seq, unsigned mseq, u64 realmino, int flags, 636 636 struct ceph_cap **new_cap) 637 637 { 638 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 638 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 639 639 struct ceph_inode_info *ci = ceph_inode(inode); 640 640 struct ceph_cap *cap; 641 641 int mds = session->s_mds; ··· 922 922 int __ceph_caps_issued_mask_metric(struct ceph_inode_info *ci, int mask, 923 923 int touch) 924 924 { 925 - struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb); 925 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(ci->netfs.inode.i_sb); 926 926 int r; 927 927 928 928 r = __ceph_caps_issued_mask(ci, mask, touch); ··· 996 996 const int WR_SHIFT = ffs(CEPH_FILE_MODE_WR); 997 997 const int LAZY_SHIFT = ffs(CEPH_FILE_MODE_LAZY); 998 998 struct ceph_mount_options *opt = 999 - ceph_inode_to_client(&ci->netfs.inode)->mount_options; 999 + ceph_inode_to_fs_client(&ci->netfs.inode)->mount_options; 1000 1000 unsigned long used_cutoff = jiffies - opt->caps_wanted_delay_max * HZ; 1001 1001 unsigned long idle_cutoff = jiffies - opt->caps_wanted_delay_min * HZ; 1002 1002 ··· 1121 1121 1122 1122 dout("__ceph_remove_cap %p from %p\n", cap, &ci->netfs.inode); 1123 1123 1124 - mdsc = ceph_inode_to_client(&ci->netfs.inode)->mdsc; 1124 + mdsc = ceph_inode_to_fs_client(&ci->netfs.inode)->mdsc; 1125 1125 1126 1126 /* remove from inode's cap rbtree, and clear auth cap */ 1127 1127 rb_erase(&cap->ci_node, &ci->i_caps); ··· 1192 1192 1193 1193 lockdep_assert_held(&ci->i_ceph_lock); 1194 1194 1195 - fsc = ceph_inode_to_client(&ci->netfs.inode); 1195 + fsc = ceph_inode_to_fs_client(&ci->netfs.inode); 1196 1196 WARN_ON_ONCE(ci->i_auth_cap == cap && 1197 1197 !list_empty(&ci->i_dirty_item) && 1198 1198 !fsc->blocklisted && ··· 1344 1344 void __ceph_remove_caps(struct ceph_inode_info *ci) 1345 1345 { 1346 1346 struct inode *inode = &ci->netfs.inode; 1347 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 1347 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 1348 1348 struct rb_node *p; 1349 1349 1350 1350 /* lock i_ceph_lock, because ceph_d_revalidate(..., LOOKUP_RCU) ··· 1688 1688 struct ceph_mds_session **psession) 1689 1689 { 1690 1690 struct inode *inode = &ci->netfs.inode; 1691 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 1691 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 1692 1692 struct ceph_mds_session *session = NULL; 1693 1693 bool need_put = false; 1694 1694 int mds; ··· 1753 1753 struct ceph_cap_flush **pcf) 1754 1754 { 1755 1755 struct ceph_mds_client *mdsc = 1756 - ceph_sb_to_client(ci->netfs.inode.i_sb)->mdsc; 1756 + ceph_sb_to_fs_client(ci->netfs.inode.i_sb)->mdsc; 1757 1757 struct inode *inode = &ci->netfs.inode; 1758 1758 int was = ci->i_dirty_caps; 1759 1759 int dirty = 0; ··· 1876 1876 struct ceph_mds_session *session, bool wake, 1877 1877 u64 *oldest_flush_tid) 1878 1878 { 1879 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 1879 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 1880 1880 struct ceph_inode_info *ci = ceph_inode(inode); 1881 1881 struct ceph_cap_flush *cf = NULL; 1882 1882 int flushing; ··· 2235 2235 */ 2236 2236 static int try_flush_caps(struct inode *inode, u64 *ptid) 2237 2237 { 2238 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 2238 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 2239 2239 struct ceph_inode_info *ci = ceph_inode(inode); 2240 2240 int flushing = 0; 2241 2241 u64 flush_tid = 0, oldest_flush_tid = 0; ··· 2313 2313 */ 2314 2314 static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode) 2315 2315 { 2316 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 2316 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 2317 2317 struct ceph_inode_info *ci = ceph_inode(inode); 2318 2318 struct ceph_mds_request *req1 = NULL, *req2 = NULL; 2319 2319 int ret, err = 0; ··· 2496 2496 caps_are_flushed(inode, flush_tid)); 2497 2497 } else { 2498 2498 struct ceph_mds_client *mdsc = 2499 - ceph_sb_to_client(inode->i_sb)->mdsc; 2499 + ceph_sb_to_fs_client(inode->i_sb)->mdsc; 2500 2500 2501 2501 spin_lock(&ci->i_ceph_lock); 2502 2502 if (__ceph_caps_dirty(ci)) ··· 2749 2749 loff_t endoff, int flags, int *got) 2750 2750 { 2751 2751 struct ceph_inode_info *ci = ceph_inode(inode); 2752 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 2752 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 2753 2753 int ret = 0; 2754 2754 int have, implemented; 2755 2755 bool snap_rwsem_locked = false; ··· 2967 2967 int want, loff_t endoff, int *got) 2968 2968 { 2969 2969 struct ceph_inode_info *ci = ceph_inode(inode); 2970 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 2970 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 2971 2971 int ret, _got, flags; 2972 2972 2973 2973 ret = ceph_pool_perm_check(inode, need); ··· 3730 3730 __releases(ci->i_ceph_lock) 3731 3731 { 3732 3732 struct ceph_inode_info *ci = ceph_inode(inode); 3733 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 3733 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 3734 3734 struct ceph_cap_flush *cf, *tmp_cf; 3735 3735 LIST_HEAD(to_remove); 3736 3736 unsigned seq = le32_to_cpu(m->seq); ··· 3836 3836 bool *wake_ci, bool *wake_mdsc) 3837 3837 { 3838 3838 struct ceph_inode_info *ci = ceph_inode(inode); 3839 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 3839 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 3840 3840 bool ret; 3841 3841 3842 3842 lockdep_assert_held(&ci->i_ceph_lock); ··· 3880 3880 struct ceph_mds_session *session) 3881 3881 { 3882 3882 struct ceph_inode_info *ci = ceph_inode(inode); 3883 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 3883 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 3884 3884 u64 follows = le64_to_cpu(m->snap_follows); 3885 3885 struct ceph_cap_snap *capsnap = NULL, *iter; 3886 3886 bool wake_ci = false; ··· 3972 3972 struct ceph_mds_cap_peer *ph, 3973 3973 struct ceph_mds_session *session) 3974 3974 { 3975 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 3975 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 3976 3976 struct ceph_mds_session *tsession = NULL; 3977 3977 struct ceph_cap *cap, *tcap, *new_cap = NULL; 3978 3978 struct ceph_inode_info *ci = ceph_inode(inode); ··· 4675 4675 4676 4676 if (__ceph_caps_dirty(ci)) { 4677 4677 struct ceph_mds_client *mdsc = 4678 - ceph_inode_to_client(inode)->mdsc; 4678 + ceph_inode_to_fs_client(inode)->mdsc; 4679 4679 __cap_delay_requeue_front(mdsc, ci); 4680 4680 } 4681 4681 } ··· 4858 4858 4859 4859 int ceph_purge_inode_cap(struct inode *inode, struct ceph_cap *cap, bool *invalidate) 4860 4860 { 4861 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 4861 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 4862 4862 struct ceph_mds_client *mdsc = fsc->mdsc; 4863 4863 struct ceph_inode_info *ci = ceph_inode(inode); 4864 4864 bool is_auth;
+1 -1
fs/ceph/crypto.c
··· 129 129 130 130 static const union fscrypt_policy *ceph_get_dummy_policy(struct super_block *sb) 131 131 { 132 - return ceph_sb_to_client(sb)->fsc_dummy_enc_policy.policy; 132 + return ceph_sb_to_fs_client(sb)->fsc_dummy_enc_policy.policy; 133 133 } 134 134 135 135 static struct fscrypt_operations ceph_fscrypt_ops = {
+11 -11
fs/ceph/dir.c
··· 310 310 struct ceph_dir_file_info *dfi = file->private_data; 311 311 struct inode *inode = file_inode(file); 312 312 struct ceph_inode_info *ci = ceph_inode(inode); 313 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 313 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 314 314 struct ceph_mds_client *mdsc = fsc->mdsc; 315 315 int i; 316 316 int err; ··· 703 703 struct dentry *ceph_handle_snapdir(struct ceph_mds_request *req, 704 704 struct dentry *dentry) 705 705 { 706 - struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); 706 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dentry->d_sb); 707 707 struct inode *parent = d_inode(dentry->d_parent); /* we hold i_rwsem */ 708 708 709 709 /* .snap dir? */ ··· 771 771 static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, 772 772 unsigned int flags) 773 773 { 774 - struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 774 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); 775 775 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); 776 776 struct ceph_mds_request *req; 777 777 int op; ··· 1199 1199 struct ceph_mds_request *req) 1200 1200 { 1201 1201 struct dentry *dentry = req->r_dentry; 1202 - struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); 1202 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dentry->d_sb); 1203 1203 struct ceph_dentry_info *di = ceph_dentry(dentry); 1204 1204 int result = req->r_err ? req->r_err : 1205 1205 le32_to_cpu(req->r_reply_info.head->result); ··· 1290 1290 */ 1291 1291 static int ceph_unlink(struct inode *dir, struct dentry *dentry) 1292 1292 { 1293 - struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 1293 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); 1294 1294 struct ceph_mds_client *mdsc = fsc->mdsc; 1295 1295 struct inode *inode = d_inode(dentry); 1296 1296 struct ceph_mds_request *req; ··· 1469 1469 return; 1470 1470 } 1471 1471 1472 - mdsc = ceph_sb_to_client(dn->d_sb)->mdsc; 1472 + mdsc = ceph_sb_to_fs_client(dn->d_sb)->mdsc; 1473 1473 spin_lock(&mdsc->dentry_list_lock); 1474 1474 list_move_tail(&di->lease_list, &mdsc->dentry_leases); 1475 1475 spin_unlock(&mdsc->dentry_list_lock); ··· 1516 1516 return; 1517 1517 } 1518 1518 1519 - mdsc = ceph_sb_to_client(dn->d_sb)->mdsc; 1519 + mdsc = ceph_sb_to_fs_client(dn->d_sb)->mdsc; 1520 1520 spin_lock(&mdsc->dentry_list_lock); 1521 1521 __dentry_dir_lease_touch(mdsc, di), 1522 1522 spin_unlock(&mdsc->dentry_list_lock); ··· 1530 1530 if (list_empty(&di->lease_list)) 1531 1531 return; 1532 1532 1533 - mdsc = ceph_sb_to_client(di->dentry->d_sb)->mdsc; 1533 + mdsc = ceph_sb_to_fs_client(di->dentry->d_sb)->mdsc; 1534 1534 spin_lock(&mdsc->dentry_list_lock); 1535 1535 list_del_init(&di->lease_list); 1536 1536 spin_unlock(&mdsc->dentry_list_lock); ··· 1888 1888 dentry, inode, ceph_dentry(dentry)->offset, 1889 1889 !!(dentry->d_flags & DCACHE_NOKEY_NAME)); 1890 1890 1891 - mdsc = ceph_sb_to_client(dir->i_sb)->mdsc; 1891 + mdsc = ceph_sb_to_fs_client(dir->i_sb)->mdsc; 1892 1892 1893 1893 /* always trust cached snapped dentries, snapdir dentry */ 1894 1894 if (ceph_snap(dir) != CEPH_NOSNAP) { ··· 1995 1995 static void ceph_d_release(struct dentry *dentry) 1996 1996 { 1997 1997 struct ceph_dentry_info *di = ceph_dentry(dentry); 1998 - struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); 1998 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dentry->d_sb); 1999 1999 2000 2000 dout("d_release %p\n", dentry); 2001 2001 ··· 2064 2064 int left; 2065 2065 const int bufsize = 1024; 2066 2066 2067 - if (!ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb), DIRSTAT)) 2067 + if (!ceph_test_mount_opt(ceph_sb_to_fs_client(inode->i_sb), DIRSTAT)) 2068 2068 return -EISDIR; 2069 2069 2070 2070 if (!dfi->dir_info) {
+5 -5
fs/ceph/export.c
··· 123 123 124 124 static struct inode *__lookup_inode(struct super_block *sb, u64 ino) 125 125 { 126 - struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc; 126 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc; 127 127 struct inode *inode; 128 128 struct ceph_vino vino; 129 129 int err; ··· 205 205 struct ceph_nfs_snapfh *sfh, 206 206 bool want_parent) 207 207 { 208 - struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc; 208 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc; 209 209 struct ceph_mds_request *req; 210 210 struct inode *inode; 211 211 struct ceph_vino vino; ··· 317 317 static struct dentry *__get_parent(struct super_block *sb, 318 318 struct dentry *child, u64 ino) 319 319 { 320 - struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc; 320 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc; 321 321 struct ceph_mds_request *req; 322 322 struct inode *inode; 323 323 int mask; ··· 439 439 { 440 440 struct inode *inode = d_inode(child); 441 441 struct inode *dir = d_inode(parent); 442 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 442 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 443 443 struct ceph_mds_request *req = NULL; 444 444 char *last_name = NULL; 445 445 unsigned next_offset = 2; ··· 544 544 if (ceph_snap(inode) != CEPH_NOSNAP) 545 545 return __get_snap_name(parent, name, child); 546 546 547 - mdsc = ceph_inode_to_client(inode)->mdsc; 547 + mdsc = ceph_inode_to_fs_client(inode)->mdsc; 548 548 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPNAME, 549 549 USE_ANY_MDS); 550 550 if (IS_ERR(req))
+12 -12
fs/ceph/file.c
··· 200 200 { 201 201 struct ceph_inode_info *ci = ceph_inode(inode); 202 202 struct ceph_mount_options *opt = 203 - ceph_inode_to_client(&ci->netfs.inode)->mount_options; 203 + ceph_inode_to_fs_client(&ci->netfs.inode)->mount_options; 204 204 struct ceph_file_info *fi; 205 205 int ret; 206 206 ··· 234 234 235 235 spin_lock_init(&fi->rw_contexts_lock); 236 236 INIT_LIST_HEAD(&fi->rw_contexts); 237 - fi->filp_gen = READ_ONCE(ceph_inode_to_client(inode)->filp_gen); 237 + fi->filp_gen = READ_ONCE(ceph_inode_to_fs_client(inode)->filp_gen); 238 238 239 239 if ((file->f_mode & FMODE_WRITE) && ceph_has_inline_data(ci)) { 240 240 ret = ceph_uninline_data(file); ··· 352 352 int ceph_open(struct inode *inode, struct file *file) 353 353 { 354 354 struct ceph_inode_info *ci = ceph_inode(inode); 355 - struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); 355 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(inode->i_sb); 356 356 struct ceph_mds_client *mdsc = fsc->mdsc; 357 357 struct ceph_mds_request *req; 358 358 struct ceph_file_info *fi = file->private_data; ··· 730 730 int ceph_atomic_open(struct inode *dir, struct dentry *dentry, 731 731 struct file *file, unsigned flags, umode_t mode) 732 732 { 733 - struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 733 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dir->i_sb); 734 734 struct ceph_mds_client *mdsc = fsc->mdsc; 735 735 struct ceph_mds_request *req; 736 736 struct inode *new_inode = NULL; ··· 962 962 u64 *last_objver) 963 963 { 964 964 struct ceph_inode_info *ci = ceph_inode(inode); 965 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 965 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 966 966 struct ceph_osd_client *osdc = &fsc->client->osdc; 967 967 ssize_t ret; 968 968 u64 off = *ki_pos; ··· 1256 1256 if (aio_work) { 1257 1257 INIT_WORK(&aio_work->work, ceph_aio_retry_work); 1258 1258 aio_work->req = req; 1259 - queue_work(ceph_inode_to_client(inode)->inode_wq, 1259 + queue_work(ceph_inode_to_fs_client(inode)->inode_wq, 1260 1260 &aio_work->work); 1261 1261 return; 1262 1262 } ··· 1386 1386 struct file *file = iocb->ki_filp; 1387 1387 struct inode *inode = file_inode(file); 1388 1388 struct ceph_inode_info *ci = ceph_inode(inode); 1389 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 1389 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 1390 1390 struct ceph_client_metric *metric = &fsc->mdsc->metric; 1391 1391 struct ceph_vino vino; 1392 1392 struct ceph_osd_request *req; ··· 1610 1610 struct file *file = iocb->ki_filp; 1611 1611 struct inode *inode = file_inode(file); 1612 1612 struct ceph_inode_info *ci = ceph_inode(inode); 1613 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 1613 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 1614 1614 struct ceph_osd_client *osdc = &fsc->client->osdc; 1615 1615 struct ceph_osd_request *req; 1616 1616 struct page **pages; ··· 2228 2228 struct ceph_file_info *fi = file->private_data; 2229 2229 struct inode *inode = file_inode(file); 2230 2230 struct ceph_inode_info *ci = ceph_inode(inode); 2231 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 2231 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 2232 2232 struct ceph_osd_client *osdc = &fsc->client->osdc; 2233 2233 struct ceph_cap_flush *prealloc_cf; 2234 2234 ssize_t count, written = 0; ··· 2462 2462 loff_t offset, loff_t *length) 2463 2463 { 2464 2464 struct ceph_inode_info *ci = ceph_inode(inode); 2465 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 2465 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 2466 2466 struct ceph_osd_request *req; 2467 2467 int ret = 0; 2468 2468 loff_t zero = 0; ··· 2845 2845 struct ceph_inode_info *src_ci = ceph_inode(src_inode); 2846 2846 struct ceph_inode_info *dst_ci = ceph_inode(dst_inode); 2847 2847 struct ceph_cap_flush *prealloc_cf; 2848 - struct ceph_fs_client *src_fsc = ceph_inode_to_client(src_inode); 2848 + struct ceph_fs_client *src_fsc = ceph_inode_to_fs_client(src_inode); 2849 2849 loff_t size; 2850 2850 ssize_t ret = -EIO, bytes; 2851 2851 u64 src_objnum, dst_objnum, src_objoff, dst_objoff; ··· 2853 2853 int src_got = 0, dst_got = 0, err, dirty; 2854 2854 2855 2855 if (src_inode->i_sb != dst_inode->i_sb) { 2856 - struct ceph_fs_client *dst_fsc = ceph_inode_to_client(dst_inode); 2856 + struct ceph_fs_client *dst_fsc = ceph_inode_to_fs_client(dst_inode); 2857 2857 2858 2858 if (ceph_fsid_compare(&src_fsc->client->fsid, 2859 2859 &dst_fsc->client->fsid)) {
+7 -7
fs/ceph/inode.c
··· 1489 1489 struct ceph_mds_reply_info_parsed *rinfo = &req->r_reply_info; 1490 1490 struct inode *in = NULL; 1491 1491 struct ceph_vino tvino, dvino; 1492 - struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 1492 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 1493 1493 int err = 0; 1494 1494 1495 1495 dout("fill_trace %p is_dentry %d is_target %d\n", req, ··· 2079 2079 2080 2080 void ceph_queue_inode_work(struct inode *inode, int work_bit) 2081 2081 { 2082 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 2082 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 2083 2083 struct ceph_inode_info *ci = ceph_inode(inode); 2084 2084 set_bit(work_bit, &ci->i_work_mask); 2085 2085 ··· 2427 2427 struct ceph_inode_info *ci = ceph_inode(inode); 2428 2428 unsigned int ia_valid = attr->ia_valid; 2429 2429 struct ceph_mds_request *req; 2430 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 2430 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 2431 2431 struct ceph_cap_flush *prealloc_cf; 2432 2432 loff_t isize = i_size_read(inode); 2433 2433 int issued; ··· 2740 2740 struct iattr *attr) 2741 2741 { 2742 2742 struct inode *inode = d_inode(dentry); 2743 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 2743 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 2744 2744 int err; 2745 2745 2746 2746 if (ceph_snap(inode) != CEPH_NOSNAP) ··· 2810 2810 int __ceph_do_getattr(struct inode *inode, struct page *locked_page, 2811 2811 int mask, bool force) 2812 2812 { 2813 - struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); 2813 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(inode->i_sb); 2814 2814 struct ceph_mds_client *mdsc = fsc->mdsc; 2815 2815 struct ceph_mds_request *req; 2816 2816 int mode; ··· 2856 2856 int ceph_do_getvxattr(struct inode *inode, const char *name, void *value, 2857 2857 size_t size) 2858 2858 { 2859 - struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); 2859 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(inode->i_sb); 2860 2860 struct ceph_mds_client *mdsc = fsc->mdsc; 2861 2861 struct ceph_mds_request *req; 2862 2862 int mode = USE_AUTH_MDS; ··· 3001 3001 stat->dev = ci->i_snapid_map ? ci->i_snapid_map->dev : 0; 3002 3002 3003 3003 if (S_ISDIR(inode->i_mode)) { 3004 - if (ceph_test_mount_opt(ceph_sb_to_client(sb), RBYTES)) { 3004 + if (ceph_test_mount_opt(ceph_sb_to_fs_client(sb), RBYTES)) { 3005 3005 stat->size = ci->i_rbytes; 3006 3006 } else if (ceph_snap(inode) == CEPH_SNAPDIR) { 3007 3007 struct ceph_inode_info *pci;
+4 -4
fs/ceph/ioctl.c
··· 65 65 static long ceph_ioctl_set_layout(struct file *file, void __user *arg) 66 66 { 67 67 struct inode *inode = file_inode(file); 68 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 68 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 69 69 struct ceph_mds_request *req; 70 70 struct ceph_ioctl_layout l; 71 71 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); ··· 140 140 struct ceph_mds_request *req; 141 141 struct ceph_ioctl_layout l; 142 142 int err; 143 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 143 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 144 144 145 145 /* copy and validate */ 146 146 if (copy_from_user(&l, arg, sizeof(l))) ··· 183 183 struct inode *inode = file_inode(file); 184 184 struct ceph_inode_info *ci = ceph_inode(inode); 185 185 struct ceph_osd_client *osdc = 186 - &ceph_sb_to_client(inode->i_sb)->client->osdc; 186 + &ceph_sb_to_fs_client(inode->i_sb)->client->osdc; 187 187 struct ceph_object_locator oloc; 188 188 CEPH_DEFINE_OID_ONSTACK(oid); 189 189 u32 xlen; ··· 244 244 struct ceph_file_info *fi = file->private_data; 245 245 struct inode *inode = file_inode(file); 246 246 struct ceph_inode_info *ci = ceph_inode(inode); 247 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 247 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 248 248 249 249 if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) { 250 250 spin_lock(&ci->i_ceph_lock);
+1 -1
fs/ceph/mds_client.c
··· 830 830 */ 831 831 int ceph_wait_on_conflict_unlink(struct dentry *dentry) 832 832 { 833 - struct ceph_fs_client *fsc = ceph_sb_to_client(dentry->d_sb); 833 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(dentry->d_sb); 834 834 struct dentry *pdentry = dentry->d_parent; 835 835 struct dentry *udentry, *found = NULL; 836 836 struct ceph_dentry_info *di;
+1 -1
fs/ceph/snap.c
··· 964 964 void ceph_change_snap_realm(struct inode *inode, struct ceph_snap_realm *realm) 965 965 { 966 966 struct ceph_inode_info *ci = ceph_inode(inode); 967 - struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 967 + struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; 968 968 struct ceph_snap_realm *oldrealm = ci->i_snap_realm; 969 969 970 970 lockdep_assert_held(&ci->i_ceph_lock);
+11 -11
fs/ceph/super.c
··· 44 44 */ 45 45 static void ceph_put_super(struct super_block *s) 46 46 { 47 - struct ceph_fs_client *fsc = ceph_sb_to_client(s); 47 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s); 48 48 49 49 dout("put_super\n"); 50 50 ceph_fscrypt_free_dummy_policy(fsc); ··· 53 53 54 54 static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) 55 55 { 56 - struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); 56 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(d_inode(dentry)); 57 57 struct ceph_mon_client *monc = &fsc->client->monc; 58 58 struct ceph_statfs st; 59 59 int i, err; ··· 118 118 119 119 static int ceph_sync_fs(struct super_block *sb, int wait) 120 120 { 121 - struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 121 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 122 122 123 123 if (!wait) { 124 124 dout("sync_fs (non-blocking)\n"); ··· 684 684 */ 685 685 static int ceph_show_options(struct seq_file *m, struct dentry *root) 686 686 { 687 - struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); 687 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(root->d_sb); 688 688 struct ceph_mount_options *fsopt = fsc->mount_options; 689 689 size_t pos; 690 690 int ret; ··· 1015 1015 */ 1016 1016 void ceph_umount_begin(struct super_block *sb) 1017 1017 { 1018 - struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 1018 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 1019 1019 1020 1020 dout("ceph_umount_begin - starting forced umount\n"); 1021 1021 if (!fsc) ··· 1226 1226 struct ceph_fs_client *new = fc->s_fs_info; 1227 1227 struct ceph_mount_options *fsopt = new->mount_options; 1228 1228 struct ceph_options *opt = new->client->options; 1229 - struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 1229 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 1230 1230 1231 1231 dout("ceph_compare_super %p\n", sb); 1232 1232 ··· 1322 1322 goto out; 1323 1323 } 1324 1324 1325 - if (ceph_sb_to_client(sb) != fsc) { 1325 + if (ceph_sb_to_fs_client(sb) != fsc) { 1326 1326 destroy_fs_client(fsc); 1327 - fsc = ceph_sb_to_client(sb); 1327 + fsc = ceph_sb_to_fs_client(sb); 1328 1328 dout("get_sb got existing client %p\n", fsc); 1329 1329 } else { 1330 1330 dout("get_sb using new client %p\n", fsc); ··· 1377 1377 struct ceph_parse_opts_ctx *pctx = fc->fs_private; 1378 1378 struct ceph_mount_options *fsopt = pctx->opts; 1379 1379 struct super_block *sb = fc->root->d_sb; 1380 - struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 1380 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 1381 1381 1382 1382 err = ceph_apply_test_dummy_encryption(sb, fc, fsopt); 1383 1383 if (err) ··· 1516 1516 1517 1517 static void ceph_kill_sb(struct super_block *s) 1518 1518 { 1519 - struct ceph_fs_client *fsc = ceph_sb_to_client(s); 1519 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s); 1520 1520 struct ceph_mds_client *mdsc = fsc->mdsc; 1521 1521 bool wait; 1522 1522 ··· 1578 1578 1579 1579 int ceph_force_reconnect(struct super_block *sb) 1580 1580 { 1581 - struct ceph_fs_client *fsc = ceph_sb_to_client(sb); 1581 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); 1582 1582 int err = 0; 1583 1583 1584 1584 fsc->mount_state = CEPH_MOUNT_RECOVER;
+5 -5
fs/ceph/super.h
··· 488 488 } 489 489 490 490 static inline struct ceph_fs_client * 491 - ceph_inode_to_client(const struct inode *inode) 491 + ceph_inode_to_fs_client(const struct inode *inode) 492 492 { 493 493 return (struct ceph_fs_client *)inode->i_sb->s_fs_info; 494 494 } 495 495 496 496 static inline struct ceph_fs_client * 497 - ceph_sb_to_client(const struct super_block *sb) 497 + ceph_sb_to_fs_client(const struct super_block *sb) 498 498 { 499 499 return (struct ceph_fs_client *)sb->s_fs_info; 500 500 } ··· 502 502 static inline struct ceph_mds_client * 503 503 ceph_sb_to_mdsc(const struct super_block *sb) 504 504 { 505 - return (struct ceph_mds_client *)ceph_sb_to_client(sb)->mdsc; 505 + return (struct ceph_mds_client *)ceph_sb_to_fs_client(sb)->mdsc; 506 506 } 507 507 508 508 static inline struct ceph_vino ··· 558 558 */ 559 559 static inline u64 ceph_present_ino(struct super_block *sb, u64 ino) 560 560 { 561 - if (unlikely(ceph_test_mount_opt(ceph_sb_to_client(sb), INO32))) 561 + if (unlikely(ceph_test_mount_opt(ceph_sb_to_fs_client(sb), INO32))) 562 562 return ceph_ino_to_ino32(ino); 563 563 return ino; 564 564 } ··· 1106 1106 static inline bool ceph_inode_is_shutdown(struct inode *inode) 1107 1107 { 1108 1108 unsigned long flags = READ_ONCE(ceph_inode(inode)->i_ceph_flags); 1109 - struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 1109 + struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode); 1110 1110 int state = READ_ONCE(fsc->mount_state); 1111 1111 1112 1112 return (flags & CEPH_I_SHUTDOWN) || state >= CEPH_MOUNT_SHUTDOWN;
+6 -6
fs/ceph/xattr.c
··· 57 57 static ssize_t ceph_vxattrcb_layout(struct ceph_inode_info *ci, char *val, 58 58 size_t size) 59 59 { 60 - struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb); 60 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(ci->netfs.inode.i_sb); 61 61 struct ceph_osd_client *osdc = &fsc->client->osdc; 62 62 struct ceph_string *pool_ns; 63 63 s64 pool = ci->i_layout.pool_id; ··· 161 161 char *val, size_t size) 162 162 { 163 163 ssize_t ret; 164 - struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb); 164 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(ci->netfs.inode.i_sb); 165 165 struct ceph_osd_client *osdc = &fsc->client->osdc; 166 166 s64 pool = ci->i_layout.pool_id; 167 167 const char *pool_name; ··· 313 313 static ssize_t ceph_vxattrcb_cluster_fsid(struct ceph_inode_info *ci, 314 314 char *val, size_t size) 315 315 { 316 - struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb); 316 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(ci->netfs.inode.i_sb); 317 317 318 318 return ceph_fmt_xattr(val, size, "%pU", &fsc->client->fsid); 319 319 } ··· 321 321 static ssize_t ceph_vxattrcb_client_id(struct ceph_inode_info *ci, 322 322 char *val, size_t size) 323 323 { 324 - struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb); 324 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(ci->netfs.inode.i_sb); 325 325 326 326 return ceph_fmt_xattr(val, size, "client%lld", 327 327 ceph_client_gid(fsc->client)); ··· 1094 1094 static int ceph_sync_setxattr(struct inode *inode, const char *name, 1095 1095 const char *value, size_t size, int flags) 1096 1096 { 1097 - struct ceph_fs_client *fsc = ceph_sb_to_client(inode->i_sb); 1097 + struct ceph_fs_client *fsc = ceph_sb_to_fs_client(inode->i_sb); 1098 1098 struct ceph_inode_info *ci = ceph_inode(inode); 1099 1099 struct ceph_mds_request *req; 1100 1100 struct ceph_mds_client *mdsc = fsc->mdsc; ··· 1164 1164 { 1165 1165 struct ceph_vxattr *vxattr; 1166 1166 struct ceph_inode_info *ci = ceph_inode(inode); 1167 - struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 1167 + struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; 1168 1168 struct ceph_cap_flush *prealloc_cf = NULL; 1169 1169 struct ceph_buffer *old_blob = NULL; 1170 1170 int issued;