diff options
| author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-23 14:02:19 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-23 14:02:19 -0500 |
| commit | 99a85b901eb54f62ff0c3fd6eb56e60b7b9f15c8 (patch) | |
| tree | 0c6637b7d2172e079c30e966847326767cbaf45c /include/linux/resource_ext.h | |
| parent | 135f9be9194cf7778eb73594aa55791b229cf27c (diff) | |
| parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
Merge tag 'v4.0-rc1' into patchwork
Linux 34.0-rc1
* tag 'v4.0-rc1': (8947 commits)
Linux 4.0-rc1
autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation
procfs: fix race between symlink removals and traversals
debugfs: leave freeing a symlink body until inode eviction
Documentation/filesystems/Locking: ->get_sb() is long gone
trylock_super(): replacement for grab_super_passive()
fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry)
SELinux: Use d_is_positive() rather than testing dentry->d_inode
Smack: Use d_is_positive() rather than testing dentry->d_inode
TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR()
Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode
Apparmor: mediated_filesystem() should use dentry->d_sb not inode->i_sb
VFS: Split DCACHE_FILE_TYPE into regular and special types
VFS: Add a fallthrough flag for marking virtual dentries
VFS: Add a whiteout dentry type
VFS: Introduce inode-getting helpers for layered/unioned fs environments
kernel: make READ_ONCE() valid on const arguments
blk-throttle: check stats_cpu before reading it from sysfs
...
Diffstat (limited to 'include/linux/resource_ext.h')
| -rw-r--r-- | include/linux/resource_ext.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/include/linux/resource_ext.h b/include/linux/resource_ext.h new file mode 100644 index 000000000000..e2bf63d881d4 --- /dev/null +++ b/include/linux/resource_ext.h | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2015, Intel Corporation | ||
| 3 | * Author: Jiang Liu <jiang.liu@linux.intel.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | #ifndef _LINUX_RESOURCE_EXT_H | ||
| 15 | #define _LINUX_RESOURCE_EXT_H | ||
| 16 | #include <linux/types.h> | ||
| 17 | #include <linux/list.h> | ||
| 18 | #include <linux/ioport.h> | ||
| 19 | #include <linux/slab.h> | ||
| 20 | |||
| 21 | /* Represent resource window for bridge devices */ | ||
| 22 | struct resource_win { | ||
| 23 | struct resource res; /* In master (CPU) address space */ | ||
| 24 | resource_size_t offset; /* Translation offset for bridge */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Common resource list management data structure and interfaces to support | ||
| 29 | * ACPI, PNP and PCI host bridge etc. | ||
| 30 | */ | ||
| 31 | struct resource_entry { | ||
| 32 | struct list_head node; | ||
| 33 | struct resource *res; /* In master (CPU) address space */ | ||
| 34 | resource_size_t offset; /* Translation offset for bridge */ | ||
| 35 | struct resource __res; /* Default storage for res */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | extern struct resource_entry * | ||
| 39 | resource_list_create_entry(struct resource *res, size_t extra_size); | ||
| 40 | extern void resource_list_free(struct list_head *head); | ||
| 41 | |||
| 42 | static inline void resource_list_add(struct resource_entry *entry, | ||
| 43 | struct list_head *head) | ||
| 44 | { | ||
| 45 | list_add(&entry->node, head); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void resource_list_add_tail(struct resource_entry *entry, | ||
| 49 | struct list_head *head) | ||
| 50 | { | ||
| 51 | list_add_tail(&entry->node, head); | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline void resource_list_del(struct resource_entry *entry) | ||
| 55 | { | ||
| 56 | list_del(&entry->node); | ||
| 57 | } | ||
| 58 | |||
| 59 | static inline void resource_list_free_entry(struct resource_entry *entry) | ||
| 60 | { | ||
| 61 | kfree(entry); | ||
| 62 | } | ||
| 63 | |||
| 64 | static inline void | ||
| 65 | resource_list_destroy_entry(struct resource_entry *entry) | ||
| 66 | { | ||
| 67 | resource_list_del(entry); | ||
| 68 | resource_list_free_entry(entry); | ||
| 69 | } | ||
| 70 | |||
| 71 | #define resource_list_for_each_entry(entry, list) \ | ||
| 72 | list_for_each_entry((entry), (list), node) | ||
| 73 | |||
| 74 | #define resource_list_for_each_entry_safe(entry, tmp, list) \ | ||
| 75 | list_for_each_entry_safe((entry), (tmp), (list), node) | ||
| 76 | |||
| 77 | #endif /* _LINUX_RESOURCE_EXT_H */ | ||
