]> git.karo-electronics.de Git - linux-beck.git/commitdiff
orangefs: Remove ``aligned'' upcall and downcall length macros.
authorMartin Brandenburg <martin@omnibond.com>
Tue, 15 Dec 2015 19:22:06 +0000 (14:22 -0500)
committerMike Marshall <hubcap@omnibond.com>
Thu, 17 Dec 2015 19:33:38 +0000 (14:33 -0500)
There was previously MAX_ALIGNED_DEV_REQ_(UP|DOWN)SIZE macros which
evaluated to MAX_DEV_REQ_(UP|DOWN)SIZE+8. As it is unclear what this is
for, other than creating a situation where we accept more data than we
can parse, it is removed.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
fs/orangefs/devorangefs-req.c
fs/orangefs/orangefs-cache.c
fs/orangefs/orangefs-kernel.h

index 4d7ab7cb08f7e72d48d768253a4c9ffdd51469b3..5a9c53eb115f7496daa5adf6ff769d2acb61a2a0 100644 (file)
@@ -120,10 +120,10 @@ static ssize_t orangefs_devreq_read(struct file *file,
        }
 
        /*
-        * The client will do an ioctl to find MAX_ALIGNED_DEV_REQ_UPSIZE, then
+        * The client will do an ioctl to find MAX_DEV_REQ_UPSIZE, then
         * always read with that size buffer.
         */
-       if (count != MAX_ALIGNED_DEV_REQ_UPSIZE) {
+       if (count != MAX_DEV_REQ_UPSIZE) {
                gossip_err("orangefs: client-core tried to read wrong size\n");
                return -EINVAL;
        }
@@ -226,7 +226,7 @@ static ssize_t orangefs_devreq_read(struct file *file,
                goto error;
 
        /* The client only asks to read one size buffer. */
-       return MAX_ALIGNED_DEV_REQ_UPSIZE;
+       return MAX_DEV_REQ_UPSIZE;
 error:
        /*
         * We were unable to copy the op data to the client. Put the op back in
@@ -258,7 +258,7 @@ static ssize_t orangefs_devreq_writev(struct file *file,
        void *buffer = NULL;
        void *ptr = NULL;
        unsigned long i = 0;
-       int num_remaining = MAX_ALIGNED_DEV_REQ_DOWNSIZE;
+       int num_remaining = MAX_DEV_REQ_DOWNSIZE;
        int ret = 0;
        /* num elements in iovec without trailer */
        int notrailer_count = 4;
@@ -661,8 +661,8 @@ static inline long check_ioctl_command(unsigned int command)
 static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
 {
        static __s32 magic = ORANGEFS_DEVREQ_MAGIC;
-       static __s32 max_up_size = MAX_ALIGNED_DEV_REQ_UPSIZE;
-       static __s32 max_down_size = MAX_ALIGNED_DEV_REQ_DOWNSIZE;
+       static __s32 max_up_size = MAX_DEV_REQ_UPSIZE;
+       static __s32 max_down_size = MAX_DEV_REQ_DOWNSIZE;
        struct ORANGEFS_dev_map_desc user_desc;
        int ret = 0;
        struct dev_mask_info_s mask_info = { 0 };
index 57e270246e3d9ed40bbccb99324481371b71e3dd..b40f5d74aa977d20cda4273d1fe0d3cc4842bf7e 100644 (file)
@@ -166,7 +166,7 @@ void op_release(struct orangefs_kernel_op_s *orangefs_op)
 int dev_req_cache_initialize(void)
 {
        dev_req_cache = kmem_cache_create("orangefs_devreqcache",
-                                         MAX_ALIGNED_DEV_REQ_DOWNSIZE,
+                                         MAX_DEV_REQ_DOWNSIZE,
                                          0,
                                          ORANGEFS_CACHE_CREATE_FLAGS,
                                          NULL);
@@ -192,7 +192,7 @@ void *dev_req_alloc(void)
        if (buffer == NULL)
                gossip_err("Failed to allocate from dev_req_cache\n");
        else
-               memset(buffer, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE));
+               memset(buffer, 0, sizeof(MAX_DEV_REQ_DOWNSIZE));
        return buffer;
 }
 
index 840872389fc5a1c03fa05ab290418352e8de7e6d..c337a52eb63940f4943a360a1bdc869212abcf51 100644 (file)
@@ -80,29 +80,11 @@ sizeof(__u64) + sizeof(struct orangefs_upcall_s))
 #define MAX_DEV_REQ_DOWNSIZE (2*sizeof(__s32) + \
 sizeof(__u64) + sizeof(struct orangefs_downcall_s))
 
-#define BITS_PER_LONG_DIV_8 (BITS_PER_LONG >> 3)
-
 /* borrowed from irda.h */
 #ifndef MSECS_TO_JIFFIES
 #define MSECS_TO_JIFFIES(ms) (((ms)*HZ+999)/1000)
 #endif
 
-#define MAX_ALIGNED_DEV_REQ_UPSIZE                             \
-               (MAX_DEV_REQ_UPSIZE +                           \
-                       ((((MAX_DEV_REQ_UPSIZE /                \
-                               (BITS_PER_LONG_DIV_8)) *        \
-                               (BITS_PER_LONG_DIV_8)) +        \
-                           (BITS_PER_LONG_DIV_8)) -            \
-                       MAX_DEV_REQ_UPSIZE))
-
-#define MAX_ALIGNED_DEV_REQ_DOWNSIZE                           \
-               (MAX_DEV_REQ_DOWNSIZE +                         \
-                       ((((MAX_DEV_REQ_DOWNSIZE /              \
-                               (BITS_PER_LONG_DIV_8)) *        \
-                               (BITS_PER_LONG_DIV_8)) +        \
-                           (BITS_PER_LONG_DIV_8)) -            \
-                       MAX_DEV_REQ_DOWNSIZE))
-
 /*
  * valid orangefs kernel operation states
  *