]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
authorMike Marshall <hubcap@omnibond.com>
Sat, 25 Feb 2017 16:12:48 +0000 (11:12 -0500)
committerMike Marshall <hubcap@omnibond.com>
Sat, 25 Feb 2017 16:12:48 +0000 (11:12 -0500)
Linux 4.10

fs/orangefs/devorangefs-req.c
fs/orangefs/inode.c
fs/orangefs/orangefs-bufmap.c
fs/orangefs/orangefs-debugfs.c
fs/orangefs/orangefs-dev-proto.h
fs/orangefs/orangefs-kernel.h
fs/orangefs/orangefs-mod.c
fs/orangefs/orangefs-sysfs.c
fs/orangefs/upcall.h

index b0ced669427e154cc67c7b4b4f9e4630f934919f..c4ab6fdf17a01426db5d6e2bb9638130147bee61 100644 (file)
@@ -400,8 +400,9 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
        /* remove the op from the in progress hash table */
        op = orangefs_devreq_remove_op(head.tag);
        if (!op) {
-               gossip_err("WARNING: No one's waiting for tag %llu\n",
-                          llu(head.tag));
+               gossip_debug(GOSSIP_DEV_DEBUG,
+                            "%s: No one's waiting for tag %llu\n",
+                            __func__, llu(head.tag));
                return ret;
        }
 
index 551bc74ed2b822fe0f211d90527397da2d86bb38..5cd617980fbfa2a38d8d08ac4017bae67679bd16 100644 (file)
@@ -136,12 +136,6 @@ static ssize_t orangefs_direct_IO(struct kiocb *iocb,
        return -EINVAL;
 }
 
-struct backing_dev_info orangefs_backing_dev_info = {
-       .name = "orangefs",
-       .ra_pages = 0,
-       .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
-};
-
 /** ORANGEFS2 implementation of address space operations */
 const struct address_space_operations orangefs_address_operations = {
        .readpage = orangefs_readpage,
index 75375e90a63f32e4bac0ef3e996c960c673b250e..6333cbbdfef7ae652c1a4e6c4d2818ae1cd188d7 100644 (file)
@@ -344,6 +344,11 @@ int orangefs_bufmap_initialize(struct ORANGEFS_dev_map_desc *user_desc)
                     user_desc->size,
                     user_desc->count);
 
+       if (user_desc->total_size < 0 ||
+           user_desc->size < 0 ||
+           user_desc->count < 0)
+               goto out;
+
        /*
         * sanity check alignment and size of buffer that caller wants to
         * work with
index 27e75cf28b3a0c386c645bf714975c4772e14866..791912da97d7487d99c618ce8ac6f5fbe3cd11fb 100644 (file)
@@ -967,13 +967,13 @@ int orangefs_debugfs_new_client_string(void __user *arg)
        int ret;
 
        ret = copy_from_user(&client_debug_array_string,
-                                     (void __user *)arg,
-                                     ORANGEFS_MAX_DEBUG_STRING_LEN);
+                            (void __user *)arg,
+                            ORANGEFS_MAX_DEBUG_STRING_LEN);
 
        if (ret != 0) {
                pr_info("%s: CLIENT_STRING: copy_from_user failed\n",
                        __func__);
-               return -EIO;
+               return -EFAULT;
        }
 
        /*
@@ -988,17 +988,18 @@ int orangefs_debugfs_new_client_string(void __user *arg)
         */
        client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN - 1] =
                '\0';
-       
+
        pr_info("%s: client debug array string has been received.\n",
                __func__);
 
        if (!help_string_initialized) {
 
                /* Build a proper debug help string. */
-               if (orangefs_prepare_debugfs_help_string(0)) {
+               ret = orangefs_prepare_debugfs_help_string(0);
+               if (ret) {
                        gossip_err("%s: no debug help string \n",
                                   __func__);
-                       return -EIO;
+                       return ret;
                }
 
        }
@@ -1011,7 +1012,7 @@ int orangefs_debugfs_new_client_string(void __user *arg)
 
        help_string_initialized++;
 
-       return ret;
+       return 0;
 }
 
 int orangefs_debugfs_new_debug(void __user *arg) 
index a3d84ffee9050a33532f3927ce9750937f27e22f..f380f9ed1b286a7eedfb41fa5f7f8f9259abfdf3 100644 (file)
@@ -50,8 +50,7 @@
  * Misc constants. Please retain them as multiples of 8!
  * Otherwise 32-64 bit interactions will be messed up :)
  */
-#define ORANGEFS_MAX_DEBUG_STRING_LEN  0x00000400
-#define ORANGEFS_MAX_DEBUG_ARRAY_LEN   0x00000800
+#define ORANGEFS_MAX_DEBUG_STRING_LEN  0x00000800
 
 /*
  * The maximum number of directory entries in a single request is 96.
index 3bf803d732c5b3702f735c5776cae6d249b85364..70355a9a25969bb681612cee734cf4341afd2428 100644 (file)
@@ -529,7 +529,6 @@ extern spinlock_t orangefs_htable_ops_in_progress_lock;
 extern int hash_table_size;
 
 extern const struct address_space_operations orangefs_address_operations;
-extern struct backing_dev_info orangefs_backing_dev_info;
 extern const struct inode_operations orangefs_file_inode_operations;
 extern const struct file_operations orangefs_file_operations;
 extern const struct inode_operations orangefs_symlink_inode_operations;
index 4113eb0495bf90549daca478dd0f8c5a7940680a..c1b5174cb5a9fd5fa0963c22478f1457503e6657 100644 (file)
@@ -80,11 +80,6 @@ static int __init orangefs_init(void)
        int ret = -1;
        __u32 i = 0;
 
-       ret = bdi_init(&orangefs_backing_dev_info);
-
-       if (ret)
-               return ret;
-
        if (op_timeout_secs < 0)
                op_timeout_secs = 0;
 
@@ -94,7 +89,7 @@ static int __init orangefs_init(void)
        /* initialize global book keeping data structures */
        ret = op_cache_initialize();
        if (ret < 0)
