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

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
...@@ -139,20 +139,6 @@ static ssize_t pvfs2_devreq_read(struct file *file, ...@@ -139,20 +139,6 @@ static ssize_t pvfs2_devreq_read(struct file *file,
cur_op = op; cur_op = op;
spin_lock(&cur_op->lock); spin_lock(&cur_op->lock);
list_del(&cur_op->list); 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); spin_unlock(&cur_op->lock);
break; break;
} }
...@@ -167,11 +153,8 @@ static ssize_t pvfs2_devreq_read(struct file *file, ...@@ -167,11 +153,8 @@ static ssize_t pvfs2_devreq_read(struct file *file,
"client-core: reading op tag %llu %s\n", "client-core: reading op tag %llu %s\n",
llu(cur_op->tag), get_opname_string(cur_op)); llu(cur_op->tag), get_opname_string(cur_op));
if (op_state_in_progress(cur_op) || op_state_serviced(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");
gossip_err("WARNING: Current op already queued...skipping\n"); } else {
} else if (cur_op->op_linger == 1 ||
(cur_op->op_linger == 2 &&
cur_op->op_linger_tmp == 0)) {
/* /*
* atomically move the operation to the * atomically move the operation to the
* htable_ops_in_progress * htable_ops_in_progress
...@@ -182,71 +165,40 @@ static ssize_t pvfs2_devreq_read(struct file *file, ...@@ -182,71 +165,40 @@ static ssize_t pvfs2_devreq_read(struct file *file,
spin_unlock(&cur_op->lock); spin_unlock(&cur_op->lock);
/* 2 cases /* Push the upcall out */
* a) OPs with no trailers len = MAX_ALIGNED_DEV_REQ_UPSIZE;
* b) OPs with trailers, Stage 1 if ((size_t) len <= count) {
* Either way push the upcall out ret = copy_to_user(buf,
*/ &proto_ver,
if (cur_op->op_linger == 1 || sizeof(__s32));
(cur_op->op_linger == 2 && cur_op->op_linger_tmp == 1)) { if (ret == 0) {
len = MAX_ALIGNED_DEV_REQ_UPSIZE; ret = copy_to_user(buf + sizeof(__s32),
if ((size_t) len <= count) { &magic,
ret = copy_to_user(buf, sizeof(__s32));
&proto_ver, if (ret == 0) {
sizeof(__s32)); ret = copy_to_user(buf+2 * sizeof(__s32),
&cur_op->tag,
sizeof(__u64));
if (ret == 0) { if (ret == 0) {
ret = copy_to_user(buf + sizeof(__s32), ret = copy_to_user(
&magic, buf +
sizeof(__s32)); 2 *
if (ret == 0) { sizeof(__s32) +
ret = copy_to_user(buf+2 * sizeof(__s32), sizeof(__u64),
&cur_op->tag, &cur_op->upcall,
sizeof(__u64)); sizeof(struct pvfs2_upcall_s));
if (ret == 0) {
ret = copy_to_user(
buf +
2 *
sizeof(__s32) +
sizeof(__u64),
&cur_op->upcall,
sizeof(struct pvfs2_upcall_s));
}
}
}
if (ret) {
gossip_err("Failed to copy data to user space\n");
len = -EFAULT;
} }
} else {
gossip_err
("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;
} }
}
if (ret) {
gossip_err("Failed to copy data to user space\n");
len = -EFAULT;
}
} else { } else {
gossip_err("cur_op: %p (op_linger %d), (op_linger_tmp %d), erroneous request list?\n", gossip_err
cur_op, ("Failed to copy data to user space\n");
cur_op->op_linger, len = -EIO;
cur_op->op_linger_tmp);
len = 0;
} }
} else if (file->f_flags & O_NONBLOCK) { } else if (file->f_flags & O_NONBLOCK) {
/* /*
...@@ -413,9 +365,8 @@ static ssize_t pvfs2_devreq_writev(struct file *file, ...@@ -413,9 +365,8 @@ static ssize_t pvfs2_devreq_writev(struct file *file,
* application reading/writing this device to return until * application reading/writing this device to return until
* the buffers are done being used. * the buffers are done being used.
*/ */
if ((op->upcall.type == PVFS2_VFS_OP_FILE_IO && if (op->upcall.type == PVFS2_VFS_OP_FILE_IO &&
op->upcall.req.io.async_vfs_io == PVFS_VFS_SYNC_IO) || op->upcall.req.io.async_vfs_io == PVFS_VFS_SYNC_IO) {
op->upcall.type == PVFS2_VFS_OP_FILE_IOX) {
int timed_out = 0; int timed_out = 0;
DECLARE_WAITQUEUE(wait_entry, current); DECLARE_WAITQUEUE(wait_entry, current);
......
...@@ -19,10 +19,6 @@ struct pvfs2_io_response { ...@@ -19,10 +19,6 @@ struct pvfs2_io_response {
__s64 amt_complete; __s64 amt_complete;
}; };
struct pvfs2_iox_response {
__s64 amt_complete;
};
struct pvfs2_lookup_response { struct pvfs2_lookup_response {
struct pvfs2_object_kref refn; struct pvfs2_object_kref refn;
}; };
...@@ -111,7 +107,6 @@ struct pvfs2_downcall_s { ...@@ -111,7 +107,6 @@ struct pvfs2_downcall_s {
union { union {
struct pvfs2_io_response io; struct pvfs2_io_response io;
struct pvfs2_iox_response iox;
struct pvfs2_lookup_response lookup; struct pvfs2_lookup_response lookup;
struct pvfs2_create_response create; struct pvfs2_create_response create;
struct pvfs2_symlink_response sym; struct pvfs2_symlink_response sym;
......
...@@ -103,13 +103,11 @@ char *get_opname_string(struct pvfs2_kernel_op_s *new_op) ...@@ -103,13 +103,11 @@ char *get_opname_string(struct pvfs2_kernel_op_s *new_op)
return "OP_FSYNC"; return "OP_FSYNC";
else if (type == PVFS2_VFS_OP_FSKEY) else if (type == PVFS2_VFS_OP_FSKEY)
return "OP_FSKEY"; return "OP_FSKEY";
else if (type == PVFS2_VFS_OP_FILE_IOX)
return "OP_FILE_IOX";
} }
return "OP_UNKNOWN?"; 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; 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) ...@@ -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(), new_op->upcall.gid = from_kgid(current_user_ns(),
current_fsgid()); current_fsgid());
new_op->op_linger = new_op->op_linger_tmp = op_linger;
} else { } else {
gossip_err("op_alloc: kmem_cache_alloc failed!\n"); gossip_err("op_alloc: kmem_cache_alloc failed!\n");
} }
return new_op; 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) void op_release(struct pvfs2_kernel_op_s *pvfs2_op)
{ {
if (pvfs2_op) { if (pvfs2_op) {
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#define PVFS2_VFS_OP_FSYNC 0xFF00EE01 #define PVFS2_VFS_OP_FSYNC 0xFF00EE01
#define PVFS2_VFS_OP_FSKEY 0xFF00EE02 #define PVFS2_VFS_OP_FSKEY 0xFF00EE02
#define PVFS2_VFS_OP_READDIRPLUS 0xFF00EE03 #define PVFS2_VFS_OP_READDIRPLUS 0xFF00EE03
#define PVFS2_VFS_OP_FILE_IOX 0xFF00EE04
/* /*
* Misc constants. Please retain them as multiples of 8! * Misc constants. Please retain them as multiples of 8!
......
...@@ -279,19 +279,6 @@ struct pvfs2_kernel_op_s { ...@@ -279,19 +279,6 @@ struct pvfs2_kernel_op_s {
int io_completed; int io_completed;
wait_queue_head_t io_completion_waitq; 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 */ /* VFS aio fields */
/* used by the async I/O code to stash the pvfs2_kiocb_s structure */ /* 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, ...@@ -507,7 +494,6 @@ static inline int match_handle(struct pvfs2_khandle resp_handle,
int op_cache_initialize(void); int op_cache_initialize(void);
int op_cache_finalize(void); int op_cache_finalize(void);
struct pvfs2_kernel_op_s *op_alloc(__s32 type); 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); char *get_opname_string(struct pvfs2_kernel_op_s *new_op);
void op_release(struct pvfs2_kernel_op_s *op); void op_release(struct pvfs2_kernel_op_s *op);
......
...@@ -23,14 +23,6 @@ struct pvfs2_io_request_s { ...@@ -23,14 +23,6 @@ struct pvfs2_io_request_s {
__s32 readahead_size; __s32 readahead_size;
}; };
struct pvfs2_iox_request_s {
__s32 buf_index;
__s32 count;
struct pvfs2_object_kref refn;
enum PVFS_io_type io_type;
__s32 __pad1;
};
struct pvfs2_lookup_request_s { struct pvfs2_lookup_request_s {
__s32 sym_follow; __s32 sym_follow;
__s32 __pad1; __s32 __pad1;
...@@ -218,13 +210,12 @@ struct pvfs2_upcall_s { ...@@ -218,13 +210,12 @@ struct pvfs2_upcall_s {
__u32 gid; __u32 gid;
int pid; int pid;
int tgid; int tgid;
/* currently trailer is used only by readx/writex (iox) */ /* Trailers unused but must be retained for protocol compatibility. */
__s64 trailer_size; __s64 trailer_size;
char *trailer_buf; char *trailer_buf;
union { union {
struct pvfs2_io_request_s io; struct pvfs2_io_request_s io;
struct pvfs2_iox_request_s iox;
struct pvfs2_lookup_request_s lookup; struct pvfs2_lookup_request_s lookup;
struct pvfs2_create_request_s create; struct pvfs2_create_request_s create;
struct pvfs2_symlink_request_s sym; struct pvfs2_symlink_request_s sym;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment