Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] cio: Register/unregister subchannels only from kslowcrw.
  [S390] Add missing die_notifier() call to die().
  [S390] Fix memory detection.
  [S390] Explicitly code allocpercpu calls in iucv
  [S390] Dont overwrite lowcores on smp_send_stop().
  [S390] Optimize storage key handling for anonymous pages
  [S390] Fix kernel preemption.
  [S390] appldata: remove unused binary sysctls.
  [S390] cmm: remove unused binary sysctls.
  [S390] Fix irq tracing and lockdep_sys_exit calls.
  [S390] magic sysrq: check for in_atomic before doing an console_unblank
  [S390] cio: change device sense procedure to work with pav aliases
  • Loading branch information
Linus Torvalds committed Nov 27, 2007
2 parents da457d4 + c5d4a99 commit 9ccc236
Show file tree
Hide file tree
Showing 20 changed files with 263 additions and 307 deletions.
1 change: 0 additions & 1 deletion arch/s390/appldata/appldata.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ struct appldata_ops {
int active; /* monitoring status */

/* fill in from here */
unsigned int ctl_nr; /* sysctl ID */
char name[APPLDATA_PROC_NAME_LENGTH]; /* name of /proc fs node */
unsigned char record_nr; /* Record Nr. for Product ID */
void (*callback)(void *data); /* callback function */
Expand Down
74 changes: 15 additions & 59 deletions arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,26 @@ static int appldata_interval_handler(ctl_table *ctl, int write,
static struct ctl_table_header *appldata_sysctl_header;
static struct ctl_table appldata_table[] = {
{
.ctl_name = CTL_APPLDATA_TIMER,
.procname = "timer",
.mode = S_IRUGO | S_IWUSR,
.proc_handler = &appldata_timer_handler,
},
{
.ctl_name = CTL_APPLDATA_INTERVAL,
.procname = "interval",
.mode = S_IRUGO | S_IWUSR,
.proc_handler = &appldata_interval_handler,
},
{ .ctl_name = 0 }
{ },
};

static struct ctl_table appldata_dir_table[] = {
{
.ctl_name = CTL_APPLDATA,
.procname = appldata_proc_name,
.maxlen = 0,
.mode = S_IRUGO | S_IXUGO,
.child = appldata_table,
},
{ .ctl_name = 0 }
{ },
};

/*
Expand Down Expand Up @@ -441,75 +438,38 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
*/
int appldata_register_ops(struct appldata_ops *ops)
{
struct list_head *lh;
struct appldata_ops *tmp_ops;
int i;

i = 0;
if ((ops->size > APPLDATA_MAX_REC_SIZE) || (ops->size < 0))
return -EINVAL;

if ((ops->size > APPLDATA_MAX_REC_SIZE) ||
(ops->size < 0)){
P_ERROR("Invalid size of %s record = %i, maximum = %i!\n",
ops->name, ops->size, APPLDATA_MAX_REC_SIZE);
return -ENOMEM;
}
if ((ops->ctl_nr == CTL_APPLDATA) ||
(ops->ctl_nr == CTL_APPLDATA_TIMER) ||
(ops->ctl_nr == CTL_APPLDATA_INTERVAL)) {
P_ERROR("ctl_nr %i already in use!\n", ops->ctl_nr);
return -EBUSY;
}
ops->ctl_table = kzalloc(4*sizeof(struct ctl_table), GFP_KERNEL);
if (ops->ctl_table == NULL) {
P_ERROR("Not enough memory for %s ctl_table!\n", ops->name);
ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL);
if (!ops->ctl_table)
return -ENOMEM;
}

spin_lock(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
tmp_ops = list_entry(lh, struct appldata_ops, list);
P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n",
++i, tmp_ops->name, tmp_ops->ctl_nr);
P_DEBUG("Comparing %s (ctl %i) with %s (ctl %i)\n",
tmp_ops->name, tmp_ops->ctl_nr, ops->name,
ops->ctl_nr);
if (strncmp(tmp_ops->name, ops->name,
APPLDATA_PROC_NAME_LENGTH) == 0) {
P_ERROR("Name \"%s\" already registered!\n", ops->name);
kfree(ops->ctl_table);
spin_unlock(&appldata_ops_lock);
return -EBUSY;
}
if (tmp_ops->ctl_nr == ops->ctl_nr) {
P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr);
kfree(ops->ctl_table);
spin_unlock(&appldata_ops_lock);
return -EBUSY;
}
}
list_add(&ops->list, &appldata_ops_list);
spin_unlock(&appldata_ops_lock);

