This only changes the names of things, so there is no functional change.
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
__func__);
mutex_lock(&devreq_mutex);
- if (get_bufmap_init())
+ if (orangefs_get_bufmap_init())
orangefs_bufmap_finalize();
open_access_count--;
(struct ORANGEFS_dev_map_desc __user *)
arg,
sizeof(struct ORANGEFS_dev_map_desc));
- if (get_bufmap_init()) {
+ if (orangefs_get_bufmap_init()) {
return -EINVAL;
} else {
return ret ?
readdir->dirent_array[i].d_name = buf + 4;
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)
goto Einval;
size -= len + 16;
rhandle->readdir_response.dirent_array = NULL;
if (rhandle->buffer_index >= 0) {
- readdir_index_put(bufmap, rhandle->buffer_index);
+ orangefs_readdir_index_put(bufmap, rhandle->buffer_index);
rhandle->buffer_index = -1;
}
if (rhandle->dents_buf) {
new_op->uses_shared_memory = 1;
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,
"%s: upcall.req.readdir.refn.khandle: %pU\n",
new_op->upcall.req.readdir.token = *ptoken;
get_new_buffer_index:
- ret = readdir_index_get(&bufmap, &buffer_index);
+ ret = orangefs_readdir_index_get(&bufmap, &buffer_index);
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);
goto out_free_op;
}
gossip_debug(GOSSIP_DIR_DEBUG,
"%s: Getting new buffer_index for retry of readdir..\n",
__func__);
- readdir_index_put(bufmap, buffer_index);
+ orangefs_readdir_index_put(bufmap, buffer_index);
goto get_new_buffer_index;
}
if (ret == -EIO && op_state_purged(new_op)) {
gossip_err("%s: Client is down. Aborting readdir call.\n",
__func__);
- readdir_index_put(bufmap, buffer_index);
+ orangefs_readdir_index_put(bufmap, buffer_index);
goto out_free_op;
}
gossip_debug(GOSSIP_DIR_DEBUG,
"Readdir request failed. Status:%d\n",
new_op->downcall.status);
- readdir_index_put(bufmap, buffer_index);
+ orangefs_readdir_index_put(bufmap, buffer_index);
if (ret >= 0)
ret = new_op->downcall.status;
goto out_free_op;
gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n",
ret);
ret = bytes_decoded;
- readdir_index_put(bufmap, buffer_index);
+ orangefs_readdir_index_put(bufmap, buffer_index);
goto out_free_op;
}
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
* buffer_index_array, is available. Otherwise, it is not.
*
* returns the value of bufmap_init
*/
-int get_bufmap_init(void)
+int orangefs_get_bufmap_init(void)
{
return __orangefs_bufmap ? 1 : 0;
}
}
/*
- * readdir_index_get()
+ * orangefs_readdir_index_get()
*
* gets a free descriptor, will sleep until one becomes
* available if necessary.
*
* 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 slot_args slargs;
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;
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_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,
struct iov_iter *iter,
#define ORANGEFS_MAX_DEBUG_ARRAY_LEN 0x00000800
/*
- * MAX_DIRENT_COUNT cannot be larger than ORANGEFS_REQ_LIMIT_LISTATTR.
- * The value of ORANGEFS_REQ_LIMIT_LISTATTR has been changed from 113 to 60
- * to accomodate an attribute object with mirrored handles.
- * MAX_DIRENT_COUNT is replaced by MAX_DIRENT_COUNT_READDIR and
- * MAX_DIRENT_COUNT_READDIRPLUS, since readdir doesn't trigger a listattr
- * but readdirplus might.
-*/
-#define MAX_DIRENT_COUNT_READDIR 0x00000060
-#define MAX_DIRENT_COUNT_READDIRPLUS 0x0000003C
+ * The maximum number of directory entries in a single request is 96.
+ * XXX: Why can this not be higher. The client-side code can handle up to 512.
+ * XXX: What happens if we expect more than the client can return?
+ */
+#define ORANGEFS_MAX_DIRENT_COUNT_READDIR 96
#include "upcall.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
goto retry_servicing;
/* op uses shared memory */
- if (get_bufmap_init() == 0) {
+ if (orangefs_get_bufmap_init() == 0) {
/*
* This operation uses the shared memory system AND
* the system is not yet ready. This situation occurs
"Client core in-service status(%d).\n",
is_daemon_in_service());
gossip_debug(GOSSIP_WAIT_DEBUG, "bufmap_init:%d.\n",
- get_bufmap_init());
+ orangefs_get_bufmap_init());
gossip_debug(GOSSIP_WAIT_DEBUG,
"operation's status is 0x%0x.\n",
op->op_state);
ret);
gossip_debug(GOSSIP_WAIT_DEBUG,
"Is shared memory available? (%d).\n",
- get_bufmap_init());
+ orangefs_get_bufmap_init());
spin_lock_irqsave(&op->lock, irqflags);
finish_wait(&orangefs_bufmap_init_waitq, &wait_entry);
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",
__func__,
ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS,