Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 640ef79d authored by Cheng Renquan's avatar Cheng Renquan Committed by Sage Weil
Browse files

ceph: use ceph_sb_to_client instead of ceph_client



ceph_sb_to_client and ceph_client are really identical, we need to dump
one; while function ceph_client is confusing with "struct ceph_client",
ceph_sb_to_client's definition is more clear; so we'd better switch all
call to ceph_sb_to_client.

  -static inline struct ceph_client *ceph_client(struct super_block *sb)
  -{
  -	return sb->s_fs_info;
  -}

Signed-off-by: default avatarCheng Renquan <crquan@gmail.com>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 2d06eeb8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ static void writepages_finish(struct ceph_osd_request *req,
	ceph_release_pages(req->r_pages, req->r_num_pages);
	if (req->r_pages_from_pool)
		mempool_free(req->r_pages,
			     ceph_client(inode->i_sb)->wb_pagevec_pool);
			     ceph_sb_to_client(inode->i_sb)->wb_pagevec_pool);
	else
		kfree(req->r_pages);
	ceph_osdc_put_request(req);
+9 −6
Original line number Diff line number Diff line
@@ -867,7 +867,8 @@ void __ceph_remove_cap(struct ceph_cap *cap)
{
	struct ceph_mds_session *session = cap->session;
	struct ceph_inode_info *ci = cap->ci;
	struct ceph_mds_client *mdsc = &ceph_client(ci->vfs_inode.i_sb)->mdsc;
	struct ceph_mds_client *mdsc =
		&ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc;
	int removed = 0;

	dout("__ceph_remove_cap %p from %p\n", cap, &ci->vfs_inode);
@@ -1298,7 +1299,8 @@ static void ceph_flush_snaps(struct ceph_inode_info *ci)
 */
void __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
{
	struct ceph_mds_client *mdsc = &ceph_client(ci->vfs_inode.i_sb)->mdsc;
	struct ceph_mds_client *mdsc =
		&ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc;
	struct inode *inode = &ci->vfs_inode;
	int was = ci->i_dirty_caps;
	int dirty = 0;
@@ -1336,7 +1338,7 @@ void __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
static int __mark_caps_flushing(struct inode *inode,
				 struct ceph_mds_session *session)
{
	struct ceph_mds_client *mdsc = &ceph_client(inode->i_sb)->mdsc;
	struct ceph_mds_client *mdsc = &ceph_sb_to_client(inode->i_sb)->mdsc;
	struct ceph_inode_info *ci = ceph_inode(inode);
	int flushing;

@@ -1663,7 +1665,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
static int try_flush_caps(struct inode *inode, struct ceph_mds_session *session,
			  unsigned *flush_tid)
{
	struct ceph_mds_client *mdsc = &ceph_client(inode->i_sb)->mdsc;
	struct ceph_mds_client *mdsc = &ceph_sb_to_client(inode->i_sb)->mdsc;
	struct ceph_inode_info *ci = ceph_inode(inode);
	int unlock_session = session ? 0 : 1;
	int flushing = 0;
@@ -1829,7 +1831,8 @@ int ceph_write_inode(struct inode *inode, struct writeback_control *wbc)
			err = wait_event_interruptible(ci->i_cap_wq,
				       caps_are_flushed(inode, flush_tid));
	} else {
		struct ceph_mds_client *mdsc = &ceph_client(inode->i_sb)->mdsc;
		struct ceph_mds_client *mdsc =
			&ceph_sb_to_client(inode->i_sb)->mdsc;

		spin_lock(&inode->i_lock);
		if (__ceph_caps_dirty(ci))
@@ -2411,7 +2414,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
	__releases(inode->i_lock)
{
	struct ceph_inode_info *ci = ceph_inode(inode);
	struct ceph_mds_client *mdsc = &ceph_client(inode->i_sb)->mdsc;
	struct ceph_mds_client *mdsc = &ceph_sb_to_client(inode->i_sb)->mdsc;
	unsigned seq = le32_to_cpu(m->seq);
	int dirty = le32_to_cpu(m->dirty);
	int cleaned = 0;
+5 −5
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
struct dentry *ceph_finish_lookup(struct ceph_mds_request *req,
				  struct dentry *dentry, int err)
{
	struct ceph_client *client = ceph_client(dentry->d_sb);
	struct ceph_client *client = ceph_sb_to_client(dentry->d_sb);
	struct inode *parent = dentry->d_parent->d_inode;

	/* .snap dir? */
@@ -1059,7 +1059,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size,
	struct ceph_inode_info *ci = ceph_inode(inode);
	int left;

	if (!ceph_test_opt(ceph_client(inode->i_sb), DIRSTAT))
	if (!ceph_test_opt(ceph_sb_to_client(inode->i_sb), DIRSTAT))
		return -EISDIR;

	if (!cf->dir_info) {
@@ -1161,7 +1161,7 @@ void ceph_dentry_lru_add(struct dentry *dn)
	dout("dentry_lru_add %p %p '%.*s'\n", di, dn,
	     dn->d_name.len, dn->d_name.name);
	if (di) {
		mdsc = &ceph_client(dn->d_sb)->mdsc;
		mdsc = &ceph_sb_to_client(dn->d_sb)->mdsc;
		spin_lock(&mdsc->dentry_lru_lock);
		list_add_tail(&di->lru, &mdsc->dentry_lru);
		mdsc->num_dentry++;
@@ -1177,7 +1177,7 @@ void ceph_dentry_lru_touch(struct dentry *dn)
	dout("dentry_lru_touch %p %p '%.*s'\n", di, dn,
	     dn->d_name.len, dn->d_name.name);
	if (di) {
		mdsc = &ceph_client(dn->d_sb)->mdsc;
		mdsc = &ceph_sb_to_client(dn->d_sb)->mdsc;
		spin_lock(&mdsc->dentry_lru_lock);
		list_move_tail(&di->lru, &mdsc->dentry_lru);
		spin_unlock(&mdsc->dentry_lru_lock);
@@ -1192,7 +1192,7 @@ void ceph_dentry_lru_del(struct dentry *dn)
	dout("dentry_lru_del %p %p '%.*s'\n", di, dn,
	     dn->d_name.len, dn->d_name.name);
	if (di) {
		mdsc = &ceph_client(dn->d_sb)->mdsc;
		mdsc = &ceph_sb_to_client(dn->d_sb)->mdsc;
		spin_lock(&mdsc->dentry_lru_lock);
		list_del_init(&di->lru);
		mdsc->num_dentry--;
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
static struct dentry *__cfh_to_dentry(struct super_block *sb,
				      struct ceph_nfs_confh *cfh)
{
	struct ceph_mds_client *mdsc = &ceph_client(sb)->mdsc;
	struct ceph_mds_client *mdsc = &ceph_sb_to_client(sb)->mdsc;
	struct inode *inode;
	struct dentry *dentry;
	struct ceph_vino vino;
+1 −1
Original line number Diff line number Diff line
@@ -809,7 +809,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
	struct file *file = iocb->ki_filp;
	struct inode *inode = file->f_dentry->d_inode;
	struct ceph_inode_info *ci = ceph_inode(inode);
	struct ceph_osd_client *osdc = &ceph_client(inode->i_sb)->osdc;
	struct ceph_osd_client *osdc = &ceph_sb_to_client(inode->i_sb)->osdc;
	loff_t endoff = pos + iov->iov_len;
	int got = 0;
	int ret, err;
Loading