-               goto err;
+               goto out;
 
        ret = orangefs_inode_cache_initialize();
        if (ret < 0)
@@ -181,9 +176,6 @@ cleanup_inode:
 cleanup_op:
        op_cache_finalize();
 
-err:
-       bdi_destroy(&orangefs_backing_dev_info);
-
 out:
        return ret;
 }
@@ -207,8 +199,6 @@ static void __exit orangefs_exit(void)
 
        kfree(orangefs_htable_ops_in_progress);
 
-       bdi_destroy(&orangefs_backing_dev_info);
-
        pr_info("orangefs: module version %s unloaded\n", ORANGEFS_VERSION);
 }
 
index 084954448f1868840cbf3291cbb226206c2ffd51..afd2f523b2837988ae30975c231d83a21869c533 100644 (file)
  * Description:
  *                     Readahead cache buffer count and size.
  *
+ * What:               /sys/fs/orangefs/readahead_readcnt
+ * Date:               Jan 2017
+ * Contact:            Martin Brandenburg <martin@omnibond.com>
+ * Description:
+ *                     Number of buffers (in multiples of readahead_size)
+ *                     which can be read ahead for a single file at once.
+ *
  * What:               /sys/fs/orangefs/acache/...
  * Date:               Jun 2015
  * Contact:            Martin Brandenburg <martin@omnibond.com>
@@ -329,7 +336,8 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
                if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
                    (!strcmp(attr->attr.name, "readahead_count") ||
                    !strcmp(attr->attr.name, "readahead_size") ||
-                   !strcmp(attr->attr.name, "readahead_count_size"))) {
+                   !strcmp(attr->attr.name, "readahead_count_size") ||
+                   !strcmp(attr->attr.name, "readahead_readcnt"))) {
                        rc = -EINVAL;
                        goto out;
                }
@@ -360,6 +368,11 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
                                 "readahead_count_size"))
                        new_op->upcall.req.param.op =
                                ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;
+
+               else if (!strcmp(attr->attr.name,
+                                "readahead_readcnt"))
+                       new_op->upcall.req.param.op =
+                               ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;
        } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
                if (!strcmp(attr->attr.name, "timeout_msecs"))
                        new_op->upcall.req.param.op =
@@ -542,7 +555,8 @@ static ssize_t sysfs_service_op_store(struct kobject *kobj,
                if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
                    (!strcmp(attr->attr.name, "readahead_count") ||
                    !strcmp(attr->attr.name, "readahead_size") ||
-                   !strcmp(attr->attr.name, "readahead_count_size"))) {
+                   !strcmp(attr->attr.name, "readahead_count_size") ||
+                   !strcmp(attr->attr.name, "readahead_readcnt"))) {
                        rc = -EINVAL;
                        goto out;
                }
@@ -609,6 +623,15 @@ static ssize_t sysfs_service_op_store(struct kobject *kobj,
                        new_op->upcall.req.param.u.value32[0] = val1;
                        new_op->upcall.req.param.u.value32[1] = val2;
                        goto value_set;
+               } else if (!strcmp(attr->attr.name,
+                                  "readahead_readcnt")) {
+                       if ((val >= 0)) {
+                               new_op->upcall.req.param.op =
+                               ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;
+                       } else {
+                               rc = 0;
+                               goto out;
+                       }
                }
 
        } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
@@ -812,6 +835,10 @@ static struct orangefs_attribute readahead_count_size_attribute =
        __ATTR(readahead_count_size, 0664, sysfs_service_op_show,
               sysfs_service_op_store);
 
+static struct orangefs_attribute readahead_readcnt_attribute =
+       __ATTR(readahead_readcnt, 0664, sysfs_service_op_show,
+              sysfs_service_op_store);
+
 static struct orangefs_attribute perf_counter_reset_attribute =
        __ATTR(perf_counter_reset,
               0664,
@@ -838,6 +865,7 @@ static struct attribute *orangefs_default_attrs[] = {
        &readahead_count_attribute.attr,
        &readahead_size_attribute.attr,
        &readahead_count_size_attribute.attr,
+       &readahead_readcnt_attribute.attr,
        &perf_counter_reset_attribute.attr,
        &perf_history_size_attribute.attr,
        &perf_time_interval_secs_attribute.attr,
index af0b0e36d5595f5b996fd0d041e763976aacc931..b8249f8fdd8027b8552e4b019203b4ea2dd6ea2a 100644 (file)
@@ -182,6 +182,7 @@ enum orangefs_param_request_op {
        ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26,
        ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27,
        ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28,
+       ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29,
 };
 
 struct orangefs_param_request_s {