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

Commit 6e188240 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: (59 commits)
  ceph: reuse mon subscribe message instead of allocated anew
  ceph: avoid resending queued message to monitor
  ceph: Storage class should be before const qualifier
  ceph: all allocation functions should get gfp_mask
  ceph: specify max_bytes on readdir replies
  ceph: cleanup pool op strings
  ceph: Use kzalloc
  ceph: use common helper for aborted dir request invalidation
  ceph: cope with out of order (unsafe after safe) mds reply
  ceph: save peer feature bits in connection structure
  ceph: resync headers with userland
  ceph: use ceph. prefix for virtual xattrs
  ceph: throw out dirty caps metadata, data on session teardown
  ceph: attempt mds reconnect if mds closes our session
  ceph: clean up send_mds_reconnect interface
  ceph: wait for mds OPEN reply to indicate reconnect success
  ceph: only send cap releases when mds is OPEN|HUNG
  ceph: dicard cap releases on mds restart
  ceph: make mon client statfs handling more generic
  ceph: drop src address(es) from message header [new protocol feature]
  ...
parents 62a11ae3 240ed68e
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -274,7 +274,6 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
	struct ceph_osd_client *osdc = &ceph_inode_to_client(inode)->osdc;
	int rc = 0;
	struct page **pages;
	struct pagevec pvec;
	loff_t offset;
	u64 len;

@@ -297,8 +296,6 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
	if (rc < 0)
		goto out;

	/* set uptodate and add to lru in pagevec-sized chunks */
	pagevec_init(&pvec, 0);
	for (; !list_empty(page_list) && len > 0;
	     rc -= PAGE_CACHE_SIZE, len -= PAGE_CACHE_SIZE) {
		struct page *page =
@@ -312,7 +309,7 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
			zero_user_segment(page, s, PAGE_CACHE_SIZE);
		}

		if (add_to_page_cache(page, mapping, page->index, GFP_NOFS)) {
		if (add_to_page_cache_lru(page, mapping, page->index, GFP_NOFS)) {
			page_cache_release(page);
			dout("readpages %p add_to_page_cache failed %p\n",
			     inode, page);
@@ -323,10 +320,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
		flush_dcache_page(page);
		SetPageUptodate(page);
		unlock_page(page);
		if (pagevec_add(&pvec, page) == 0)
			pagevec_lru_add_file(&pvec);   /* add to lru */
		page_cache_release(page);
	}
	pagevec_lru_add_file(&pvec);
	rc = 0;

out:
@@ -568,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);
+5 −4
Original line number Diff line number Diff line
@@ -150,7 +150,8 @@ int ceph_build_auth_request(struct ceph_auth_client *ac,

	ret = ac->ops->build_request(ac, p + sizeof(u32), end);
	if (ret < 0) {
		pr_err("error %d building request\n", ret);
		pr_err("error %d building auth method %s request\n", ret,
		       ac->ops->name);
		return ret;
	}
	dout(" built request %d bytes\n", ret);
@@ -216,8 +217,8 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
		if (ac->protocol != protocol) {
			ret = ceph_auth_init_protocol(ac, protocol);
			if (ret) {
				pr_err("error %d on auth protocol %d init\n",
				       ret, protocol);
				pr_err("error %d on auth method %s init\n",
				       ret, ac->ops->name);
				goto out;
			}
		}
@@ -229,7 +230,7 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
	if (ret == -EAGAIN) {
		return ceph_build_auth_request(ac, reply_buf, reply_len);
	} else if (ret) {
		pr_err("authentication error %d\n", ret);
		pr_err("auth method '%s' error %d\n", ac->ops->name, ret);
		return ret;
	}
	return 0;
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ struct ceph_auth_client;
struct ceph_authorizer;

struct ceph_auth_client_ops {
	const char *name;

	/*
	 * true if we are authenticated and can connect to
	 * services.
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ static void ceph_auth_none_destroy_authorizer(struct ceph_auth_client *ac,
}

static const struct ceph_auth_client_ops ceph_auth_none_ops = {
	.name = "none",
	.reset = reset,
	.destroy = destroy,
	.is_authenticated = is_authenticated,
+10 −9
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
	int ret;
	char *dbuf;
	char *ticket_buf;
	u8 struct_v;
	u8 reply_struct_v;

	dbuf = kmalloc(TEMP_TICKET_BUF_LEN, GFP_NOFS);
	if (!dbuf)
@@ -139,14 +139,14 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
		goto out_dbuf;

	ceph_decode_need(&p, end, 1 + sizeof(u32), bad);
	struct_v = ceph_decode_8(&p);
	if (struct_v != 1)
	reply_struct_v = ceph_decode_8(&p);
	if (reply_struct_v != 1)
		goto bad;
	num = ceph_decode_32(&p);
	dout("%d tickets\n", num);
	while (num--) {
		int type;
		u8 struct_v;
		u8 tkt_struct_v, blob_struct_v;
		struct ceph_x_ticket_handler *th;
		void *dp, *dend;
		int dlen;
@@ -165,8 +165,8 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
		type = ceph_decode_32(&p);
		dout(" ticket type %d %s\n", type, ceph_entity_type_name(type));

		struct_v = ceph_decode_8(&p);
		if (struct_v != 1)
		tkt_struct_v = ceph_decode_8(&p);
		if (tkt_struct_v != 1)
			goto bad;

		th = get_ticket_handler(ac, type);
@@ -186,8 +186,8 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
		dend = dbuf + dlen;
		dp = dbuf;

		struct_v = ceph_decode_8(&dp);
		if (struct_v != 1)
		tkt_struct_v = ceph_decode_8(&dp);
		if (tkt_struct_v != 1)
			goto bad;

		memcpy(&old_key, &th->session_key, sizeof(old_key));
@@ -224,7 +224,7 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
		tpend = tp + dlen;
		dout(" ticket blob is %d bytes\n", dlen);
		ceph_decode_need(&tp, tpend, 1 + sizeof(u64), bad);
		struct_v = ceph_decode_8(&tp);
		blob_struct_v = ceph_decode_8(&tp);
		new_secret_id = ceph_decode_64(&tp);
		ret = ceph_decode_buffer(&new_ticket_blob, &tp, tpend);
		if (ret)
@@ -618,6 +618,7 @@ static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac,


static const struct ceph_auth_client_ops ceph_x_ops = {
	.name = "x",
	.is_authenticated = ceph_x_is_authenticated,
	.build_request = ceph_x_build_request,
	.handle_reply = ceph_x_handle_reply,
Loading