]> git.karo-electronics.de Git - linux-beck.git/commitdiff
orangefs: rename most remaining global variables
authorMartin Brandenburg <martin@omnibond.com>
Tue, 16 Aug 2016 15:38:14 +0000 (11:38 -0400)
committerMartin Brandenburg <martin@omnibond.com>
Tue, 16 Aug 2016 15:41:24 +0000 (11:41 -0400)
Only op_timeout_secs, slot_timeout_secs, and hash_table_size are left
because they are exposed as module parameters. All other global
variables have the orangefs_ prefix.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
fs/orangefs/dcache.c
fs/orangefs/devorangefs-req.c
fs/orangefs/namei.c
fs/orangefs/orangefs-kernel.h
fs/orangefs/orangefs-mod.c
fs/orangefs/orangefs-sysfs.c
fs/orangefs/orangefs-utils.c
fs/orangefs/super.c
fs/orangefs/waitqueue.c

index 00235bf644dcfd43b9b7978408270c31f6de0268..1e8fe844e69fdaa92c80c9ca162d736c8b06a984 100644 (file)
@@ -73,7 +73,7 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
                }
        }
 
-       dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
+       dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
        ret = 1;
 out_release_op:
        op_release(new_op);
index a5c76583dffa58141a6b1b244eb58e5220e1a8f1..641e27152d7ea8951234c61b2ae74e93c58a561f 100644 (file)
@@ -46,7 +46,7 @@ static void orangefs_devreq_add_op(struct orangefs_kernel_op_s *op)
 {
        int index = hash_func(op->tag, hash_table_size);
 
-       list_add_tail(&op->list, &htable_ops_in_progress[index]);
+       list_add_tail(&op->list, &orangefs_htable_ops_in_progress[index]);
 }
 
 /*
@@ -60,20 +60,20 @@ static struct orangefs_kernel_op_s *orangefs_devreq_remove_op(__u64 tag)
 
        index = hash_func(tag, hash_table_size);
 
-       spin_lock(&htable_ops_in_progress_lock);
+       spin_lock(&orangefs_htable_ops_in_progress_lock);
        list_for_each_entry_safe(op,
                                 next,
-                                &htable_ops_in_progress[index],
+                                &orangefs_htable_ops_in_progress[index],
                                 list) {
                if (op->tag == tag && !op_state_purged(op) &&
                    !op_state_given_up(op)) {
                        list_del_init(&op->list);
-                       spin_unlock(&htable_ops_in_progress_lock);
+                       spin_unlock(&orangefs_htable_ops_in_progress_lock);
                        return op;
                }
        }
 
-       spin_unlock(&htable_ops_in_progress_lock);
+       spin_unlock(&orangefs_htable_ops_in_progress_lock);
        return NULL;
 }
 
@@ -279,11 +279,11 @@ restart:
        if (ret != 0)
                goto error;
 
-       spin_lock(&htable_ops_in_progress_lock);
+       spin_lock(&orangefs_htable_ops_in_progress_lock);
        spin_lock(&cur_op->lock);
        if (unlikely(op_state_given_up(cur_op))) {
                spin_unlock(&cur_op->lock);
-               spin_unlock(&htable_ops_in_progress_lock);
+               spin_unlock(&orangefs_htable_ops_in_progress_lock);
                complete(&cur_op->waitq);
                goto restart;
        }
@@ -301,7 +301,7 @@ restart:
                     current->comm);
        orangefs_devreq_add_op(cur_op);
        spin_unlock(&cur_op->lock);
-       spin_unlock(&htable_ops_in_progress_lock);
+       spin_unlock(&orangefs_htable_ops_in_progress_lock);
 
        /* The client only asks to read one size buffer. */
        return MAX_DEV_REQ_UPSIZE;
@@ -620,7 +620,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
                 * all of the remounts are serviced (to avoid ops between
                 * mounts to fail)
                 */
