Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d503617 authored by Martin Brandenburg's avatar Martin Brandenburg
Browse files

orangefs: rename most remaining global variables



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: default avatarMartin Brandenburg <martin@omnibond.com>
parent 889d5f1b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+10 −10
Original line number Diff line number Diff line
@@ -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 @@ static ssize_t orangefs_devreq_read(struct file *file,
	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 @@ static ssize_t orangefs_devreq_read(struct file *file,
		     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:
+4 −4
Original line number Diff line number Diff line
@@ -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,
+5 −5
Original line number Diff line number Diff line
@@ -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;
+14 −14
Original line number Diff line number Diff line
@@ -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 @@ static int __init orangefs_init(void)
	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);
	}
}

Loading