orangefs: Fix some more global namespace pollution.
authorMartin Brandenburg <martin@omnibond.com>
Mon, 4 Jan 2016 20:05:28 +0000 (15:05 -0500)
committerMike Marshall <hubcap@omnibond.com>
Mon, 4 Jan 2016 21:21:46 +0000 (16:21 -0500)
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>
fs/orangefs/devorangefs-req.c
fs/orangefs/dir.c
fs/orangefs/orangefs-bufmap.c
fs/orangefs/orangefs-bufmap.h
fs/orangefs/orangefs-dev-proto.h
fs/orangefs/waitqueue.c

index 5a9c53eb115f7496daa5adf6ff769d2acb61a2a0..e3bb15e344ed3e90769e50cc9da311ff663cae83 100644 (file)
@@ -600,7 +600,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
                     __func__);
 
        mutex_lock(&devreq_mutex);
-       if (get_bufmap_init())
+       if (orangefs_get_bufmap_init())
                orangefs_bufmap_finalize();
 
        open_access_count--;
@@ -693,7 +693,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
                                     (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 ?
index c043894fc2bd8f337da5e8e68c53cb3707d15d7f..58558e37fb8ab9ab09ab168fb4a7deb002d26ed3 100644 (file)
@@ -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_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;
@@ -109,7 +113,7 @@ static void readdir_handle_dtor(struct orangefs_bufmap *bufmap,
        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) {
@@ -175,7 +179,8 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
 
        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",
@@ -185,9 +190,9 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
        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;
        }
@@ -211,14 +216,14 @@ get_new_buffer_index:
                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;
        }
 
@@ -226,7 +231,7 @@ get_new_buffer_index:
                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;
@@ -241,7 +246,7 @@ get_new_buffer_index:
                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;
        }
 
index 888aa28136ee094fa0823c422e44b447e97686e8..15baecb8094d6415dc9f6d950ad0eec57b3ae4c8 100644 (file)
@@ -115,14 +115,14 @@ static DECLARE_WAIT_QUEUE_HEAD(bufmap_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
  * 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;
 }
@@ -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
  * available if necessary.
@@ -483,7 +483,7 @@ void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index)
  *
  * 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;
@@ -505,7 +505,7 @@ int readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
        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;
 
index 112ec33a1b862d0b419599b074d8ff3e97cc0c0a..dff55e2857c5ca0fa76da1c6c5f50f0e12047594 100644 (file)
@@ -15,7 +15,7 @@ int orangefs_bufmap_shift_query(void);
 
 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);
 
@@ -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);
 
-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,
index dc1951dd7045fe9b537da01bac8c6b266d0d7c5c..5a8725a88eacac0fe4454575e5ef5e642c81c3fc 100644 (file)
 #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
index e1415e3882ba527a6932d5a175b31556d4a7b862..751c3c640a52c6913c0243a4b07840a8551abd36 100644 (file)
@@ -180,7 +180,7 @@ retry_servicing:
                        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
@@ -194,7 +194,7 @@ retry_servicing:
                                     "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);
@@ -222,13 +222,13 @@ retry_servicing:
                                     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,