]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/swap.h
net: rtnetlink: validate IFLA_MTU attribute in rtnl_create_link()
[mirror_ubuntu-bionic-kernel.git] / include / linux / swap.h
index c2b8128799c1eff57243d0e3fe9efa468b4e7478..ea96cd4ae80ae935017a4562d2f56290d9ecd2f0 100644 (file)
@@ -155,9 +155,9 @@ struct swap_extent {
 /*
  * Max bad pages in the new format..
  */
-#define __swapoffset(x) ((unsigned long)&((union swap_header *)0)->x)
 #define MAX_SWAP_BADPAGES \
-       ((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int))
+       ((offsetof(union swap_header, magic.magic) - \
+         offsetof(union swap_header, info.badpages)) / sizeof(int))
 
 enum {
        SWP_USED        = (1 << 0),     /* is slot in swap_info[] used? */
@@ -232,7 +232,6 @@ struct swap_info_struct {
        unsigned long   flags;          /* SWP_USED etc: see above */
        signed short    prio;           /* swap priority of this type */
        struct plist_node list;         /* entry in swap_active_head */
-       struct plist_node avail_lists[MAX_NUMNODES];/* entry in swap_avail_heads */
        signed char     type;           /* strange name for an index */
        unsigned int    max;            /* extent of the swap_map */
        unsigned char *swap_map;        /* vmalloc'ed array of usage counts */
@@ -273,6 +272,16 @@ struct swap_info_struct {
                                         */
        struct work_struct discard_work; /* discard worker */
        struct swap_cluster_list discard_clusters; /* discard clusters list */
+       struct plist_node avail_lists[0]; /*
+                                          * entries in swap_avail_heads, one
+                                          * entry per node.
+                                          * Must be last as the number of the
+                                          * array is nr_node_ids, which is not
+                                          * a fixed value so have to allocate
+                                          * dynamically.
+                                          * And it has to be an array so that
+                                          * plist_for_each_* can work.
+                                          */
 };
 
 #ifdef CONFIG_64BIT
@@ -366,14 +375,8 @@ extern unsigned long vm_total_pages;
 extern int node_reclaim_mode;
 extern int sysctl_min_unmapped_ratio;
 extern int sysctl_min_slab_ratio;
-extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int);
 #else
 #define node_reclaim_mode 0
-static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask,
-                               unsigned int order)
-{
-       return 0;
-}
 #endif
 
 extern int page_evictable(struct page *page);