]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/base/memory.c
memory-hotplug: check whether all memory blocks are offlined or not when removing...
[mirror_ubuntu-hirsute-kernel.git] / drivers / base / memory.c
index 987604d56c83009cf94c63235d10841bdbf5bd94..a51007b790327dfe6c1df06dc2f2240f5e94ca3b 100644 (file)
@@ -494,8 +494,8 @@ store_hard_offline_page(struct device *dev,
        return ret ? ret : count;
 }
 
-static DEVICE_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page);
-static DEVICE_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page);
+static DEVICE_ATTR(soft_offline_page, S_IWUSR, NULL, store_soft_offline_page);
+static DEVICE_ATTR(hard_offline_page, S_IWUSR, NULL, store_hard_offline_page);
 
 static __init int memory_fail_init(void)
 {
@@ -693,6 +693,12 @@ int offline_memory_block(struct memory_block *mem)
        return ret;
 }
 
+/* return true if the memory block is offlined, otherwise, return false */
+bool is_memblock_offlined(struct memory_block *mem)
+{
+       return mem->state == MEM_OFFLINE;
+}
+
 /*
  * Initialize the sysfs support for memory devices...
  */