Commit 7d221485 authored by Martin Brandenburg's avatar Martin Brandenburg Committed by Mike Marshall

orangefs: Fix some more global namespace pollution.

This only changes the names of things, so there is no functional change.
Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent c146c0b8
...@@ -600,7 +600,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file) ...@@ -600,7 +600,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
__func__); __func__);
mutex_lock(&devreq_mutex); mutex_lock(&devreq_mutex);
if (get_bufmap_init()) if (orangefs_get_bufmap_init())
orangefs_bufmap_finalize(); orangefs_bufmap_finalize();
open_access_count--; open_access_count--;
...@@ -693,7 +693,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg) ...@@ -693,7 +693,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
(struct ORANGEFS_dev_map_desc __user *) (struct ORANGEFS_dev_map_desc __user *)
arg, arg,
sizeof(struct ORANGEFS_dev_map_desc)); sizeof(struct ORANGEFS_dev_map_desc));
if (get_bufmap_init()) { if (orangefs_get_bufmap_init()) {
return -EINVAL; return -EINVAL;
} else { } else {
return ret ? return ret ?
......
...@@ -52,7 +52,11 @@ static long decode_dirents(char *ptr, size_t size, ...@@ -52,7 +52,11 @@ static long decode_dirents(char *ptr, size_t size,
readdir->dirent_array[i].d_name = buf + 4; readdir->dirent_array[i].d_name = buf + 4;
readdir->dirent_array[i].d_length = len; readdir->dirent_array[i].d_length = len;
len = roundup8(4 + len + 1); /*
* Round 4 + len + 1, which is the encoded size plus the string
* plus the null terminator to the nearest eight byte boundry.
*/
len = ((4 + len + 1) + 7) & ~7;
if (size < len + 16) if (size < len + 16)
goto Einval; goto Einval;
size -= len + 16; size -= len + 16;
...@@ -109,7 +113,7 @@ static void readdir_handle_dtor(struct orangefs_bufmap *bufmap, ...@@ -109,7 +113,7 @@ static void readdir_handle_dtor(struct orangefs_bufmap *bufmap,
rhandle->readdir_response.dirent_array = NULL; rhandle->readdir_response.dirent_array = NULL;
if (rhandle->buffer_index >= 0) { if (rhandle->buffer_index >= 0) {
readdir_index_put(bufmap, rhandle->buffer_index); orangefs_readdir_index_put(bufmap, rhandle->buffer_index);
rhandle->buffer_index = -1; rhandle->buffer_index = -1;
} }
if (rhandle->dents_buf) { if (rhandle->dents_buf) {
...@@ -175,7 +179,8 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx) ...@@ -175,7 +179,8 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
new_op->uses_shared_memory = 1; new_op->uses_shared_memory = 1;
new_op->upcall.req.readdir.refn = orangefs_inode->refn; new_op->upcall.req.readdir.refn = orangefs_inode->refn;
new_op->upcall.req.readdir.max_dirent_count = MAX_DIRENT_COUNT_READDIR; new_op->upcall.req.readdir.max_dirent_count =
ORANGEFS_MAX_DIRENT_COUNT_READDIR;
gossip_debug(GOSSIP_DIR_DEBUG, gossip_debug(GOSSIP_DIR_DEBUG,
"%s: upcall.req.readdir.refn.khandle: %pU\n", "%s: upcall.req.readdir.refn.khandle: %pU\n",
...@@ -185,9 +190,9 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx) ...@@ -185,9 +190,9 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
new_op->upcall.req.readdir.token = *ptoken; new_op->upcall.req.readdir.token = *ptoken;
get_new_buffer_index: get_new_buffer_index:
ret = readdir_index_get(&bufmap, &buffer_index); ret = orangefs_readdir_index_get(&bufmap, &buffer_index);
if (ret < 0) { if (ret < 0) {
gossip_lerr("orangefs_readdir: readdir_index_get() failure (%d)\n", gossip_lerr("orangefs_readdir: orangefs_readdir_index_get() failure (%d)\n",
ret); ret);
goto out_free_op; goto out_free_op;
} }
...@@ -211,14 +216,14 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx) ...@@ -211,14 +216,14 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
gossip_debug(GOSSIP_DIR_DEBUG, gossip_debug(GOSSIP_DIR_DEBUG,
"%s: Getting new buffer_index for retry of readdir..\n", "%s: Getting new buffer_index for retry of readdir..\n",
__func__); __func__);
readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(bufmap, buffer_index);
goto get_new_buffer_index; goto get_new_buffer_index;
} }
if (ret == -EIO && op_state_purged(new_op)) { if (ret == -EIO && op_state_purged(new_op)) {
gossip_err("%s: Client is down. Aborting readdir call.\n", gossip_err("%s: Client is down. Aborting readdir call.\n",
__func__); __func__);
readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(bufmap, buffer_index);
goto out_free_op; goto out_free_op;
} }
...@@ -226,7 +231,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx) ...@@ -226,7 +231,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
gossip_debug(GOSSIP_DIR_DEBUG, gossip_debug(GOSSIP_DIR_DEBUG,
"Readdir request failed. Status:%d\n", "Readdir request failed. Status:%d\n",
new_op->downcall.status); new_op->downcall.status);
readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(bufmap, buffer_index);
if (ret >= 0) if (ret >= 0)
ret = new_op->downcall.status; ret = new_op->downcall.status;
goto out_free_op; goto out_free_op;
...@@ -241,7 +246,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx) ...@@ -241,7 +246,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n", gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n",
ret); ret);
ret = bytes_decoded; ret = bytes_decoded;
readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(bufmap, buffer_index);
goto out_free_op; goto out_free_op;
} }
......
...@@ -115,14 +115,14 @@ static DECLARE_WAIT_QUEUE_HEAD(bufmap_waitq); ...@@ -115,14 +115,14 @@ static DECLARE_WAIT_QUEUE_HEAD(bufmap_waitq);
static DECLARE_WAIT_QUEUE_HEAD(readdir_waitq); static DECLARE_WAIT_QUEUE_HEAD(readdir_waitq);
/* /*
* get_bufmap_init * orangefs_get_bufmap_init
* *
* If bufmap_init is 1, then the shared memory system, including the * If bufmap_init is 1, then the shared memory system, including the
* buffer_index_array, is available. Otherwise, it is not. * buffer_index_array, is available. Otherwise, it is not.
* *
* returns the value of bufmap_init * returns the value of bufmap_init
*/ */
int get_bufmap_init(void) int orangefs_get_bufmap_init(void)
{ {
return __orangefs_bufmap ? 1 : 0; return __orangefs_bufmap ? 1 : 0;
} }
...@@ -473,7 +473,7 @@ void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index) ...@@ -473,7 +473,7 @@ void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index)
} }
/* /*
* readdir_index_get() * orangefs_readdir_index_get()
* *
* gets a free descriptor, will sleep until one becomes * gets a free descriptor, will sleep until one becomes
* available if necessary. * available if necessary.
...@@ -483,7 +483,7 @@ void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index) ...@@ -483,7 +483,7 @@ void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index)
* *
* returns 0 on success, -errno on failure * returns 0 on success, -errno on failure
*/ */
int readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index) int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
{ {
struct orangefs_bufmap *bufmap = orangefs_bufmap_ref(); struct orangefs_bufmap *bufmap = orangefs_bufmap_ref();
struct slot_args slargs; struct slot_args slargs;
...@@ -505,7 +505,7 @@ int readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index) ...@@ -505,7 +505,7 @@ int readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
return ret; return ret;
} }
void readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index) void orangefs_readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index)
{ {
struct slot_args slargs; struct slot_args slargs;
......
...@@ -15,7 +15,7 @@ int orangefs_bufmap_shift_query(void); ...@@ -15,7 +15,7 @@ int orangefs_bufmap_shift_query(void);
int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc); int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc);
int get_bufmap_init(void); int orangefs_get_bufmap_init(void);
void orangefs_bufmap_finalize(void); void orangefs_bufmap_finalize(void);
...@@ -23,9 +23,9 @@ int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index); ...@@ -23,9 +23,9 @@ int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index);
void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index); void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index);
int readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index); int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index);
void readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index); void orangefs_readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index);
int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
struct iov_iter *iter, struct iov_iter *iter,
......
...@@ -51,35 +51,13 @@ ...@@ -51,35 +51,13 @@
#define ORANGEFS_MAX_DEBUG_ARRAY_LEN 0x00000800 #define ORANGEFS_MAX_DEBUG_ARRAY_LEN 0x00000800
/* /*
* MAX_DIRENT_COUNT cannot be larger than ORANGEFS_REQ_LIMIT_LISTATTR. * The maximum number of directory entries in a single request is 96.
* The value of ORANGEFS_REQ_LIMIT_LISTATTR has been changed from 113 to 60 * XXX: Why can this not be higher. The client-side code can handle up to 512.
* to accomodate an attribute object with mirrored handles. * XXX: What happens if we expect more than the client can return?
* MAX_DIRENT_COUNT is replaced by MAX_DIRENT_COUNT_READDIR and */
* MAX_DIRENT_COUNT_READDIRPLUS, since readdir doesn't trigger a listattr #define ORANGEFS_MAX_DIRENT_COUNT_READDIR 96
* but readdirplus might.
*/
#define MAX_DIRENT_COUNT_READDIR 0x00000060
#define MAX_DIRENT_COUNT_READDIRPLUS 0x0000003C
#include "upcall.h" #include "upcall.h"
#include "downcall.h" #include "downcall.h"
/*
* These macros differ from proto macros in that they don't do any
* byte-swappings and are used to ensure that kernel-clientcore interactions
* don't cause any unaligned accesses etc on 64 bit machines
*/
#ifndef roundup4
#define roundup4(x) (((x)+3) & ~3)
#endif
#ifndef roundup8
#define roundup8(x) (((x)+7) & ~7)
#endif
struct read_write_x {
__s64 off;
__s64 len;
};
#endif #endif
...@@ -180,7 +180,7 @@ int service_operation(struct orangefs_kernel_op_s *op, ...@@ -180,7 +180,7 @@ int service_operation(struct orangefs_kernel_op_s *op,
goto retry_servicing; goto retry_servicing;
/* op uses shared memory */ /* op uses shared memory */
if (get_bufmap_init() == 0) { if (orangefs_get_bufmap_init() == 0) {
/* /*
* This operation uses the shared memory system AND * This operation uses the shared memory system AND
* the system is not yet ready. This situation occurs * the system is not yet ready. This situation occurs
...@@ -194,7 +194,7 @@ int service_operation(struct orangefs_kernel_op_s *op, ...@@ -194,7 +194,7 @@ int service_operation(struct orangefs_kernel_op_s *op,
"Client core in-service status(%d).\n", "Client core in-service status(%d).\n",
is_daemon_in_service()); is_daemon_in_service());
gossip_debug(GOSSIP_WAIT_DEBUG, "bufmap_init:%d.\n", gossip_debug(GOSSIP_WAIT_DEBUG, "bufmap_init:%d.\n",
get_bufmap_init()); orangefs_get_bufmap_init());
gossip_debug(GOSSIP_WAIT_DEBUG, gossip_debug(GOSSIP_WAIT_DEBUG,
"operation's status is 0x%0x.\n", "operation's status is 0x%0x.\n",
op->op_state); op->op_state);
...@@ -222,13 +222,13 @@ int service_operation(struct orangefs_kernel_op_s *op, ...@@ -222,13 +222,13 @@ int service_operation(struct orangefs_kernel_op_s *op,
ret); ret);
gossip_debug(GOSSIP_WAIT_DEBUG, gossip_debug(GOSSIP_WAIT_DEBUG,
"Is shared memory available? (%d).\n", "Is shared memory available? (%d).\n",
get_bufmap_init()); orangefs_get_bufmap_init());
spin_lock_irqsave(&op->lock, irqflags); spin_lock_irqsave(&op->lock, irqflags);
finish_wait(&orangefs_bufmap_init_waitq, &wait_entry); finish_wait(&orangefs_bufmap_init_waitq, &wait_entry);
spin_unlock_irqrestore(&op->lock, irqflags); spin_unlock_irqrestore(&op->lock, irqflags);
if (get_bufmap_init() == 0) { if (orangefs_get_bufmap_init() == 0) {
gossip_err("%s:The shared memory system has not started in %d seconds after the client core restarted. Aborting user's request(%s).\n", gossip_err("%s:The shared memory system has not started in %d seconds after the client core restarted. Aborting user's request(%s).\n",
__func__, __func__,
ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS, ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS,
......
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