/linux/fs/ceph/ |
H A D | snap.c | 66 void ceph_get_snap_realm(struct ceph_mds_client *mdsc, in ceph_get_snap_realm() argument 69 lockdep_assert_held(&mdsc->snap_rwsem); in ceph_get_snap_realm() 80 spin_lock(&mdsc->snap_empty_lock); in ceph_get_snap_realm() 83 spin_unlock(&mdsc->snap_empty_lock); in ceph_get_snap_realm() 114 struct ceph_mds_client *mdsc, in ceph_create_snap_realm() argument 119 lockdep_assert_held_write(&mdsc->snap_rwsem); in ceph_create_snap_realm() 138 __insert_snap_realm(&mdsc->snap_realms, realm); in ceph_create_snap_realm() 139 mdsc->num_snap_realms++; in ceph_create_snap_realm() 141 doutc(mdsc->fsc->client, "%llx %p\n", realm->ino, realm); in ceph_create_snap_realm() 150 static struct ceph_snap_realm *__lookup_snap_realm(struct ceph_mds_client *mdsc, in __lookup_snap_realm() argument [all …]
|
H A D | quota.c | 15 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_adjust_quota_realms_count() local 17 atomic64_inc(&mdsc->quotarealms_count); in ceph_adjust_quota_realms_count() 19 atomic64_dec(&mdsc->quotarealms_count); in ceph_adjust_quota_realms_count() 25 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(sb); in ceph_has_realms_with_quotas() local 28 if (atomic64_read(&mdsc->quotarealms_count) > 0) in ceph_has_realms_with_quotas() 40 void ceph_handle_quota(struct ceph_mds_client *mdsc, in ceph_handle_quota() argument 44 struct super_block *sb = mdsc->fsc->sb; in ceph_handle_quota() 46 struct ceph_client *cl = mdsc->fsc->client; in ceph_handle_quota() 51 if (!ceph_inc_mds_stopping_blocker(mdsc, session)) in ceph_handle_quota() 81 ceph_dec_mds_stopping_blocker(mdsc); in ceph_handle_quota() [all …]
|
H A D | mds_client.c | 63 static void __wake_requests(struct ceph_mds_client *mdsc, 934 struct ceph_mds_session *__ceph_lookup_mds_session(struct ceph_mds_client *mdsc, in __ceph_lookup_mds_session() argument 937 if (mds >= mdsc->max_sessions || !mdsc->sessions[mds]) in __ceph_lookup_mds_session() 939 return ceph_get_mds_session(mdsc->sessions[mds]); in __ceph_lookup_mds_session() 942 static bool __have_session(struct ceph_mds_client *mdsc, int mds) in __have_session() argument 944 if (mds >= mdsc->max_sessions || !mdsc->sessions[mds]) in __have_session() 950 static int __verify_registered_session(struct ceph_mds_client *mdsc, in __verify_registered_session() argument 953 if (s->s_mds >= mdsc->max_sessions || in __verify_registered_session() 954 mdsc->sessions[s->s_mds] != s) in __verify_registered_session() 963 static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc, in register_session() argument [all …]
|
H A D | caps.c | 48 static u64 __get_oldest_flush_tid(struct ceph_mds_client *mdsc); 49 static void __kick_flushing_caps(struct ceph_mds_client *mdsc, 130 void ceph_caps_init(struct ceph_mds_client *mdsc) in ceph_caps_init() argument 132 INIT_LIST_HEAD(&mdsc->caps_list); in ceph_caps_init() 133 spin_lock_init(&mdsc->caps_list_lock); in ceph_caps_init() 136 void ceph_caps_finalize(struct ceph_mds_client *mdsc) in ceph_caps_finalize() argument 140 spin_lock(&mdsc->caps_list_lock); in ceph_caps_finalize() 141 while (!list_empty(&mdsc->caps_list)) { in ceph_caps_finalize() 142 cap = list_first_entry(&mdsc->caps_list, in ceph_caps_finalize() 147 mdsc->caps_total_count = 0; in ceph_caps_finalize() [all …]
|
H A D | debugfs.c | 31 if (!fsc->mdsc || !fsc->mdsc->mdsmap) in mdsmap_show() 33 mdsmap = fsc->mdsc->mdsmap; in mdsmap_show() 55 struct ceph_mds_client *mdsc = fsc->mdsc; in mdsc_show() local 62 mutex_lock(&mdsc->mutex); in mdsc_show() 63 for (rp = rb_first(&mdsc->request_tree); rp; rp = rb_next(rp)) { in mdsc_show() 84 path = ceph_mdsc_build_path(mdsc, req->r_dentry, &pathlen, in mdsc_show() 103 path = ceph_mdsc_build_path(mdsc, req->r_old_dentry, &pathlen, in mdsc_show() 125 mutex_unlock(&mdsc->mutex); in mdsc_show() 152 struct ceph_client_metric *m = &fsc->mdsc->metric; in metrics_file_show() 176 struct ceph_client_metric *cm = &fsc->mdsc->metric; in metrics_latency_show() [all …]
|
H A D | ioctl.c | 38 static long __validate_layout(struct ceph_mds_client *mdsc, in __validate_layout() argument 51 mutex_lock(&mdsc->mutex); in __validate_layout() 53 for (i = 0; i < mdsc->mdsmap->m_num_data_pg_pools; i++) in __validate_layout() 54 if (mdsc->mdsmap->m_data_pg_pools[i] == l->data_pool) { in __validate_layout() 58 mutex_unlock(&mdsc->mutex); in __validate_layout() 68 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; in ceph_ioctl_set_layout() local 104 err = __validate_layout(mdsc, &nl); in ceph_ioctl_set_layout() 108 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_SETLAYOUT, in ceph_ioctl_set_layout() 126 err = ceph_mdsc_do_request(mdsc, NULL, req); in ceph_ioctl_set_layout() 143 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; in ceph_ioctl_set_layout_policy() local [all …]
|
H A D | dir.c | 42 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dentry->d_sb); in ceph_d_init() local 54 atomic64_inc(&mdsc->metric.total_dentries); in ceph_d_init() 322 struct ceph_mds_client *mdsc = fsc->mdsc; in ceph_readdir() local 365 __ceph_touch_fmode(ci, mdsc, CEPH_FILE_MODE_WR); in ceph_readdir() 408 req = ceph_mdsc_create_request(mdsc, op, USE_AUTH_MDS); in ceph_readdir() 456 err = ceph_mdsc_do_request(mdsc, NULL, req); in ceph_readdir() 799 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); in ceph_lookup() local 839 __ceph_touch_fmode(ci, mdsc, CEPH_FILE_MODE_RD); in ceph_lookup() 852 req = ceph_mdsc_create_request(mdsc, op, USE_ANY_MDS); in ceph_lookup() 866 err = ceph_mdsc_do_request(mdsc, NULL, req); in ceph_lookup() [all …]
|
H A D | mds_client.h | 271 typedef void (*ceph_mds_request_callback_t) (struct ceph_mds_client *mdsc, 276 typedef int (*ceph_mds_request_wait_callback_t) (struct ceph_mds_client *mdsc, 563 extern void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc); 564 extern void ceph_mdsc_force_umount(struct ceph_mds_client *mdsc); 567 extern void ceph_mdsc_sync(struct ceph_mds_client *mdsc); 573 ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode); 574 extern int ceph_mdsc_submit_request(struct ceph_mds_client *mdsc, 577 int ceph_mdsc_wait_request(struct ceph_mds_client *mdsc, 580 extern int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, 596 extern void ceph_mdsc_iterate_sessions(struct ceph_mds_client *mdsc, [all …]
|
H A D | super.c | 51 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super() 64 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs() 65 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs() 128 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs() 129 ceph_flush_cap_releases(fsc->mdsc); in ceph_sync_fs() 136 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs() 792 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch() 795 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch() 1013 ceph_mdsc_force_umount(fsc->mdsc); in __ceph_umount_begin() 1054 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry() local [all …]
|
H A D | metric.c | 17 static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc, in ceph_mdsc_send_metrics() argument 31 struct ceph_client_metric *m = &mdsc->metric; in ceph_mdsc_send_metrics() 34 struct ceph_client *cl = mdsc->fsc->client; in ceph_mdsc_send_metrics() 41 mutex_lock(&mdsc->mutex); in ceph_mdsc_send_metrics() 42 if (ceph_mdsmap_get_state(mdsc->mdsmap, s->s_mds) != CEPH_MDS_STATE_ACTIVE) { in ceph_mdsc_send_metrics() 43 mutex_unlock(&mdsc->mutex); in ceph_mdsc_send_metrics() 46 mutex_unlock(&mdsc->mutex); in ceph_mdsc_send_metrics() 186 static void metric_get_session(struct ceph_mds_client *mdsc) in metric_get_session() argument 191 mutex_lock(&mdsc->mutex); in metric_get_session() 192 for (i = 0; i < mdsc->max_sessions; i++) { in metric_get_session() [all …]
|
H A D | export.c | 128 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc; in __lookup_inode() local 144 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPINO, in __lookup_inode() 156 err = ceph_mdsc_do_request(mdsc, NULL, req); in __lookup_inode() 210 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc; in __snapfh_to_dentry() local 211 struct ceph_client *cl = mdsc->fsc->client; in __snapfh_to_dentry() 244 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPINO, in __snapfh_to_dentry() 265 err = ceph_mdsc_do_request(mdsc, NULL, req); in __snapfh_to_dentry() 321 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(sb)->mdsc; in __get_parent() local 327 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPPARENT, in __get_parent() 348 err = ceph_mdsc_do_request(mdsc, NULL, req); in __get_parent() [all …]
|
H A D | super.h | 137 struct ceph_mds_client *mdsc; member 507 return (struct ceph_mds_client *)ceph_sb_to_fs_client(sb)->mdsc; in ceph_sb_to_mdsc() 812 extern void ceph_caps_init(struct ceph_mds_client *mdsc); 813 extern void ceph_caps_finalize(struct ceph_mds_client *mdsc); 814 extern void ceph_adjust_caps_max_min(struct ceph_mds_client *mdsc, 816 extern int ceph_reserve_caps(struct ceph_mds_client *mdsc, 818 extern void ceph_unreserve_caps(struct ceph_mds_client *mdsc, 986 struct ceph_snap_realm *ceph_lookup_snap_realm(struct ceph_mds_client *mdsc, 988 extern void ceph_get_snap_realm(struct ceph_mds_client *mdsc, 990 extern void ceph_put_snap_realm(struct ceph_mds_client *mdsc, [all …]
|
H A D | locks.c | 14 static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc, 79 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_lock_message() local 80 struct ceph_client *cl = mdsc->fsc->client; in ceph_lock_message() 100 req = ceph_mdsc_create_request(mdsc, operation, USE_AUTH_MDS); in ceph_lock_message() 129 err = ceph_mdsc_submit_request(mdsc, inode, req); in ceph_lock_message() 131 err = ceph_mdsc_wait_request(mdsc, req, wait ? in ceph_lock_message() 159 static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc, in ceph_lock_wait_for_completion() argument 162 struct ceph_client *cl = mdsc->fsc->client; in ceph_lock_wait_for_completion() 182 mutex_lock(&mdsc->mutex); in ceph_lock_wait_for_completion() 201 mutex_unlock(&mdsc->mutex); in ceph_lock_wait_for_completion() [all …]
|
H A D | addr.c | 219 ceph_update_read_metrics(&fsc->mdsc->metric, req->r_start_latency, in finish_netfs_read() 259 ceph_dec_osd_stopping_blocker(fsc->mdsc); in finish_netfs_read() 269 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_netfs_issue_op_inline() local 284 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_GETATTR, mode); in ceph_netfs_issue_op_inline() 294 err = ceph_mdsc_do_request(mdsc, NULL, req); in ceph_netfs_issue_op_inline() 416 if (!ceph_inc_osd_stopping_blocker(fsc->mdsc)) { in ceph_netfs_issue_read() 767 ceph_update_write_metrics(&fsc->mdsc->metric, req->r_start_latency, in writepage_nounlock() 925 ceph_update_write_metrics(&fsc->mdsc->metric, req->r_start_latency, in writepages_finish() 936 ceph_dec_osd_stopping_blocker(fsc->mdsc); in writepages_finish() 1248 if (!ceph_inc_osd_stopping_blocker(fsc->mdsc)) { in ceph_writepages_start() [all …]
|
H A D | inode.c | 48 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_set_ino_cb() local 53 percpu_counter_inc(&mdsc->metric.total_inodes); in ceph_set_ino_cb() 134 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(sb); in ceph_get_inode() local 135 struct ceph_client *cl = mdsc->fsc->client; in ceph_get_inode() 689 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_evict_inode() local 696 percpu_counter_dec(&mdsc->metric.total_inodes); in ceph_evict_inode() 722 ceph_put_snapid_map(mdsc, ci->i_snapid_map); in ceph_evict_inode() 902 static int decode_encrypted_symlink(struct ceph_mds_client *mdsc, in decode_encrypted_symlink() argument 906 struct ceph_client *cl = mdsc->fsc->client; in decode_encrypted_symlink() 927 static int decode_encrypted_symlink(struct ceph_mds_client *mdsc, in decode_encrypted_symlink() argument [all …]
|
H A D | xattr.c | 1115 struct ceph_mds_client *mdsc = fsc->mdsc; in ceph_sync_setxattr() local 1140 req = ceph_mdsc_create_request(mdsc, op, USE_AUTH_MDS); in ceph_sync_setxattr() 1167 err = ceph_mdsc_do_request(mdsc, NULL, req); in ceph_sync_setxattr() 1183 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; in __ceph_setxattr() local 1238 (required_blob_size > mdsc->mdsmap->m_max_xattr_size)) { in __ceph_setxattr() 1241 mdsc->mdsmap->m_max_xattr_size); in __ceph_setxattr() 1247 if (!down_read_trylock(&mdsc->snap_rwsem)) { in __ceph_setxattr() 1249 down_read(&mdsc->snap_rwsem); in __ceph_setxattr() 1291 up_read(&mdsc->snap_rwsem); in __ceph_setxattr() 1301 up_read(&mdsc->snap_rwsem); in __ceph_setxattr()
|
H A D | mdsmap.h | 74 struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p,
|
H A D | mdsmap.c | 118 struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p, in ceph_mdsmap_decode() argument 121 struct ceph_client *cl = mdsc->fsc->client; in ceph_mdsmap_decode()
|