ops->ctl_table[0].ctl_name = CTL_APPLDATA;
ops->ctl_table[0].procname = appldata_proc_name;
ops->ctl_table[0].maxlen = 0;
ops->ctl_table[0].mode = S_IRUGO | S_IXUGO;
ops->ctl_table[0].child = &ops->ctl_table[2];

ops->ctl_table[1].ctl_name = 0;

ops->ctl_table[2].ctl_name = ops->ctl_nr;
ops->ctl_table[2].procname = ops->name;
ops->ctl_table[2].mode = S_IRUGO | S_IWUSR;
ops->ctl_table[2].proc_handler = appldata_generic_handler;
ops->ctl_table[2].data = ops;

ops->ctl_table[3].ctl_name = 0;

ops->sysctl_header = register_sysctl_table(ops->ctl_table);

if (!ops->sysctl_header)
goto out;
P_INFO("%s-ops registered!\n", ops->name);
return 0;
out:
spin_lock(&appldata_ops_lock);
list_del(&ops->list);
spin_unlock(&appldata_ops_lock);
kfree(ops->ctl_table);
return -ENOMEM;
}

/*
Expand All @@ -519,15 +479,11 @@ int appldata_register_ops(struct appldata_ops *ops)
*/
void appldata_unregister_ops(struct appldata_ops *ops)
{
void *table;
spin_lock(&appldata_ops_lock);
list_del(&ops->list);
/* at that point any incoming access will fail */
table = ops->ctl_table;
ops->ctl_table = NULL;
spin_unlock(&appldata_ops_lock);
unregister_sysctl_table(ops->sysctl_header);
kfree(table);
kfree(ops->ctl_table);
P_INFO("%s-ops unregistered!\n", ops->name);
}
/********************** module-ops management <END> **************************/
Expand Down
1 change: 0 additions & 1 deletion arch/s390/appldata/appldata_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ static void appldata_get_mem_data(void *data)


static struct appldata_ops ops = {
.ctl_nr = CTL_APPLDATA_MEM,
.name = "mem",
.record_nr = APPLDATA_RECORD_MEM_ID,
.size = sizeof(struct appldata_mem_data),
Expand Down
1 change: 0 additions & 1 deletion arch/s390/appldata/appldata_net_sum.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ static void appldata_get_net_sum_data(void *data)


static struct appldata_ops ops = {
.ctl_nr = CTL_APPLDATA_NET_SUM,
.name = "net_sum",
.record_nr = APPLDATA_RECORD_NET_SUM_ID,
.size = sizeof(struct appldata_net_sum_data),
Expand Down
1 change: 0 additions & 1 deletion arch/s390/appldata/appldata_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ struct appldata_os_data {
static struct appldata_os_data *appldata_os_data;

static struct appldata_ops ops = {
.ctl_nr = CTL_APPLDATA_OS,
.name = "os",
.record_nr = APPLDATA_RECORD_OS_ID,
.owner = THIS_MODULE,
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static noinline __init void find_memory_chunks(unsigned long memsize)
cc = __tprot(addr);
while (cc == old_cc) {
addr += CHUNK_INCR;
if (addr >= memsize)
if (memsize && addr >= memsize)
break;
#ifndef CONFIG_64BIT
if (addr == ADDR2G)
Expand Down
Loading

0 comments on commit 9ccc236

Please sign in to comment.