-               ret = mutex_lock_interruptible(&request_mutex);
+               ret = mutex_lock_interruptible(&orangefs_request_mutex);
                if (ret < 0)
                        return ret;
                gossip_debug(GOSSIP_DEV_DEBUG,
@@ -655,7 +655,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
                gossip_debug(GOSSIP_DEV_DEBUG,
                             "%s: priority remount complete\n",
                             __func__);
-               mutex_unlock(&request_mutex);
+               mutex_unlock(&orangefs_request_mutex);
                return ret;
 
        case ORANGEFS_DEV_UPSTREAM:
index 62c525936ee88f639725553dec920d729c2f9876..35269e31de926ea1dd3a00314984e58255fceba1 100644 (file)
@@ -72,7 +72,7 @@ static int orangefs_create(struct inode *dir,
 
        d_instantiate(dentry, inode);
        unlock_new_inode(inode);
-       dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
+       dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
        ORANGEFS_I(inode)->getattr_time = jiffies - 1;
 
        gossip_debug(GOSSIP_NAME_DEBUG,
@@ -183,7 +183,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
                goto out;
        }
 
-       dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
+       dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
 
        inode = orangefs_iget(dir->i_sb, &new_op->downcall.resp.lookup.refn);
        if (IS_ERR(inode)) {
@@ -322,7 +322,7 @@ static int orangefs_symlink(struct inode *dir,
 
        d_instantiate(dentry, inode);
        unlock_new_inode(inode);
-       dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
+       dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
        ORANGEFS_I(inode)->getattr_time = jiffies - 1;
 
        gossip_debug(GOSSIP_NAME_DEBUG,
@@ -386,7 +386,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
 
        d_instantiate(dentry, inode);
        unlock_new_inode(inode);
-       dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
+       dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;
        ORANGEFS_I(inode)->getattr_time = jiffies - 1;
 
        gossip_debug(GOSSIP_NAME_DEBUG,
index 761a1d852979227b7f381b57bfb2e10d25fce565..5584dfadb81cfb44f3092bd84fb0fae63ee34fba 100644 (file)
@@ -510,18 +510,18 @@ bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op);
 
 int orangefs_normalize_to_errno(__s32 error_code);
 
-extern struct mutex request_mutex;
+extern struct mutex orangefs_request_mutex;
 extern int op_timeout_secs;
 extern int slot_timeout_secs;
-extern int dcache_timeout_msecs;
-extern int getattr_timeout_msecs;
+extern int orangefs_dcache_timeout_msecs;
+extern int orangefs_getattr_timeout_msecs;
 extern struct list_head orangefs_superblocks;
 extern spinlock_t orangefs_superblocks_lock;
 extern struct list_head orangefs_request_list;
 extern spinlock_t orangefs_request_list_lock;
 extern wait_queue_head_t orangefs_request_list_waitq;
-extern struct list_head *htable_ops_in_progress;
-extern spinlock_t htable_ops_in_progress_lock;
+extern struct list_head *orangefs_htable_ops_in_progress;
+extern spinlock_t orangefs_htable_ops_in_progress_lock;
 extern int hash_table_size;
 
 extern const struct address_space_operations orangefs_address_operations;
index f342a2cef1e380f668b5e5ee9e75eab7a6a19777..2e5b03065f345a3e9f48d0401f0def348eeaa1e6 100644 (file)
@@ -30,8 +30,8 @@ static ulong module_parm_debug_mask;
 __u64 orangefs_gossip_debug_mask;
 int op_timeout_secs = ORANGEFS_DEFAULT_OP_TIMEOUT_SECS;
 int slot_timeout_secs = ORANGEFS_DEFAULT_SLOT_TIMEOUT_SECS;
-int dcache_timeout_msecs = 50;
-int getattr_timeout_msecs = 50;
+int orangefs_dcache_timeout_msecs = 50;
+int orangefs_getattr_timeout_msecs = 50;
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("ORANGEFS Development Team");
@@ -60,11 +60,11 @@ module_param(slot_timeout_secs, int, 0);
  * for now it's only being used to stall the op addition to the request
  * list
  */
-DEFINE_MUTEX(request_mutex);
+DEFINE_MUTEX(orangefs_request_mutex);
 
 /* hash table for storing operations waiting for matching downcall */
-struct list_head *htable_ops_in_progress;
-DEFINE_SPINLOCK(htable_ops_in_progress_lock);
+struct list_head *orangefs_htable_ops_in_progress;
+DEFINE_SPINLOCK(orangefs_htable_ops_in_progress_lock);
 
 /* list for queueing upcall operations */
 LIST_HEAD(orangefs_request_list);
@@ -100,9 +100,9 @@ static int __init orangefs_init(void)
        if (ret < 0)
                goto cleanup_op;
 
-       htable_ops_in_progress =
+       orangefs_htable_ops_in_progress =
            kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL);
-       if (!htable_ops_in_progress) {
+       if (!orangefs_htable_ops_in_progress) {
                gossip_err("Failed to initialize op hashtable");
                ret = -ENOMEM;
                goto cleanup_inode;
@@ -110,7 +110,7 @@ static int __init orangefs_init(void)
 
        /* initialize a doubly linked at each hash table index */
        for (i = 0; i < hash_table_size; i++)
-               INIT_LIST_HEAD(&htable_ops_in_progress[i]);
+               INIT_LIST_HEAD(&orangefs_htable_ops_in_progress[i]);
 
        ret = fsid_key_table_initialize();
        if (ret < 0)
@@ -171,7 +171,7 @@ cleanup_key_table:
        fsid_key_table_finalize();
 
 cleanup_progress_table:
-       kfree(htable_ops_in_progress);
+       kfree(orangefs_htable_ops_in_progress);
 
 cleanup_inode:
        orangefs_inode_cache_finalize();
@@ -198,12 +198,12 @@ static void __exit orangefs_exit(void)
        orangefs_dev_cleanup();
        BUG_ON(!list_empty(&orangefs_request_list));
        for (i = 0; i < hash_table_size; i++)
-               BUG_ON(!list_empty(&htable_ops_in_progress[i]));
+               BUG_ON(!list_empty(&orangefs_htable_ops_in_progress[i]));
 
        orangefs_inode_cache_finalize();
        op_cache_finalize();
 
-       kfree(htable_ops_in_progress);
+       kfree(orangefs_htable_ops_in_progress);
 
        bdi_destroy(&orangefs_backing_dev_info);
 
@@ -222,10 +222,10 @@ void purge_inprogress_ops(void)
                struct orangefs_kernel_op_s *op;
                struct orangefs_kernel_op_s *next;
 
-               spin_lock(&htable_ops_in_progress_lock);
+               spin_lock(&orangefs_htable_ops_in_progress_lock);
                list_for_each_entry_safe(op,
                                         next,
-                                        &htable_ops_in_progress[i],
+                                        &orangefs_htable_ops_in_progress[i],
                                         list) {
                        set_op_state_purged(op);
                        gossip_debug(GOSSIP_DEV_DEBUG,
@@ -235,7 +235,7 @@ void purge_inprogress_ops(void)
                                     op->op_state,
                                     current->comm);
                }
-               spin_unlock(&htable_ops_in_progress_lock);
+               spin_unlock(&orangefs_htable_ops_in_progress_lock);
        }
 }
 
index 755c37c998cf8ebfac58470abe9f558043e3e61b..e88370540cb4677502fefc61e758594d0866feb3 100644 (file)
@@ -218,14 +218,14 @@ static ssize_t sysfs_int_show(struct kobject *kobj,
                        rc = scnprintf(buf,
                                       PAGE_SIZE,
                                       "%d\n",
-                                      dcache_timeout_msecs);
+                                      orangefs_dcache_timeout_msecs);
                        goto out;
                } else if (!strcmp(attr->attr.name,
                                   "getattr_timeout_msecs")) {
                        rc = scnprintf(buf,
                                       PAGE_SIZE,
                                       "%d\n",
-                                      getattr_timeout_msecs);
+                                      orangefs_getattr_timeout_msecs);
                        goto out;
                } else {
                        goto out;
@@ -270,10 +270,10 @@ static ssize_t sysfs_int_store(struct kobject *kobj,
                rc = kstrtoint(buf, 0, &slot_timeout_secs);
                goto out;
        } else if (!strcmp(attr->attr.name, "dcache_timeout_msecs")) {
-               rc = kstrtoint(buf, 0, &dcache_timeout_msecs);
+               rc = kstrtoint(buf, 0, &orangefs_dcache_timeout_msecs);
                goto out;
        } else if (!strcmp(attr->attr.name, "getattr_timeout_msecs")) {
-               rc = kstrtoint(buf, 0, &getattr_timeout_msecs);
+               rc = kstrtoint(buf, 0, &orangefs_getattr_timeout_msecs);
                goto out;
        } else {
                goto out;
index f7328f26cb00971cf305e3d07d2e7aea527e5960..06af81f71e10233b4bd9afa23b952eef96fb5f77 100644 (file)
@@ -347,7 +347,8 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass)
        inode->i_mode = type | (is_root_handle(inode) ? S_ISVTX : 0) |
            orangefs_inode_perms(&new_op->downcall.resp.getattr.attributes);
 
-       orangefs_inode->getattr_time = jiffies + getattr_timeout_msecs*HZ/1000;
+       orangefs_inode->getattr_time = jiffies +
+           orangefs_getattr_timeout_msecs*HZ/1000;
        ret = 0;
 out:
        op_release(new_op);
index b9da9a0281c9b916e33d3d226abf36130a76b06c..74b84c08a140d01ccad6702a152b5ed825baafb8 100644 (file)
@@ -530,8 +530,8 @@ void orangefs_kill_sb(struct super_block *sb)
         * make sure that ORANGEFS_DEV_REMOUNT_ALL loop that might've seen us
         * gets completed before we free the dang thing.
         */
-       mutex_lock(&request_mutex);
-       mutex_unlock(&request_mutex);
+       mutex_lock(&orangefs_request_mutex);
+       mutex_unlock(&orangefs_request_mutex);
 
        /* free the orangefs superblock private data */
        kfree(ORANGEFS_SB(sb));
index 31635bc303fe638f4890457486466fb2a07a849f..abcfa3fa9992957006461c202c54380018a17787 100644 (file)
@@ -87,9 +87,9 @@ retry_servicing:
         */
        if (!(flags & ORANGEFS_OP_NO_MUTEX)) {
                if (flags & ORANGEFS_OP_INTERRUPTIBLE)
-                       ret = mutex_lock_interruptible(&request_mutex);
+                       ret = mutex_lock_interruptible(&orangefs_request_mutex);
                else
-                       ret = mutex_lock_killable(&request_mutex);
+                       ret = mutex_lock_killable(&orangefs_request_mutex);
                /*
                 * check to see if we were interrupted while waiting for
                 * mutex
@@ -129,7 +129,7 @@ retry_servicing:
        spin_unlock(&orangefs_request_list_lock);
 
        if (!(flags & ORANGEFS_OP_NO_MUTEX))
-               mutex_unlock(&request_mutex);
+               mutex_unlock(&orangefs_request_mutex);
 
        ret = wait_for_matching_downcall(op, timeout,
                                         flags & ORANGEFS_OP_INTERRUPTIBLE);
@@ -272,9 +272,9 @@ static void
        } else if (op_state_in_progress(op)) {
                /* op must be removed from the in progress htable */
                spin_unlock(&op->lock);
-               spin_lock(&htable_ops_in_progress_lock);
+               spin_lock(&orangefs_htable_ops_in_progress_lock);
                list_del_init(&op->list);
-               spin_unlock(&htable_ops_in_progress_lock);
+               spin_unlock(&orangefs_htable_ops_in_progress_lock);
                gossip_debug(GOSSIP_WAIT_DEBUG,
                             "Interrupted: Removed op %p"
                             " from htable_ops_in_progress\n",