Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179711
b: refs/heads/master
c: bd79667
h: refs/heads/master
i:
  179709: c4dcf3e
  179707: c669fc4
  179703: 9f96d35
  179695: 4798f22
  179679: 59fcaf2
  179647: 8978001
  179583: 3a80cd9
  179455: 26c7211
  179199: 682ff24
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jan 20, 2010
1 parent c91dde9 commit fe48a44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f776c5ec4690b21b3668ad5956774a22c86f541a
refs/heads/master: bd796671f093d5b1841d383674d5650f5ec6c9c6
32 changes: 12 additions & 20 deletions trunk/drivers/base/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,17 @@ static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL);
* Block size attribute stuff
*/
static ssize_t
print_block_size(struct sysdev_class *class,
struct sysdev_class_attribute *class_attr,
char *buf)
print_block_size(struct class *class, char *buf)
{
return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE);
}

static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);

static int block_size_init(void)
{
return sysfs_create_file(&memory_sysdev_class.kset.kobj,
&attr_block_size_bytes.attr);
&class_attr_block_size_bytes.attr);
}

/*
Expand All @@ -332,9 +330,7 @@ static int block_size_init(void)
*/
#ifdef CONFIG_ARCH_MEMORY_PROBE
static ssize_t
memory_probe_store(struct sysdev_class *class,
struct sysdev_class_attribute *class_attr,
const char *buf, size_t count)
memory_probe_store(struct class *class, const char *buf, size_t count)
{
u64 phys_addr;
int nid;
Expand All @@ -350,12 +346,12 @@ memory_probe_store(struct sysdev_class *class,

return count;
}
static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store);
static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store);

static int memory_probe_init(void)
{
return sysfs_create_file(&memory_sysdev_class.kset.kobj,
&attr_probe.attr);
&class_attr_probe.attr);
}
#else
static inline int memory_probe_init(void)
Expand All @@ -371,9 +367,7 @@ static inline int memory_probe_init(void)

/* Soft offline a page */
static ssize_t
store_soft_offline_page(struct sysdev_class *class,
struct sysdev_class_attribute *class_attr,
const char *buf, size_t count)
store_soft_offline_page(struct class *class, const char *buf, size_t count)
{
int ret;
u64 pfn;
Expand All @@ -390,9 +384,7 @@ store_soft_offline_page(struct sysdev_class *class,

/* Forcibly offline a page, including killing processes. */
static ssize_t
store_hard_offline_page(struct sysdev_class *class,
struct sysdev_class_attribute *class_attr,
const char *buf, size_t count)
store_hard_offline_page(struct class *class, const char *buf, size_t count)
{
int ret;
u64 pfn;
Expand All @@ -405,18 +397,18 @@ store_hard_offline_page(struct sysdev_class *class,
return ret ? ret : count;
}

static SYSDEV_CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page);
static SYSDEV_CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page);
static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page);
static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page);

static __init int memory_fail_init(void)
{
int err;

err = sysfs_create_file(&memory_sysdev_class.kset.kobj,
&attr_soft_offline_page.attr);
&class_attr_soft_offline_page.attr);
if (!err)
err = sysfs_create_file(&memory_sysdev_class.kset.kobj,
&attr_hard_offline_page.attr);
&class_attr_hard_offline_page.attr);
return err;
}
#else
Expand Down

0 comments on commit fe48a44

Please sign in to comment.