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

Commit f0ed4418 authored by Martin Brandenburg's avatar Martin Brandenburg Committed by Mike Marshall
Browse files

Orangefs: Remove upcall trailers which are not used.



Also removes remnants of iox (readx/writex) which previously used
trailers, but no longer exist.

Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent b5bbc843
Loading
Loading
Loading
Loading
+34 −83
Original line number Diff line number Diff line
@@ -139,20 +139,6 @@ static ssize_t pvfs2_devreq_read(struct file *file,
				cur_op = op;
				spin_lock(&cur_op->lock);
				list_del(&cur_op->list);
				cur_op->op_linger_tmp--;
				/*
				 * if there is a trailer, re-add it to
				 * the request list.
				 */
				if (cur_op->op_linger == 2 &&
				    cur_op->op_linger_tmp == 1) {
					if (cur_op->upcall.trailer_size <= 0 ||
					    cur_op->upcall.trailer_buf == NULL)
						gossip_err("BUG:trailer_size is %ld and trailer buf is %p\n", (long)cur_op->upcall.trailer_size, cur_op->upcall.trailer_buf);
					/* re-add it to the head of the list */
					list_add(&cur_op->list,
						 &pvfs2_request_list);
				}
				spin_unlock(&cur_op->lock);
				break;
			}
