Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Removed sparse (semantic parser) wanings
Browse files Browse the repository at this point in the history
Signed-off-by: sanoj <sunnikrishnan@stec-inc.com>
  • Loading branch information
sanoj-stec committed Jan 28, 2013
1 parent 0651feb commit ac7c103
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 81 deletions.
16 changes: 4 additions & 12 deletions Driver/enhanceio/eio_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
#define KMEM_DMC_BIO_PAIR "eio-dmc-bio-pair"
/* #define KMEM_CACHE_PENDING_JOB "eio-pending-jobs" */

struct cache_c *cache_list_head = NULL;
static struct cache_c *cache_list_head = NULL;
struct work_struct _kcached_wq;

struct kmem_cache *_job_cache;
static struct kmem_cache *_job_cache;
struct kmem_cache *_io_cache; /* cache of eio_context objects */
mempool_t *_job_pool;
mempool_t *_io_pool; /* pool of eio_context object */
Expand Down Expand Up @@ -2095,14 +2095,6 @@ eio_ctr_ssd_add(struct cache_c *dmc, char *dev)
return r;
}


void
eio_status_info(struct cache_c *dmc, status_type_t type, char *result, unsigned int maxlen)
{

return; /* We already have stats under /proc/.../eio_stats */
}

/*
* Stop the async tasks for a cache(threads, scheduled works).
* Used during the cache remove
Expand Down Expand Up @@ -2441,7 +2433,7 @@ eio_notify_ssd_rm(struct notifier_block *nb, unsigned long action, void *data)
/*
* Initiate a cache target.
*/
int __init
static int __init
eio_init(void)
{
int r;
Expand Down Expand Up @@ -2489,7 +2481,7 @@ eio_init(void)
/*
* Destroy a cache target.
*/
void
static void
eio_exit(void)
{
int r;
Expand Down
2 changes: 1 addition & 1 deletion Driver/enhanceio/eio_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct eio_fifo_cache_set {
/*
* Context that captures the FIFO replacement policy
*/
struct eio_policy_header eio_fifo_ops = {
static struct eio_policy_header eio_fifo_ops = {
.sph_name = CACHE_REPL_FIFO,
.sph_instance_init = eio_fifo_instance_init,

Expand Down
15 changes: 8 additions & 7 deletions Driver/enhanceio/eio_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
dev_notifier_t note;
int do_delete = 0;


switch(cmd) {
case EIO_IOC_CREATE:
case EIO_IOC_ENABLE:
Expand All @@ -47,7 +48,7 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
if (!cache) {
return -ENOMEM;
}
if (copy_from_user(cache, (cache_rec_short_t *)arg,
if (copy_from_user(cache, (void __user *)arg,
sizeof (cache_rec_short_t))) {
vfree(cache);
return -EFAULT;
Expand All @@ -65,7 +66,7 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
if (!cache) {
return -ENOMEM;
}
if (copy_from_user(cache, (cache_rec_short_t *)arg,
if (copy_from_user(cache, (void __user *)arg,
sizeof (cache_rec_short_t))) {
vfree(cache);
return -EFAULT;
Expand All @@ -80,7 +81,7 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
return -ENOMEM;
}

if (copy_from_user(cache, (cache_rec_short_t *)arg,
if (copy_from_user(cache, (void __user *)arg,
sizeof (cache_rec_short_t))) {
vfree(cache);
return -EFAULT;
Expand All @@ -93,14 +94,14 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)

case EIO_IOC_NCACHES:
ncaches = eio_get_cache_count();
if (copy_to_user((uint64_t *)arg, &ncaches,
if (copy_to_user((uint64_t __user *)arg, &ncaches,
sizeof (uint64_t))) {
return -EFAULT;
}
break;

case EIO_IOC_CACHE_LIST:
error = eio_get_cache_list((unsigned long *)arg);
error = eio_get_cache_list((unsigned long __user *)arg);
break;

case EIO_IOC_SET_WARM_BOOT:
Expand All @@ -112,7 +113,7 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
if (!cache)
return -ENOMEM;

if (copy_from_user(cache, (cache_rec_short_t *)arg,
if (copy_from_user(cache, (void __user *)arg,
sizeof (cache_rec_short_t))) {
vfree(cache);
return -EFAULT;
Expand All @@ -127,7 +128,7 @@ eio_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
cache = vmalloc(sizeof (cache_rec_short_t));
if (!cache)
return -ENOMEM;
if (copy_from_user(cache, (cache_rec_short_t *)arg,
if (copy_from_user(cache, (void __user *)arg,
sizeof (cache_rec_short_t))) {
vfree(cache);
return -EFAULT;
Expand Down
4 changes: 2 additions & 2 deletions Driver/enhanceio/eio_lru.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ struct eio_lru_cache_block {
};

/* LRU specifc data structures */
struct eio_lru eio_lru = {
static struct eio_lru eio_lru = {
.sl_lru_pushblks = eio_lru_pushblks,
.sl_reclaim_lru_movetail = eio_reclaim_lru_movetail,
};

/*
* Context that captures the LRU replacement policy
*/
struct eio_policy_header eio_lru_ops = {
static struct eio_policy_header eio_lru_ops = {
.sph_name = CACHE_REPL_LRU,
.sph_instance_init = eio_lru_instance_init,
};
Expand Down
14 changes: 7 additions & 7 deletions Driver/enhanceio/eio_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ eb_endio(struct eio_bio *ebio, int error)
kfree(ebio);
}

int
static int
eio_io_async_pages(struct cache_c *dmc, struct eio_io_region *where, int rw,
struct page **pages, unsigned nr_pages, eio_notify_fn fn, void *context,
int hddio)
Expand Down Expand Up @@ -167,7 +167,7 @@ eio_io_async_pages(struct cache_c *dmc, struct eio_io_region *where, int rw,
return error;
}

int
static int
eio_io_async_bvec(struct cache_c *dmc, struct eio_io_region *where, int rw,
struct bio_vec *pages, unsigned nr_bvecs, eio_notify_fn fn,
void *context, int hddio)
Expand Down Expand Up @@ -271,7 +271,7 @@ eio_flag_abios(struct cache_c *dmc, struct eio_bio *abio, int invalidated)
}
}

void
static void
eio_disk_io_callback(int error, void *context)
{
struct kcached_job *job;
Expand Down Expand Up @@ -355,7 +355,7 @@ eio_uncached_read_done(struct kcached_job *job)
}
}

void
static void
eio_io_callback(int error, void *context)
{
struct kcached_job *job = (struct kcached_job *)context;
Expand Down Expand Up @@ -1096,7 +1096,7 @@ eio_do_mdupdate(struct work_struct *work)
int error, j;
index_t blk_index;
int k;
void *pg_virt_addr[2] = {0};
void *pg_virt_addr[2] = {NULL};
u_int8_t sector_bits[2] = {0};
int startbit, endbit;
int rw_flags = 0;
Expand Down Expand Up @@ -1393,7 +1393,7 @@ eio_enq_mdupdate(struct bio_container *bc)
index_t set_index;
struct eio_bio *ebio;
struct cache_c *dmc = bc->bc_dmc;
struct cache_set *set = 0;
struct cache_set *set = NULL;
struct mdupdate_request *mdreq;
int do_schedule;

Expand Down Expand Up @@ -3151,7 +3151,7 @@ eio_clean_set(struct cache_c *dmc, index_t set, int whole, int force)
index_t blkindex;
struct bio_vec *bvecs;
unsigned nr_bvecs, total;
void *pg_virt_addr[2] = {0};
void *pg_virt_addr[2] = {NULL};

/* Cache is failed mode, do nothing. */
if (unlikely(CACHE_FAILED_IS_SET(dmc))) {
Expand Down
46 changes: 11 additions & 35 deletions Driver/enhanceio/eio_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define ENHANCEIO_GIT_COMMIT_HASH "unknown-git-version"
#endif /* !ENHANCEIO_GIT_COMMIT_HASH */

int
int
eio_version_query(size_t buf_sz, char *bufp)
{
if (unlikely(buf_sz == 0) || unlikely(bufp == NULL))
Expand All @@ -52,7 +52,7 @@ static struct sysctl_table_dir *sysctl_handle_dir;
/*
* eio_zerostats_sysctl
*/
int
static int
eio_zerostats_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -116,7 +116,7 @@ eio_zerostats_sysctl(ctl_table *table, int write, void __user *buffer, size_t *l
* eio_mem_limit_pct_sysctl
* - sets the eio sysctl mem_limit_pct value
*/
int
static int
eio_mem_limit_pct_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -156,33 +156,10 @@ eio_mem_limit_pct_sysctl(ctl_table *table, int write, void __user *buffer, size_
return 0;
}

/*
* eio_error_inject_sysctl
* - sets the eio sysctl error_inject value
*/
int
eio_error_inject_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
unsigned long flags = 0;

/* fetch the new tunable value or post the existing value */

if (!write) {
spin_lock_irqsave(&dmc->cache_spin_lock, flags);
dmc->sysctl_pending.error_inject = dmc->sysctl_active.error_inject;
spin_unlock_irqrestore(&dmc->cache_spin_lock, flags);
}

proc_dointvec(table, write, buffer, length, ppos);

return 0;
}

/*
* eio_clean_sysctl
*/
int
static int
eio_clean_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -259,7 +236,7 @@ eio_clean_sysctl(ctl_table *table, int write, void __user *buffer, size_t *lengt
/*
* eio_dirty_high_threshold_sysctl
*/
int
static int
eio_dirty_high_threshold_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -334,7 +311,7 @@ eio_dirty_high_threshold_sysctl(ctl_table *table, int write, void __user *buffer
/*
* eio_dirty_low_threshold_sysctl
*/
int
static int
eio_dirty_low_threshold_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -415,7 +392,7 @@ eio_dirty_low_threshold_sysctl(ctl_table *table, int write, void __user *buffer,
/*
* eio_dirty_set_high_threshold_sysctl
*/
int
static int
eio_dirty_set_high_threshold_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -493,7 +470,7 @@ eio_dirty_set_high_threshold_sysctl(ctl_table *table, int write, void __user *bu
/*
* eio_dirty_set_low_threshold_sysctl
*/
int
static int
eio_dirty_set_low_threshold_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -578,7 +555,7 @@ eio_dirty_set_low_threshold_sysctl(ctl_table *table, int write, void __user *buf
/*
* eio_autoclean_threshold_sysctl
*/
int
static int
eio_autoclean_threshold_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -647,7 +624,7 @@ eio_autoclean_threshold_sysctl(ctl_table *table, int write, void __user *buffer,
/*
* eio_time_based_clean_interval_sysctl
*/
int
static int
eio_time_based_clean_interval_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
struct cache_c *dmc = (struct cache_c *)table->extra1;
Expand Down Expand Up @@ -730,7 +707,7 @@ static void eio_sysctl_unregister_invalidate(struct cache_c *dmc);
/*
* eio_control_sysctl
*/
/* exported */ int
int
eio_control_sysctl(ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos)
{
int rv = 0;
Expand Down Expand Up @@ -1273,7 +1250,6 @@ eio_procfs_dtr(struct cache_c *dmc)


static spinlock_t invalidate_spin_lock;
u_int64_t invalidate_spin_lock_flags;

/*
* eio_invalidate_sysctl
Expand Down
14 changes: 7 additions & 7 deletions Driver/enhanceio/eio_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
#include "eio_ttc.h"

static DEFINE_SPINLOCK(_job_lock);
u_int64_t _job_lock_flags;
static u_int64_t _job_lock_flags;

extern mempool_t *_job_pool;

extern atomic_t nr_cache_jobs;

LIST_HEAD(_io_jobs);
LIST_HEAD(_disk_read_jobs);
static LIST_HEAD(_io_jobs);
static LIST_HEAD(_disk_read_jobs);

int
eio_io_empty(void)
Expand Down Expand Up @@ -71,7 +71,7 @@ eio_free_cache_job(struct kcached_job *job)
/*
* Functions to push and pop a job onto the head of a given job list.
*/
struct kcached_job *
static struct kcached_job *
eio_pop(struct list_head *jobs)
{
struct kcached_job *job = NULL;
Expand All @@ -88,7 +88,7 @@ eio_pop(struct list_head *jobs)
}


void
static void
eio_push(struct list_head *jobs, struct kcached_job *job)
{
unsigned long flags = 0;
Expand All @@ -106,7 +106,7 @@ eio_push_ssdread_failures(struct kcached_job *job)
eio_push(&_disk_read_jobs, job);
}

void
static void
eio_push_io(struct kcached_job *job)
{

Expand Down Expand Up @@ -212,7 +212,7 @@ eio_new_job(struct cache_c *dmc, struct eio_bio* bio, index_t index)
return job;
}

void
static void
eio_sync_endio(struct bio *bio, int error)
{
if(error) {
Expand Down
Loading

0 comments on commit ac7c103

Please sign in to comment.