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

Commit 3568bd97 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: do not use i_wrbuffer_ref as refcount for Fb cap
  ceph: fix list_add in ceph_put_snap_realm
  ceph: print debug message before put mds session
parents fad63209 d3d0720d
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -819,7 +819,7 @@ int __ceph_caps_used(struct ceph_inode_info *ci)
		used |= CEPH_CAP_FILE_CACHE;
		used |= CEPH_CAP_FILE_CACHE;
	if (ci->i_wr_ref)
	if (ci->i_wr_ref)
		used |= CEPH_CAP_FILE_WR;
		used |= CEPH_CAP_FILE_WR;
	if (ci->i_wrbuffer_ref)
	if (ci->i_wb_ref || ci->i_wrbuffer_ref)
		used |= CEPH_CAP_FILE_BUFFER;
		used |= CEPH_CAP_FILE_BUFFER;
	return used;
	return used;
}
}
@@ -1990,11 +1990,11 @@ static void __take_cap_refs(struct ceph_inode_info *ci, int got)
	if (got & CEPH_CAP_FILE_WR)
	if (got & CEPH_CAP_FILE_WR)
		ci->i_wr_ref++;
		ci->i_wr_ref++;
	if (got & CEPH_CAP_FILE_BUFFER) {
	if (got & CEPH_CAP_FILE_BUFFER) {
		if (ci->i_wrbuffer_ref == 0)
		if (ci->i_wb_ref == 0)
			ihold(&ci->vfs_inode);
			ihold(&ci->vfs_inode);
		ci->i_wrbuffer_ref++;
		ci->i_wb_ref++;
		dout("__take_cap_refs %p wrbuffer %d -> %d (?)\n",
		dout("__take_cap_refs %p wb %d -> %d (?)\n",
		     &ci->vfs_inode, ci->i_wrbuffer_ref-1, ci->i_wrbuffer_ref);
		     &ci->vfs_inode, ci->i_wb_ref-1, ci->i_wb_ref);
	}
	}
}
}


@@ -2169,12 +2169,12 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
		if (--ci->i_rdcache_ref == 0)
		if (--ci->i_rdcache_ref == 0)
			last++;
			last++;
	if (had & CEPH_CAP_FILE_BUFFER) {
	if (had & CEPH_CAP_FILE_BUFFER) {
		if (--ci->i_wrbuffer_ref == 0) {
		if (--ci->i_wb_ref == 0) {
			last++;
			last++;
			put++;
			put++;
		}
		}
		dout("put_cap_refs %p wrbuffer %d -> %d (?)\n",
		dout("put_cap_refs %p wb %d -> %d (?)\n",
		     inode, ci->i_wrbuffer_ref+1, ci->i_wrbuffer_ref);
		     inode, ci->i_wb_ref+1, ci->i_wb_ref);
	}
	}
	if (had & CEPH_CAP_FILE_WR)
	if (had & CEPH_CAP_FILE_WR)
		if (--ci->i_wr_ref == 0) {
		if (--ci->i_wr_ref == 0) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -355,6 +355,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
	ci->i_rd_ref = 0;
	ci->i_rd_ref = 0;
	ci->i_rdcache_ref = 0;
	ci->i_rdcache_ref = 0;
	ci->i_wr_ref = 0;
	ci->i_wr_ref = 0;
	ci->i_wb_ref = 0;
	ci->i_wrbuffer_ref = 0;
	ci->i_wrbuffer_ref = 0;
	ci->i_wrbuffer_ref_head = 0;
	ci->i_wrbuffer_ref_head = 0;
	ci->i_shared_gen = 0;
	ci->i_shared_gen = 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -3304,8 +3304,8 @@ static void con_put(struct ceph_connection *con)
{
{
	struct ceph_mds_session *s = con->private;
	struct ceph_mds_session *s = con->private;


	dout("mdsc con_put %p (%d)\n", s, atomic_read(&s->s_ref) - 1);
	ceph_put_mds_session(s);
	ceph_put_mds_session(s);
	dout("mdsc con_put %p (%d)\n", s, atomic_read(&s->s_ref));
}
}


/*
/*
+1 −1
Original line number Original line Diff line number Diff line
@@ -206,7 +206,7 @@ void ceph_put_snap_realm(struct ceph_mds_client *mdsc,
		up_write(&mdsc->snap_rwsem);
		up_write(&mdsc->snap_rwsem);
	} else {
	} else {
		spin_lock(&mdsc->snap_empty_lock);
		spin_lock(&mdsc->snap_empty_lock);
		list_add(&mdsc->snap_empty, &realm->empty_item);
		list_add(&realm->empty_item, &mdsc->snap_empty);
		spin_unlock(&mdsc->snap_empty_lock);
		spin_unlock(&mdsc->snap_empty_lock);
	}
	}
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -293,7 +293,7 @@ struct ceph_inode_info {


	/* held references to caps */
	/* held references to caps */
	int i_pin_ref;
	int i_pin_ref;
	int i_rd_ref, i_rdcache_ref, i_wr_ref;
	int i_rd_ref, i_rdcache_ref, i_wr_ref, i_wb_ref;
	int i_wrbuffer_ref, i_wrbuffer_ref_head;
	int i_wrbuffer_ref, i_wrbuffer_ref_head;
	u32 i_shared_gen;       /* increment each time we get FILE_SHARED */
	u32 i_shared_gen;       /* increment each time we get FILE_SHARED */
	u32 i_rdcache_gen;      /* incremented each time we get FILE_CACHE. */
	u32 i_rdcache_gen;      /* incremented each time we get FILE_CACHE. */