@@ -167,11 +153,8 @@ static ssize_t pvfs2_devreq_read(struct file *file,
			     "client-core: reading op tag %llu %s\n",
			     llu(cur_op->tag), get_opname_string(cur_op));
		if (op_state_in_progress(cur_op) || op_state_serviced(cur_op)) {
			if (cur_op->op_linger == 1)
			gossip_err("WARNING: Current op already queued...skipping\n");
		} else if (cur_op->op_linger == 1 ||
			   (cur_op->op_linger == 2 &&
			    cur_op->op_linger_tmp == 0)) {
		} else  {
			/*
			 * atomically move the operation to the
			 * htable_ops_in_progress
@@ -182,13 +165,7 @@ static ssize_t pvfs2_devreq_read(struct file *file,

		spin_unlock(&cur_op->lock);

		/* 2 cases
		 * a) OPs with no trailers
		 * b) OPs with trailers, Stage 1
		 * Either way push the upcall out
		 */
		if (cur_op->op_linger == 1 ||
		   (cur_op->op_linger == 2 && cur_op->op_linger_tmp == 1)) {
		/* Push the upcall out */
		len = MAX_ALIGNED_DEV_REQ_UPSIZE;
		if ((size_t) len <= count) {
		    ret = copy_to_user(buf,
@@ -223,31 +200,6 @@ static ssize_t pvfs2_devreq_read(struct file *file,
			    ("Failed to copy data to user space\n");
			len = -EIO;
		}
		}
		/* Stage 2: Push the trailer out */
		else if (cur_op->op_linger == 2 && cur_op->op_linger_tmp == 0) {
			len = cur_op->upcall.trailer_size;
			if ((size_t) len <= count) {
				ret = copy_to_user(buf,
						   cur_op->upcall.trailer_buf,
						   len);
				if (ret) {
					gossip_err("Failed to copy trailer to user space\n");
					len = -EFAULT;
				}
			} else {
				gossip_err("Read buffer for trailer is too small (%ld as opposed to %ld)\n",
					(long)count,
					(long)len);
				len = -EIO;
			}
		} else {
			gossip_err("cur_op: %p (op_linger %d), (op_linger_tmp %d), erroneous request list?\n",
				cur_op,
				cur_op->op_linger,
				cur_op->op_linger_tmp);
			len = 0;
		}
	} else if (file->f_flags & O_NONBLOCK) {
		/*
		 * if in non-blocking mode, return EAGAIN since no requests are
@@ -413,9 +365,8 @@ static ssize_t pvfs2_devreq_writev(struct file *file,
		 * application reading/writing this device to return until
		 * the buffers are done being used.
		 */
		if ((op->upcall.type == PVFS2_VFS_OP_FILE_IO &&
		     op->upcall.req.io.async_vfs_io == PVFS_VFS_SYNC_IO) ||
		     op->upcall.type == PVFS2_VFS_OP_FILE_IOX) {
		if (op->upcall.type == PVFS2_VFS_OP_FILE_IO &&
		    op->upcall.req.io.async_vfs_io == PVFS_VFS_SYNC_IO) {
			int timed_out = 0;
			DECLARE_WAITQUEUE(wait_entry, current);

+0 −5
Original line number Diff line number Diff line
@@ -19,10 +19,6 @@ struct pvfs2_io_response {
	__s64 amt_complete;
};

struct pvfs2_iox_response {
	__s64 amt_complete;
};

struct pvfs2_lookup_response {
	struct pvfs2_object_kref refn;
};
@@ -111,7 +107,6 @@ struct pvfs2_downcall_s {

	union {
		struct pvfs2_io_response io;
		struct pvfs2_iox_response iox;
		struct pvfs2_lookup_response lookup;
		struct pvfs2_create_response create;
		struct pvfs2_symlink_response sym;
+1 −15
Original line number Diff line number Diff line
@@ -103,13 +103,11 @@ char *get_opname_string(struct pvfs2_kernel_op_s *new_op)
			return "OP_FSYNC";
		else if (type == PVFS2_VFS_OP_FSKEY)
			return "OP_FSKEY";
		else if (type == PVFS2_VFS_OP_FILE_IOX)
			return "OP_FILE_IOX";
	}
	return "OP_UNKNOWN?";
}

static struct pvfs2_kernel_op_s *op_alloc_common(__s32 op_linger, __s32 type)
struct pvfs2_kernel_op_s *op_alloc(__s32 type)
{
	struct pvfs2_kernel_op_s *new_op = NULL;

@@ -145,24 +143,12 @@ static struct pvfs2_kernel_op_s *op_alloc_common(__s32 op_linger, __s32 type)

		new_op->upcall.gid = from_kgid(current_user_ns(),
					       current_fsgid());

		new_op->op_linger = new_op->op_linger_tmp = op_linger;
	} else {
		gossip_err("op_alloc: kmem_cache_alloc failed!\n");
	}
	return new_op;
}

struct pvfs2_kernel_op_s *op_alloc(__s32 type)
{
	return op_alloc_common(1, type);
}

struct pvfs2_kernel_op_s *op_alloc_trailer(__s32 type)
{
	return op_alloc_common(2, type);
}

void op_release(struct pvfs2_kernel_op_s *pvfs2_op)
{
	if (pvfs2_op) {
+0 −1
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@
#define PVFS2_VFS_OP_FSYNC             0xFF00EE01
#define PVFS2_VFS_OP_FSKEY             0xFF00EE02
#define PVFS2_VFS_OP_READDIRPLUS       0xFF00EE03
#define PVFS2_VFS_OP_FILE_IOX          0xFF00EE04

/*
 * Misc constants. Please retain them as multiples of 8!
+0 −14
Original line number Diff line number Diff line
@@ -279,19 +279,6 @@ struct pvfs2_kernel_op_s {
	int io_completed;
	wait_queue_head_t io_completion_waitq;

	/*
	 * upcalls requiring variable length trailers require that this struct
	 * be in the request list even after client-core does a read() on the
	 * device to dequeue the upcall.
	 * if op_linger field goes to 0, we dequeue this op off the list.
	 * else we let it stay. What gets passed to the read() is
	 * a) if op_linger field is = 1, pvfs2_kernel_op_s itself
	 * b) else if = 0, we pass ->upcall.trailer_buf
	 * We expect to have only a single upcall trailer buffer,
	 * so we expect callers with trailers
	 * to set this field to 2 and others to set it to 1.
	 */
	__s32 op_linger, op_linger_tmp;
	/* VFS aio fields */

	/* used by the async I/O code to stash the pvfs2_kiocb_s structure */
@@ -507,7 +494,6 @@ static inline int match_handle(struct pvfs2_khandle resp_handle,
int op_cache_initialize(void);
int op_cache_finalize(void);
struct pvfs2_kernel_op_s *op_alloc(__s32 type);
struct pvfs2_kernel_op_s *op_alloc_trailer(__s32 type);
char *get_opname_string(struct pvfs2_kernel_op_s *new_op);
void op_release(struct pvfs2_kernel_op_s *op);

Loading