mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
convert 'memory' sysdev_class to a regular subsystem
This moves the 'memory sysdev_class' over to a regular 'memory' subsystem and converts the devices to regular devices. The sysdev drivers are implemented as subsystem interfaces now. After all sysdev classes are ported to regular driver core entities, the sysdev implementation will be entirely removed from the kernel. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
8a25a2fd12
commit
10fbcf4c6c
8 changed files with 177 additions and 200 deletions
14
mm/vmscan.c
14
mm/vmscan.c
|
@ -3475,16 +3475,16 @@ int scan_unevictable_handler(struct ctl_table *table, int write,
|
|||
* a specified node's per zone unevictable lists for evictable pages.
|
||||
*/
|
||||
|
||||
static ssize_t read_scan_unevictable_node(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
static ssize_t read_scan_unevictable_node(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
warn_scan_unevictable_pages();
|
||||
return sprintf(buf, "0\n"); /* always zero; should fit... */
|
||||
}
|
||||
|
||||
static ssize_t write_scan_unevictable_node(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
static ssize_t write_scan_unevictable_node(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
warn_scan_unevictable_pages();
|
||||
|
@ -3492,17 +3492,17 @@ static ssize_t write_scan_unevictable_node(struct sys_device *dev,
|
|||
}
|
||||
|
||||
|
||||
static SYSDEV_ATTR(scan_unevictable_pages, S_IRUGO | S_IWUSR,
|
||||
static DEVICE_ATTR(scan_unevictable_pages, S_IRUGO | S_IWUSR,
|
||||
read_scan_unevictable_node,
|
||||
write_scan_unevictable_node);
|
||||
|
||||
int scan_unevictable_register_node(struct node *node)
|
||||
{
|
||||
return sysdev_create_file(&node->sysdev, &attr_scan_unevictable_pages);
|
||||
return device_create_file(&node->dev, &dev_attr_scan_unevictable_pages);
|
||||
}
|
||||
|
||||
void scan_unevictable_unregister_node(struct node *node)
|
||||
{
|
||||
sysdev_remove_file(&node->sysdev, &attr_scan_unevictable_pages);
|
||||
device_remove_file(&node->dev, &dev_attr_scan_unevictable_pages);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue