/linux-4.1.27/lib/ |
H A D | hweight.c | 20 unsigned int res = w - ((w >> 1) & 0x55555555); __sw_hweight32() 21 res = (res & 0x33333333) + ((res >> 2) & 0x33333333); __sw_hweight32() 22 res = (res + (res >> 4)) & 0x0F0F0F0F; __sw_hweight32() 23 res = res + (res >> 8); __sw_hweight32() 24 return (res + (res >> 16)) & 0x000000FF; __sw_hweight32() 31 unsigned int res = w - ((w >> 1) & 0x5555); __sw_hweight16() local 32 res = (res & 0x3333) + ((res >> 2) & 0x3333); __sw_hweight16() 33 res = (res + (res >> 4)) & 0x0F0F; __sw_hweight16() 34 return (res + (res >> 8)) & 0x00FF; __sw_hweight16() 40 unsigned int res = w - ((w >> 1) & 0x55); __sw_hweight8() local 41 res = (res & 0x33) + ((res >> 2) & 0x33); __sw_hweight8() 42 return (res + (res >> 4)) & 0x0F; __sw_hweight8() 58 __u64 res = w - ((w >> 1) & 0x5555555555555555ul); __sw_hweight64() 59 res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul); __sw_hweight64() 60 res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0Ful; __sw_hweight64() 61 res = res + (res >> 8); __sw_hweight64() 62 res = res + (res >> 16); __sw_hweight64() 63 return (res + (res >> 32)) & 0x00000000000000FFul; __sw_hweight64()
|
H A D | kstrtox.h | 6 unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long *res);
|
H A D | kstrtox.c | 49 unsigned long long res; _parse_integer() local 53 res = 0; _parse_integer() 72 if (unlikely(res & (~0ull << 60))) { _parse_integer() 73 if (res > div_u64(ULLONG_MAX - val, base)) _parse_integer() 76 res = res * base + val; _parse_integer() 80 *p = res; _parse_integer() 86 static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res) _kstrtoull() argument 102 *res = _res; _kstrtoull() 116 * @res: Where to write the result of the conversion on success. 122 int kstrtoull(const char *s, unsigned int base, unsigned long long *res) kstrtoull() argument 126 return _kstrtoull(s, base, res); kstrtoull() 140 * @res: Where to write the result of the conversion on success. 146 int kstrtoll(const char *s, unsigned int base, long long *res) kstrtoll() argument 157 *res = -tmp; kstrtoll() 164 *res = tmp; kstrtoll() 171 int _kstrtoul(const char *s, unsigned int base, unsigned long *res) _kstrtoul() argument 181 *res = tmp; _kstrtoul() 187 int _kstrtol(const char *s, unsigned int base, long *res) _kstrtol() argument 197 *res = tmp; _kstrtol() 212 * @res: Where to write the result of the conversion on success. 218 int kstrtouint(const char *s, unsigned int base, unsigned int *res) kstrtouint() argument 228 *res = tmp; kstrtouint() 243 * @res: Where to write the result of the conversion on success. 249 int kstrtoint(const char *s, unsigned int base, int *res) kstrtoint() argument 259 *res = tmp; kstrtoint() 264 int kstrtou16(const char *s, unsigned int base, u16 *res) kstrtou16() argument 274 *res = tmp; kstrtou16() 279 int kstrtos16(const char *s, unsigned int base, s16 *res) kstrtos16() argument 289 *res = tmp; kstrtos16() 294 int kstrtou8(const char *s, unsigned int base, u8 *res) kstrtou8() argument 304 *res = tmp; kstrtou8() 309 int kstrtos8(const char *s, unsigned int base, s8 *res) kstrtos8() argument 319 *res = tmp; kstrtos8() 325 int f(const char __user *s, size_t count, unsigned int base, type *res) \ 334 return g(buf, base, res); \
|
H A D | strncpy_from_user.c | 26 long res = 0; do_strncpy_from_user() local 42 if (unlikely(__get_user(c,(unsigned long __user *)(src+res)))) do_strncpy_from_user() 44 *(unsigned long *)(dst+res) = c; do_strncpy_from_user() 48 return res + find_zero(data); do_strncpy_from_user() 50 res += sizeof(unsigned long); do_strncpy_from_user() 58 if (unlikely(__get_user(c,src+res))) do_strncpy_from_user() 60 dst[res] = c; do_strncpy_from_user() 62 return res; do_strncpy_from_user() 63 res++; do_strncpy_from_user() 71 if (res >= count) do_strncpy_from_user() 72 return res; do_strncpy_from_user()
|
H A D | devres.c | 7 void devm_ioremap_release(struct device *dev, void *res) devm_ioremap_release() argument 9 iounmap(*(void __iomem **)res); devm_ioremap_release() 12 static int devm_ioremap_match(struct device *dev, void *res, void *match_data) devm_ioremap_match() argument 14 return *(void **)res == match_data; devm_ioremap_match() 120 * @res: resource to be handled 130 * res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 131 * base = devm_ioremap_resource(&pdev->dev, res); 135 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res) devm_ioremap_resource() argument 143 if (!res || resource_type(res) != IORESOURCE_MEM) { devm_ioremap_resource() 148 size = resource_size(res); devm_ioremap_resource() 149 name = res->name ?: dev_name(dev); devm_ioremap_resource() 151 if (!devm_request_mem_region(dev, res->start, size, name)) { devm_ioremap_resource() 152 dev_err(dev, "can't request region for resource %pR\n", res); devm_ioremap_resource() 156 if (res->flags & IORESOURCE_CACHEABLE) devm_ioremap_resource() 157 dest_ptr = devm_ioremap(dev, res->start, size); devm_ioremap_resource() 159 dest_ptr = devm_ioremap_nocache(dev, res->start, size); devm_ioremap_resource() 162 dev_err(dev, "ioremap failed for resource %pR\n", res); devm_ioremap_resource() 163 devm_release_mem_region(dev, res->start, size); devm_ioremap_resource() 175 static void devm_ioport_map_release(struct device *dev, void *res) devm_ioport_map_release() argument 177 ioport_unmap(*(void __iomem **)res); devm_ioport_map_release() 180 static int devm_ioport_map_match(struct device *dev, void *res, devm_ioport_map_match() argument 183 return *(void **)res == match_data; devm_ioport_map_match() 242 static void pcim_iomap_release(struct device *gendev, void *res) pcim_iomap_release() argument 245 struct pcim_iomap_devres *this = res; pcim_iomap_release()
|
/linux-4.1.27/drivers/pcmcia/ |
H A D | rsrc_iodyn.c | 30 const struct resource *res, pcmcia_align() 36 start = (res->start & ~data->mask) + data->offset; pcmcia_align() 37 if (start < res->start) pcmcia_align() 41 if (res->flags & IORESOURCE_IO) { pcmcia_align() 48 if (res->flags & IORESOURCE_IO) { pcmcia_align() 49 if ((res->start + size - 1) >= 1024) pcmcia_align() 50 start = res->end; pcmcia_align() 62 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO, __iodyn_find_io_region() local 73 ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1, __iodyn_find_io_region() 77 ret = allocate_resource(&ioport_resource, res, num, min, ~0UL, __iodyn_find_io_region() 81 kfree(res); __iodyn_find_io_region() 82 res = NULL; __iodyn_find_io_region() 84 return res; __iodyn_find_io_region() 98 if (!s->io[i].res) iodyn_find_io() 104 if ((s->io[i].res->start & (align-1)) == *base) iodyn_find_io() 109 struct resource *res = s->io[i].res; iodyn_find_io() local 112 if (res && (res->flags & IORESOURCE_BITS) != iodyn_find_io() 116 if (!res) { iodyn_find_io() 120 res = s->io[i].res = __iodyn_find_io_region(s, *base, iodyn_find_io() 122 if (!res) iodyn_find_io() 125 *base = res->start; iodyn_find_io() 126 s->io[i].res->flags = iodyn_find_io() 127 ((res->flags & ~IORESOURCE_BITS) | iodyn_find_io() 130 *parent = res; iodyn_find_io() 135 try = res->end + 1; iodyn_find_io() 137 if (adjust_resource(s->io[i].res, res->start, iodyn_find_io() 138 resource_size(res) + num)) iodyn_find_io() 142 *parent = res; iodyn_find_io() 147 try = res->start - num; iodyn_find_io() 149 if (adjust_resource(s->io[i].res, iodyn_find_io() 150 res->start - num, iodyn_find_io() 151 resource_size(res) + num)) iodyn_find_io() 155 *parent = res; iodyn_find_io() 29 pcmcia_align(void *align_data, const struct resource *res, resource_size_t size, resource_size_t align) pcmcia_align() argument
|
H A D | rsrc_mgr.c | 37 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); pcmcia_make_resource() local 39 if (res) { pcmcia_make_resource() 40 res->name = name; pcmcia_make_resource() 41 res->start = start; pcmcia_make_resource() 42 res->end = start + end - 1; pcmcia_make_resource() 43 res->flags = flags; pcmcia_make_resource() 45 return res; pcmcia_make_resource()
|
H A D | pcmcia_resource.c | 61 * @res: resource to release 64 static void release_io_space(struct pcmcia_socket *s, struct resource *res) release_io_space() argument 66 resource_size_t num = resource_size(res); release_io_space() 69 dev_dbg(&s->dev, "release_io_space for %pR\n", res); release_io_space() 72 if (!s->io[i].res) release_io_space() 74 if ((s->io[i].res->start <= res->start) && release_io_space() 75 (s->io[i].res->end >= res->end)) { release_io_space() 77 if (res->parent) release_io_space() 78 release_resource(res); release_io_space() 79 res->start = res->end = 0; release_io_space() 80 res->flags = IORESOURCE_IO; release_io_space() 83 release_resource(s->io[i].res); release_io_space() 84 kfree(s->io[i].res); release_io_space() 85 s->io[i].res = NULL; release_io_space() 95 * @res: resource to allocate (begin: begin, end: size) 100 static int alloc_io_space(struct pcmcia_socket *s, struct resource *res, alloc_io_space() argument 104 unsigned int base = res->start; alloc_io_space() 105 unsigned int num = res->end; alloc_io_space() 108 res->flags |= IORESOURCE_IO; alloc_io_space() 111 res, lines); alloc_io_space() 127 ret = s->resource_ops->find_io(s, res->flags, &base, num, align, alloc_io_space() 128 &res->parent); alloc_io_space() 134 res->start = base; alloc_io_space() 135 res->end = res->start + num - 1; alloc_io_space() 137 if (res->parent) { alloc_io_space() 138 ret = request_resource(res->parent, res); alloc_io_space() 141 "request_resource %pR failed: %d\n", res, ret); alloc_io_space() 142 res->parent = NULL; alloc_io_space() 143 release_io_space(s, res); alloc_io_space() 146 dev_dbg(&s->dev, "alloc_io_space request result %d: %pR\n", ret, res); alloc_io_space() 220 * @res: iomem resource already enabled by pcmcia_request_window() 227 int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res, pcmcia_map_mem_page() argument 234 w = ((res->flags & IORESOURCE_BITS & WIN_FLAGS_REQ) >> 2) - 1; pcmcia_map_mem_page() 277 if (!s->io[i].res) pcmcia_fixup_iowidth() 283 io_on.start = s->io[i].res->start; pcmcia_fixup_iowidth() 284 io_on.stop = s->io[i].res->end; pcmcia_fixup_iowidth() 372 if (!s->io[i].res) pcmcia_release_configuration() 427 * @res: iomem resource to release 429 * pcmcia_release_window() releases &struct resource *res which was 432 int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res) pcmcia_release_window() argument 438 dev_dbg(&p_dev->dev, "releasing window %pR\n", res); pcmcia_release_window() 440 w = ((res->flags & IORESOURCE_BITS & WIN_FLAGS_REQ) >> 2) - 1; pcmcia_release_window() 459 if (win->res) { pcmcia_release_window() 460 release_resource(res); pcmcia_release_window() 461 release_resource(win->res); pcmcia_release_window() 462 kfree(win->res); pcmcia_release_window() 463 win->res = NULL; pcmcia_release_window() 465 res->start = res->end = 0; pcmcia_release_window() 466 res->flags = IORESOURCE_MEM; pcmcia_release_window() 595 if (s->io[i].res) { pcmcia_enable_device() 598 switch (s->io[i].res->flags & IO_DATA_PATH_WIDTH) { pcmcia_enable_device() 606 iomap.start = s->io[i].res->start; pcmcia_enable_device() 607 iomap.stop = s->io[i].res->end; pcmcia_enable_device() 869 * @res: &struct resource pointing to p_dev->resource[2..5] 873 * &struct resource @res pointing to one of the entries in 878 int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res, pcmcia_request_window() argument 886 dev_dbg(&p_dev->dev, "request_window %pR %d\n", res, speed); pcmcia_request_window() 894 if (res->end == 0) pcmcia_request_window() 895 res->end = s->map_size; pcmcia_request_window() 896 align = (s->features & SS_CAP_MEM_ALIGN) ? res->end : s->map_size; pcmcia_request_window() 897 if (res->end & (s->map_size-1)) { pcmcia_request_window() 901 if ((res->start && (s->features & SS_CAP_STATIC_MAP)) || pcmcia_request_window() 902 (res->start & (align-1))) { pcmcia_request_window() 906 if (res->start) pcmcia_request_window() 923 win->res = pcmcia_find_mem_region(res->start, res->end, align, pcmcia_request_window() 925 if (!win->res) { pcmcia_request_window() 935 win->flags = res->flags & WIN_FLAGS_MAP; pcmcia_request_window() 948 res->start = win->static_start; pcmcia_request_window() 950 res->start = win->res->start; pcmcia_request_window() 953 res->end += res->start - 1; pcmcia_request_window() 954 res->flags &= ~WIN_FLAGS_REQ; pcmcia_request_window() 955 res->flags |= (win->map << 2) | IORESOURCE_MEM; pcmcia_request_window() 956 res->parent = win->res; pcmcia_request_window() 957 if (win->res) pcmcia_request_window() 958 request_resource(&iomem_resource, res); pcmcia_request_window() 960 dev_dbg(&p_dev->dev, "request_window results in %pR\n", res); pcmcia_request_window() 988 struct resource *res = p_dev->resource[MAX_IO_WIN + i]; pcmcia_disable_device() local 989 if (res->flags & WIN_FLAGS_REQ) pcmcia_disable_device() 990 pcmcia_release_window(p_dev, res); pcmcia_disable_device()
|
H A D | rsrc_nonstatic.c | 79 struct resource *res, *parent; claim_region() local 82 res = pcmcia_make_resource(base, size, type | IORESOURCE_BUSY, name); claim_region() 84 if (res) { claim_region() 87 parent = pci_find_parent_resource(s->cb_dev, res); claim_region() 89 if (!parent || request_resource(parent, res)) { claim_region() 90 kfree(res); claim_region() 91 res = NULL; claim_region() 94 return res; claim_region() 97 static void free_region(struct resource *res) free_region() argument 99 if (res) { free_region() 100 release_resource(res); free_region() 101 kfree(res); free_region() 188 struct resource *res; do_io_probe() local 206 res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); do_io_probe() 207 if (!res) do_io_probe() 213 free_region(res); do_io_probe() 223 res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); do_io_probe() 224 if (!res) { do_io_probe() 234 free_region(res); do_io_probe() 268 static int readable(struct pcmcia_socket *s, struct resource *res, readable() argument 278 s->cis_mem.res = res; readable() 279 s->cis_virt = ioremap(res->start, s->map_size); readable() 290 s->cis_mem.res = NULL; readable() 299 static int checksum(struct pcmcia_socket *s, struct resource *res, checksum() argument 306 virt = ioremap(res->start, s->map_size); checksum() 311 map.res = res; checksum() 352 struct resource *res, do_validate_mem() 407 struct resource *res, do_mem_probe() 410 struct resource *res, do_mem_probe() 608 pcmcia_align(void *align_data, const struct resource *res, pcmcia_align() argument 615 start = pcmcia_common_align(data, res->start); pcmcia_align() 633 if (start >= res->end) pcmcia_align() 644 start = res->end; pcmcia_align() 691 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO, __nonstatic_find_io_region() local 704 ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1, __nonstatic_find_io_region() 708 ret = allocate_resource(&ioport_resource, res, num, min, ~0UL, __nonstatic_find_io_region() 712 kfree(res); __nonstatic_find_io_region() 713 res = NULL; __nonstatic_find_io_region() 715 return res; __nonstatic_find_io_region() 729 if (!s->io[i].res) nonstatic_find_io() 735 if ((s->io[i].res->start & (align-1)) == *base) nonstatic_find_io() 740 struct resource *res = s->io[i].res; nonstatic_find_io() local 743 if (res && (res->flags & IORESOURCE_BITS) != nonstatic_find_io() 747 if (!res) { nonstatic_find_io() 751 res = s->io[i].res = __nonstatic_find_io_region(s, nonstatic_find_io() 754 if (!res) nonstatic_find_io() 757 *base = res->start; nonstatic_find_io() 758 s->io[i].res->flags = nonstatic_find_io() 759 ((res->flags & ~IORESOURCE_BITS) | nonstatic_find_io() 762 *parent = res; nonstatic_find_io() 767 try = res->end + 1; nonstatic_find_io() 769 ret = __nonstatic_adjust_io_region(s, res->start, nonstatic_find_io() 770 res->end + num); nonstatic_find_io() 772 ret = adjust_resource(s->io[i].res, res->start, nonstatic_find_io() 773 resource_size(res) + num); nonstatic_find_io() 778 *parent = res; nonstatic_find_io() 784 try = res->start - num; nonstatic_find_io() 787 res->start - num, nonstatic_find_io() 788 res->end); nonstatic_find_io() 790 ret = adjust_resource(s->io[i].res, nonstatic_find_io() 791 res->start - num, nonstatic_find_io() 792 resource_size(res) + num); nonstatic_find_io() 797 *parent = res; nonstatic_find_io() 810 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_MEM, nonstatic_find_mem_region() local 836 res, num, 1, min, 0, nonstatic_find_mem_region() 842 res, num, min, max, 1, nonstatic_find_mem_region() 855 kfree(res); nonstatic_find_mem_region() 856 res = NULL; nonstatic_find_mem_region() 858 return res; nonstatic_find_mem_region() 935 struct resource *res; local 964 res = s->cb_dev->bus->resource[i]; 966 pci_bus_for_each_resource(s->cb_dev->bus, res, i) { 968 if (!res) 971 if (res->flags & IORESOURCE_IO) { 975 if (res == &ioport_resource) 980 res); 981 if (!adjust_io(s, ADD_MANAGED_RESOURCE, res->start, res->end)) 986 if (res->flags & IORESOURCE_MEM) { 990 if (res == &iomem_resource) 995 res); 996 if (!adjust_memory(s, ADD_MANAGED_RESOURCE, res->start, res->end)) 349 do_validate_mem(struct pcmcia_socket *s, unsigned long base, unsigned long size, int validate (struct pcmcia_socket *s, struct resource *res, unsigned int *value)) do_validate_mem() argument 405 do_mem_probe(struct pcmcia_socket *s, u_long base, u_long num, int validate (struct pcmcia_socket *s, struct resource *res, unsigned int *value), int fallback (struct pcmcia_socket *s, struct resource *res, unsigned int *value)) do_mem_probe() argument
|
/linux-4.1.27/arch/microblaze/include/asm/ |
H A D | atomic.h | 15 int res; atomic_dec_if_positive() local 18 res = v->counter - 1; atomic_dec_if_positive() 19 if (res >= 0) atomic_dec_if_positive() 20 v->counter = res; atomic_dec_if_positive() 23 return res; atomic_dec_if_positive()
|
/linux-4.1.27/arch/mips/ath79/ |
H A D | pci.c | 138 struct resource res[4]; ath79_register_pci_ar71xx() local 140 memset(res, 0, sizeof(res)); ath79_register_pci_ar71xx() 142 res[0].name = "cfg_base"; ath79_register_pci_ar71xx() 143 res[0].flags = IORESOURCE_MEM; ath79_register_pci_ar71xx() 144 res[0].start = AR71XX_PCI_CFG_BASE; ath79_register_pci_ar71xx() 145 res[0].end = AR71XX_PCI_CFG_BASE + AR71XX_PCI_CFG_SIZE - 1; ath79_register_pci_ar71xx() 147 res[1].flags = IORESOURCE_IRQ; ath79_register_pci_ar71xx() 148 res[1].start = ATH79_CPU_IRQ(2); ath79_register_pci_ar71xx() 149 res[1].end = ATH79_CPU_IRQ(2); ath79_register_pci_ar71xx() 151 res[2].name = "io_base"; ath79_register_pci_ar71xx() 152 res[2].flags = IORESOURCE_IO; ath79_register_pci_ar71xx() 153 res[2].start = 0; ath79_register_pci_ar71xx() 154 res[2].end = 0; ath79_register_pci_ar71xx() 156 res[3].name = "mem_base"; ath79_register_pci_ar71xx() 157 res[3].flags = IORESOURCE_MEM; ath79_register_pci_ar71xx() 158 res[3].start = AR71XX_PCI_MEM_BASE; ath79_register_pci_ar71xx() 159 res[3].end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1; ath79_register_pci_ar71xx() 162 res, ARRAY_SIZE(res)); ath79_register_pci_ar71xx() 177 struct resource res[6]; ath79_register_pci_ar724x() local 179 memset(res, 0, sizeof(res)); ath79_register_pci_ar724x() 181 res[0].name = "cfg_base"; ath79_register_pci_ar724x() 182 res[0].flags = IORESOURCE_MEM; ath79_register_pci_ar724x() 183 res[0].start = cfg_base; ath79_register_pci_ar724x() 184 res[0].end = cfg_base + AR724X_PCI_CFG_SIZE - 1; ath79_register_pci_ar724x() 186 res[1].name = "ctrl_base"; ath79_register_pci_ar724x() 187 res[1].flags = IORESOURCE_MEM; ath79_register_pci_ar724x() 188 res[1].start = ctrl_base; ath79_register_pci_ar724x() 189 res[1].end = ctrl_base + AR724X_PCI_CTRL_SIZE - 1; ath79_register_pci_ar724x() 191 res[2].flags = IORESOURCE_IRQ; ath79_register_pci_ar724x() 192 res[2].start = irq; ath79_register_pci_ar724x() 193 res[2].end = irq; ath79_register_pci_ar724x() 195 res[3].name = "mem_base"; ath79_register_pci_ar724x() 196 res[3].flags = IORESOURCE_MEM; ath79_register_pci_ar724x() 197 res[3].start = mem_base; ath79_register_pci_ar724x() 198 res[3].end = mem_base + mem_size - 1; ath79_register_pci_ar724x() 200 res[4].name = "io_base"; ath79_register_pci_ar724x() 201 res[4].flags = IORESOURCE_IO; ath79_register_pci_ar724x() 202 res[4].start = io_base; ath79_register_pci_ar724x() 203 res[4].end = io_base; ath79_register_pci_ar724x() 205 res[5].name = "crp_base"; ath79_register_pci_ar724x() 206 res[5].flags = IORESOURCE_MEM; ath79_register_pci_ar724x() 207 res[5].start = crp_base; ath79_register_pci_ar724x() 208 res[5].end = crp_base + AR724X_PCI_CRP_SIZE - 1; ath79_register_pci_ar724x() 211 res, ARRAY_SIZE(res)); ath79_register_pci_ar724x()
|
H A D | dev-common.c | 99 struct resource res; ath79_register_wdt() local 101 memset(&res, 0, sizeof(res)); ath79_register_wdt() 103 res.flags = IORESOURCE_MEM; ath79_register_wdt() 104 res.start = AR71XX_RESET_BASE + AR71XX_RESET_REG_WDOG_CTRL; ath79_register_wdt() 105 res.end = res.start + 0x8 - 1; ath79_register_wdt() 107 platform_device_register_simple("ath79-wdt", -1, &res, 1); ath79_register_wdt()
|
/linux-4.1.27/fs/hfs/ |
H A D | attr.c | 23 int res; hfs_setxattr() local 28 res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); hfs_setxattr() 29 if (res) hfs_setxattr() 30 return res; hfs_setxattr() 32 res = hfs_brec_find(&fd); hfs_setxattr() 33 if (res) hfs_setxattr() 43 res = -ERANGE; hfs_setxattr() 48 res = -ERANGE; hfs_setxattr() 50 res = -EOPNOTSUPP; hfs_setxattr() 51 if (!res) hfs_setxattr() 56 return res; hfs_setxattr() 66 ssize_t res = 0; hfs_getxattr() local 72 res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); hfs_getxattr() 73 if (res) hfs_getxattr() 74 return res; hfs_getxattr() 76 res = hfs_brec_find(&fd); hfs_getxattr() 77 if (res) hfs_getxattr() 87 res = 4; hfs_getxattr() 89 res = size ? -ERANGE : 4; hfs_getxattr() 93 res = 4; hfs_getxattr() 95 res = size ? -ERANGE : 4; hfs_getxattr() 97 res = -ENODATA; hfs_getxattr() 101 return res; hfs_getxattr()
|
H A D | extent.c | 112 int res; __hfs_ext_write_extent() local 116 res = hfs_brec_find(fd); __hfs_ext_write_extent() 118 if (res != -ENOENT) __hfs_ext_write_extent() 119 return res; __hfs_ext_write_extent() 123 if (res) __hfs_ext_write_extent() 124 return res; __hfs_ext_write_extent() 134 int res = 0; hfs_ext_write_extent() local 137 res = hfs_find_init(HFS_SB(inode->i_sb)->ext_tree, &fd); hfs_ext_write_extent() 138 if (res) hfs_ext_write_extent() 139 return res; hfs_ext_write_extent() 140 res = __hfs_ext_write_extent(inode, &fd); hfs_ext_write_extent() 143 return res; hfs_ext_write_extent() 149 int res; __hfs_ext_read_extent() local 153 res = hfs_brec_find(fd); __hfs_ext_read_extent() 154 if (res && res != -ENOENT) __hfs_ext_read_extent() 155 return res; __hfs_ext_read_extent() 167 int res; __hfs_ext_cache_extent() local 170 res = __hfs_ext_write_extent(inode, fd); __hfs_ext_cache_extent() 171 if (res) __hfs_ext_cache_extent() 172 return res; __hfs_ext_cache_extent() 175 res = __hfs_ext_read_extent(fd, HFS_I(inode)->cached_extents, inode->i_ino, __hfs_ext_cache_extent() 177 if (!res) { __hfs_ext_cache_extent() 184 return res; __hfs_ext_cache_extent() 190 int res; hfs_ext_read_extent() local 196 res = hfs_find_init(HFS_SB(inode->i_sb)->ext_tree, &fd); hfs_ext_read_extent() 197 if (!res) { hfs_ext_read_extent() 198 res = __hfs_ext_cache_extent(&fd, inode, block); hfs_ext_read_extent() 201 return res; hfs_ext_read_extent() 289 int res, i; hfs_free_fork() local 306 res = hfs_free_extents(sb, extent, blocks, blocks); hfs_free_fork() 307 if (res) hfs_free_fork() 308 return res; hfs_free_fork() 312 res = hfs_find_init(HFS_SB(sb)->ext_tree, &fd); hfs_free_fork() 313 if (res) hfs_free_fork() 314 return res; hfs_free_fork() 316 res = __hfs_ext_read_extent(&fd, extent, cnid, total_blocks, type); hfs_free_fork() 317 if (res) hfs_free_fork() 326 return res; hfs_free_fork() 337 int res; hfs_get_block() local 347 res = hfs_extend_file(inode); hfs_get_block() 348 if (res) hfs_get_block() 349 return res; hfs_get_block() 360 res = hfs_ext_read_extent(inode, ablock); hfs_get_block() 361 if (!res) hfs_get_block() 389 int res; hfs_extend_file() local 395 res = hfs_ext_read_extent(inode, HFS_I(inode)->alloc_blocks); hfs_extend_file() 396 if (res) hfs_extend_file() 404 res = -ENOSPC; hfs_extend_file() 415 res = 0; hfs_extend_file() 418 res = hfs_add_extent(HFS_I(inode)->first_extents, hfs_extend_file() 421 if (res == -ENOSPC) hfs_extend_file() 424 if (!res) { hfs_extend_file() 429 res = hfs_add_extent(HFS_I(inode)->cached_extents, hfs_extend_file() 433 if (!res) { hfs_extend_file() 437 } else if (res == -ENOSPC) hfs_extend_file() 442 if (!res) { hfs_extend_file() 450 return res; hfs_extend_file() 454 res = hfs_ext_write_extent(inode); hfs_extend_file() 455 if (res) hfs_extend_file() 466 res = 0; hfs_extend_file() 476 int res; hfs_file_truncate() local 488 res = pagecache_write_begin(NULL, mapping, size+1, 0, hfs_file_truncate() 490 if (!res) { hfs_file_truncate() 491 res = pagecache_write_end(NULL, mapping, size+1, 0, 0, hfs_file_truncate() 494 if (res) hfs_file_truncate() 506 res = hfs_find_init(HFS_SB(sb)->ext_tree, &fd); hfs_file_truncate() 507 if (res) { hfs_file_truncate() 520 res = __hfs_ext_cache_extent(&fd, inode, alloc_cnt); hfs_file_truncate() 521 if (res) hfs_file_truncate()
|
H A D | bfind.c | 48 int res; __hfs_brec_find() local 52 res = -ENOENT; __hfs_brec_find() 58 res = -EINVAL; __hfs_brec_find() 65 res = 0; __hfs_brec_find() 77 res = -EINVAL; __hfs_brec_find() 89 return res; __hfs_brec_find() 100 int height, res; hfs_brec_find() local 110 res = 0; hfs_brec_find() 115 res = PTR_ERR(bnode); hfs_brec_find() 125 res = __hfs_brec_find(bnode, fd); hfs_brec_find() 137 return res; hfs_brec_find() 142 res = -EIO; hfs_brec_find() 145 return res; hfs_brec_find() 150 int res; hfs_brec_read() local 152 res = hfs_brec_find(fd); hfs_brec_read() 153 if (res) hfs_brec_read() 154 return res; hfs_brec_read() 165 int idx, res = 0; hfs_brec_goto() local 178 res = -ENOENT; hfs_brec_goto() 184 res = PTR_ERR(bnode); hfs_brec_goto() 196 res = -ENOENT; hfs_brec_goto() 202 res = PTR_ERR(bnode); hfs_brec_goto() 213 res = -EINVAL; hfs_brec_goto() 223 return res; hfs_brec_goto()
|
H A D | dir.c | 26 int res; hfs_lookup() local 28 res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); hfs_lookup() 29 if (res) hfs_lookup() 30 return ERR_PTR(res); hfs_lookup() 32 res = hfs_brec_read(&fd, &rec, sizeof(rec)); hfs_lookup() 33 if (res) { hfs_lookup() 35 if (res == -ENOENT) { hfs_lookup() 40 return ERR_PTR(res); hfs_lookup() 196 int res; hfs_create() local 202 res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode); hfs_create() 203 if (res) { hfs_create() 207 return res; hfs_create() 225 int res; hfs_mkdir() local 231 res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode); hfs_mkdir() 232 if (res) { hfs_mkdir() 236 return res; hfs_mkdir() 257 int res; hfs_remove() local 261 res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name); hfs_remove() 262 if (res) hfs_remove() 263 return res; hfs_remove() 285 int res; hfs_rename() local 289 res = hfs_remove(new_dir, new_dentry); hfs_rename() 290 if (res) hfs_rename() 291 return res; hfs_rename() 294 res = hfs_cat_move(d_inode(old_dentry)->i_ino, hfs_rename() 297 if (!res) hfs_rename() 301 return res; hfs_rename()
|
/linux-4.1.27/drivers/pnp/ |
H A D | manager.c | 26 struct resource *res = pnp_get_resource(dev, type, bar); pnp_find_resource() local 29 if (res) { pnp_find_resource() 30 res->flags &= ~IORESOURCE_BITS; pnp_find_resource() 31 res->flags |= rule & IORESOURCE_BITS; pnp_find_resource() 34 return res; pnp_find_resource() 39 struct resource *res, local_res; pnp_assign_port() local 41 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IO, idx); pnp_assign_port() 42 if (res) { pnp_assign_port() 44 "flags %#lx\n", idx, (unsigned long long) res->start, pnp_assign_port() 45 (unsigned long long) res->end, res->flags); pnp_assign_port() 49 res = &local_res; pnp_assign_port() 50 res->flags = rule->flags | IORESOURCE_AUTO; pnp_assign_port() 51 res->start = 0; pnp_assign_port() 52 res->end = 0; pnp_assign_port() 55 res->flags |= IORESOURCE_DISABLED; pnp_assign_port() 60 res->start = rule->min; pnp_assign_port() 61 res->end = res->start + rule->size - 1; pnp_assign_port() 63 while (!pnp_check_port(dev, res)) { pnp_assign_port() 64 res->start += rule->align; pnp_assign_port() 65 res->end = res->start + rule->size - 1; pnp_assign_port() 66 if (res->start > rule->max || !rule->align) { pnp_assign_port() 76 pnp_add_io_resource(dev, res->start, res->end, res->flags); pnp_assign_port() 82 struct resource *res, local_res; pnp_assign_mem() local 84 res = pnp_find_resource(dev, rule->flags, IORESOURCE_MEM, idx); pnp_assign_mem() 85 if (res) { pnp_assign_mem() 87 "flags %#lx\n", idx, (unsigned long long) res->start, pnp_assign_mem() 88 (unsigned long long) res->end, res->flags); pnp_assign_mem() 92 res = &local_res; pnp_assign_mem() 93 res->flags = rule->flags | IORESOURCE_AUTO; pnp_assign_mem() 94 res->start = 0; pnp_assign_mem() 95 res->end = 0; pnp_assign_mem() 99 res->flags |= IORESOURCE_READONLY; pnp_assign_mem() 101 res->flags |= IORESOURCE_CACHEABLE; pnp_assign_mem() 103 res->flags |= IORESOURCE_RANGELENGTH; pnp_assign_mem() 105 res->flags |= IORESOURCE_SHADOWABLE; pnp_assign_mem() 108 res->flags |= IORESOURCE_DISABLED; pnp_assign_mem() 113 res->start = rule->min; pnp_assign_mem() 114 res->end = res->start + rule->size - 1; pnp_assign_mem() 116 while (!pnp_check_mem(dev, res)) { pnp_assign_mem() 117 res->start += rule->align; pnp_assign_mem() 118 res->end = res->start + rule->size - 1; pnp_assign_mem() 119 if (res->start > rule->max || !rule->align) { pnp_assign_mem() 129 pnp_add_mem_resource(dev, res->start, res->end, res->flags); pnp_assign_mem() 135 struct resource *res, local_res; pnp_assign_irq() local 143 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IRQ, idx); pnp_assign_irq() 144 if (res) { pnp_assign_irq() 146 idx, (int) res->start, res->flags); pnp_assign_irq() 150 res = &local_res; pnp_assign_irq() 151 res->flags = rule->flags | IORESOURCE_AUTO; pnp_assign_irq() 152 res->start = -1; pnp_assign_irq() 153 res->end = -1; pnp_assign_irq() 156 res->flags |= IORESOURCE_DISABLED; pnp_assign_irq() 162 res->start = find_next_bit(rule->map.bits, PNP_IRQ_NR, 16); pnp_assign_irq() 163 if (res->start < PNP_IRQ_NR) { pnp_assign_irq() 164 res->end = res->start; pnp_assign_irq() 169 res->start = res->end = xtab[i]; pnp_assign_irq() 170 if (pnp_check_irq(dev, res)) pnp_assign_irq() 176 res->start = -1; pnp_assign_irq() 177 res->end = -1; pnp_assign_irq() 178 res->flags |= IORESOURCE_DISABLED; pnp_assign_irq() 187 pnp_add_irq_resource(dev, res->start, res->flags); pnp_assign_irq() 194 struct resource *res, local_res; pnp_assign_dma() local 202 res = pnp_find_resource(dev, rule->flags, IORESOURCE_DMA, idx); pnp_assign_dma() 203 if (res) { pnp_assign_dma() 205 idx, (int) res->start, res->flags); pnp_assign_dma() 209 res = &local_res; pnp_assign_dma() 210 res->flags = rule->flags | IORESOURCE_AUTO; pnp_assign_dma() 211 res->start = -1; pnp_assign_dma() 212 res->end = -1; pnp_assign_dma() 215 res->flags |= IORESOURCE_DISABLED; pnp_assign_dma() 222 res->start = res->end = xtab[i]; pnp_assign_dma() 223 if (pnp_check_dma(dev, res)) pnp_assign_dma() 232 pnp_add_dma_resource(dev, res->start, res->flags); pnp_assign_dma() 247 if (pnp_res->res.flags & IORESOURCE_AUTO) pnp_clean_resource_table()
|
H A D | system.c | 30 struct resource *res; reserve_range() local 38 res = request_region(start, end - start + 1, regionid); reserve_range() 40 res = request_mem_region(start, end - start + 1, regionid); reserve_range() 41 if (res) reserve_range() 42 res->flags &= ~IORESOURCE_BUSY; reserve_range() 52 res ? "has been" : "could not be"); reserve_range() 57 struct resource *res; reserve_resources_of_dev() local 60 for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_IO, i)); i++) { reserve_resources_of_dev() 61 if (res->flags & IORESOURCE_DISABLED) reserve_resources_of_dev() 63 if (res->start == 0) reserve_resources_of_dev() 65 if (res->start < 0x100) reserve_resources_of_dev() 75 if (res->end < res->start) reserve_resources_of_dev() 78 reserve_range(dev, res, 1); reserve_resources_of_dev() 81 for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) { reserve_resources_of_dev() 82 if (res->flags & IORESOURCE_DISABLED) reserve_resources_of_dev() 85 reserve_range(dev, res, 0); reserve_resources_of_dev()
|
H A D | resource.c | 165 int pnp_check_port(struct pnp_dev *dev, struct resource *res) pnp_check_port() argument 172 port = &res->start; pnp_check_port() 173 end = &res->end; pnp_check_port() 176 if (cannot_compare(res->flags)) pnp_check_port() 197 if (tres != res && tres->flags & IORESOURCE_IO) { pnp_check_port() 228 int pnp_check_mem(struct pnp_dev *dev, struct resource *res) pnp_check_mem() argument 235 addr = &res->start; pnp_check_mem() 236 end = &res->end; pnp_check_mem() 239 if (cannot_compare(res->flags)) pnp_check_mem() 260 if (tres != res && tres->flags & IORESOURCE_MEM) { pnp_check_mem() 351 int pnp_check_irq(struct pnp_dev *dev, struct resource *res) pnp_check_irq() argument 358 irq = &res->start; pnp_check_irq() 361 if (cannot_compare(res->flags)) pnp_check_irq() 376 if (tres != res && tres->flags & IORESOURCE_IRQ) { pnp_check_irq() 415 int pnp_check_dma(struct pnp_dev *dev, struct resource *res) pnp_check_dma() argument 422 dma = &res->start; pnp_check_dma() 425 if (cannot_compare(res->flags)) pnp_check_dma() 440 if (tres != res && tres->flags & IORESOURCE_DMA) { pnp_check_dma() 474 unsigned long pnp_resource_type(struct resource *res) pnp_resource_type() argument 476 return res->flags & (IORESOURCE_IO | IORESOURCE_MEM | pnp_resource_type() 485 struct resource *res; pnp_get_resource() local 488 res = &pnp_res->res; pnp_get_resource() 489 if (pnp_resource_type(res) == type && num-- == 0) pnp_get_resource() 490 return res; pnp_get_resource() 509 struct resource *res) pnp_add_resource() 515 dev_err(&dev->dev, "can't add resource %pR\n", res); pnp_add_resource() 519 pnp_res->res = *res; pnp_add_resource() 520 pnp_res->res.name = dev->name; pnp_add_resource() 521 dev_dbg(&dev->dev, "%pR\n", res); pnp_add_resource() 529 struct resource *res; pnp_add_irq_resource() local 537 res = &pnp_res->res; pnp_add_irq_resource() 538 res->flags = IORESOURCE_IRQ | flags; pnp_add_irq_resource() 539 res->start = irq; pnp_add_irq_resource() 540 res->end = irq; pnp_add_irq_resource() 542 dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); pnp_add_irq_resource() 550 struct resource *res; pnp_add_dma_resource() local 558 res = &pnp_res->res; pnp_add_dma_resource() 559 res->flags = IORESOURCE_DMA | flags; pnp_add_dma_resource() 560 res->start = dma; pnp_add_dma_resource() 561 res->end = dma; pnp_add_dma_resource() 563 dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); pnp_add_dma_resource() 572 struct resource *res; pnp_add_io_resource() local 582 res = &pnp_res->res; pnp_add_io_resource() 583 res->flags = IORESOURCE_IO | flags; pnp_add_io_resource() 584 res->start = start; pnp_add_io_resource() 585 res->end = end; pnp_add_io_resource() 587 dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); pnp_add_io_resource() 596 struct resource *res; pnp_add_mem_resource() local 606 res = &pnp_res->res; pnp_add_mem_resource() 607 res->flags = IORESOURCE_MEM | flags; pnp_add_mem_resource() 608 res->start = start; pnp_add_mem_resource() 609 res->end = end; pnp_add_mem_resource() 611 dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); pnp_add_mem_resource() 620 struct resource *res; pnp_add_bus_resource() local 630 res = &pnp_res->res; pnp_add_bus_resource() 631 res->flags = IORESOURCE_BUS; pnp_add_bus_resource() 632 res->start = start; pnp_add_bus_resource() 633 res->end = end; pnp_add_bus_resource() 635 dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); pnp_add_bus_resource() 693 dev_start = &pnp_res->res.start; pnp_for_each_dev() 694 dev_end = &pnp_res->res.end; pnp_for_each_dev() 508 pnp_add_resource(struct pnp_dev *dev, struct resource *res) pnp_add_resource() argument
|
H A D | quirks.c | 234 struct resource *res; quirk_system_pci_resources() local 262 (res = pnp_get_resource(dev, type, j)); j++) { for_each_pci_dev() 263 if (res->start == 0 && res->end == 0) for_each_pci_dev() 266 pnp_start = res->start; for_each_pci_dev() 267 pnp_end = res->end; for_each_pci_dev() 294 "%s BAR %d %pR\n", res, for_each_pci_dev() 296 res->flags |= IORESOURCE_DISABLED; for_each_pci_dev() 310 struct resource *res; quirk_amd_mmconfig_area() local 318 res = &pnp_res->res; quirk_amd_mmconfig_area() 319 if (res->end < mmconfig->start || res->start > mmconfig->end || quirk_amd_mmconfig_area() 320 (res->start == mmconfig->start && res->end == mmconfig->end)) quirk_amd_mmconfig_area() 325 res, mmconfig); quirk_amd_mmconfig_area() 326 if (mmconfig->start < res->start) { quirk_amd_mmconfig_area() 328 end = res->start - 1; quirk_amd_mmconfig_area() 331 if (mmconfig->end > res->end) { quirk_amd_mmconfig_area() 332 start = res->end + 1; quirk_amd_mmconfig_area() 369 struct resource *res; quirk_intel_mch() local 399 res = &pnp_res->res; quirk_intel_mch() 400 if (res->end < mch.start || res->start > mch.end) quirk_intel_mch() 402 if (res->start == mch.start && res->end == mch.end) quirk_intel_mch() 406 res, pci_name(host), &mch); quirk_intel_mch() 407 res->start = mch.start; quirk_intel_mch() 408 res->end = mch.end; quirk_intel_mch()
|
/linux-4.1.27/fs/ocfs2/dlm/ |
H A D | dlmthread.c | 59 /* will exit holding res->spinlock, but may drop in function */ 60 /* waits until flags are cleared on res->state */ __dlm_wait_on_lockres_flags() 61 void __dlm_wait_on_lockres_flags(struct dlm_lock_resource *res, int flags) __dlm_wait_on_lockres_flags() argument 65 assert_spin_locked(&res->spinlock); __dlm_wait_on_lockres_flags() 67 add_wait_queue(&res->wq, &wait); __dlm_wait_on_lockres_flags() 70 if (res->state & flags) { __dlm_wait_on_lockres_flags() 71 spin_unlock(&res->spinlock); __dlm_wait_on_lockres_flags() 73 spin_lock(&res->spinlock); __dlm_wait_on_lockres_flags() 76 remove_wait_queue(&res->wq, &wait); __dlm_wait_on_lockres_flags() 80 int __dlm_lockres_has_locks(struct dlm_lock_resource *res) __dlm_lockres_has_locks() argument 82 if (list_empty(&res->granted) && __dlm_lockres_has_locks() 83 list_empty(&res->converting) && __dlm_lockres_has_locks() 84 list_empty(&res->blocked)) __dlm_lockres_has_locks() 93 int __dlm_lockres_unused(struct dlm_lock_resource *res) __dlm_lockres_unused() argument 97 assert_spin_locked(&res->spinlock); __dlm_lockres_unused() 99 if (__dlm_lockres_has_locks(res)) __dlm_lockres_unused() 103 if (res->inflight_locks) __dlm_lockres_unused() 106 if (!list_empty(&res->dirty) || res->state & DLM_LOCK_RES_DIRTY) __dlm_lockres_unused() 109 if (res->state & DLM_LOCK_RES_RECOVERING) __dlm_lockres_unused() 113 bit = find_next_bit(res->refmap, O2NM_MAX_NODES, 0); __dlm_lockres_unused() 125 struct dlm_lock_resource *res) __dlm_lockres_calc_usage() 128 assert_spin_locked(&res->spinlock); __dlm_lockres_calc_usage() 130 if (__dlm_lockres_unused(res)){ __dlm_lockres_calc_usage() 131 if (list_empty(&res->purge)) { __dlm_lockres_calc_usage() 132 mlog(0, "%s: Adding res %.*s to purge list\n", __dlm_lockres_calc_usage() 133 dlm->name, res->lockname.len, res->lockname.name); __dlm_lockres_calc_usage() 135 res->last_used = jiffies; __dlm_lockres_calc_usage() 136 dlm_lockres_get(res); __dlm_lockres_calc_usage() 137 list_add_tail(&res->purge, &dlm->purge_list); __dlm_lockres_calc_usage() 140 } else if (!list_empty(&res->purge)) { __dlm_lockres_calc_usage() 141 mlog(0, "%s: Removing res %.*s from purge list\n", __dlm_lockres_calc_usage() 142 dlm->name, res->lockname.len, res->lockname.name); __dlm_lockres_calc_usage() 144 list_del_init(&res->purge); __dlm_lockres_calc_usage() 145 dlm_lockres_put(res); __dlm_lockres_calc_usage() 151 struct dlm_lock_resource *res) dlm_lockres_calc_usage() 154 spin_lock(&res->spinlock); dlm_lockres_calc_usage() 156 __dlm_lockres_calc_usage(dlm, res); dlm_lockres_calc_usage() 158 spin_unlock(&res->spinlock); dlm_lockres_calc_usage() 163 struct dlm_lock_resource *res) dlm_purge_lockres() 169 assert_spin_locked(&res->spinlock); dlm_purge_lockres() 171 master = (res->owner == dlm->node_num); dlm_purge_lockres() 173 mlog(0, "%s: Purging res %.*s, master %d\n", dlm->name, dlm_purge_lockres() 174 res->lockname.len, res->lockname.name, master); dlm_purge_lockres() 177 res->state |= DLM_LOCK_RES_DROPPING_REF; dlm_purge_lockres() 179 spin_unlock(&res->spinlock); dlm_purge_lockres() 182 spin_lock(&res->spinlock); dlm_purge_lockres() 184 __dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_SETREF_INPROG); dlm_purge_lockres() 185 spin_unlock(&res->spinlock); dlm_purge_lockres() 188 ret = dlm_drop_lockres_ref(dlm, res); dlm_purge_lockres() 194 spin_lock(&res->spinlock); dlm_purge_lockres() 197 if (!list_empty(&res->purge)) { dlm_purge_lockres() 198 mlog(0, "%s: Removing res %.*s from purgelist, master %d\n", dlm_purge_lockres() 199 dlm->name, res->lockname.len, res->lockname.name, master); dlm_purge_lockres() 200 list_del_init(&res->purge); dlm_purge_lockres() 201 dlm_lockres_put(res); dlm_purge_lockres() 205 if (!__dlm_lockres_unused(res)) { dlm_purge_lockres() 206 mlog(ML_ERROR, "%s: res %.*s in use after deref\n", dlm_purge_lockres() 207 dlm->name, res->lockname.len, res->lockname.name); dlm_purge_lockres() 208 __dlm_print_one_lock_resource(res); dlm_purge_lockres() 212 __dlm_unhash_lockres(dlm, res); dlm_purge_lockres() 217 res->state &= ~DLM_LOCK_RES_DROPPING_REF; dlm_purge_lockres() 218 spin_unlock(&res->spinlock); dlm_purge_lockres() 219 wake_up(&res->wq); dlm_purge_lockres() 221 spin_unlock(&res->spinlock); dlm_purge_lockres() 264 mlog(0, "%s: res %.*s is in use or being remastered, " dlm_run_purge_list() 289 struct dlm_lock_resource *res) dlm_shuffle_lists() 301 assert_spin_locked(&res->spinlock); dlm_shuffle_lists() 302 BUG_ON((res->state & (DLM_LOCK_RES_MIGRATING| dlm_shuffle_lists() 307 if (list_empty(&res->converting)) dlm_shuffle_lists() 309 mlog(0, "%s: res %.*s has locks on the convert queue\n", dlm->name, dlm_shuffle_lists() 310 res->lockname.len, res->lockname.name); dlm_shuffle_lists() 312 target = list_entry(res->converting.next, struct dlm_lock, list); dlm_shuffle_lists() 314 mlog(ML_ERROR, "%s: res %.*s converting lock to invalid mode\n", dlm_shuffle_lists() 315 dlm->name, res->lockname.len, res->lockname.name); dlm_shuffle_lists() 318 list_for_each_entry(lock, &res->granted, list) { dlm_shuffle_lists() 326 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists() 336 list_for_each_entry(lock, &res->converting, list) { dlm_shuffle_lists() 343 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists() 357 mlog(0, "%s: res %.*s, AST for Converting lock %u:%llu, type " dlm_shuffle_lists() 358 "%d => %d, node %u\n", dlm->name, res->lockname.len, dlm_shuffle_lists() 359 res->lockname.name, dlm_shuffle_lists() 367 list_move_tail(&target->list, &res->granted); dlm_shuffle_lists() 374 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists() 381 if (list_empty(&res->blocked)) dlm_shuffle_lists() 383 target = list_entry(res->blocked.next, struct dlm_lock, list); dlm_shuffle_lists() 385 list_for_each_entry(lock, &res->granted, list) { dlm_shuffle_lists() 391 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists() 399 list_for_each_entry(lock, &res->converting, list) { dlm_shuffle_lists() 405 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists() 419 mlog(0, "%s: res %.*s, AST for Blocked lock %u:%llu, type %d, " dlm_shuffle_lists() 420 "node %u\n", dlm->name, res->lockname.len, dlm_shuffle_lists() 421 res->lockname.name, dlm_shuffle_lists() 427 list_move_tail(&target->list, &res->granted); dlm_shuffle_lists() 434 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists() 444 /* must have NO locks when calling this with res !=NULL * */ dlm_kick_thread() 445 void dlm_kick_thread(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_kick_thread() argument 447 if (res) { dlm_kick_thread() 449 spin_lock(&res->spinlock); dlm_kick_thread() 450 __dlm_dirty_lockres(dlm, res); dlm_kick_thread() 451 spin_unlock(&res->spinlock); dlm_kick_thread() 457 void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_dirty_lockres() argument 460 assert_spin_locked(&res->spinlock); __dlm_dirty_lockres() 463 if ((res->owner == dlm->node_num)) { __dlm_dirty_lockres() 464 if (res->state & (DLM_LOCK_RES_MIGRATING | __dlm_dirty_lockres() 468 if (list_empty(&res->dirty)) { __dlm_dirty_lockres() 470 dlm_lockres_get(res); __dlm_dirty_lockres() 471 list_add_tail(&res->dirty, &dlm->dirty_list); __dlm_dirty_lockres() 472 res->state |= DLM_LOCK_RES_DIRTY; __dlm_dirty_lockres() 476 mlog(0, "%s: res %.*s\n", dlm->name, res->lockname.len, __dlm_dirty_lockres() 477 res->lockname.name); __dlm_dirty_lockres() 520 struct dlm_lock_resource *res; dlm_flush_asts() local 529 res = lock->lockres; dlm_flush_asts() 530 mlog(0, "%s: res %.*s, Flush AST for lock %u:%llu, type %d, " dlm_flush_asts() 531 "node %u\n", dlm->name, res->lockname.len, dlm_flush_asts() 532 res->lockname.name, dlm_flush_asts() 545 ret = dlm_do_remote_ast(dlm, res, lock); dlm_flush_asts() 549 dlm_do_local_ast(dlm, res, lock); dlm_flush_asts() 556 mlog(0, "%s: res %.*s, AST queued while flushing last " dlm_flush_asts() 557 "one\n", dlm->name, res->lockname.len, dlm_flush_asts() 558 res->lockname.name); dlm_flush_asts() 565 dlm_lockres_release_ast(dlm, res); dlm_flush_asts() 573 res = lock->lockres; dlm_flush_asts() 589 mlog(0, "%s: res %.*s, Flush BAST for lock %u:%llu, " dlm_flush_asts() 591 dlm->name, res->lockname.len, res->lockname.name, dlm_flush_asts() 597 ret = dlm_send_proxy_bast(dlm, res, lock, hi); dlm_flush_asts() 601 dlm_do_local_bast(dlm, res, lock, hi); dlm_flush_asts() 608 mlog(0, "%s: res %.*s, BAST queued while flushing last " dlm_flush_asts() 609 "one\n", dlm->name, res->lockname.len, dlm_flush_asts() 610 res->lockname.name); dlm_flush_asts() 617 dlm_lockres_release_ast(dlm, res); dlm_flush_asts() 630 struct dlm_lock_resource *res; dlm_thread() local 650 * res->spinlock needs to be taken again to protect dlm_thread() 655 res = list_entry(dlm->dirty_list.next, dlm_thread() 660 BUG_ON(!res); dlm_thread() 661 dlm_lockres_get(res); dlm_thread() 663 spin_lock(&res->spinlock); dlm_thread() 665 list_del_init(&res->dirty); dlm_thread() 666 spin_unlock(&res->spinlock); dlm_thread() 669 dlm_lockres_put(res); dlm_thread() 675 spin_lock(&res->spinlock); dlm_thread() 676 if (res->owner != dlm->node_num) { dlm_thread() 677 __dlm_print_one_lock_resource(res); dlm_thread() 680 !!(res->state & DLM_LOCK_RES_IN_PROGRESS), dlm_thread() 681 !!(res->state & DLM_LOCK_RES_MIGRATING), dlm_thread() 682 !!(res->state & DLM_LOCK_RES_RECOVERING), dlm_thread() 683 !!(res->state & DLM_LOCK_RES_DIRTY)); dlm_thread() 685 BUG_ON(res->owner != dlm->node_num); dlm_thread() 690 BUG_ON(res->state & DLM_LOCK_RES_MIGRATING); dlm_thread() 691 if (res->state & (DLM_LOCK_RES_IN_PROGRESS | dlm_thread() 694 res->state &= ~DLM_LOCK_RES_DIRTY; dlm_thread() 695 spin_unlock(&res->spinlock); dlm_thread() 697 mlog(0, "%s: res %.*s, inprogress, delay list " dlm_thread() 699 res->lockname.len, res->lockname.name, dlm_thread() 700 res->state); dlm_thread() 711 dlm_shuffle_lists(dlm, res); dlm_thread() 712 res->state &= ~DLM_LOCK_RES_DIRTY; dlm_thread() 713 spin_unlock(&res->spinlock); dlm_thread() 716 dlm_lockres_calc_usage(dlm, res); dlm_thread() 724 spin_lock(&res->spinlock); dlm_thread() 725 __dlm_dirty_lockres(dlm, res); dlm_thread() 726 spin_unlock(&res->spinlock); dlm_thread() 728 dlm_lockres_put(res); dlm_thread() 124 __dlm_lockres_calc_usage(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_calc_usage() argument 150 dlm_lockres_calc_usage(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_calc_usage() argument 162 dlm_purge_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_purge_lockres() argument 288 dlm_shuffle_lists(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_shuffle_lists() argument
|
H A D | dlmconvert.c | 54 * needs a spinlock held on entry (res->spinlock) and it is the 55 * only one that holds a lock on exit (res->spinlock). 59 struct dlm_lock_resource *res, 64 struct dlm_lock_resource *res, 72 * taken: takes and drops res->spinlock 77 struct dlm_lock_resource *res, dlmconvert_master() 83 spin_lock(&res->spinlock); dlmconvert_master() 85 __dlm_wait_on_lockres(res); dlmconvert_master() 86 __dlm_lockres_reserve_ast(res); dlmconvert_master() 87 res->state |= DLM_LOCK_RES_IN_PROGRESS; dlmconvert_master() 89 status = __dlmconvert_master(dlm, res, lock, flags, type, dlmconvert_master() 92 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlmconvert_master() 93 spin_unlock(&res->spinlock); dlmconvert_master() 94 wake_up(&res->wq); dlmconvert_master() 102 dlm_lockres_release_ast(dlm, res); dlmconvert_master() 105 dlm_kick_thread(dlm, res); dlmconvert_master() 112 * caller needs: res->spinlock 114 * held on exit: res->spinlock 120 struct dlm_lock_resource *res, __dlmconvert_master() 128 assert_spin_locked(&res->spinlock); __dlmconvert_master() 144 if (!dlm_lock_on_list(&res->granted, lock)) { __dlmconvert_master() 187 list_for_each_entry(tmplock, &res->granted, list) { __dlmconvert_master() 194 list_for_each_entry(tmplock, &res->converting, list) { __dlmconvert_master() 205 mlog(0, "res %.*s, granting %s lock\n", res->lockname.len, __dlmconvert_master() 206 res->lockname.name, dlm_lock_mode_name(type)); __dlmconvert_master() 213 memcpy(res->lvb, lock->lksb->lvb, DLM_LVB_LEN); __dlmconvert_master() 222 "%d to %d...\n", res->lockname.len, res->lockname.name, __dlmconvert_master() 227 mlog(0, "res %.*s, queueing...\n", res->lockname.len, __dlmconvert_master() 228 res->lockname.name); __dlmconvert_master() 232 list_move_tail(&lock->list, &res->converting); __dlmconvert_master() 237 __dlm_print_one_lock_resource(res); __dlmconvert_master() 244 void dlm_revert_pending_convert(struct dlm_lock_resource *res, dlm_revert_pending_convert() argument 248 list_move_tail(&lock->list, &res->granted); dlm_revert_pending_convert() 256 * taken: takes and drops res->spinlock, uses DLM_LOCK_RES_IN_PROGRESS 261 struct dlm_lock_resource *res, dlmconvert_remote() 265 u8 old_owner = res->owner; dlmconvert_remote() 268 lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); dlmconvert_remote() 270 spin_lock(&res->spinlock); dlmconvert_remote() 271 if (res->state & DLM_LOCK_RES_RECOVERING) { dlmconvert_remote() 272 mlog(0, "bailing out early since res is RECOVERING " dlmconvert_remote() 274 /* __dlm_print_one_lock_resource(res); */ dlmconvert_remote() 279 __dlm_wait_on_lockres(res); dlmconvert_remote() 282 __dlm_print_one_lock_resource(res); dlmconvert_remote() 294 "owner has already queued and sent ast to me. res %.*s, " dlmconvert_remote() 296 res->lockname.len, res->lockname.name, dlmconvert_remote() 304 res->state |= DLM_LOCK_RES_IN_PROGRESS; dlmconvert_remote() 307 list_move_tail(&lock->list, &res->converting); dlmconvert_remote() 324 spin_unlock(&res->spinlock); dlmconvert_remote() 328 status = dlm_send_remote_convert_request(dlm, res, lock, flags, type); dlmconvert_remote() 330 spin_lock(&res->spinlock); dlmconvert_remote() 331 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlmconvert_remote() 340 dlm_revert_pending_convert(res, lock); dlmconvert_remote() 341 } else if ((res->state & DLM_LOCK_RES_RECOVERING) || dlmconvert_remote() 342 (old_owner != res->owner)) { dlmconvert_remote() 343 mlog(0, "res %.*s is in recovering or has been recovered.\n", dlmconvert_remote() 344 res->lockname.len, res->lockname.name); dlmconvert_remote() 348 spin_unlock(&res->spinlock); dlmconvert_remote() 352 wake_up(&res->wq); dlmconvert_remote() 365 struct dlm_lock_resource *res, dlm_send_remote_convert_request() 375 mlog(0, "%.*s\n", res->lockname.len, res->lockname.name); dlm_send_remote_convert_request() 381 convert.namelen = res->lockname.len; dlm_send_remote_convert_request() 383 memcpy(convert.name, res->lockname.name, convert.namelen); dlm_send_remote_convert_request() 396 vec, veclen, res->owner, &status); dlm_send_remote_convert_request() 402 "message!\n", res->owner); dlm_send_remote_convert_request() 405 "message!\n", res->owner); dlm_send_remote_convert_request() 408 "message!\n", res->owner); dlm_send_remote_convert_request() 414 res->owner); dlm_send_remote_convert_request() 419 dlm_wait_for_node_death(dlm, res->owner, dlm_send_remote_convert_request() 423 "from convert message!\n", res->owner); dlm_send_remote_convert_request() 435 * taken: takes and drop res->spinlock 445 struct dlm_lock_resource *res = NULL; dlm_convert_lock_handler() local 480 res = dlm_lookup_lockres(dlm, cnv->name, cnv->namelen); dlm_convert_lock_handler() 481 if (!res) { dlm_convert_lock_handler() 486 spin_lock(&res->spinlock); dlm_convert_lock_handler() 487 status = __dlm_lockres_state_to_status(res); dlm_convert_lock_handler() 489 spin_unlock(&res->spinlock); dlm_convert_lock_handler() 493 list_for_each_entry(tmp_lock, &res->granted, list) { dlm_convert_lock_handler() 501 spin_unlock(&res->spinlock); dlm_convert_lock_handler() 508 dlm_print_one_lock_resource(res); dlm_convert_lock_handler() 525 spin_lock(&res->spinlock); dlm_convert_lock_handler() 526 status = __dlm_lockres_state_to_status(res); dlm_convert_lock_handler() 528 __dlm_lockres_reserve_ast(res); dlm_convert_lock_handler() 530 res->state |= DLM_LOCK_RES_IN_PROGRESS; dlm_convert_lock_handler() 531 status = __dlmconvert_master(dlm, res, lock, flags, dlm_convert_lock_handler() 534 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlm_convert_lock_handler() 537 spin_unlock(&res->spinlock); dlm_convert_lock_handler() 539 wake_up(&res->wq); dlm_convert_lock_handler() 555 dlm_lockres_release_ast(dlm, res); dlm_convert_lock_handler() 558 dlm_kick_thread(dlm, res); dlm_convert_lock_handler() 560 if (res) dlm_convert_lock_handler() 561 dlm_lockres_put(res); dlm_convert_lock_handler() 76 dlmconvert_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags, int type) dlmconvert_master() argument 119 __dlmconvert_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags, int type, int *call_ast, int *kick_thread) __dlmconvert_master() argument 260 dlmconvert_remote(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags, int type) dlmconvert_remote() argument 364 dlm_send_remote_convert_request(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags, int type) dlm_send_remote_convert_request() argument
|
H A D | dlmast.c | 51 static void dlm_update_lvb(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, 93 struct dlm_lock_resource *res; __dlm_queue_ast() local 98 res = lock->lockres; __dlm_queue_ast() 103 mlog(ML_ERROR, "%s: res %.*s, lock %u:%llu, " __dlm_queue_ast() 105 dlm->name, res->lockname.len, res->lockname.name, __dlm_queue_ast() 112 mlog(0, "%s: res %.*s, lock %u:%llu, AST getting flushed\n", __dlm_queue_ast() 113 dlm->name, res->lockname.len, res->lockname.name, __dlm_queue_ast() 123 mlog(0, "%s: res %.*s, lock %u:%llu, Cancelling BAST\n", __dlm_queue_ast() 124 dlm->name, res->lockname.len, res->lockname.name, __dlm_queue_ast() 132 * so res->spinlock will not be taken here */ __dlm_queue_ast() 137 * to get to this point. the res->spinlock will not be __dlm_queue_ast() 139 dlm_lockres_release_ast(dlm, res); __dlm_queue_ast() 159 struct dlm_lock_resource *res; __dlm_queue_bast() local 166 res = lock->lockres; __dlm_queue_bast() 170 mlog(0, "%s: res %.*s, lock %u:%llu, BAST getting flushed\n", __dlm_queue_bast() 171 dlm->name, res->lockname.len, res->lockname.name, __dlm_queue_bast() 193 static void dlm_update_lvb(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_update_lvb() argument 200 spin_lock(&res->spinlock); dlm_update_lvb() 201 if (res->owner == dlm->node_num) { dlm_update_lvb() 207 memcpy(lksb->lvb, res->lvb, DLM_LVB_LEN); dlm_update_lvb() 217 spin_unlock(&res->spinlock); dlm_update_lvb() 223 void dlm_do_local_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_do_local_ast() argument 229 mlog(0, "%s: res %.*s, lock %u:%llu, Local AST\n", dlm->name, dlm_do_local_ast() 230 res->lockname.len, res->lockname.name, dlm_do_local_ast() 238 dlm_update_lvb(dlm, res, lock); dlm_do_local_ast() 243 int dlm_do_remote_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_do_remote_ast() argument 250 mlog(0, "%s: res %.*s, lock %u:%llu, Remote AST\n", dlm->name, dlm_do_remote_ast() 251 res->lockname.len, res->lockname.name, dlm_do_remote_ast() 259 dlm_update_lvb(dlm, res, lock); dlm_do_remote_ast() 263 ret = dlm_send_proxy_ast(dlm, res, lock, lksbflags); dlm_do_remote_ast() 267 void dlm_do_local_bast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_do_local_bast() argument 274 mlog(0, "%s: res %.*s, lock %u:%llu, Local BAST, blocked %d\n", dlm_do_local_bast() 275 dlm->name, res->lockname.len, res->lockname.name, dlm_do_local_bast() 291 struct dlm_lock_resource *res = NULL; dlm_proxy_ast_handler() local 345 res = dlm_lookup_lockres(dlm, name, locklen); dlm_proxy_ast_handler() 346 if (!res) { dlm_proxy_ast_handler() 357 BUG_ON(res->owner == dlm->node_num); dlm_proxy_ast_handler() 359 mlog(0, "%s: res %.*s\n", dlm->name, res->lockname.len, dlm_proxy_ast_handler() 360 res->lockname.name); dlm_proxy_ast_handler() 362 spin_lock(&res->spinlock); dlm_proxy_ast_handler() 363 if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_proxy_ast_handler() 368 if (res->state & DLM_LOCK_RES_MIGRATING) { dlm_proxy_ast_handler() 374 head = &res->converting; dlm_proxy_ast_handler() 383 head = &res->blocked; 385 head = &res->granted; 404 spin_unlock(&res->spinlock); 411 list_move_tail(&lock->list, &res->granted); 412 mlog(0, "%s: res %.*s, lock %u:%llu, Granted type %d => %d\n", 413 dlm->name, res->lockname.len, res->lockname.name, 433 spin_unlock(&res->spinlock); 436 dlm_do_local_ast(dlm, res, lock); 438 dlm_do_local_bast(dlm, res, lock, past->blocked_type); 441 if (res) 442 dlm_lockres_put(res); 450 int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_send_proxy_ast_msg() argument 460 mlog(0, "%s: res %.*s, to %u, type %d, blocked_type %d\n", dlm->name, dlm_send_proxy_ast_msg() 461 res->lockname.len, res->lockname.name, lock->ml.node, msg_type, dlm_send_proxy_ast_msg() 468 past.namelen = res->lockname.len; dlm_send_proxy_ast_msg() 469 memcpy(past.name, res->lockname.name, past.namelen); dlm_send_proxy_ast_msg() 484 mlog(ML_ERROR, "%s: res %.*s, error %d send AST to node %u\n", dlm_send_proxy_ast_msg() 485 dlm->name, res->lockname.len, res->lockname.name, ret, dlm_send_proxy_ast_msg()
|
H A D | dlmlock.c | 61 struct dlm_lock_resource *res, 86 * caller needs: res->spinlock 91 static int dlm_can_grant_new_lock(struct dlm_lock_resource *res, dlm_can_grant_new_lock() argument 96 list_for_each_entry(tmplock, &res->granted, list) { dlm_can_grant_new_lock() 101 list_for_each_entry(tmplock, &res->converting, list) { dlm_can_grant_new_lock() 115 * taken: takes and drops res->spinlock 120 struct dlm_lock_resource *res, dlmlock_master() 128 spin_lock(&res->spinlock); dlmlock_master() 131 status = __dlm_lockres_state_to_status(res); dlmlock_master() 135 spin_unlock(&res->spinlock); dlmlock_master() 139 __dlm_wait_on_lockres(res); dlmlock_master() 140 __dlm_lockres_reserve_ast(res); dlmlock_master() 142 if (dlm_can_grant_new_lock(res, lock)) { dlmlock_master() 148 list_add_tail(&lock->list, &res->granted); dlmlock_master() 155 if (!dlm_is_recovery_lock(res->lockname.name, dlmlock_master() 156 res->lockname.len)) { dlmlock_master() 169 if (dlm_is_recovery_lock(res->lockname.name, dlmlock_master() 170 res->lockname.len)) { dlmlock_master() 178 list_add_tail(&lock->list, &res->blocked); dlmlock_master() 183 spin_unlock(&res->spinlock); dlmlock_master() 184 wake_up(&res->wq); dlmlock_master() 190 dlm_lockres_release_ast(dlm, res); dlmlock_master() 192 dlm_lockres_calc_usage(dlm, res); dlmlock_master() 194 dlm_kick_thread(dlm, res); dlmlock_master() 199 void dlm_revert_pending_lock(struct dlm_lock_resource *res, dlm_revert_pending_lock() argument 211 * taken: takes and drops res->spinlock 216 struct dlm_lock_resource *res, dlmlock_remote() 223 lock->ml.type, res->lockname.len, dlmlock_remote() 224 res->lockname.name, flags); dlmlock_remote() 230 spin_lock(&res->spinlock); dlmlock_remote() 231 __dlm_wait_on_lockres(res); dlmlock_remote() 232 if (res->owner == dlm->node_num) { dlmlock_remote() 233 spin_unlock(&res->spinlock); dlmlock_remote() 236 res->state |= DLM_LOCK_RES_IN_PROGRESS; dlmlock_remote() 240 list_add_tail(&lock->list, &res->blocked); dlmlock_remote() 242 spin_unlock(&res->spinlock); dlmlock_remote() 246 status = dlm_send_remote_lock_request(dlm, res, lock, flags); dlmlock_remote() 248 spin_lock(&res->spinlock); dlmlock_remote() 249 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlmlock_remote() 253 dlm_is_recovery_lock(res->lockname.name, dlmlock_remote() 254 res->lockname.len)) { dlmlock_remote() 260 dlm->name, res->owner); dlmlock_remote() 271 dlm_revert_pending_lock(res, lock); dlmlock_remote() 273 } else if (dlm_is_recovery_lock(res->lockname.name, dlmlock_remote() 274 res->lockname.len)) { dlmlock_remote() 281 dlm->name, dlm->node_num, res->owner); dlmlock_remote() 282 list_move_tail(&lock->list, &res->granted); dlmlock_remote() 284 spin_unlock(&res->spinlock); dlmlock_remote() 287 dlm_lockres_calc_usage(dlm, res); dlmlock_remote() 289 wake_up(&res->wq); dlmlock_remote() 296 * caller needs: none, but need res->state & DLM_LOCK_RES_IN_PROGRESS 302 struct dlm_lock_resource *res, dlm_send_remote_lock_request() 313 create.namelen = res->lockname.len; dlm_send_remote_lock_request() 315 memcpy(create.name, res->lockname.name, create.namelen); dlm_send_remote_lock_request() 318 sizeof(create), res->owner, &status); dlm_send_remote_lock_request() 322 mlog(ML_ERROR, "%s: res %.*s, Stale lockres no longer " dlm_send_remote_lock_request() 325 create.name, res->owner); dlm_send_remote_lock_request() 326 dlm_print_one_lock_resource(res); dlm_send_remote_lock_request() 330 mlog(ML_ERROR, "%s: res %.*s, Error %d send CREATE LOCK to " dlm_send_remote_lock_request() 332 tmpret, res->owner); dlm_send_remote_lock_request() 375 struct dlm_lock_resource *res) dlm_lock_attach_lockres() 377 dlm_lockres_get(res); dlm_lock_attach_lockres() 378 lock->lockres = res; dlm_lock_attach_lockres() 384 struct dlm_lock_resource *res; dlm_lock_detach_lockres() local 386 res = lock->lockres; dlm_lock_detach_lockres() 387 if (res) { dlm_lock_detach_lockres() 390 dlm_lockres_put(res); dlm_lock_detach_lockres() 454 * taken: takes and drops res->spinlock 463 struct dlm_lock_resource *res = NULL; dlm_create_lock_handler() local 509 res = dlm_lookup_lockres(dlm, name, namelen); dlm_create_lock_handler() 510 if (!res) { dlm_create_lock_handler() 515 spin_lock(&res->spinlock); dlm_create_lock_handler() 516 status = __dlm_lockres_state_to_status(res); dlm_create_lock_handler() 517 spin_unlock(&res->spinlock); dlm_create_lock_handler() 524 dlm_lock_attach_lockres(newlock, res); dlm_create_lock_handler() 526 status = dlmlock_master(dlm, res, newlock, be32_to_cpu(create->flags)); dlm_create_lock_handler() 532 if (res) dlm_create_lock_handler() 533 dlm_lockres_put(res); dlm_create_lock_handler() 564 struct dlm_lock_resource *res = NULL; dlmlock() local 611 res = lock->lockres; dlmlock() 612 if (!res) { dlmlock() 617 dlm_lockres_get(res); dlmlock() 637 if (res->owner == dlm->node_num) dlmlock() 638 status = dlmconvert_master(dlm, res, lock, flags, mode); dlmlock() 640 status = dlmconvert_remote(dlm, res, lock, flags, mode); dlmlock() 679 res = dlm_get_lock_resource(dlm, name, namelen, flags); dlmlock() 680 if (!res) { dlmlock() 687 mlog(0, "creating lock: lock=%p res=%p\n", lock, res); dlmlock() 689 dlm_lock_attach_lockres(lock, res); dlmlock() 708 if (res->owner == dlm->node_num) dlmlock() 709 status = dlmlock_master(dlm, res, lock, flags); dlmlock() 711 status = dlmlock_remote(dlm, res, lock, flags); dlmlock() 722 dlm_wait_for_node_death(dlm, res->owner, dlmlock() 731 spin_lock(&res->spinlock); dlmlock() 732 dlm_lockres_drop_inflight_ref(dlm, res); dlmlock() 733 spin_unlock(&res->spinlock); dlmlock() 735 dlm_lockres_calc_usage(dlm, res); dlmlock() 736 dlm_kick_thread(dlm, res); dlmlock() 756 if (res) dlmlock() 757 dlm_lockres_put(res); dlmlock() 119 dlmlock_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags) dlmlock_master() argument 215 dlmlock_remote(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags) dlmlock_remote() argument 301 dlm_send_remote_lock_request(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags) dlm_send_remote_lock_request() argument 374 dlm_lock_attach_lockres(struct dlm_lock *lock, struct dlm_lock_resource *res) dlm_lock_attach_lockres() argument
|
H A D | dlmmaster.c | 66 struct dlm_lock_resource *res, 93 struct dlm_lock_resource *res, 102 static int dlm_do_master_request(struct dlm_lock_resource *res, 107 struct dlm_lock_resource *res, 111 struct dlm_lock_resource *res, 115 struct dlm_lock_resource *res, 122 struct dlm_lock_resource *res); 124 struct dlm_lock_resource *res); 126 struct dlm_lock_resource *res, 129 struct dlm_lock_resource *res); 268 struct dlm_lock_resource *res, dlm_init_mle() 293 BUG_ON(!res); dlm_init_mle() 294 mle->mleres = res; dlm_init_mle() 295 memcpy(mle->mname, res->lockname.name, res->lockname.len); dlm_init_mle() 296 mle->mnamelen = res->lockname.len; dlm_init_mle() 297 mle->mnamehash = res->lockname.hash; dlm_init_mle() 488 struct dlm_lock_resource *res; dlm_lockres_release() local 491 res = container_of(kref, struct dlm_lock_resource, refs); dlm_lockres_release() 492 dlm = res->dlm; dlm_lockres_release() 496 BUG_ON(!res->lockname.name); dlm_lockres_release() 498 mlog(0, "destroying lockres %.*s\n", res->lockname.len, dlm_lockres_release() 499 res->lockname.name); dlm_lockres_release() 502 if (!list_empty(&res->tracking)) dlm_lockres_release() 503 list_del_init(&res->tracking); dlm_lockres_release() 506 res->lockname.len, res->lockname.name); dlm_lockres_release() 507 dlm_print_one_lock_resource(res); dlm_lockres_release() 513 if (!hlist_unhashed(&res->hash_node) || dlm_lockres_release() 514 !list_empty(&res->granted) || dlm_lockres_release() 515 !list_empty(&res->converting) || dlm_lockres_release() 516 !list_empty(&res->blocked) || dlm_lockres_release() 517 !list_empty(&res->dirty) || dlm_lockres_release() 518 !list_empty(&res->recovering) || dlm_lockres_release() 519 !list_empty(&res->purge)) { dlm_lockres_release() 523 res->lockname.len, res->lockname.name, dlm_lockres_release() 524 !hlist_unhashed(&res->hash_node) ? 'H' : ' ', dlm_lockres_release() 525 !list_empty(&res->granted) ? 'G' : ' ', dlm_lockres_release() 526 !list_empty(&res->converting) ? 'C' : ' ', dlm_lockres_release() 527 !list_empty(&res->blocked) ? 'B' : ' ', dlm_lockres_release() 528 !list_empty(&res->dirty) ? 'D' : ' ', dlm_lockres_release() 529 !list_empty(&res->recovering) ? 'R' : ' ', dlm_lockres_release() 530 !list_empty(&res->purge) ? 'P' : ' '); dlm_lockres_release() 532 dlm_print_one_lock_resource(res); dlm_lockres_release() 537 BUG_ON(!hlist_unhashed(&res->hash_node)); dlm_lockres_release() 538 BUG_ON(!list_empty(&res->granted)); dlm_lockres_release() 539 BUG_ON(!list_empty(&res->converting)); dlm_lockres_release() 540 BUG_ON(!list_empty(&res->blocked)); dlm_lockres_release() 541 BUG_ON(!list_empty(&res->dirty)); dlm_lockres_release() 542 BUG_ON(!list_empty(&res->recovering)); dlm_lockres_release() 543 BUG_ON(!list_empty(&res->purge)); dlm_lockres_release() 545 kmem_cache_free(dlm_lockname_cache, (void *)res->lockname.name); dlm_lockres_release() 547 kmem_cache_free(dlm_lockres_cache, res); dlm_lockres_release() 550 void dlm_lockres_put(struct dlm_lock_resource *res) dlm_lockres_put() argument 552 kref_put(&res->refs, dlm_lockres_release); dlm_lockres_put() 556 struct dlm_lock_resource *res, dlm_init_lockres() 562 * res->lockname.name, so be sure to init every field dlm_init_lockres() 565 qname = (char *) res->lockname.name; dlm_init_lockres() 568 res->lockname.len = namelen; dlm_init_lockres() 569 res->lockname.hash = dlm_lockid_hash(name, namelen); dlm_init_lockres() 571 init_waitqueue_head(&res->wq); dlm_init_lockres() 572 spin_lock_init(&res->spinlock); dlm_init_lockres() 573 INIT_HLIST_NODE(&res->hash_node); dlm_init_lockres() 574 INIT_LIST_HEAD(&res->granted); dlm_init_lockres() 575 INIT_LIST_HEAD(&res->converting); dlm_init_lockres() 576 INIT_LIST_HEAD(&res->blocked); dlm_init_lockres() 577 INIT_LIST_HEAD(&res->dirty); dlm_init_lockres() 578 INIT_LIST_HEAD(&res->recovering); dlm_init_lockres() 579 INIT_LIST_HEAD(&res->purge); dlm_init_lockres() 580 INIT_LIST_HEAD(&res->tracking); dlm_init_lockres() 581 atomic_set(&res->asts_reserved, 0); dlm_init_lockres() 582 res->migration_pending = 0; dlm_init_lockres() 583 res->inflight_locks = 0; dlm_init_lockres() 584 res->inflight_assert_workers = 0; dlm_init_lockres() 586 res->dlm = dlm; dlm_init_lockres() 588 kref_init(&res->refs); dlm_init_lockres() 594 spin_lock(&res->spinlock); dlm_init_lockres() 595 dlm_set_lockres_owner(dlm, res, DLM_LOCK_RES_OWNER_UNKNOWN); dlm_init_lockres() 596 spin_unlock(&res->spinlock); dlm_init_lockres() 598 res->state = DLM_LOCK_RES_IN_PROGRESS; dlm_init_lockres() 600 res->last_used = 0; dlm_init_lockres() 603 list_add_tail(&res->tracking, &dlm->tracking_list); dlm_init_lockres() 606 memset(res->lvb, 0, DLM_LVB_LEN); dlm_init_lockres() 607 memset(res->refmap, 0, sizeof(res->refmap)); dlm_init_lockres() 614 struct dlm_lock_resource *res = NULL; dlm_new_lockres() local 616 res = kmem_cache_zalloc(dlm_lockres_cache, GFP_NOFS); dlm_new_lockres() 617 if (!res) dlm_new_lockres() 620 res->lockname.name = kmem_cache_zalloc(dlm_lockname_cache, GFP_NOFS); dlm_new_lockres() 621 if (!res->lockname.name) dlm_new_lockres() 624 dlm_init_lockres(dlm, res, name, namelen); dlm_new_lockres() 625 return res; dlm_new_lockres() 628 if (res) dlm_new_lockres() 629 kmem_cache_free(dlm_lockres_cache, res); dlm_new_lockres() 634 struct dlm_lock_resource *res, int bit) dlm_lockres_set_refmap_bit() 636 assert_spin_locked(&res->spinlock); dlm_lockres_set_refmap_bit() 638 mlog(0, "res %.*s, set node %u, %ps()\n", res->lockname.len, dlm_lockres_set_refmap_bit() 639 res->lockname.name, bit, __builtin_return_address(0)); dlm_lockres_set_refmap_bit() 641 set_bit(bit, res->refmap); dlm_lockres_set_refmap_bit() 645 struct dlm_lock_resource *res, int bit) dlm_lockres_clear_refmap_bit() 647 assert_spin_locked(&res->spinlock); dlm_lockres_clear_refmap_bit() 649 mlog(0, "res %.*s, clr node %u, %ps()\n", res->lockname.len, dlm_lockres_clear_refmap_bit() 650 res->lockname.name, bit, __builtin_return_address(0)); dlm_lockres_clear_refmap_bit() 652 clear_bit(bit, res->refmap); dlm_lockres_clear_refmap_bit() 656 struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_ref() 658 res->inflight_locks++; __dlm_lockres_grab_inflight_ref() 660 mlog(0, "%s: res %.*s, inflight++: now %u, %ps()\n", dlm->name, __dlm_lockres_grab_inflight_ref() 661 res->lockname.len, res->lockname.name, res->inflight_locks, __dlm_lockres_grab_inflight_ref() 666 struct dlm_lock_resource *res) dlm_lockres_grab_inflight_ref() 668 assert_spin_locked(&res->spinlock); dlm_lockres_grab_inflight_ref() 669 __dlm_lockres_grab_inflight_ref(dlm, res); dlm_lockres_grab_inflight_ref() 673 struct dlm_lock_resource *res) dlm_lockres_drop_inflight_ref() 675 assert_spin_locked(&res->spinlock); dlm_lockres_drop_inflight_ref() 677 BUG_ON(res->inflight_locks == 0); dlm_lockres_drop_inflight_ref() 679 res->inflight_locks--; dlm_lockres_drop_inflight_ref() 681 mlog(0, "%s: res %.*s, inflight--: now %u, %ps()\n", dlm->name, dlm_lockres_drop_inflight_ref() 682 res->lockname.len, res->lockname.name, res->inflight_locks, dlm_lockres_drop_inflight_ref() 685 wake_up(&res->wq); dlm_lockres_drop_inflight_ref() 689 struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_worker() 691 assert_spin_locked(&res->spinlock); __dlm_lockres_grab_inflight_worker() 692 res->inflight_assert_workers++; __dlm_lockres_grab_inflight_worker() 694 dlm->name, res->lockname.len, res->lockname.name, __dlm_lockres_grab_inflight_worker() 695 res->inflight_assert_workers); __dlm_lockres_grab_inflight_worker() 699 struct dlm_lock_resource *res) __dlm_lockres_drop_inflight_worker() 701 assert_spin_locked(&res->spinlock); __dlm_lockres_drop_inflight_worker() 702 BUG_ON(res->inflight_assert_workers == 0); __dlm_lockres_drop_inflight_worker() 703 res->inflight_assert_workers--; __dlm_lockres_drop_inflight_worker() 705 dlm->name, res->lockname.len, res->lockname.name, __dlm_lockres_drop_inflight_worker() 706 res->inflight_assert_workers); __dlm_lockres_drop_inflight_worker() 710 struct dlm_lock_resource *res) dlm_lockres_drop_inflight_worker() 712 spin_lock(&res->spinlock); dlm_lockres_drop_inflight_worker() 713 __dlm_lockres_drop_inflight_worker(dlm, res); dlm_lockres_drop_inflight_worker() 714 spin_unlock(&res->spinlock); dlm_lockres_drop_inflight_worker() 738 struct dlm_lock_resource *tmpres=NULL, *res=NULL; dlm_get_lock_resource() local 798 if (res) dlm_get_lock_resource() 799 dlm_lockres_put(res); dlm_get_lock_resource() 800 res = tmpres; dlm_get_lock_resource() 804 if (!res) { dlm_get_lock_resource() 811 res = dlm_new_lockres(dlm, lockid, namelen); dlm_get_lock_resource() 812 if (!res) dlm_get_lock_resource() 817 mlog(0, "no lockres found, allocated our own: %p\n", res); dlm_get_lock_resource() 822 spin_lock(&res->spinlock); dlm_get_lock_resource() 823 dlm_change_lockres_owner(dlm, res, dlm->node_num); dlm_get_lock_resource() 824 __dlm_insert_lockres(dlm, res); dlm_get_lock_resource() 825 dlm_lockres_grab_inflight_ref(dlm, res); dlm_get_lock_resource() 826 spin_unlock(&res->spinlock); dlm_get_lock_resource() 878 dlm_init_mle(mle, DLM_MLE_MASTER, dlm, res, NULL, 0); dlm_get_lock_resource() 888 mlog(0, "%s: res %.*s, At least one node (%d) " dlm_get_lock_resource() 901 __dlm_insert_lockres(dlm, res); dlm_get_lock_resource() 904 __dlm_lockres_grab_inflight_ref(dlm, res); dlm_get_lock_resource() 922 if (!dlm_pre_master_reco_lockres(dlm, res)) dlm_get_lock_resource() 939 mlog(0, "%s: res %.*s, At least one node (%d) " dlm_get_lock_resource() 958 ret = dlm_do_master_request(res, mle, nodenum); dlm_get_lock_resource() 969 mlog(0, "%s: res %.*s, Requests only up to %u but " dlm_get_lock_resource() 977 ret = dlm_wait_for_lock_mastery(dlm, res, mle, &blocked); dlm_get_lock_resource() 980 mlog(0, "%s: res %.*s, Node map changed, redo the master " dlm_get_lock_resource() 981 "request now, blocked=%d\n", dlm->name, res->lockname.len, dlm_get_lock_resource() 982 res->lockname.name, blocked); dlm_get_lock_resource() 984 mlog(ML_ERROR, "%s: res %.*s, Spinning on " dlm_get_lock_resource() 986 dlm->name, res->lockname.len, dlm_get_lock_resource() 987 res->lockname.name, blocked); dlm_get_lock_resource() 988 dlm_print_one_lock_resource(res); dlm_get_lock_resource() 995 mlog(0, "%s: res %.*s, Mastered by %u\n", dlm->name, res->lockname.len, dlm_get_lock_resource() 996 res->lockname.name, res->owner); dlm_get_lock_resource() 998 BUG_ON(res->owner == O2NM_MAX_NODES); dlm_get_lock_resource() 1007 spin_lock(&res->spinlock); dlm_get_lock_resource() 1008 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlm_get_lock_resource() 1009 spin_unlock(&res->spinlock); dlm_get_lock_resource() 1010 wake_up(&res->wq); dlm_get_lock_resource() 1017 return res; dlm_get_lock_resource() 1024 struct dlm_lock_resource *res, dlm_wait_for_lock_mastery() 1038 spin_lock(&res->spinlock); dlm_wait_for_lock_mastery() 1039 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { dlm_wait_for_lock_mastery() 1041 res->lockname.len, res->lockname.name, res->owner); dlm_wait_for_lock_mastery() 1042 spin_unlock(&res->spinlock); dlm_wait_for_lock_mastery() 1045 if (res->owner != dlm->node_num) { dlm_wait_for_lock_mastery() 1046 ret = dlm_do_master_request(res, mle, res->owner); dlm_wait_for_lock_mastery() 1049 mlog(ML_ERROR, "link to %u went down?: %d\n", res->owner, ret); dlm_wait_for_lock_mastery() 1057 spin_unlock(&res->spinlock); dlm_wait_for_lock_mastery() 1070 dlm->name, res->lockname.len, res->lockname.name); dlm_wait_for_lock_mastery() 1071 ret = dlm_restart_lock_mastery(dlm, res, mle, *blocked); dlm_wait_for_lock_mastery() 1075 dlm->name, res->lockname.len, res->lockname.name, dlm_wait_for_lock_mastery() 1085 "rechecking now\n", dlm->name, res->lockname.len, dlm_wait_for_lock_mastery() 1086 res->lockname.name); dlm_wait_for_lock_mastery() 1091 "for %s:%.*s\n", dlm->name, res->lockname.len, dlm_wait_for_lock_mastery() 1092 res->lockname.name); dlm_wait_for_lock_mastery() 1130 res->lockname.len, res->lockname.name); dlm_wait_for_lock_mastery() 1136 if (res->owner == O2NM_MAX_NODES) { dlm_wait_for_lock_mastery() 1138 res->lockname.len, res->lockname.name); dlm_wait_for_lock_mastery() 1141 mlog(0, "done waiting, master is %u\n", res->owner); dlm_wait_for_lock_mastery() 1150 res->lockname.len, res->lockname.name, m); dlm_wait_for_lock_mastery() 1151 ret = dlm_do_assert_master(dlm, res, mle->vote_map, 0); dlm_wait_for_lock_mastery() 1166 spin_lock(&res->spinlock); dlm_wait_for_lock_mastery() 1169 dlm_change_lockres_owner(dlm, res, m); dlm_wait_for_lock_mastery() 1170 spin_unlock(&res->spinlock); dlm_wait_for_lock_mastery() 1236 struct dlm_lock_resource *res, dlm_restart_lock_mastery() 1283 res->lockname.len, dlm_restart_lock_mastery() 1284 res->lockname.name, dlm_restart_lock_mastery() 1299 res->lockname.len, dlm_restart_lock_mastery() 1300 res->lockname.name); dlm_restart_lock_mastery() 1302 mle->mleres = res; dlm_restart_lock_mastery() 1335 static int dlm_do_master_request(struct dlm_lock_resource *res, dlm_do_master_request() argument 1387 "reference\n", dlm->name, res->lockname.len, dlm_do_master_request() 1388 res->lockname.name, to); dlm_do_master_request() 1423 * res->spinlock 1434 struct dlm_lock_resource *res = NULL; dlm_master_request_handler() local 1463 res = __dlm_lookup_lockres(dlm, name, namelen, hash); dlm_master_request_handler() 1464 if (res) { dlm_master_request_handler() 1468 spin_lock(&res->spinlock); dlm_master_request_handler() 1475 if (hlist_unhashed(&res->hash_node)) { dlm_master_request_handler() 1476 spin_unlock(&res->spinlock); dlm_master_request_handler() 1477 dlm_lockres_put(res); dlm_master_request_handler() 1481 if (res->state & (DLM_LOCK_RES_RECOVERING| dlm_master_request_handler() 1483 spin_unlock(&res->spinlock); dlm_master_request_handler() 1484 mlog(0, "returning DLM_MASTER_RESP_ERROR since res is " dlm_master_request_handler() 1492 if (res->owner == dlm->node_num) { dlm_master_request_handler() 1493 dlm_lockres_set_refmap_bit(dlm, res, request->node_idx); dlm_master_request_handler() 1494 spin_unlock(&res->spinlock); dlm_master_request_handler() 1507 } else if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { dlm_master_request_handler() 1508 spin_unlock(&res->spinlock); dlm_master_request_handler() 1509 // mlog(0, "node %u is the master\n", res->owner); dlm_master_request_handler() 1519 if (!(res->state & DLM_LOCK_RES_IN_PROGRESS)) { dlm_master_request_handler() 1558 dlm_lockres_set_refmap_bit(dlm, res, dlm_master_request_handler() 1572 spin_unlock(&res->spinlock); dlm_master_request_handler() 1649 if (!res) { dlm_master_request_handler() 1654 dlm->node_num, res->lockname.len, res->lockname.name); dlm_master_request_handler() 1655 spin_lock(&res->spinlock); dlm_master_request_handler() 1656 ret = dlm_dispatch_assert_master(dlm, res, 0, request->node_idx, dlm_master_request_handler() 1661 dlm_lockres_put(res); dlm_master_request_handler() 1664 __dlm_lockres_grab_inflight_worker(dlm, res); dlm_master_request_handler() 1666 spin_unlock(&res->spinlock); dlm_master_request_handler() 1668 if (res) dlm_master_request_handler() 1669 dlm_lockres_put(res); dlm_master_request_handler() 1688 struct dlm_lock_resource *res, dlm_do_assert_master() 1696 const char *lockname = res->lockname.name; dlm_do_assert_master() 1697 unsigned int namelen = res->lockname.len; dlm_do_assert_master() 1701 spin_lock(&res->spinlock); dlm_do_assert_master() 1702 res->state |= DLM_LOCK_RES_SETREF_INPROG; dlm_do_assert_master() 1703 spin_unlock(&res->spinlock); dlm_do_assert_master() 1770 spin_lock(&res->spinlock); dlm_do_assert_master() 1771 dlm_lockres_set_refmap_bit(dlm, res, to); dlm_do_assert_master() 1772 spin_unlock(&res->spinlock); dlm_do_assert_master() 1779 spin_lock(&res->spinlock); dlm_do_assert_master() 1780 res->state &= ~DLM_LOCK_RES_SETREF_INPROG; dlm_do_assert_master() 1781 spin_unlock(&res->spinlock); dlm_do_assert_master() 1782 wake_up(&res->wq); dlm_do_assert_master() 1790 * res->spinlock 1802 struct dlm_lock_resource *res = NULL; dlm_assert_master_handler() local 1880 res = __dlm_lookup_lockres(dlm, name, namelen, hash); dlm_assert_master_handler() 1881 if (res) { dlm_assert_master_handler() 1882 spin_lock(&res->spinlock); dlm_assert_master_handler() 1883 if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_assert_master_handler() 1889 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN && dlm_assert_master_handler() 1890 res->owner != assert->node_idx) { dlm_assert_master_handler() 1893 assert->node_idx, res->owner, namelen, dlm_assert_master_handler() 1895 __dlm_print_one_lock_resource(res); dlm_assert_master_handler() 1899 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { dlm_assert_master_handler() 1901 if (res->owner == assert->node_idx) { dlm_assert_master_handler() 1910 res->owner, namelen, name); dlm_assert_master_handler() 1913 if (!(res->state & DLM_LOCK_RES_IN_PROGRESS)) { dlm_assert_master_handler() 1934 spin_unlock(&res->spinlock); dlm_assert_master_handler() 1964 if (res) { dlm_assert_master_handler() 1966 spin_lock(&res->spinlock); dlm_assert_master_handler() 1970 res->lockname.len, res->lockname.name, dlm_assert_master_handler() 1972 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_assert_master_handler() 1974 dlm_change_lockres_owner(dlm, res, mle->new_master); dlm_assert_master_handler() 1975 BUG_ON(res->state & DLM_LOCK_RES_DIRTY); dlm_assert_master_handler() 1977 dlm_change_lockres_owner(dlm, res, mle->master); dlm_assert_master_handler() 1979 spin_unlock(&res->spinlock); dlm_assert_master_handler() 1982 wake_up(&res->wq); dlm_assert_master_handler() 2020 } else if (res) { dlm_assert_master_handler() 2021 if (res->owner != assert->node_idx) { dlm_assert_master_handler() 2024 res->owner, namelen, name); dlm_assert_master_handler() 2031 if (res) { dlm_assert_master_handler() 2032 spin_lock(&res->spinlock); dlm_assert_master_handler() 2033 res->state |= DLM_LOCK_RES_SETREF_INPROG; dlm_assert_master_handler() 2034 spin_unlock(&res->spinlock); dlm_assert_master_handler() 2035 *ret_data = (void *)res; dlm_assert_master_handler() 2060 __dlm_print_one_lock_resource(res); dlm_assert_master_handler() 2061 spin_unlock(&res->spinlock); dlm_assert_master_handler() 2067 *ret_data = (void *)res; dlm_assert_master_handler() 2074 struct dlm_lock_resource *res = (struct dlm_lock_resource *)ret_data; dlm_assert_master_post_handler() local 2077 spin_lock(&res->spinlock); dlm_assert_master_post_handler() 2078 res->state &= ~DLM_LOCK_RES_SETREF_INPROG; dlm_assert_master_post_handler() 2079 spin_unlock(&res->spinlock); dlm_assert_master_post_handler() 2080 wake_up(&res->wq); dlm_assert_master_post_handler() 2081 dlm_lockres_put(res); dlm_assert_master_post_handler() 2087 struct dlm_lock_resource *res, dlm_dispatch_assert_master() 2098 item->u.am.lockres = res; /* already have a ref */ dlm_dispatch_assert_master() 2105 mlog(0, "IGNORE HIGHER: %.*s\n", res->lockname.len, dlm_dispatch_assert_master() 2106 res->lockname.name); dlm_dispatch_assert_master() 2120 struct dlm_lock_resource *res; dlm_assert_master_worker() local 2128 res = item->u.am.lockres; dlm_assert_master_worker() 2159 spin_lock(&res->spinlock); dlm_assert_master_worker() 2160 if (res->state & DLM_LOCK_RES_MIGRATING) { dlm_assert_master_worker() 2164 spin_unlock(&res->spinlock); dlm_assert_master_worker() 2167 __dlm_lockres_reserve_ast(res); dlm_assert_master_worker() 2168 spin_unlock(&res->spinlock); dlm_assert_master_worker() 2173 res->lockname.len, res->lockname.name, dlm->node_num); dlm_assert_master_worker() 2174 ret = dlm_do_assert_master(dlm, res, nodemap, flags); dlm_assert_master_worker() 2182 dlm_lockres_release_ast(dlm, res); dlm_assert_master_worker() 2185 dlm_lockres_drop_inflight_worker(dlm, res); dlm_assert_master_worker() 2187 dlm_lockres_put(res); dlm_assert_master_worker() 2203 struct dlm_lock_resource *res) dlm_pre_master_reco_lockres() 2218 ret = dlm_do_master_requery(dlm, res, nodenum, &master); dlm_pre_master_reco_lockres() 2252 int dlm_drop_lockres_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_drop_lockres_ref() argument 2259 lockname = res->lockname.name; dlm_drop_lockres_ref() 2260 namelen = res->lockname.len; dlm_drop_lockres_ref() 2269 &deref, sizeof(deref), res->owner, &r); dlm_drop_lockres_ref() 2271 mlog(ML_ERROR, "%s: res %.*s, error %d send DEREF to node %u\n", dlm_drop_lockres_ref() 2272 dlm->name, namelen, lockname, ret, res->owner); dlm_drop_lockres_ref() 2275 mlog(ML_ERROR, "%s: res %.*s, DEREF to node %u got %d\n", dlm_drop_lockres_ref() 2276 dlm->name, namelen, lockname, res->owner, r); dlm_drop_lockres_ref() 2277 dlm_print_one_lock_resource(res); dlm_drop_lockres_ref() 2288 struct dlm_lock_resource *res = NULL; dlm_deref_lockres_handler() local 2317 res = __dlm_lookup_lockres_full(dlm, name, namelen, hash); dlm_deref_lockres_handler() 2318 if (!res) { dlm_deref_lockres_handler() 2326 spin_lock(&res->spinlock); dlm_deref_lockres_handler() 2327 if (res->state & DLM_LOCK_RES_SETREF_INPROG) dlm_deref_lockres_handler() 2330 BUG_ON(res->state & DLM_LOCK_RES_DROPPING_REF); dlm_deref_lockres_handler() 2331 if (test_bit(node, res->refmap)) { dlm_deref_lockres_handler() 2332 dlm_lockres_clear_refmap_bit(dlm, res, node); dlm_deref_lockres_handler() 2336 spin_unlock(&res->spinlock); dlm_deref_lockres_handler() 2340 dlm_lockres_calc_usage(dlm, res); dlm_deref_lockres_handler() 2344 res->lockname.len, res->lockname.name, node); dlm_deref_lockres_handler() 2345 dlm_print_one_lock_resource(res); dlm_deref_lockres_handler() 2359 item->u.dl.deref_res = res; dlm_deref_lockres_handler() 2370 if (res) dlm_deref_lockres_handler() 2371 dlm_lockres_put(res); dlm_deref_lockres_handler() 2380 struct dlm_lock_resource *res; dlm_deref_lockres_worker() local 2385 res = item->u.dl.deref_res; dlm_deref_lockres_worker() 2388 spin_lock(&res->spinlock); dlm_deref_lockres_worker() 2389 BUG_ON(res->state & DLM_LOCK_RES_DROPPING_REF); dlm_deref_lockres_worker() 2390 if (test_bit(node, res->refmap)) { dlm_deref_lockres_worker() 2391 __dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_SETREF_INPROG); dlm_deref_lockres_worker() 2392 dlm_lockres_clear_refmap_bit(dlm, res, node); dlm_deref_lockres_worker() 2395 spin_unlock(&res->spinlock); dlm_deref_lockres_worker() 2399 dlm->name, res->lockname.len, res->lockname.name, node); dlm_deref_lockres_worker() 2400 dlm_lockres_calc_usage(dlm, res); dlm_deref_lockres_worker() 2404 res->lockname.len, res->lockname.name, node); dlm_deref_lockres_worker() 2405 dlm_print_one_lock_resource(res); dlm_deref_lockres_worker() 2408 dlm_lockres_put(res); dlm_deref_lockres_worker() 2419 struct dlm_lock_resource *res) dlm_is_lockres_migrateable() 2427 assert_spin_locked(&res->spinlock); dlm_is_lockres_migrateable() 2430 if (res->state & DLM_LOCK_RES_MIGRATING) dlm_is_lockres_migrateable() 2434 if (res->state & DLM_LOCK_RES_RECOVERING) dlm_is_lockres_migrateable() 2437 if (res->owner != dlm->node_num) dlm_is_lockres_migrateable() 2441 queue = dlm_list_idx_to_ptr(res, idx); list_for_each_entry() 2448 mlog(0, "%s: Not migrateable res %.*s, lock %u:%llu on " list_for_each_entry() 2449 "%s list\n", dlm->name, res->lockname.len, list_for_each_entry() 2450 res->lockname.name, list_for_each_entry() 2459 node_ref = find_next_bit(res->refmap, O2NM_MAX_NODES, 0); 2464 mlog(0, "%s: res %.*s, Migrateable\n", dlm->name, res->lockname.len, 2465 res->lockname.name); 2476 struct dlm_lock_resource *res, u8 target) dlm_migrate_lockres() 2492 name = res->lockname.name; dlm_migrate_lockres() 2493 namelen = res->lockname.len; dlm_migrate_lockres() 2519 ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, name, dlm_migrate_lockres() 2539 if (dlm_mark_lockres_migrating(dlm, res, target) < 0) { dlm_migrate_lockres() 2541 "the target went down.\n", res->lockname.len, dlm_migrate_lockres() 2542 res->lockname.name, target); dlm_migrate_lockres() 2543 spin_lock(&res->spinlock); dlm_migrate_lockres() 2544 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres() 2546 spin_unlock(&res->spinlock); dlm_migrate_lockres() 2583 ret = dlm_send_one_lockres(dlm, res, mres, target, dlm_migrate_lockres() 2593 spin_lock(&res->spinlock); dlm_migrate_lockres() 2594 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres() 2596 spin_unlock(&res->spinlock); dlm_migrate_lockres() 2622 res->owner == target) dlm_migrate_lockres() 2626 dlm->name, res->lockname.len, res->lockname.name); dlm_migrate_lockres() 2632 dlm->name, res->lockname.len, dlm_migrate_lockres() 2633 res->lockname.name, target); dlm_migrate_lockres() 2639 spin_lock(&res->spinlock); dlm_migrate_lockres() 2640 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres() 2642 spin_unlock(&res->spinlock); dlm_migrate_lockres() 2647 dlm->name, res->lockname.len, res->lockname.name); dlm_migrate_lockres() 2651 spin_lock(&res->spinlock); dlm_migrate_lockres() 2652 dlm_set_lockres_owner(dlm, res, target); dlm_migrate_lockres() 2653 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres() 2654 dlm_remove_nonlocal_locks(dlm, res); dlm_migrate_lockres() 2655 spin_unlock(&res->spinlock); dlm_migrate_lockres() 2656 wake_up(&res->wq); dlm_migrate_lockres() 2663 dlm_lockres_calc_usage(dlm, res); dlm_migrate_lockres() 2668 dlm_kick_thread(dlm, res); dlm_migrate_lockres() 2673 wake_up(&res->wq); dlm_migrate_lockres() 2697 int dlm_empty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_empty_lockres() argument 2705 spin_lock(&res->spinlock); dlm_empty_lockres() 2706 if (dlm_is_lockres_migrateable(dlm, res)) dlm_empty_lockres() 2707 target = dlm_pick_migration_target(dlm, res); dlm_empty_lockres() 2708 spin_unlock(&res->spinlock); dlm_empty_lockres() 2716 ret = dlm_migrate_lockres(dlm, res, target); dlm_empty_lockres() 2718 mlog(0, "%s: res %.*s, Migrate to node %u failed with %d\n", dlm_empty_lockres() 2719 dlm->name, res->lockname.len, res->lockname.name, dlm_empty_lockres() 2738 struct dlm_lock_resource *res, dlm_migration_can_proceed() 2742 spin_lock(&res->spinlock); dlm_migration_can_proceed() 2743 can_proceed = !!(res->state & DLM_LOCK_RES_MIGRATING); dlm_migration_can_proceed() 2744 spin_unlock(&res->spinlock); dlm_migration_can_proceed() 2756 struct dlm_lock_resource *res) dlm_lockres_is_dirty() 2759 spin_lock(&res->spinlock); dlm_lockres_is_dirty() 2760 ret = !!(res->state & DLM_LOCK_RES_DIRTY); dlm_lockres_is_dirty() 2761 spin_unlock(&res->spinlock); dlm_lockres_is_dirty() 2767 struct dlm_lock_resource *res, dlm_mark_lockres_migrating() 2773 res->lockname.len, res->lockname.name, dlm->node_num, dlm_mark_lockres_migrating() 2777 spin_lock(&res->spinlock); dlm_mark_lockres_migrating() 2778 BUG_ON(res->migration_pending); dlm_mark_lockres_migrating() 2779 res->migration_pending = 1; dlm_mark_lockres_migrating() 2782 __dlm_lockres_reserve_ast(res); dlm_mark_lockres_migrating() 2783 spin_unlock(&res->spinlock); dlm_mark_lockres_migrating() 2786 dlm_kick_thread(dlm, res); dlm_mark_lockres_migrating() 2789 spin_lock(&res->spinlock); dlm_mark_lockres_migrating() 2790 BUG_ON(res->state & DLM_LOCK_RES_BLOCK_DIRTY); dlm_mark_lockres_migrating() 2791 res->state |= DLM_LOCK_RES_BLOCK_DIRTY; dlm_mark_lockres_migrating() 2792 spin_unlock(&res->spinlock); dlm_mark_lockres_migrating() 2794 wait_event(dlm->ast_wq, !dlm_lockres_is_dirty(dlm, res)); dlm_mark_lockres_migrating() 2795 dlm_lockres_release_ast(dlm, res); dlm_mark_lockres_migrating() 2798 res->state & DLM_LOCK_RES_DIRTY ? "yes" : "no"); dlm_mark_lockres_migrating() 2804 dlm_migration_can_proceed(dlm, res, target), dlm_mark_lockres_migrating() 2808 res->state & DLM_LOCK_RES_MIGRATING ? "yes":"no", dlm_mark_lockres_migrating() 2812 res->state & DLM_LOCK_RES_MIGRATING ? "yes":"no", dlm_mark_lockres_migrating() 2815 if (!dlm_migration_can_proceed(dlm, res, target)) { dlm_mark_lockres_migrating() 2835 spin_lock(&res->spinlock); dlm_mark_lockres_migrating() 2836 BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY)); dlm_mark_lockres_migrating() 2837 res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY; dlm_mark_lockres_migrating() 2839 BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING)); dlm_mark_lockres_migrating() 2840 spin_unlock(&res->spinlock); dlm_mark_lockres_migrating() 2857 struct dlm_lock_resource *res) dlm_remove_nonlocal_locks() 2859 struct list_head *queue = &res->granted; dlm_remove_nonlocal_locks() 2863 assert_spin_locked(&res->spinlock); dlm_remove_nonlocal_locks() 2865 BUG_ON(res->owner == dlm->node_num); dlm_remove_nonlocal_locks() 2877 dlm_lockres_clear_refmap_bit(dlm, res, list_for_each_entry_safe() 2890 bit = find_next_bit(res->refmap, O2NM_MAX_NODES, bit); 2898 res->lockname.len, res->lockname.name, bit); 2899 dlm_lockres_clear_refmap_bit(dlm, res, bit); 2911 struct dlm_lock_resource *res) dlm_pick_migration_target() 2914 struct list_head *queue = &res->granted; dlm_pick_migration_target() 2920 assert_spin_locked(&res->spinlock); dlm_pick_migration_target() 2924 queue = dlm_list_idx_to_ptr(res, idx); list_for_each_entry() 2938 noderef = find_next_bit(res->refmap, O2NM_MAX_NODES, 2957 struct dlm_lock_resource *res, dlm_do_migrate_request() 2966 migrate.namelen = res->lockname.len; dlm_do_migrate_request() 2967 memcpy(migrate.name, res->lockname.name, migrate.namelen); dlm_do_migrate_request() 2992 mlog(ML_ERROR, "%s: res %.*s, Error %d send " dlm_do_migrate_request() 3010 dlm->name, res->lockname.len, res->lockname.name, dlm_do_migrate_request() 3012 spin_lock(&res->spinlock); dlm_do_migrate_request() 3013 dlm_lockres_set_refmap_bit(dlm, res, nodenum); dlm_do_migrate_request() 3014 spin_unlock(&res->spinlock); dlm_do_migrate_request() 3037 struct dlm_lock_resource *res = NULL; dlm_migrate_request_handler() local 3061 res = __dlm_lookup_lockres(dlm, name, namelen, hash); dlm_migrate_request_handler() 3062 if (res) { dlm_migrate_request_handler() 3063 spin_lock(&res->spinlock); dlm_migrate_request_handler() 3064 if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_migrate_request_handler() 3068 spin_unlock(&res->spinlock); dlm_migrate_request_handler() 3075 res->state |= DLM_LOCK_RES_MIGRATING; dlm_migrate_request_handler() 3076 spin_unlock(&res->spinlock); dlm_migrate_request_handler() 3081 ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, dlm_migrate_request_handler() 3096 if (res) dlm_migrate_request_handler() 3097 dlm_lockres_put(res); dlm_migrate_request_handler() 3111 struct dlm_lock_resource *res, dlm_add_migration_mle() 3170 dlm_init_mle(mle, DLM_MLE_MIGRATION, dlm, res, name, namelen); dlm_add_migration_mle() 3188 struct dlm_lock_resource *res; dlm_reset_mleres_owner() local 3191 res = __dlm_lookup_lockres(dlm, mle->mname, mle->mnamelen, dlm_reset_mleres_owner() 3193 if (res) { dlm_reset_mleres_owner() 3197 spin_lock(&res->spinlock); dlm_reset_mleres_owner() 3198 dlm_set_lockres_owner(dlm, res, DLM_LOCK_RES_OWNER_UNKNOWN); dlm_reset_mleres_owner() 3199 dlm_move_lockres_to_recovery_list(dlm, res); dlm_reset_mleres_owner() 3200 spin_unlock(&res->spinlock); dlm_reset_mleres_owner() 3201 dlm_lockres_put(res); dlm_reset_mleres_owner() 3212 return res; dlm_reset_mleres_owner() 3260 struct dlm_lock_resource *res; dlm_clean_master_list() local 3329 res = dlm_reset_mleres_owner(dlm, mle); hlist_for_each_entry_safe() 3330 if (res) hlist_for_each_entry_safe() 3341 int dlm_finish_migration(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_finish_migration() argument 3356 spin_lock(&res->spinlock); dlm_finish_migration() 3357 dlm_lockres_set_refmap_bit(dlm, res, old_master); dlm_finish_migration() 3358 spin_unlock(&res->spinlock); dlm_finish_migration() 3361 ret = dlm_do_migrate_request(dlm, res, old_master, dlm_finish_migration() 3369 res->lockname.len, res->lockname.name); dlm_finish_migration() 3372 ret = dlm_do_assert_master(dlm, res, iter.node_map, dlm_finish_migration() 3383 res->lockname.len, res->lockname.name, old_master); dlm_finish_migration() 3384 ret = dlm_do_assert_master(dlm, res, iter.node_map, dlm_finish_migration() 3395 spin_lock(&res->spinlock); dlm_finish_migration() 3396 dlm_set_lockres_owner(dlm, res, dlm->node_num); dlm_finish_migration() 3397 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_finish_migration() 3398 spin_unlock(&res->spinlock); dlm_finish_migration() 3400 dlm_kick_thread(dlm, res); dlm_finish_migration() 3401 wake_up(&res->wq); dlm_finish_migration() 3415 void __dlm_lockres_reserve_ast(struct dlm_lock_resource *res) __dlm_lockres_reserve_ast() argument 3417 assert_spin_locked(&res->spinlock); __dlm_lockres_reserve_ast() 3418 if (res->state & DLM_LOCK_RES_MIGRATING) { __dlm_lockres_reserve_ast() 3419 __dlm_print_one_lock_resource(res); __dlm_lockres_reserve_ast() 3421 BUG_ON(res->state & DLM_LOCK_RES_MIGRATING); __dlm_lockres_reserve_ast() 3423 atomic_inc(&res->asts_reserved); __dlm_lockres_reserve_ast() 3440 struct dlm_lock_resource *res) dlm_lockres_release_ast() 3442 if (!atomic_dec_and_lock(&res->asts_reserved, &res->spinlock)) dlm_lockres_release_ast() 3445 if (!res->migration_pending) { dlm_lockres_release_ast() 3446 spin_unlock(&res->spinlock); dlm_lockres_release_ast() 3450 BUG_ON(res->state & DLM_LOCK_RES_MIGRATING); dlm_lockres_release_ast() 3451 res->migration_pending = 0; dlm_lockres_release_ast() 3452 res->state |= DLM_LOCK_RES_MIGRATING; dlm_lockres_release_ast() 3453 spin_unlock(&res->spinlock); dlm_lockres_release_ast() 3454 wake_up(&res->wq); dlm_lockres_release_ast() 265 dlm_init_mle(struct dlm_master_list_entry *mle, enum dlm_mle_type type, struct dlm_ctxt *dlm, struct dlm_lock_resource *res, const char *name, unsigned int namelen) dlm_init_mle() argument 555 dlm_init_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, const char *name, unsigned int namelen) dlm_init_lockres() argument 633 dlm_lockres_set_refmap_bit(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, int bit) dlm_lockres_set_refmap_bit() argument 644 dlm_lockres_clear_refmap_bit(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, int bit) dlm_lockres_clear_refmap_bit() argument 655 __dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_ref() argument 665 dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_grab_inflight_ref() argument 672 dlm_lockres_drop_inflight_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_drop_inflight_ref() argument 688 __dlm_lockres_grab_inflight_worker(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_worker() argument 698 __dlm_lockres_drop_inflight_worker(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_drop_inflight_worker() argument 709 dlm_lockres_drop_inflight_worker(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_drop_inflight_worker() argument 1023 dlm_wait_for_lock_mastery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_master_list_entry *mle, int *blocked) dlm_wait_for_lock_mastery() argument 1235 dlm_restart_lock_mastery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_master_list_entry *mle, int blocked) dlm_restart_lock_mastery() argument 1687 dlm_do_assert_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, void *nodemap, u32 flags) dlm_do_assert_master() argument 2086 dlm_dispatch_assert_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, int ignore_higher, u8 request_from, u32 flags) dlm_dispatch_assert_master() argument 2202 dlm_pre_master_reco_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_pre_master_reco_lockres() argument 2418 dlm_is_lockres_migrateable(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_is_lockres_migrateable() argument 2475 dlm_migrate_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 target) dlm_migrate_lockres() argument 2737 dlm_migration_can_proceed(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 mig_target) dlm_migration_can_proceed() argument 2755 dlm_lockres_is_dirty(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_is_dirty() argument 2766 dlm_mark_lockres_migrating(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 target) dlm_mark_lockres_migrating() argument 2856 dlm_remove_nonlocal_locks(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_remove_nonlocal_locks() argument 2910 dlm_pick_migration_target(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_pick_migration_target() argument 2956 dlm_do_migrate_request(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 master, u8 new_master, struct dlm_node_iter *iter) dlm_do_migrate_request() argument 3110 dlm_add_migration_mle(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_master_list_entry *mle, struct dlm_master_list_entry **oldmle, const char *name, unsigned int namelen, u8 new_master, u8 master) dlm_add_migration_mle() argument 3439 dlm_lockres_release_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_release_ast() argument
|
H A D | dlmunlock.c | 59 struct dlm_lock_resource *res, 64 struct dlm_lock_resource *res, 70 struct dlm_lock_resource *res, 93 * taken: res->spinlock and lock->spinlock taken and dropped 99 struct dlm_lock_resource *res, dlmunlock_common() 114 BUG_ON(res->owner != dlm->node_num); dlmunlock_common() 116 BUG_ON(res->owner == dlm->node_num); dlmunlock_common() 125 "while waiting for an ast!", res->lockname.len, dlmunlock_common() 126 res->lockname.name); dlmunlock_common() 130 spin_lock(&res->spinlock); dlmunlock_common() 131 if (res->state & DLM_LOCK_RES_IN_PROGRESS) { dlmunlock_common() 134 spin_unlock(&res->spinlock); dlmunlock_common() 138 __dlm_wait_on_lockres(res); dlmunlock_common() 139 res->state |= DLM_LOCK_RES_IN_PROGRESS; dlmunlock_common() 143 if (res->state & DLM_LOCK_RES_RECOVERING) { dlmunlock_common() 148 if (res->state & DLM_LOCK_RES_MIGRATING) { dlmunlock_common() 156 status = dlm_get_cancel_actions(dlm, res, lock, lksb, &actions); dlmunlock_common() 158 status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions); dlmunlock_common() 167 memcpy(res->lvb, lksb->lvb, DLM_LVB_LEN); dlmunlock_common() 174 owner = res->owner; dlmunlock_common() 181 spin_unlock(&res->spinlock); dlmunlock_common() 182 status = dlm_send_remote_unlock_request(dlm, res, lock, lksb, dlmunlock_common() 184 spin_lock(&res->spinlock); dlmunlock_common() 201 dlm->name, res->lockname.len, dlmunlock_common() 202 res->lockname.name, dlmunlock_common() 226 list_add_tail(&lock->list, &res->granted); dlmunlock_common() 238 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlmunlock_common() 239 if (!dlm_lock_on_list(&res->converting, lock)) dlmunlock_common() 244 spin_unlock(&res->spinlock); dlmunlock_common() 245 wake_up(&res->wq); dlmunlock_common() 267 void dlm_commit_pending_unlock(struct dlm_lock_resource *res, dlm_commit_pending_unlock() argument 275 void dlm_commit_pending_cancel(struct dlm_lock_resource *res, dlm_commit_pending_cancel() argument 278 list_move_tail(&lock->list, &res->granted); dlm_commit_pending_cancel() 284 struct dlm_lock_resource *res, dlmunlock_master() 290 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 1); dlmunlock_master() 294 struct dlm_lock_resource *res, dlmunlock_remote() 299 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 0); dlmunlock_remote() 310 struct dlm_lock_resource *res, dlm_send_remote_unlock_request() 323 mlog(0, "%.*s\n", res->lockname.len, res->lockname.name); dlm_send_remote_unlock_request() 331 res->lockname.len, res->lockname.name); dlm_send_remote_unlock_request() 339 unlock.namelen = res->lockname.len; dlm_send_remote_unlock_request() 340 memcpy(unlock.name, res->lockname.name, unlock.namelen); dlm_send_remote_unlock_request() 386 * taken: takes and drops res->spinlock 396 struct dlm_lock_resource *res = NULL; dlm_unlock_lock_handler() local 431 res = dlm_lookup_lockres(dlm, unlock->name, unlock->namelen); dlm_unlock_lock_handler() 432 if (!res) { dlm_unlock_lock_handler() 436 mlog(0, "returning DLM_FORWARD -- res no longer exists\n"); dlm_unlock_lock_handler() 441 queue=&res->granted; dlm_unlock_lock_handler() 443 spin_lock(&res->spinlock); dlm_unlock_lock_handler() 444 if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_unlock_lock_handler() 445 spin_unlock(&res->spinlock); dlm_unlock_lock_handler() 451 if (res->state & DLM_LOCK_RES_MIGRATING) { dlm_unlock_lock_handler() 452 spin_unlock(&res->spinlock); dlm_unlock_lock_handler() 458 if (res->owner != dlm->node_num) { dlm_unlock_lock_handler() 459 spin_unlock(&res->spinlock); dlm_unlock_lock_handler() 479 spin_unlock(&res->spinlock); 499 status = dlmunlock_master(dlm, res, lock, lksb, flags, &ignore); 506 dlm_lockres_calc_usage(dlm, res); 507 dlm_kick_thread(dlm, res); 519 if (res) 520 dlm_lockres_put(res); 529 struct dlm_lock_resource *res, dlm_get_cancel_actions() 536 if (dlm_lock_on_list(&res->blocked, lock)) { dlm_get_cancel_actions() 541 } else if (dlm_lock_on_list(&res->converting, lock)) { dlm_get_cancel_actions() 548 } else if (dlm_lock_on_list(&res->granted, lock)) { dlm_get_cancel_actions() 561 struct dlm_lock_resource *res, dlm_get_unlock_actions() 569 if (!dlm_lock_on_list(&res->granted, lock)) { dlm_get_unlock_actions() 591 struct dlm_lock_resource *res; dlmunlock() local 619 res = lock->lockres; dlmunlock() 620 BUG_ON(!res); dlmunlock() 621 dlm_lockres_get(res); dlmunlock() 625 mlog(0, "lock=%p res=%p\n", lock, res); dlmunlock() 627 spin_lock(&res->spinlock); dlmunlock() 628 is_master = (res->owner == dlm->node_num); dlmunlock() 631 spin_unlock(&res->spinlock); dlmunlock() 634 status = dlmunlock_master(dlm, res, lock, lksb, flags, dlmunlock() 639 status = dlmunlock_remote(dlm, res, lock, lksb, flags, dlmunlock() 686 dlm_kick_thread(dlm, res); dlmunlock() 690 dlm_lockres_calc_usage(dlm, res); dlmunlock() 691 dlm_lockres_put(res); dlmunlock() 98 dlmunlock_common(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, struct dlm_lockstatus *lksb, int flags, int *call_ast, int master_node) dlmunlock_common() argument 283 dlmunlock_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, struct dlm_lockstatus *lksb, int flags, int *call_ast) dlmunlock_master() argument 293 dlmunlock_remote(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, struct dlm_lockstatus *lksb, int flags, int *call_ast) dlmunlock_remote() argument 309 dlm_send_remote_unlock_request(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, struct dlm_lockstatus *lksb, int flags, u8 owner) dlm_send_remote_unlock_request() argument 528 dlm_get_cancel_actions(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, struct dlm_lockstatus *lksb, int *actions) dlm_get_cancel_actions() argument 560 dlm_get_unlock_actions(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, struct dlm_lockstatus *lksb, int *actions) dlm_get_unlock_actions() argument
|
H A D | dlmrecovery.c | 67 static inline int dlm_num_locks_in_lockres(struct dlm_lock_resource *res); 75 struct dlm_lock_resource *res, 78 struct dlm_lock_resource *res, 95 struct dlm_lock_resource *res, 255 struct dlm_lock_resource *res; dlm_print_reco_node_status() local 293 list_for_each_entry(res, &dlm->reco.resources, recovering) { dlm_print_reco_node_status() 295 dlm->name, res->lockname.len, res->lockname.name); dlm_print_reco_node_status() 883 struct dlm_lock_resource *res; dlm_request_all_locks_worker() local 929 list_for_each_entry(res, &resources, recovering) { dlm_request_all_locks_worker() 930 ret = dlm_send_one_lockres(dlm, res, mres, reco_master, dlm_request_all_locks_worker() 1055 struct dlm_lock_resource *res, *next; dlm_move_reco_locks_to_list() local 1059 list_for_each_entry_safe(res, next, &dlm->reco.resources, recovering) { dlm_move_reco_locks_to_list() 1062 if (dlm_is_recovery_lock(res->lockname.name, dlm_move_reco_locks_to_list() 1063 res->lockname.len)) { dlm_move_reco_locks_to_list() 1064 spin_lock(&res->spinlock); dlm_move_reco_locks_to_list() 1065 list_for_each_entry(lock, &res->granted, list) { dlm_move_reco_locks_to_list() 1079 spin_unlock(&res->spinlock); dlm_move_reco_locks_to_list() 1083 if (res->owner == dead_node) { dlm_move_reco_locks_to_list() 1087 list_move_tail(&res->recovering, list); dlm_move_reco_locks_to_list() 1088 } else if (res->owner == DLM_LOCK_RES_OWNER_UNKNOWN) { dlm_move_reco_locks_to_list() 1091 list_move_tail(&res->recovering, list); dlm_move_reco_locks_to_list() 1097 static inline int dlm_num_locks_in_lockres(struct dlm_lock_resource *res) dlm_num_locks_in_lockres() argument 1100 struct list_head *iter, *queue = &res->granted; dlm_num_locks_in_lockres() 1115 struct dlm_lock_resource *res, dlm_send_mig_lockres_msg() 1138 dlm->name, res->lockname.len, res->lockname.name, dlm_send_mig_lockres_msg() 1148 mlog(ML_ERROR, "%s: res %.*s, Error %d send MIG_LOCKRES to " dlm_send_mig_lockres_msg() 1168 dlm_init_migratable_lockres(mres, res->lockname.name, dlm_send_mig_lockres_msg() 1169 res->lockname.len, mres_total_locks, dlm_send_mig_lockres_msg() 1279 int dlm_send_one_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_send_one_lockres() argument 1293 total_locks = dlm_num_locks_in_lockres(res); dlm_send_one_lockres() 1302 dlm_init_migratable_lockres(mres, res->lockname.name, dlm_send_one_lockres() 1303 res->lockname.len, total_locks, dlm_send_one_lockres() 1304 mig_cookie, flags, res->owner); dlm_send_one_lockres() 1308 queue = dlm_list_idx_to_ptr(res, i); list_for_each_entry() 1318 res, total_locks); list_for_each_entry() 1326 dlm->name, res->lockname.len, res->lockname.name, 1332 ret = dlm_send_mig_lockres_msg(dlm, mres, send_to, res, total_locks); 1345 res->lockname.len, res->lockname.name); 1375 struct dlm_lock_resource *res = NULL; dlm_mig_lockres_handler() local 1403 res = dlm_lookup_lockres(dlm, mres->lockname, mres->lockname_len); dlm_mig_lockres_handler() 1404 if (res) { dlm_mig_lockres_handler() 1405 /* this will get a ref on res */ dlm_mig_lockres_handler() 1407 spin_lock(&res->spinlock); dlm_mig_lockres_handler() 1409 res->state |= DLM_LOCK_RES_RECOVERING; dlm_mig_lockres_handler() 1411 if (res->state & DLM_LOCK_RES_MIGRATING) { dlm_mig_lockres_handler() 1417 } else if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_mig_lockres_handler() 1423 spin_unlock(&res->spinlock); dlm_mig_lockres_handler() 1424 dlm_lockres_put(res); dlm_mig_lockres_handler() 1427 res->state |= DLM_LOCK_RES_MIGRATING; dlm_mig_lockres_handler() 1429 spin_unlock(&res->spinlock); dlm_mig_lockres_handler() 1433 res = dlm_new_lockres(dlm, mres->lockname, mres->lockname_len); dlm_mig_lockres_handler() 1434 if (!res) dlm_mig_lockres_handler() 1439 dlm_lockres_get(res); dlm_mig_lockres_handler() 1443 res->state |= DLM_LOCK_RES_RECOVERING; dlm_mig_lockres_handler() 1445 res->state |= DLM_LOCK_RES_MIGRATING; dlm_mig_lockres_handler() 1448 __dlm_insert_lockres(dlm, res); dlm_mig_lockres_handler() 1454 dlm_lockres_get(res); dlm_mig_lockres_handler() 1469 spin_lock(&res->spinlock); dlm_mig_lockres_handler() 1470 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; dlm_mig_lockres_handler() 1471 spin_unlock(&res->spinlock); dlm_mig_lockres_handler() 1472 wake_up(&res->wq); dlm_mig_lockres_handler() 1477 * the proper res->state flags. */ dlm_mig_lockres_handler() 1479 spin_lock(&res->spinlock); dlm_mig_lockres_handler() 1482 dlm_lockres_grab_inflight_ref(dlm, res); dlm_mig_lockres_handler() 1492 dlm_change_lockres_owner(dlm, res, dlm->node_num); dlm_mig_lockres_handler() 1494 spin_unlock(&res->spinlock); dlm_mig_lockres_handler() 1500 item->u.ml.lockres = res; /* already have a ref */ dlm_mig_lockres_handler() 1511 dlm_lockres_put(res); dlm_mig_lockres_handler() 1529 struct dlm_lock_resource *res; dlm_mig_lockres_worker() local 1536 res = item->u.ml.lockres; dlm_mig_lockres_worker() 1544 ret = dlm_lockres_master_requery(dlm, res, &real_master); dlm_mig_lockres_worker() 1553 res->lockname.len, res->lockname.name); dlm_mig_lockres_worker() 1555 spin_lock(&res->spinlock); dlm_mig_lockres_worker() 1556 dlm_lockres_drop_inflight_ref(dlm, res); dlm_mig_lockres_worker() 1557 spin_unlock(&res->spinlock); dlm_mig_lockres_worker() 1560 real_master, res->lockname.len, dlm_mig_lockres_worker() 1561 res->lockname.name); dlm_mig_lockres_worker() 1567 ret = dlm_process_recovery_data(dlm, res, mres); dlm_mig_lockres_worker() 1575 ret = dlm_finish_migration(dlm, res, mres->master); dlm_mig_lockres_worker() 1582 if (res) { dlm_mig_lockres_worker() 1584 dlm_lockres_put(res); dlm_mig_lockres_worker() 1585 dlm_lockres_put(res); dlm_mig_lockres_worker() 1593 struct dlm_lock_resource *res, dlm_lockres_master_requery() 1633 ret = dlm_do_master_requery(dlm, res, nodenum, real_master); dlm_lockres_master_requery() 1650 int dlm_do_master_requery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_do_master_requery() argument 1659 req.namelen = res->lockname.len; dlm_do_master_requery() 1660 memcpy(req.name, res->lockname.name, res->lockname.len); dlm_do_master_requery() 1693 struct dlm_lock_resource *res = NULL; dlm_master_requery_handler() local 1708 res = __dlm_lookup_lockres(dlm, req->name, req->namelen, hash); dlm_master_requery_handler() 1709 if (res) { dlm_master_requery_handler() 1710 spin_lock(&res->spinlock); dlm_master_requery_handler() 1711 master = res->owner; dlm_master_requery_handler() 1713 int ret = dlm_dispatch_assert_master(dlm, res, dlm_master_requery_handler() 1717 spin_unlock(&res->spinlock); dlm_master_requery_handler() 1718 dlm_lockres_put(res); dlm_master_requery_handler() 1725 __dlm_lockres_grab_inflight_worker(dlm, res); dlm_master_requery_handler() 1727 spin_unlock(&res->spinlock); dlm_master_requery_handler() 1730 spin_unlock(&res->spinlock); dlm_master_requery_handler() 1731 dlm_lockres_put(res); dlm_master_requery_handler() 1742 dlm_list_num_to_pointer(struct dlm_lock_resource *res, int list_num) dlm_list_num_to_pointer() argument 1747 ret = &(res->granted); dlm_list_num_to_pointer() 1779 struct dlm_lock_resource *res, dlm_process_recovery_data() 1804 spin_lock(&res->spinlock); dlm_process_recovery_data() 1805 dlm_lockres_set_refmap_bit(dlm, res, from); dlm_process_recovery_data() 1806 spin_unlock(&res->spinlock); dlm_process_recovery_data() 1814 queue = dlm_list_num_to_pointer(res, ml->list); dlm_process_recovery_data() 1825 spin_lock(&res->spinlock); dlm_process_recovery_data() 1827 tmpq = dlm_list_idx_to_ptr(res, j); list_for_each() 1851 __dlm_print_one_lock_resource(res); 1861 res->lockname.len, res->lockname.name, 1871 __dlm_print_one_lock_resource(res); 1881 j, ml->list, res->lockname.len, 1882 res->lockname.name); 1883 __dlm_print_one_lock_resource(res); 1884 spin_unlock(&res->spinlock); 1894 spin_unlock(&res->spinlock); 1909 dlm_lock_attach_lockres(newlock, res); 1912 BUG_ON(queue != &res->converting); 1938 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); 1944 if (!dlm_lvb_is_empty(res->lvb) && 1946 memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) { 1950 res->lockname.len, 1951 res->lockname.name, ml->type); 1954 printk("%02x", res->lvb[i]); 1959 dlm_print_one_lock_resource(res); 1962 memcpy(res->lvb, mres->lvb, DLM_LVB_LEN); 1984 spin_lock(&res->spinlock); list_for_each_entry() 1990 res->lockname.len, res->lockname.name, list_for_each_entry() 2001 __dlm_print_one_lock_resource(res); list_for_each_entry() 2019 res->lockname.len, res->lockname.name, ml->node); 2020 dlm_lockres_set_refmap_bit(dlm, res, ml->node); 2023 spin_unlock(&res->spinlock); 2029 spin_lock(&res->spinlock); 2030 dlm_lockres_drop_inflight_ref(dlm, res); 2031 spin_unlock(&res->spinlock); 2040 struct dlm_lock_resource *res) dlm_move_lockres_to_recovery_list() 2047 assert_spin_locked(&res->spinlock); dlm_move_lockres_to_recovery_list() 2048 res->state |= DLM_LOCK_RES_RECOVERING; dlm_move_lockres_to_recovery_list() 2049 if (!list_empty(&res->recovering)) { dlm_move_lockres_to_recovery_list() 2051 "Recovering res %s:%.*s, is already on recovery list!\n", dlm_move_lockres_to_recovery_list() 2052 dlm->name, res->lockname.len, res->lockname.name); dlm_move_lockres_to_recovery_list() 2053 list_del_init(&res->recovering); dlm_move_lockres_to_recovery_list() 2054 dlm_lockres_put(res); dlm_move_lockres_to_recovery_list() 2057 dlm_lockres_get(res); dlm_move_lockres_to_recovery_list() 2058 list_add_tail(&res->recovering, &dlm->reco.resources); dlm_move_lockres_to_recovery_list() 2062 queue = dlm_list_idx_to_ptr(res, i); list_for_each_entry_safe() 2069 res->lockname.len, res->lockname.name); list_for_each_entry_safe() 2070 dlm_revert_pending_convert(res, lock); list_for_each_entry_safe() 2077 res->lockname.len, res->lockname.name); list_for_each_entry_safe() 2083 dlm_revert_pending_lock(res, lock); list_for_each_entry_safe() 2098 res->lockname.len, res->lockname.name); list_for_each_entry_safe() 2099 dlm_commit_pending_unlock(res, lock); list_for_each_entry_safe() 2109 res->lockname.len, res->lockname.name); list_for_each_entry_safe() 2110 dlm_commit_pending_cancel(res, lock); list_for_each_entry_safe() 2121 * sets the res->owner to the new master. 2128 struct dlm_lock_resource *res, *next; dlm_finish_local_lockres_recovery() local 2132 list_for_each_entry_safe(res, next, &dlm->reco.resources, recovering) { dlm_finish_local_lockres_recovery() 2133 if (res->owner == dead_node) { dlm_finish_local_lockres_recovery() 2134 mlog(0, "%s: res %.*s, Changing owner from %u to %u\n", dlm_finish_local_lockres_recovery() 2135 dlm->name, res->lockname.len, res->lockname.name, dlm_finish_local_lockres_recovery() 2136 res->owner, new_master); dlm_finish_local_lockres_recovery() 2137 list_del_init(&res->recovering); dlm_finish_local_lockres_recovery() 2138 spin_lock(&res->spinlock); dlm_finish_local_lockres_recovery() 2141 dlm_change_lockres_owner(dlm, res, new_master); dlm_finish_local_lockres_recovery() 2142 res->state &= ~DLM_LOCK_RES_RECOVERING; dlm_finish_local_lockres_recovery() 2143 if (__dlm_lockres_has_locks(res)) dlm_finish_local_lockres_recovery() 2144 __dlm_dirty_lockres(dlm, res); dlm_finish_local_lockres_recovery() 2145 spin_unlock(&res->spinlock); dlm_finish_local_lockres_recovery() 2146 wake_up(&res->wq); dlm_finish_local_lockres_recovery() 2147 dlm_lockres_put(res); dlm_finish_local_lockres_recovery() 2157 hlist_for_each_entry(res, bucket, hash_node) { hlist_for_each_entry() 2158 if (!(res->state & DLM_LOCK_RES_RECOVERING)) hlist_for_each_entry() 2161 if (res->owner != dead_node && hlist_for_each_entry() 2162 res->owner != dlm->node_num) hlist_for_each_entry() 2165 if (!list_empty(&res->recovering)) { hlist_for_each_entry() 2166 list_del_init(&res->recovering); hlist_for_each_entry() 2167 dlm_lockres_put(res); hlist_for_each_entry() 2172 mlog(0, "%s: res %.*s, Changing owner from %u to %u\n", hlist_for_each_entry() 2173 dlm->name, res->lockname.len, res->lockname.name, hlist_for_each_entry() 2174 res->owner, new_master); hlist_for_each_entry() 2175 spin_lock(&res->spinlock); hlist_for_each_entry() 2176 dlm_change_lockres_owner(dlm, res, new_master); hlist_for_each_entry() 2177 res->state &= ~DLM_LOCK_RES_RECOVERING; hlist_for_each_entry() 2178 if (__dlm_lockres_has_locks(res)) hlist_for_each_entry() 2179 __dlm_dirty_lockres(dlm, res); hlist_for_each_entry() 2180 spin_unlock(&res->spinlock); hlist_for_each_entry() 2181 wake_up(&res->wq); hlist_for_each_entry() 2198 struct dlm_lock_resource *res, u8 dead_node) dlm_revalidate_lvb() 2207 assert_spin_locked(&res->spinlock); dlm_revalidate_lvb() 2209 if (res->owner == dlm->node_num) dlm_revalidate_lvb() 2221 queue = dlm_list_idx_to_ptr(res, i); list_for_each_entry() 2235 res->lockname.len, res->lockname.name, dead_node); 2236 memset(res->lvb, 0, DLM_LVB_LEN); 2241 struct dlm_lock_resource *res, u8 dead_node) dlm_free_dead_locks() 2251 assert_spin_locked(&res->spinlock); dlm_free_dead_locks() 2257 list_for_each_entry_safe(lock, next, &res->granted, list) { dlm_free_dead_locks() 2266 list_for_each_entry_safe(lock, next, &res->converting, list) { dlm_free_dead_locks() 2275 list_for_each_entry_safe(lock, next, &res->blocked, list) { dlm_free_dead_locks() 2288 res->lockname.len, res->lockname.name, freed, dead_node); dlm_free_dead_locks() 2289 if(!test_bit(dead_node, res->refmap)) { dlm_free_dead_locks() 2292 res->lockname.len, res->lockname.name, freed, dead_node); dlm_free_dead_locks() 2293 __dlm_print_one_lock_resource(res); dlm_free_dead_locks() 2295 dlm_lockres_clear_refmap_bit(dlm, res, dead_node); dlm_free_dead_locks() 2296 } else if (test_bit(dead_node, res->refmap)) { dlm_free_dead_locks() 2299 res->lockname.len, res->lockname.name, dead_node); dlm_free_dead_locks() 2300 dlm_lockres_clear_refmap_bit(dlm, res, dead_node); dlm_free_dead_locks() 2304 __dlm_dirty_lockres(dlm, res); dlm_free_dead_locks() 2316 struct dlm_lock_resource *res; dlm_do_local_recovery_cleanup() local 2341 hlist_for_each_entry(res, bucket, hash_node) { hlist_for_each_entry() 2344 if (dlm_is_recovery_lock(res->lockname.name, hlist_for_each_entry() 2345 res->lockname.len)) { hlist_for_each_entry() 2346 spin_lock(&res->spinlock); hlist_for_each_entry() 2347 list_for_each_entry(lock, &res->granted, list) { hlist_for_each_entry() 2362 dlm_lockres_clear_refmap_bit(dlm, res, hlist_for_each_entry() 2364 spin_unlock(&res->spinlock); hlist_for_each_entry() 2367 spin_lock(&res->spinlock); hlist_for_each_entry() 2369 dlm_revalidate_lvb(dlm, res, dead_node); hlist_for_each_entry() 2370 if (res->owner == dead_node) { hlist_for_each_entry() 2371 if (res->state & DLM_LOCK_RES_DROPPING_REF) { hlist_for_each_entry() 2372 mlog(ML_NOTICE, "%s: res %.*s, Skip " hlist_for_each_entry() 2374 dlm->name, res->lockname.len, hlist_for_each_entry() 2375 res->lockname.name); hlist_for_each_entry() 2378 res); hlist_for_each_entry() 2380 } else if (res->owner == dlm->node_num) { hlist_for_each_entry() 2381 dlm_free_dead_locks(dlm, res, dead_node); hlist_for_each_entry() 2382 __dlm_lockres_calc_usage(dlm, res); hlist_for_each_entry() 2383 } else if (res->owner == DLM_LOCK_RES_OWNER_UNKNOWN) { hlist_for_each_entry() 2384 if (test_bit(dead_node, res->refmap)) { hlist_for_each_entry() 2387 dlm->name, res->lockname.len, hlist_for_each_entry() 2388 res->lockname.name, dead_node); hlist_for_each_entry() 2389 dlm_lockres_clear_refmap_bit(dlm, res, dead_node); hlist_for_each_entry() 2392 spin_unlock(&res->spinlock); hlist_for_each_entry() 2631 struct dlm_lock_resource *res; dlm_pick_recovery_master() local 2637 res = dlm_lookup_lockres(dlm, DLM_RECOVERY_LOCK_NAME, dlm_pick_recovery_master() 2639 if (res) { dlm_pick_recovery_master() 2640 dlm_print_one_lock_resource(res); dlm_pick_recovery_master() 2641 dlm_lockres_put(res); dlm_pick_recovery_master() 2713 struct dlm_lock_resource *res; dlm_send_begin_reco_message() local 2720 res = dlm_lookup_lockres(dlm, DLM_RECOVERY_LOCK_NAME, dlm_send_begin_reco_message() 2722 if (res) { dlm_send_begin_reco_message() 2723 dlm_print_one_lock_resource(res); dlm_send_begin_reco_message() 2724 dlm_lockres_put(res); dlm_send_begin_reco_message() 1112 dlm_send_mig_lockres_msg(struct dlm_ctxt *dlm, struct dlm_migratable_lockres *mres, u8 send_to, struct dlm_lock_resource *res, int total_locks) dlm_send_mig_lockres_msg() argument 1592 dlm_lockres_master_requery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 *real_master) dlm_lockres_master_requery() argument 1778 dlm_process_recovery_data(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_migratable_lockres *mres) dlm_process_recovery_data() argument 2039 dlm_move_lockres_to_recovery_list(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_move_lockres_to_recovery_list() argument 2197 dlm_revalidate_lvb(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 dead_node) dlm_revalidate_lvb() argument 2240 dlm_free_dead_locks(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 dead_node) dlm_free_dead_locks() argument
|
/linux-4.1.27/include/net/ |
H A D | dn_fib.h | 45 #define DN_FIB_RES_RESET(res) ((res).nh_sel = 0) 46 #define DN_FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) 48 #define DN_FIB_RES_PREFSRC(res) ((res).fi->fib_prefsrc ? : __dn_fib_res_prefsrc(&res)) 49 #define DN_FIB_RES_GW(res) (DN_FIB_RES_NH(res).nh_gw) 50 #define DN_FIB_RES_DEV(res) (DN_FIB_RES_NH(res).nh_dev) 51 #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) 87 struct dn_fib_res *res); 106 const struct flowidn *fld, struct dn_fib_res *res); 109 void dn_fib_select_multipath(const struct flowidn *fld, struct dn_fib_res *res); 125 int dn_fib_lookup(struct flowidn *fld, struct dn_fib_res *res); 137 static inline void dn_fib_res_put(struct dn_fib_res *res) dn_fib_res_put() argument 139 if (res->fi) dn_fib_res_put() 140 dn_fib_info_put(res->fi); dn_fib_res_put() 141 if (res->r) dn_fib_res_put() 142 fib_rule_put(res->r); dn_fib_res_put() 150 #define dn_fib_lookup(fl, res) (-ESRCH) 152 #define dn_fib_select_multipath(fl, res) do { } while(0) 153 #define dn_fib_rules_policy(saddr,res,flags) (0) 154 #define dn_fib_res_put(res) do { } while(0)
|
H A D | ip_fib.h | 159 #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) 161 #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) 172 #define FIB_RES_SADDR(net, res) \ 173 ((FIB_RES_NH(res).nh_saddr_genid == \ 175 FIB_RES_NH(res).nh_saddr : \ 176 fib_info_update_nh_saddr((net), &FIB_RES_NH(res))) 177 #define FIB_RES_GW(res) (FIB_RES_NH(res).nh_gw) 178 #define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev) 179 #define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif) 181 #define FIB_RES_PREFSRC(net, res) ((res).fi->fib_prefsrc ? : \ 182 FIB_RES_SADDR(net, res)) 195 struct fib_result *res, int fib_flags); 230 struct fib_result *res) fib_lookup() 238 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF)) fib_lookup() 253 int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res); 256 struct fib_result *res) fib_lookup() 262 return __fib_lookup(net, flp, res); fib_lookup() 266 res->tclassid = 0; fib_lookup() 270 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF)) fib_lookup() 274 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF)) fib_lookup() 292 void fib_select_default(struct fib_result *res); 312 void fib_select_multipath(struct fib_result *res); 318 static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) fib_combine_itag() argument 324 *itag = FIB_RES_NH(*res).nh_tclassid<<16; fib_combine_itag() 326 rtag = res->tclassid; fib_combine_itag() 229 fib_lookup(struct net *net, const struct flowi4 *flp, struct fib_result *res) fib_lookup() argument 255 fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res) fib_lookup() argument
|
/linux-4.1.27/drivers/media/platform/s5p-tv/ |
H A D | mixer_drv.c | 66 struct mxr_resources *res = &mdev->res; mxr_streamer_get() local 70 clk_set_parent(res->sclk_mixer, res->sclk_dac); mxr_streamer_get() 72 clk_set_parent(res->sclk_mixer, res->sclk_hdmi); mxr_streamer_get() 157 struct resource *res; mxr_acquire_plat_resources() local 160 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mxr"); mxr_acquire_plat_resources() 161 if (res == NULL) { mxr_acquire_plat_resources() 167 mdev->res.mxr_regs = ioremap(res->start, resource_size(res)); mxr_acquire_plat_resources() 168 if (mdev->res.mxr_regs == NULL) { mxr_acquire_plat_resources() 174 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vp"); mxr_acquire_plat_resources() 175 if (res == NULL) { mxr_acquire_plat_resources() 181 mdev->res.vp_regs = ioremap(res->start, resource_size(res)); mxr_acquire_plat_resources() 182 if (mdev->res.vp_regs == NULL) { mxr_acquire_plat_resources() 188 res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "irq"); mxr_acquire_plat_resources() 189 if (res == NULL) { mxr_acquire_plat_resources() 195 ret = request_irq(res->start, mxr_irq_handler, 0, "s5p-mixer", mdev); mxr_acquire_plat_resources() 200 mdev->res.irq = res->start; mxr_acquire_plat_resources() 205 iounmap(mdev->res.vp_regs); mxr_acquire_plat_resources() 208 iounmap(mdev->res.mxr_regs); mxr_acquire_plat_resources() 214 static void mxr_resource_clear_clocks(struct mxr_resources *res) mxr_resource_clear_clocks() argument 216 res->mixer = ERR_PTR(-EINVAL); mxr_resource_clear_clocks() 217 res->vp = ERR_PTR(-EINVAL); mxr_resource_clear_clocks() 218 res->sclk_mixer = ERR_PTR(-EINVAL); mxr_resource_clear_clocks() 219 res->sclk_hdmi = ERR_PTR(-EINVAL); mxr_resource_clear_clocks() 220 res->sclk_dac = ERR_PTR(-EINVAL); mxr_resource_clear_clocks() 225 free_irq(mdev->res.irq, mdev); mxr_release_plat_resources() 226 iounmap(mdev->res.vp_regs); mxr_release_plat_resources() 227 iounmap(mdev->res.mxr_regs); mxr_release_plat_resources() 232 struct mxr_resources *res = &mdev->res; mxr_release_clocks() local 234 if (!IS_ERR(res->sclk_dac)) mxr_release_clocks() 235 clk_put(res->sclk_dac); mxr_release_clocks() 236 if (!IS_ERR(res->sclk_hdmi)) mxr_release_clocks() 237 clk_put(res->sclk_hdmi); mxr_release_clocks() 238 if (!IS_ERR(res->sclk_mixer)) mxr_release_clocks() 239 clk_put(res->sclk_mixer); mxr_release_clocks() 240 if (!IS_ERR(res->vp)) mxr_release_clocks() 241 clk_put(res->vp); mxr_release_clocks() 242 if (!IS_ERR(res->mixer)) mxr_release_clocks() 243 clk_put(res->mixer); mxr_release_clocks() 248 struct mxr_resources *res = &mdev->res; mxr_acquire_clocks() local 251 mxr_resource_clear_clocks(res); mxr_acquire_clocks() 253 res->mixer = clk_get(dev, "mixer"); mxr_acquire_clocks() 254 if (IS_ERR(res->mixer)) { mxr_acquire_clocks() 258 res->vp = clk_get(dev, "vp"); mxr_acquire_clocks() 259 if (IS_ERR(res->vp)) { mxr_acquire_clocks() 263 res->sclk_mixer = clk_get(dev, "sclk_mixer"); mxr_acquire_clocks() 264 if (IS_ERR(res->sclk_mixer)) { mxr_acquire_clocks() 268 res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); mxr_acquire_clocks() 269 if (IS_ERR(res->sclk_hdmi)) { mxr_acquire_clocks() 273 res->sclk_dac = clk_get(dev, "sclk_dac"); mxr_acquire_clocks() 274 if (IS_ERR(res->sclk_dac)) { mxr_acquire_clocks() 312 memset(&mdev->res, 0, sizeof(mdev->res)); mxr_release_resources() 313 mxr_resource_clear_clocks(&mdev->res); mxr_release_resources() 349 struct mxr_resources *res = &mdev->res; mxr_runtime_resume() local 355 ret = clk_prepare_enable(res->mixer); mxr_runtime_resume() 360 ret = clk_prepare_enable(res->vp); mxr_runtime_resume() 365 ret = clk_prepare_enable(res->sclk_mixer); mxr_runtime_resume() 378 clk_disable_unprepare(res->vp); mxr_runtime_resume() 380 clk_disable_unprepare(res->mixer); mxr_runtime_resume() 390 struct mxr_resources *res = &mdev->res; mxr_runtime_suspend() local 394 clk_disable_unprepare(res->sclk_mixer); mxr_runtime_suspend() 395 clk_disable_unprepare(res->vp); mxr_runtime_suspend() 396 clk_disable_unprepare(res->mixer); mxr_runtime_suspend()
|
H A D | hdmi_drv.c | 96 struct hdmi_resources res; member in struct:hdmi_device 499 struct hdmi_resources *res = &hdev->res; hdmi_streamon() local 536 clk_disable(res->sclk_hdmi); hdmi_streamon() 537 clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy); hdmi_streamon() 538 clk_enable(res->sclk_hdmi); hdmi_streamon() 550 struct hdmi_resources *res = &hdev->res; hdmi_streamoff() local 558 clk_disable(res->sclk_hdmi); hdmi_streamoff() 559 clk_set_parent(res->sclk_hdmi, res->sclk_pixel); hdmi_streamoff() 560 clk_enable(res->sclk_hdmi); hdmi_streamoff() 580 static int hdmi_resource_poweron(struct hdmi_resources *res) hdmi_resource_poweron() argument 585 ret = regulator_bulk_enable(res->regul_count, res->regul_bulk); hdmi_resource_poweron() 589 clk_enable(res->hdmiphy); hdmi_resource_poweron() 591 clk_set_parent(res->sclk_hdmi, res->sclk_pixel); hdmi_resource_poweron() 593 clk_enable(res->sclk_hdmi); hdmi_resource_poweron() 598 static void hdmi_resource_poweroff(struct hdmi_resources *res) hdmi_resource_poweroff() argument 601 clk_disable(res->sclk_hdmi); hdmi_resource_poweroff() 603 clk_disable(res->hdmiphy); hdmi_resource_poweroff() 605 regulator_bulk_disable(res->regul_count, res->regul_bulk); hdmi_resource_poweroff() 736 hdmi_resource_poweroff(&hdev->res); hdmi_runtime_suspend() 750 ret = hdmi_resource_poweron(&hdev->res); hdmi_runtime_resume() 764 hdmi_resource_poweroff(&hdev->res); hdmi_runtime_resume() 775 static void hdmi_resource_clear_clocks(struct hdmi_resources *res) hdmi_resource_clear_clocks() argument 777 res->hdmi = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks() 778 res->sclk_hdmi = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks() 779 res->sclk_pixel = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks() 780 res->sclk_hdmiphy = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks() 781 res->hdmiphy = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks() 786 struct hdmi_resources *res = &hdev->res; hdmi_resources_cleanup() local 790 if (res->regul_count) hdmi_resources_cleanup() 791 regulator_bulk_free(res->regul_count, res->regul_bulk); hdmi_resources_cleanup() 793 kfree(res->regul_bulk); hdmi_resources_cleanup() 794 if (!IS_ERR(res->hdmiphy)) hdmi_resources_cleanup() 795 clk_put(res->hdmiphy); hdmi_resources_cleanup() 796 if (!IS_ERR(res->sclk_hdmiphy)) hdmi_resources_cleanup() 797 clk_put(res->sclk_hdmiphy); hdmi_resources_cleanup() 798 if (!IS_ERR(res->sclk_pixel)) hdmi_resources_cleanup() 799 clk_put(res->sclk_pixel); hdmi_resources_cleanup() 800 if (!IS_ERR(res->sclk_hdmi)) hdmi_resources_cleanup() 801 clk_put(res->sclk_hdmi); hdmi_resources_cleanup() 802 if (!IS_ERR(res->hdmi)) hdmi_resources_cleanup() 803 clk_put(res->hdmi); hdmi_resources_cleanup() 804 memset(res, 0, sizeof(*res)); hdmi_resources_cleanup() 805 hdmi_resource_clear_clocks(res); hdmi_resources_cleanup() 811 struct hdmi_resources *res = &hdev->res; hdmi_resources_init() local 822 memset(res, 0, sizeof(*res)); hdmi_resources_init() 823 hdmi_resource_clear_clocks(res); hdmi_resources_init() 826 res->hdmi = clk_get(dev, "hdmi"); hdmi_resources_init() 827 if (IS_ERR(res->hdmi)) { hdmi_resources_init() 831 res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); hdmi_resources_init() 832 if (IS_ERR(res->sclk_hdmi)) { hdmi_resources_init() 836 res->sclk_pixel = clk_get(dev, "sclk_pixel"); hdmi_resources_init() 837 if (IS_ERR(res->sclk_pixel)) { hdmi_resources_init() 841 res->sclk_hdmiphy = clk_get(dev, "sclk_hdmiphy"); hdmi_resources_init() 842 if (IS_ERR(res->sclk_hdmiphy)) { hdmi_resources_init() 846 res->hdmiphy = clk_get(dev, "hdmiphy"); hdmi_resources_init() 847 if (IS_ERR(res->hdmiphy)) { hdmi_resources_init() 851 res->regul_bulk = kcalloc(ARRAY_SIZE(supply), hdmi_resources_init() 852 sizeof(res->regul_bulk[0]), GFP_KERNEL); hdmi_resources_init() 853 if (!res->regul_bulk) { hdmi_resources_init() 858 res->regul_bulk[i].supply = supply[i]; hdmi_resources_init() 859 res->regul_bulk[i].consumer = NULL; hdmi_resources_init() 862 ret = regulator_bulk_get(dev, ARRAY_SIZE(supply), res->regul_bulk); hdmi_resources_init() 867 res->regul_count = ARRAY_SIZE(supply); hdmi_resources_init() 879 struct resource *res; hdmi_probe() local 908 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hdmi_probe() 909 if (res == NULL) { hdmi_probe() 915 hdmi_dev->regs = devm_ioremap(&pdev->dev, res->start, hdmi_probe() 916 resource_size(res)); hdmi_probe() 923 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); hdmi_probe() 924 if (res == NULL) { hdmi_probe() 930 ret = devm_request_irq(&pdev->dev, res->start, hdmi_irq_handler, 0, hdmi_probe() 936 hdmi_dev->irq = res->start; hdmi_probe() 993 clk_enable(hdmi_dev->res.hdmi); hdmi_probe() 1034 clk_disable(hdmi_dev->res.hdmi); hdmi_remove()
|
/linux-4.1.27/samples/hidraw/ |
H A D | hid-example.c | 45 int i, res, desc_size = 0; main() local 68 res = ioctl(fd, HIDIOCGRDESCSIZE, &desc_size); main() 69 if (res < 0) main() 76 res = ioctl(fd, HIDIOCGRDESC, &rpt_desc); main() 77 if (res < 0) { main() 87 res = ioctl(fd, HIDIOCGRAWNAME(256), buf); main() 88 if (res < 0) main() 94 res = ioctl(fd, HIDIOCGRAWPHYS(256), buf); main() 95 if (res < 0) main() 101 res = ioctl(fd, HIDIOCGRAWINFO, &info); main() 102 if (res < 0) { main() 117 res = ioctl(fd, HIDIOCSFEATURE(4), buf); main() 118 if (res < 0) main() 121 printf("ioctl HIDIOCGFEATURE returned: %d\n", res); main() 125 res = ioctl(fd, HIDIOCGFEATURE(256), buf); main() 126 if (res < 0) { main() 129 printf("ioctl HIDIOCGFEATURE returned: %d\n", res); main() 131 for (i = 0; i < res; i++) main() 139 res = write(fd, buf, 2); main() 140 if (res < 0) { main() 144 printf("write() wrote %d bytes\n", res); main() 148 res = read(fd, buf, 16); main() 149 if (res < 0) { main() 152 printf("read() read %d bytes:\n\t", res); main() 153 for (i = 0; i < res; i++) main()
|
/linux-4.1.27/arch/x86/kernel/ |
H A D | resource.c | 4 static void resource_clip(struct resource *res, resource_size_t start, resource_clip() argument 9 if (res->end < start || res->start > end) resource_clip() 12 if (res->start < start) resource_clip() 13 low = start - res->start; resource_clip() 15 if (res->end > end) resource_clip() 16 high = res->end - end; resource_clip() 20 res->end = start - 1; resource_clip() 22 res->start = end + 1; resource_clip()
|
H A D | pmem.c | 11 static __init void register_pmem_device(struct resource *res) register_pmem_device() argument 20 error = platform_device_add_resources(pdev, res, 1); register_pmem_device() 42 struct resource res = { register_pmem_devices() local 47 register_pmem_device(&res); register_pmem_devices()
|
H A D | sysfb_simplefb.c | 68 struct resource res; create_simplefb() local 81 memset(&res, 0, sizeof(res)); create_simplefb() 82 res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; create_simplefb() 83 res.name = simplefb_resname; create_simplefb() 84 res.start = si->lfb_base; create_simplefb() 85 res.end = si->lfb_base + len - 1; create_simplefb() 86 if (res.end <= res.start) create_simplefb() 90 &res, 1, mode, sizeof(*mode)); create_simplefb()
|
/linux-4.1.27/arch/x86/pci/ |
H A D | broadcom_bus.c | 26 struct resource res; cnb20le_res() local 53 res.start = (word1 << 16) | 0x0000; cnb20le_res() 54 res.end = (word2 << 16) | 0xffff; cnb20le_res() 55 res.flags = IORESOURCE_MEM; cnb20le_res() 56 update_res(info, res.start, res.end, res.flags, 0); cnb20le_res() 63 res.start = ((resource_size_t) word1 << 16) | 0x0000; cnb20le_res() 64 res.end = ((resource_size_t) word2 << 16) | 0xffff; cnb20le_res() 65 res.flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; cnb20le_res() 66 update_res(info, res.start, res.end, res.flags, 0); cnb20le_res() 73 res.start = word1; cnb20le_res() 74 res.end = word2; cnb20le_res() 75 res.flags = IORESOURCE_IO; cnb20le_res() 76 update_res(info, res.start, res.end, res.flags, 0); cnb20le_res() 80 res.start = fbus; cnb20le_res() 81 res.end = lbus; cnb20le_res() 82 res.flags = IORESOURCE_BUS; cnb20le_res() 83 printk(KERN_INFO "CNB20LE PCI Host Bridge (domain 0000 %pR)\n", &res); cnb20le_res() 86 printk(KERN_INFO "host bridge window %pR\n", &root_res->res); cnb20le_res()
|
H A D | bus_numa.c | 45 if (window->res->flags & IORESOURCE_BUS) { resource_list_for_each_entry() 54 struct resource *res; local 57 res = &root_res->res; 58 pci_add_resource(resources, res); 59 if (res->flags & IORESOURCE_IO) 63 insert_resource(root, res); 106 struct resource *res; update_res() local 123 res = &root_res->res; update_res() 124 if (res->flags != flags) update_res() 127 common_start = max(res->start, start); update_res() 128 common_end = min(res->end, end); update_res() 132 final_start = min(res->start, start); update_res() 133 final_end = max(res->end, end); update_res() 135 res->start = final_start; update_res() 136 res->end = final_end; update_res() 147 res = &root_res->res; update_res() 148 res->name = info->name; update_res() 149 res->flags = flags; update_res() 150 res->start = start; update_res() 151 res->end = end; update_res()
|
/linux-4.1.27/drivers/thunderbolt/ |
H A D | eeprom.c | 41 int res = tb_eeprom_ctl_read(sw, &ctl); tb_eeprom_active() local 42 if (res) tb_eeprom_active() 43 return res; tb_eeprom_active() 46 res = tb_eeprom_ctl_write(sw, &ctl); tb_eeprom_active() 47 if (res) tb_eeprom_active() 48 return res; tb_eeprom_active() 53 res = tb_eeprom_ctl_write(sw, &ctl); tb_eeprom_active() 54 if (res) tb_eeprom_active() 55 return res; tb_eeprom_active() 70 int res; tb_eeprom_transfer() local 72 res = tb_eeprom_ctl_write(sw, ctl); tb_eeprom_transfer() 73 if (res) tb_eeprom_transfer() 74 return res; tb_eeprom_transfer() 77 res = tb_eeprom_ctl_write(sw, ctl); tb_eeprom_transfer() 78 if (res) tb_eeprom_transfer() 79 return res; tb_eeprom_transfer() 81 res = tb_eeprom_ctl_read(sw, ctl); tb_eeprom_transfer() 82 if (res) tb_eeprom_transfer() 83 return res; tb_eeprom_transfer() 96 int res = tb_eeprom_ctl_read(sw, &ctl); tb_eeprom_out() local 97 if (res) tb_eeprom_out() 98 return res; tb_eeprom_out() 101 res = tb_eeprom_transfer(sw, &ctl, TB_EEPROM_OUT); tb_eeprom_out() 102 if (res) tb_eeprom_out() 103 return res; tb_eeprom_out() 116 int res = tb_eeprom_ctl_read(sw, &ctl); tb_eeprom_in() local 117 if (res) tb_eeprom_in() 118 return res; tb_eeprom_in() 122 res = tb_eeprom_transfer(sw, &ctl, TB_EEPROM_IN); tb_eeprom_in() 123 if (res) tb_eeprom_in() 124 return res; tb_eeprom_in() 136 int i, res; tb_eeprom_read_n() local 137 res = tb_eeprom_active(sw, true); tb_eeprom_read_n() 138 if (res) tb_eeprom_read_n() 139 return res; tb_eeprom_read_n() 140 res = tb_eeprom_out(sw, 3); tb_eeprom_read_n() 141 if (res) tb_eeprom_read_n() 142 return res; tb_eeprom_read_n() 143 res = tb_eeprom_out(sw, offset >> 8); tb_eeprom_read_n() 144 if (res) tb_eeprom_read_n() 145 return res; tb_eeprom_read_n() 146 res = tb_eeprom_out(sw, offset); tb_eeprom_read_n() 147 if (res) tb_eeprom_read_n() 148 return res; tb_eeprom_read_n() 150 res = tb_eeprom_in(sw, val + i); tb_eeprom_read_n() 151 if (res) tb_eeprom_read_n() 152 return res; tb_eeprom_read_n() 239 int res; tb_eeprom_get_drom_offset() local 244 res = tb_sw_read(sw, &cap, TB_CFG_SWITCH, sw->cap_plug_events, tb_eeprom_get_drom_offset() 246 if (res) tb_eeprom_get_drom_offset() 247 return res; tb_eeprom_get_drom_offset() 274 int res = tb_eeprom_get_drom_offset(sw, &drom_offset); tb_drom_read_uid_only() local 275 if (res) tb_drom_read_uid_only() 276 return res; tb_drom_read_uid_only() 279 res = tb_eeprom_read_n(sw, drom_offset, data, 9); tb_drom_read_uid_only() 280 if (res) tb_drom_read_uid_only() 281 return res; tb_drom_read_uid_only() 307 int res; tb_drom_parse_entry() local 318 res = tb_port_read(port, &type, TB_CFG_PORT, 2, 1); tb_drom_parse_entry() 319 if (res) tb_drom_parse_entry() 320 return res; tb_drom_parse_entry() 371 int res; tb_drom_read() local 394 res = tb_eeprom_get_drom_offset(sw, &drom_offset); tb_drom_read() 395 if (res) tb_drom_read() 396 return res; tb_drom_read() 398 res = tb_eeprom_read_n(sw, drom_offset + 14, (u8 *) &size, 2); tb_drom_read() 399 if (res) tb_drom_read() 400 return res; tb_drom_read() 412 res = tb_eeprom_read_n(sw, drom_offset, sw->drom, size); tb_drom_read() 413 if (res) tb_drom_read()
|
H A D | ctl.c | 204 struct tb_cfg_result res = { 0 }; decode_error() local 205 res.response_route = get_route(pkg->header); decode_error() 206 res.response_port = 0; decode_error() 207 res.err = check_header(response, sizeof(*pkg), TB_CFG_PKG_ERROR, decode_error() 209 if (res.err) decode_error() 210 return res; decode_error() 215 res.err = 1; decode_error() 216 res.tb_error = pkg->error; decode_error() 217 res.response_port = pkg->port; decode_error() 218 return res; decode_error() 226 struct tb_cfg_result res = { 0 }; parse_header() local 231 res.response_port = 0; /* will be updated later for cfg_read/write */ parse_header() 232 res.response_route = get_route(*header); parse_header() 233 res.err = check_header(pkg, len, type, route); parse_header() 234 return res; parse_header() 238 const struct tb_cfg_result *res) tb_cfg_print_error() 240 WARN_ON(res->err != 1); tb_cfg_print_error() 241 switch (res->tb_error) { tb_cfg_print_error() 253 res->response_route, res->response_port); tb_cfg_print_error() 262 res->response_route, res->response_port); tb_cfg_print_error() 266 res->response_route, res->response_port); tb_cfg_print_error() 271 res->response_route, res->response_port); tb_cfg_print_error() 339 int res; tb_ctl_tx() local 360 res = ring_tx(ctl->tx, &pkg->frame); tb_ctl_tx() 361 if (res) /* ring is stopped */ tb_ctl_tx() 363 return res; tb_ctl_tx() 444 struct tb_cfg_result res; tb_ctl_rx() local 457 res = parse_header(pkg, length, type, route); tb_ctl_rx() 458 if (!res.err) tb_ctl_rx() 461 return res; tb_ctl_rx() 620 struct tb_cfg_result res = { 0 }; tb_cfg_read_raw() local 632 res.err = tb_ctl_tx(ctl, &request, sizeof(request), TB_CFG_PKG_READ); tb_cfg_read_raw() 633 if (res.err) tb_cfg_read_raw() 634 return res; tb_cfg_read_raw() 636 res = tb_ctl_rx(ctl, &reply, 12 + 4 * length, timeout_msec, route, tb_cfg_read_raw() 638 if (res.err) tb_cfg_read_raw() 639 return res; tb_cfg_read_raw() 641 res.response_port = reply.addr.port; tb_cfg_read_raw() 642 res.err = check_config_address(reply.addr, space, offset, length); tb_cfg_read_raw() 643 if (!res.err) tb_cfg_read_raw() 645 return res; tb_cfg_read_raw() 657 struct tb_cfg_result res = { 0 }; tb_cfg_write_raw() local 671 res.err = tb_ctl_tx(ctl, &request, 12 + 4 * length, TB_CFG_PKG_WRITE); tb_cfg_write_raw() 672 if (res.err) tb_cfg_write_raw() 673 return res; tb_cfg_write_raw() 675 res = tb_ctl_rx(ctl, &reply, sizeof(reply), timeout_msec, route, tb_cfg_write_raw() 677 if (res.err) tb_cfg_write_raw() 678 return res; tb_cfg_write_raw() 680 res.response_port = reply.addr.port; tb_cfg_write_raw() 681 res.err = check_config_address(reply.addr, space, offset, length); tb_cfg_write_raw() 682 return res; tb_cfg_write_raw() 688 struct tb_cfg_result res = tb_cfg_read_raw(ctl, buffer, route, port, tb_cfg_read() local 690 if (res.err == 1) { tb_cfg_read() 691 tb_cfg_print_error(ctl, &res); tb_cfg_read() 694 WARN(res.err, "tb_cfg_read: %d\n", res.err); tb_cfg_read() 695 return res.err; tb_cfg_read() 701 struct tb_cfg_result res = tb_cfg_write_raw(ctl, buffer, route, port, tb_cfg_write() local 703 if (res.err == 1) { tb_cfg_write() 704 tb_cfg_print_error(ctl, &res); tb_cfg_write() 707 WARN(res.err, "tb_cfg_write: %d\n", res.err); tb_cfg_write() 708 return res.err; tb_cfg_write() 723 struct tb_cfg_result res = tb_cfg_read_raw(ctl, &dummy, route, 0, tb_cfg_get_upstream_port() local 726 if (res.err == 1) tb_cfg_get_upstream_port() 728 if (res.err) tb_cfg_get_upstream_port() 729 return res.err; tb_cfg_get_upstream_port() 730 return res.response_port; tb_cfg_get_upstream_port() 237 tb_cfg_print_error(struct tb_ctl *ctl, const struct tb_cfg_result *res) tb_cfg_print_error() argument
|
H A D | cap.c | 84 int res; tb_find_cap() local 87 res = tb_port_read(port, &header, space, offset, 1); tb_find_cap() 88 if (res) { tb_find_cap() 95 return res; tb_find_cap() 102 res = tb_port_read(port, &header, space, tb_find_cap() 104 if (res) tb_find_cap() 105 return res; tb_find_cap()
|
/linux-4.1.27/drivers/ps3/ |
H A D | ps3av_cmd.c | 157 int res; ps3av_cmd_init() local 165 res = ps3av_do_pkt(PS3AV_CID_VIDEO_INIT, sizeof(video_init.send_hdr), ps3av_cmd_init() 167 if (res < 0) ps3av_cmd_init() 168 return res; ps3av_cmd_init() 170 res = get_status(&video_init); ps3av_cmd_init() 171 if (res) { ps3av_cmd_init() 172 printk(KERN_ERR "PS3AV_CID_VIDEO_INIT: failed %x\n", res); ps3av_cmd_init() 173 return res; ps3av_cmd_init() 179 res = ps3av_do_pkt(PS3AV_CID_AUDIO_INIT, sizeof(audio_init.send_hdr), ps3av_cmd_init() 181 if (res < 0) ps3av_cmd_init() 182 return res; ps3av_cmd_init() 184 res = get_status(&audio_init); ps3av_cmd_init() 185 if (res) { ps3av_cmd_init() 186 printk(KERN_ERR "PS3AV_CID_AUDIO_INIT: failed %x\n", res); ps3av_cmd_init() 187 return res; ps3av_cmd_init() 194 res = ps3av_do_pkt(PS3AV_CID_AV_INIT, sizeof(av_init), sizeof(av_init), ps3av_cmd_init() 196 if (res < 0) ps3av_cmd_init() 197 return res; ps3av_cmd_init() 199 res = get_status(&av_init); ps3av_cmd_init() 200 if (res) ps3av_cmd_init() 201 printk(KERN_ERR "PS3AV_CID_AV_INIT: failed %x\n", res); ps3av_cmd_init() 203 return res; ps3av_cmd_init() 208 int res; ps3av_cmd_fin() local 213 res = ps3av_do_pkt(PS3AV_CID_AV_FIN, sizeof(av_fin.send_hdr), ps3av_cmd_fin() 215 if (res < 0) ps3av_cmd_fin() 216 return res; ps3av_cmd_fin() 218 res = get_status(&av_fin); ps3av_cmd_fin() 219 if (res) ps3av_cmd_fin() 220 printk(KERN_ERR "PS3AV_CID_AV_FIN: failed %x\n", res); ps3av_cmd_fin() 222 return res; ps3av_cmd_fin() 227 int i, send_len, res; ps3av_cmd_av_video_mute() local 241 res = ps3av_do_pkt(PS3AV_CID_AV_VIDEO_MUTE, send_len, ps3av_cmd_av_video_mute() 243 if (res < 0) ps3av_cmd_av_video_mute() 244 return res; ps3av_cmd_av_video_mute() 246 res = get_status(&av_video_mute); ps3av_cmd_av_video_mute() 247 if (res) ps3av_cmd_av_video_mute() 248 printk(KERN_ERR "PS3AV_CID_AV_VIDEO_MUTE: failed %x\n", res); ps3av_cmd_av_video_mute() 250 return res; ps3av_cmd_av_video_mute() 255 int res; ps3av_cmd_av_video_disable_sig() local 261 res = ps3av_do_pkt(PS3AV_CID_AV_VIDEO_DISABLE_SIG, ps3av_cmd_av_video_disable_sig() 264 if (res < 0) ps3av_cmd_av_video_disable_sig() 265 return res; ps3av_cmd_av_video_disable_sig() 267 res = get_status(&av_video_sig); ps3av_cmd_av_video_disable_sig() 268 if (res) ps3av_cmd_av_video_disable_sig() 271 res, port); ps3av_cmd_av_video_disable_sig() 273 return res; ps3av_cmd_av_video_disable_sig() 278 int res; ps3av_cmd_av_tv_mute() local 285 res = ps3av_do_pkt(PS3AV_CID_AV_TV_MUTE, sizeof(tv_mute), ps3av_cmd_av_tv_mute() 287 if (res < 0) ps3av_cmd_av_tv_mute() 288 return res; ps3av_cmd_av_tv_mute() 290 res = get_status(&tv_mute); ps3av_cmd_av_tv_mute() 291 if (res) ps3av_cmd_av_tv_mute() 293 res, avport); ps3av_cmd_av_tv_mute() 295 return res; ps3av_cmd_av_tv_mute() 300 int res; ps3av_cmd_enable_event() local 307 res = ps3av_do_pkt(PS3AV_CID_AV_ENABLE_EVENT, sizeof(av_event), ps3av_cmd_enable_event() 309 if (res < 0) ps3av_cmd_enable_event() 310 return res; ps3av_cmd_enable_event() 312 res = get_status(&av_event); ps3av_cmd_enable_event() 313 if (res) ps3av_cmd_enable_event() 314 printk(KERN_ERR "PS3AV_CID_AV_ENABLE_EVENT: failed %x\n", res); ps3av_cmd_enable_event() 316 return res; ps3av_cmd_enable_event() 321 int res; ps3av_cmd_av_hdmi_mode() local 327 res = ps3av_do_pkt(PS3AV_CID_AV_HDMI_MODE, sizeof(hdmi_mode), ps3av_cmd_av_hdmi_mode() 329 if (res < 0) ps3av_cmd_av_hdmi_mode() 330 return res; ps3av_cmd_av_hdmi_mode() 332 res = get_status(&hdmi_mode); ps3av_cmd_av_hdmi_mode() 333 if (res && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE) ps3av_cmd_av_hdmi_mode() 334 printk(KERN_ERR "PS3AV_CID_AV_HDMI_MODE: failed %x\n", res); ps3av_cmd_av_hdmi_mode() 336 return res; ps3av_cmd_av_hdmi_mode() 423 int res; ps3av_cmd_video_format_black() local 435 res = ps3av_do_pkt(PS3AV_CID_VIDEO_FORMAT, sizeof(video_format), ps3av_cmd_video_format_black() 437 if (res < 0) ps3av_cmd_video_format_black() 438 return res; ps3av_cmd_video_format_black() 440 res = get_status(&video_format); ps3av_cmd_video_format_black() 441 if (res) ps3av_cmd_video_format_black() 442 printk(KERN_ERR "PS3AV_CID_VIDEO_FORMAT: failed %x\n", res); ps3av_cmd_video_format_black() 444 return res; ps3av_cmd_video_format_black() 450 int i, res; ps3av_cmd_av_audio_mute() local 463 res = ps3av_do_pkt(PS3AV_CID_AV_AUDIO_MUTE, ps3av_cmd_av_audio_mute() 467 if (res < 0) ps3av_cmd_av_audio_mute() 468 return res; ps3av_cmd_av_audio_mute() 470 res = get_status(&av_audio_mute); ps3av_cmd_av_audio_mute() 471 if (res) ps3av_cmd_av_audio_mute() 472 printk(KERN_ERR "PS3AV_CID_AV_AUDIO_MUTE: failed %x\n", res); ps3av_cmd_av_audio_mute() 474 return res; ps3av_cmd_av_audio_mute() 797 int res; ps3av_cmd_audio_mode() local 799 res = ps3av_do_pkt(PS3AV_CID_AUDIO_MODE, sizeof(*audio_mode), ps3av_cmd_audio_mode() 801 if (res < 0) ps3av_cmd_audio_mode() 802 return res; ps3av_cmd_audio_mode() 804 res = get_status(audio_mode); ps3av_cmd_audio_mode() 805 if (res) ps3av_cmd_audio_mode() 806 printk(KERN_ERR "PS3AV_CID_AUDIO_MODE: failed %x\n", res); ps3av_cmd_audio_mode() 808 return res; ps3av_cmd_audio_mode() 813 int i, res; ps3av_cmd_audio_mute() local 826 res = ps3av_do_pkt(PS3AV_CID_AUDIO_MUTE, ps3av_cmd_audio_mute() 830 if (res < 0) ps3av_cmd_audio_mute() 831 return res; ps3av_cmd_audio_mute() 833 res = get_status(&audio_mute); ps3av_cmd_audio_mute() 834 if (res) ps3av_cmd_audio_mute() 835 printk(KERN_ERR "PS3AV_CID_AUDIO_MUTE: failed %x\n", res); ps3av_cmd_audio_mute() 837 return res; ps3av_cmd_audio_mute() 842 int res; ps3av_cmd_audio_active() local 851 res = ps3av_do_pkt(cid, sizeof(audio_active), sizeof(audio_active), ps3av_cmd_audio_active() 853 if (res < 0) ps3av_cmd_audio_active() 854 return res; ps3av_cmd_audio_active() 856 res = get_status(&audio_active); ps3av_cmd_audio_active() 857 if (res) ps3av_cmd_audio_active() 859 res); ps3av_cmd_audio_active() 861 return res; ps3av_cmd_audio_active() 866 int res; ps3av_cmd_avb_param() local 871 res = ps3av_do_pkt(PS3AV_CID_AVB_PARAM, send_len, sizeof(*avb), ps3av_cmd_avb_param() 873 if (res < 0) ps3av_cmd_avb_param() 876 res = get_status(avb); ps3av_cmd_avb_param() 877 if (res) ps3av_cmd_avb_param() 879 res); ps3av_cmd_avb_param() 883 return res; ps3av_cmd_avb_param() 888 int res; ps3av_cmd_av_get_hw_conf() local 892 res = ps3av_do_pkt(PS3AV_CID_AV_GET_HW_CONF, sizeof(hw_conf->send_hdr), ps3av_cmd_av_get_hw_conf() 894 if (res < 0) ps3av_cmd_av_get_hw_conf() 895 return res; ps3av_cmd_av_get_hw_conf() 897 res = get_status(hw_conf); ps3av_cmd_av_get_hw_conf() 898 if (res) ps3av_cmd_av_get_hw_conf() 899 printk(KERN_ERR "PS3AV_CID_AV_GET_HW_CONF: failed %x\n", res); ps3av_cmd_av_get_hw_conf() 901 return res; ps3av_cmd_av_get_hw_conf() 907 int res; ps3av_cmd_video_get_monitor_info() local 912 res = ps3av_do_pkt(PS3AV_CID_AV_GET_MONITOR_INFO, ps3av_cmd_video_get_monitor_info() 916 if (res < 0) ps3av_cmd_video_get_monitor_info() 917 return res; ps3av_cmd_video_get_monitor_info() 919 res = get_status(info); ps3av_cmd_video_get_monitor_info() 920 if (res) ps3av_cmd_video_get_monitor_info() 922 res); ps3av_cmd_video_get_monitor_info() 924 return res; ps3av_cmd_video_get_monitor_info()
|
H A D | ps3av.c | 223 int res; ps3av_send_cmd_pkt() local 231 res = ps3av_vuart_write(ps3av->dev, send_buf, write_len); ps3av_send_cmd_pkt() 232 if (res < 0) { ps3av_send_cmd_pkt() 235 __func__, res); ps3av_send_cmd_pkt() 236 return res; ps3av_send_cmd_pkt() 243 res = ps3av_vuart_read(ps3av->dev, recv_buf, PS3AV_HDR_SIZE, ps3av_send_cmd_pkt() 245 if (res != PS3AV_HDR_SIZE) { ps3av_send_cmd_pkt() 248 __func__, res); ps3av_send_cmd_pkt() 249 return res; ps3av_send_cmd_pkt() 253 res = ps3av_vuart_read(ps3av->dev, &recv_buf->cid, ps3av_send_cmd_pkt() 255 if (res < 0) { ps3av_send_cmd_pkt() 258 __func__, res); ps3av_send_cmd_pkt() 259 return res; ps3av_send_cmd_pkt() 261 res += PS3AV_HDR_SIZE; /* total len */ ps3av_send_cmd_pkt() 303 int res = 0; ps3av_do_pkt() local 320 res = ps3av_send_cmd_pkt(buf, &ps3av->recv_buf.reply_hdr, send_len, ps3av_do_pkt() 322 if (res < 0) { ps3av_do_pkt() 325 __func__, res); ps3av_do_pkt() 330 res = ps3av_process_reply_packet(buf, &ps3av->recv_buf.reply_hdr, ps3av_do_pkt() 332 if (res < 0) { ps3av_do_pkt() 334 __func__, res); ps3av_do_pkt() 343 printk(KERN_ERR "%s: failed cid:%x res:%d\n", __func__, cid, res); ps3av_do_pkt() 344 return res; ps3av_do_pkt() 349 int i, num_of_av_port, res; ps3av_set_av_video_mute() local 355 res = ps3av_cmd_av_video_mute(1, &ps3av->av_port[i], mute); ps3av_set_av_video_mute() 356 if (res < 0) ps3av_set_av_video_mute() 365 int i, num_of_hdmi_port, num_of_av_port, res; ps3av_set_video_disable_sig() local 373 res = ps3av_cmd_av_tv_mute(ps3av->av_port[i], ps3av_set_video_disable_sig() 375 if (res < 0) ps3av_set_video_disable_sig() 382 res = ps3av_cmd_av_video_disable_sig(ps3av->av_port[i]); ps3av_set_video_disable_sig() 383 if (res < 0) ps3av_set_video_disable_sig() 386 res = ps3av_cmd_av_tv_mute(ps3av->av_port[i], ps3av_set_video_disable_sig() 388 if (res < 0) ps3av_set_video_disable_sig() 399 int i, num_of_av_port, num_of_opt_port, res; ps3av_set_audio_mute() local 406 res = ps3av_cmd_av_audio_mute(1, &ps3av->av_port[i], mute); ps3av_set_audio_mute() 407 if (res < 0) ps3av_set_audio_mute() 411 res = ps3av_cmd_audio_mute(1, &ps3av->opt_port[i], mute); ps3av_set_audio_mute() 412 if (res < 0) ps3av_set_audio_mute() 422 int i, num_of_audio, vid, res; ps3av_set_audio_mode() local 441 res = ps3av_cmd_audio_active(0, ps3av->audio_port); ps3av_set_audio_mode() 442 if (res < 0) ps3av_set_audio_mode() 457 res = ps3av_cmd_audio_mode(&audio_mode); ps3av_set_audio_mode() 458 if (res < 0) ps3av_set_audio_mode() 465 res = ps3av_cmd_avb_param(&avb_param, len); ps3av_set_audio_mode() 466 if (res < 0) ps3av_set_audio_mode() 473 res = ps3av_cmd_audio_active(1, ps3av->audio_port); ps3av_set_audio_mode() 474 if (res < 0) ps3av_set_audio_mode() 499 int res; ps3av_set_videomode_packet() local 532 res = ps3av_cmd_avb_param(&avb_param, len); ps3av_set_videomode_packet() 533 if (res == PS3AV_STATUS_NO_SYNC_HEAD) ps3av_set_videomode_packet() 537 else if (res) ps3av_set_videomode_packet() 544 int res; ps3av_set_videomode_cont() local 561 res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_HDCP_OFF); ps3av_set_videomode_cont() 562 if (res == PS3AV_STATUS_UNSUPPORTED_HDMI_MODE) ps3av_set_videomode_cont() 564 else if (res) ps3av_set_videomode_cont() 568 res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_MODE_NORMAL); ps3av_set_videomode_cont() 569 if (res < 0 && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE) ps3av_set_videomode_cont() 765 int i, res, id = 0, dvi = 0, rgb = 0; ps3av_auto_videomode() local 771 res = ps3av_cmd_video_get_monitor_info(&monitor_info, ps3av_auto_videomode() 774 if (res < 0) ps3av_auto_videomode() 808 int i, j, k, res; ps3av_get_hw_conf() local 812 res = ps3av_cmd_av_get_hw_conf(&ps3av->av_hw_conf); ps3av_get_hw_conf() 813 if (res < 0) ps3av_get_hw_conf() 915 int i, res; ps3av_audio_mute_analog() local 918 res = ps3av_cmd_av_audio_mute(1, ps3av_audio_mute_analog() 921 if (res < 0) ps3av_audio_mute_analog() 937 int res; ps3av_probe() local 961 res = -ENOMEM; ps3av_probe() 982 res = ps3av_cmd_init(); ps3av_probe() 983 if (res < 0) ps3av_probe() 985 res); ps3av_probe() 996 res = -EINVAL; ps3av_probe() 1013 return res; ps3av_probe()
|
/linux-4.1.27/drivers/pci/hotplug/ |
H A D | cpqphp_sysfs.c | 46 struct pci_resource *res; show_ctrl() local 50 res = ctrl->mem_head; show_ctrl() 51 while (res && index--) { show_ctrl() 52 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_ctrl() 53 res = res->next; show_ctrl() 57 res = ctrl->p_mem_head; show_ctrl() 58 while (res && index--) { show_ctrl() 59 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_ctrl() 60 res = res->next; show_ctrl() 64 res = ctrl->io_head; show_ctrl() 65 while (res && index--) { show_ctrl() 66 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_ctrl() 67 res = res->next; show_ctrl() 71 res = ctrl->bus_head; show_ctrl() 72 while (res && index--) { show_ctrl() 73 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_ctrl() 74 res = res->next; show_ctrl() 84 struct pci_resource *res; show_dev() local 96 res = new_slot->mem_head; show_dev() 97 while (res && index--) { show_dev() 98 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_dev() 99 res = res->next; show_dev() 103 res = new_slot->p_mem_head; show_dev() 104 while (res && index--) { show_dev() 105 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_dev() 106 res = res->next; show_dev() 110 res = new_slot->io_head; show_dev() 111 while (res && index--) { show_dev() 112 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_dev() 113 res = res->next; show_dev() 117 res = new_slot->bus_head; show_dev() 118 while (res && index--) { show_dev() 119 out += sprintf(out, "start = %8.8x, length = %8.8x\n", res->base, res->length); show_dev() 120 res = res->next; show_dev()
|
H A D | shpchp_sysfs.c | 43 struct resource *res; show_ctrl() local 50 pci_bus_for_each_resource(bus, res, index) { pci_bus_for_each_resource() 51 if (res && (res->flags & IORESOURCE_MEM) && pci_bus_for_each_resource() 52 !(res->flags & IORESOURCE_PREFETCH)) { pci_bus_for_each_resource() 54 (unsigned long long)res->start, pci_bus_for_each_resource() 55 (unsigned long long)resource_size(res)); pci_bus_for_each_resource() 59 pci_bus_for_each_resource(bus, res, index) { pci_bus_for_each_resource() 60 if (res && (res->flags & IORESOURCE_MEM) && pci_bus_for_each_resource() 61 (res->flags & IORESOURCE_PREFETCH)) { pci_bus_for_each_resource() 63 (unsigned long long)res->start, pci_bus_for_each_resource() 64 (unsigned long long)resource_size(res)); pci_bus_for_each_resource() 68 pci_bus_for_each_resource(bus, res, index) { pci_bus_for_each_resource() 69 if (res && (res->flags & IORESOURCE_IO)) { pci_bus_for_each_resource() 71 (unsigned long long)res->start, pci_bus_for_each_resource() 72 (unsigned long long)resource_size(res)); pci_bus_for_each_resource()
|
H A D | ibmphp_res.c | 467 struct resource_node *res = NULL; update_resources() local 473 res = bus_cur->firstMem; update_resources() 477 res = bus_cur->firstPFMem; update_resources() 481 res = bus_cur->firstIO; update_resources() 485 if (res) { update_resources() 486 while (res) { update_resources() 487 if (res->rangeno == rangeno) update_resources() 489 if (res->next) update_resources() 490 res = res->next; update_resources() 491 else if (res->nextRange) update_resources() 492 res = res->nextRange; update_resources() 501 while (res) { update_resources() 502 ++res->rangeno; update_resources() 503 res = res->next; update_resources() 509 static void fix_me (struct resource_node *res, struct bus_node *bus_cur, struct range_node *range) fix_me() argument 512 switch (res->type) { fix_me() 524 while (res) { fix_me() 525 if (res->rangeno == -1) { fix_me() 527 if ((res->start >= range->start) && (res->end <= range->end)) { fix_me() 528 res->rangeno = range->rangeno; fix_me() 529 debug ("%s->rangeno in fix_resources is %d\n", str, res->rangeno); fix_me() 530 switch (res->type) { fix_me() 546 if (res->next) fix_me() 547 res = res->next; fix_me() 549 res = res->nextRange; fix_me() 567 struct resource_node *res; fix_resources() local 572 res = bus_cur->firstIO; fix_resources() 574 fix_me (res, bus_cur, range); fix_resources() 577 res = bus_cur->firstMem; fix_resources() 579 fix_me (res, bus_cur, range); fix_resources() 582 res = bus_cur->firstPFMem; fix_resources() 584 fix_me (res, bus_cur, range); fix_resources() 597 int ibmphp_add_resource (struct resource_node *res) ibmphp_add_resource() argument 607 if (!res) { ibmphp_add_resource() 612 bus_cur = find_bus_wprev (res->busno, NULL, 0); ibmphp_add_resource() 621 switch (res->type) { ibmphp_add_resource() 639 if ((res->start >= range_cur->start) && (res->end <= range_cur->end)) { ibmphp_add_resource() 640 res->rangeno = range_cur->rangeno; ibmphp_add_resource() 652 switch (res->type) { ibmphp_add_resource() 663 res->rangeno = -1; ibmphp_add_resource() 666 debug ("The range is %d\n", res->rangeno); ibmphp_add_resource() 669 switch (res->type) { ibmphp_add_resource() 671 bus_cur->firstIO = res; ibmphp_add_resource() 674 bus_cur->firstMem = res; ibmphp_add_resource() 677 bus_cur->firstPFMem = res; ibmphp_add_resource() 680 res->next = NULL; ibmphp_add_resource() 681 res->nextRange = NULL; ibmphp_add_resource() 689 if (res_cur->rangeno >= res->rangeno) ibmphp_add_resource() 700 debug ("i should be here, [%x - %x]\n", res->start, res->end); ibmphp_add_resource() 701 res_prev->nextRange = res; ibmphp_add_resource() 702 res->next = NULL; ibmphp_add_resource() 703 res->nextRange = NULL; ibmphp_add_resource() 704 } else if (res_cur->rangeno == res->rangeno) { ibmphp_add_resource() 707 if (res->start < res_cur->start) ibmphp_add_resource() 714 res_prev->next = res; ibmphp_add_resource() 715 res->next = NULL; ibmphp_add_resource() 716 res->nextRange = res_prev->nextRange; ibmphp_add_resource() 718 } else if (res->start < res_cur->start) { ibmphp_add_resource() 721 switch (res->type) { ibmphp_add_resource() 723 bus_cur->firstIO = res; ibmphp_add_resource() 726 bus_cur->firstMem = res; ibmphp_add_resource() 729 bus_cur->firstPFMem = res; ibmphp_add_resource() 733 res_prev->next = res; ibmphp_add_resource() 735 res_prev->nextRange = res; ibmphp_add_resource() 737 res->next = res_cur; ibmphp_add_resource() 738 res->nextRange = NULL; ibmphp_add_resource() 744 res->next = NULL; ibmphp_add_resource() 745 switch (res->type) { ibmphp_add_resource() 747 res->nextRange = bus_cur->firstIO; ibmphp_add_resource() 748 bus_cur->firstIO = res; ibmphp_add_resource() 751 res->nextRange = bus_cur->firstMem; ibmphp_add_resource() 752 bus_cur->firstMem = res; ibmphp_add_resource() 755 res->nextRange = bus_cur->firstPFMem; ibmphp_add_resource() 756 bus_cur->firstPFMem = res; ibmphp_add_resource() 759 } else if (res_cur->rangeno > res->rangeno) { ibmphp_add_resource() 761 res_prev->nextRange = res; ibmphp_add_resource() 762 res->next = NULL; ibmphp_add_resource() 763 res->nextRange = res_cur; ibmphp_add_resource() 779 int ibmphp_remove_resource (struct resource_node *res) ibmphp_remove_resource() argument 787 if (!res) { ibmphp_remove_resource() 792 bus_cur = find_bus_wprev (res->busno, NULL, 0); ibmphp_remove_resource() 799 switch (res->type) { ibmphp_remove_resource() 819 if ((res_cur->start == res->start) && (res_cur->end == res->end)) ibmphp_remove_resource() 829 if (res->type == PFMEM) { ibmphp_remove_resource() 839 if ((res_cur->start == res->start) && (res_cur->end == res->end)) { ibmphp_remove_resource() 881 switch (res->type) { ibmphp_remove_resource() 893 switch (res->type) { ibmphp_remove_resource() 905 switch (res->type) { ibmphp_remove_resource() 939 static struct range_node *find_range (struct bus_node *bus_cur, struct resource_node *res) find_range() argument 943 switch (res->type) { find_range() 958 if (res->rangeno == range->rangeno) find_range() 974 int ibmphp_check_resource (struct resource_node *res, u8 bridge) ibmphp_check_resource() argument 986 if (!res) ibmphp_check_resource() 991 if (res->type == IO) ibmphp_check_resource() 996 tmp_divide = res->len; ibmphp_check_resource() 998 bus_cur = find_bus_wprev (res->busno, NULL, 0); ibmphp_check_resource() 1011 res->len -= 1; ibmphp_check_resource() 1013 switch (res->type) { ibmphp_check_resource() 1046 if ((res_cur->start != range->start) && (len_tmp >= res->len)) { ibmphp_check_resource() 1061 while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) { ibmphp_check_resource() 1074 if (flag && len_cur == res->len) { ibmphp_check_resource() 1076 res->start = start_cur; ibmphp_check_resource() 1077 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1078 res->end = res->start + res->len - 1; ibmphp_check_resource() 1088 if ((range->end != res_cur->end) && (len_tmp >= res->len)) { ibmphp_check_resource() 1102 while ((len_tmp = range->end - tmp_start) >= res->len) { ibmphp_check_resource() 1114 if (flag && len_cur == res->len) { ibmphp_check_resource() 1115 res->start = start_cur; ibmphp_check_resource() 1116 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1117 res->end = res->start + res->len - 1; ibmphp_check_resource() 1129 if ((res_cur->start != range->start) && (len_tmp >= res->len)) { ibmphp_check_resource() 1141 while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) { ibmphp_check_resource() 1154 if (flag && len_cur == res->len) { ibmphp_check_resource() 1155 res->start = start_cur; ibmphp_check_resource() 1156 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1157 res->end = res->start + res->len - 1; ibmphp_check_resource() 1166 if (len_tmp >= res->len) { ibmphp_check_resource() 1178 while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) { ibmphp_check_resource() 1191 if (flag && len_cur == res->len) { ibmphp_check_resource() 1192 res->start = start_cur; ibmphp_check_resource() 1193 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1194 res->end = res->start + res->len - 1; ibmphp_check_resource() 1213 switch (res->type) { ibmphp_check_resource() 1227 if (len_tmp >= res->len) { ibmphp_check_resource() 1239 while ((len_tmp = range->end - tmp_start) >= res->len) { ibmphp_check_resource() 1252 if (flag && len_cur == res->len) { ibmphp_check_resource() 1253 res->start = start_cur; ibmphp_check_resource() 1254 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1255 res->end = res->start + res->len - 1; ibmphp_check_resource() 1268 res->start = start_cur; ibmphp_check_resource() 1269 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1270 res->end = res->start + res->len - 1; ibmphp_check_resource() 1279 switch (res->type) { ibmphp_check_resource() 1293 if (len_tmp >= res->len) { ibmphp_check_resource() 1305 while ((len_tmp = range->end - tmp_start) >= res->len) { ibmphp_check_resource() 1318 if (flag && len_cur == res->len) { ibmphp_check_resource() 1319 res->start = start_cur; ibmphp_check_resource() 1320 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1321 res->end = res->start + res->len - 1; ibmphp_check_resource() 1334 res->start = start_cur; ibmphp_check_resource() 1335 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1336 res->end = res->start + res->len - 1; ibmphp_check_resource() 1342 res->start = start_cur; ibmphp_check_resource() 1343 res->len += 1; /* To restore the balance */ ibmphp_check_resource() 1344 res->end = res->start + res->len - 1; ibmphp_check_resource() 1450 struct resource_node *res = NULL; remove_ranges() local 1455 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, IO) < 0) remove_ranges() 1457 ibmphp_remove_resource (res); remove_ranges() 1469 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, MEM) < 0) remove_ranges() 1472 ibmphp_remove_resource (res); remove_ranges() 1483 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, PFMEM) < 0) remove_ranges() 1486 ibmphp_remove_resource (res); remove_ranges() 1501 int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resource_node **res, int flag) ibmphp_find_resource() argument 1531 *res = res_cur; ibmphp_find_resource() 1545 *res = res_cur; ibmphp_find_resource() 1560 if (*res) ibmphp_find_resource() 1561 debug ("*res->start = %x\n", (*res)->start); ibmphp_find_resource() 1790 struct resource_node *res; ibmphp_print_test() local 1841 res = bus_cur->firstIO; ibmphp_print_test() 1842 while (res) { ibmphp_print_test() 1843 debug_pci ("The range # is %d\n", res->rangeno); ibmphp_print_test() 1844 debug_pci ("The bus, devfnc is %d, %x\n", res->busno, res->devfunc); ibmphp_print_test() 1845 debug_pci ("[%x - %x], len=%x\n", res->start, res->end, res->len); ibmphp_print_test() 1846 if (res->next) ibmphp_print_test() 1847 res = res->next; ibmphp_print_test() 1848 else if (res->nextRange) ibmphp_print_test() 1849 res = res->nextRange; ibmphp_print_test() 1856 res = bus_cur->firstMem; ibmphp_print_test() 1857 while (res) { ibmphp_print_test() 1858 debug_pci ("The range # is %d\n", res->rangeno); ibmphp_print_test() 1859 debug_pci ("The bus, devfnc is %d, %x\n", res->busno, res->devfunc); ibmphp_print_test() 1860 debug_pci ("[%x - %x], len=%x\n", res->start, res->end, res->len); ibmphp_print_test() 1861 if (res->next) ibmphp_print_test() 1862 res = res->next; ibmphp_print_test() 1863 else if (res->nextRange) ibmphp_print_test() 1864 res = res->nextRange; ibmphp_print_test() 1871 res = bus_cur->firstPFMem; ibmphp_print_test() 1872 while (res) { ibmphp_print_test() 1873 debug_pci ("The range # is %d\n", res->rangeno); ibmphp_print_test() 1874 debug_pci ("The bus, devfnc is %d, %x\n", res->busno, res->devfunc); ibmphp_print_test() 1875 debug_pci ("[%x - %x], len=%x\n", res->start, res->end, res->len); ibmphp_print_test() 1876 if (res->next) ibmphp_print_test() 1877 res = res->next; ibmphp_print_test() 1878 else if (res->nextRange) ibmphp_print_test() 1879 res = res->nextRange; ibmphp_print_test() 1887 res = bus_cur->firstPFMemFromMem; ibmphp_print_test() 1888 while (res) { ibmphp_print_test() 1889 debug_pci ("The range # is %d\n", res->rangeno); ibmphp_print_test() 1890 debug_pci ("The bus, devfnc is %d, %x\n", res->busno, res->devfunc); ibmphp_print_test() 1891 debug_pci ("[%x - %x], len=%x\n", res->start, res->end, res->len); ibmphp_print_test() 1892 res = res->next; ibmphp_print_test()
|
/linux-4.1.27/fs/jffs2/ |
H A D | writev.c | 21 int res; jffs2_flash_direct_writev() local 22 res = jffs2_sum_add_kvec(c, vecs, count, (uint32_t) to); jffs2_flash_direct_writev() 23 if (res) { jffs2_flash_direct_writev() 24 return res; jffs2_flash_direct_writev() 40 int res; jffs2_flash_direct_write() local 45 res = jffs2_sum_add_kvec(c, vecs, 1, (uint32_t) ofs); jffs2_flash_direct_write() 46 if (res) { jffs2_flash_direct_write() 47 return res; jffs2_flash_direct_write()
|
/linux-4.1.27/fs/ext4/ |
H A D | crypto_key.c | 27 ecr->res = rc; derive_crypt_complete() 43 int res = 0; ext4_derive_key_aes() local 51 res = PTR_ERR(tfm); ext4_derive_key_aes() 58 res = -ENOMEM; ext4_derive_key_aes() 64 res = crypto_ablkcipher_setkey(tfm, deriving_key, ext4_derive_key_aes() 66 if (res < 0) ext4_derive_key_aes() 72 res = crypto_ablkcipher_encrypt(req); ext4_derive_key_aes() 73 if (res == -EINPROGRESS || res == -EBUSY) { ext4_derive_key_aes() 76 res = ecr.res; ext4_derive_key_aes() 84 return res; ext4_derive_key_aes() 102 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_generate_encryption_key() local 106 if (res != sizeof(ctx)) { ext4_generate_encryption_key() 107 if (res > 0) ext4_generate_encryption_key() 108 res = -EINVAL; ext4_generate_encryption_key() 111 res = 0; ext4_generate_encryption_key() 137 res = PTR_ERR(keyring_key); ext4_generate_encryption_key() 144 res = -EINVAL; ext4_generate_encryption_key() 151 res = ext4_derive_key_aes(ctx.nonce, master_key->raw, crypt_key->raw); ext4_generate_encryption_key() 155 if (res < 0) ext4_generate_encryption_key() 157 return res; ext4_generate_encryption_key()
|
H A D | crypto_policy.c | 20 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_inode_has_encryption_context() local 22 return (res > 0); ext4_inode_has_encryption_context() 33 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_is_encryption_context_consistent_with_policy() local 36 if (res != sizeof(ctx)) ext4_is_encryption_context_consistent_with_policy() 52 int res = 0; ext4_create_encryption_context_from_policy() local 77 res = ext4_xattr_set(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_create_encryption_context_from_policy() 80 if (!res) ext4_create_encryption_context_from_policy() 82 return res; ext4_create_encryption_context_from_policy() 110 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_get_policy() local 113 if (res != sizeof(ctx)) ext4_get_policy() 130 int res; ext4_is_child_context_consistent_with_parent() local 139 res = ext4_xattr_get(parent, EXT4_XATTR_INDEX_ENCRYPTION, ext4_is_child_context_consistent_with_parent() 142 if (res != sizeof(parent_ctx)) ext4_is_child_context_consistent_with_parent() 147 res = ext4_xattr_get(child, EXT4_XATTR_INDEX_ENCRYPTION, ext4_is_child_context_consistent_with_parent() 150 if (res != sizeof(child_ctx)) ext4_is_child_context_consistent_with_parent() 171 int res = ext4_xattr_get(parent, EXT4_XATTR_INDEX_ENCRYPTION, ext4_inherit_context() local 175 if (res != sizeof(ctx)) { ext4_inherit_context() 185 res = 0; ext4_inherit_context() 191 res = ext4_xattr_set(child, EXT4_XATTR_INDEX_ENCRYPTION, ext4_inherit_context() 195 if (!res) ext4_inherit_context() 197 return res; ext4_inherit_context()
|
/linux-4.1.27/arch/m68k/amiga/ |
H A D | chipram.c | 46 struct resource *res; amiga_chip_alloc() local 49 res = kzalloc(sizeof(struct resource), GFP_KERNEL); amiga_chip_alloc() 50 if (!res) amiga_chip_alloc() 53 res->name = name; amiga_chip_alloc() 54 p = amiga_chip_alloc_res(size, res); amiga_chip_alloc() 56 kfree(res); amiga_chip_alloc() 72 void *amiga_chip_alloc_res(unsigned long size, struct resource *res) amiga_chip_alloc_res() argument 80 error = allocate_resource(&chipram_res, res, size, 0, UINT_MAX, amiga_chip_alloc_res() 89 pr_debug("amiga_chip_alloc_res: returning %pR\n", res); amiga_chip_alloc_res() 90 return ZTWO_VADDR(res->start); amiga_chip_alloc_res() 96 struct resource *res; amiga_chip_free() local 99 res = lookup_resource(&chipram_res, start); amiga_chip_free() 100 if (!res) { amiga_chip_free() 106 size = resource_size(res); amiga_chip_free() 109 release_resource(res); amiga_chip_free() 110 kfree(res); amiga_chip_free()
|
/linux-4.1.27/drivers/pci/ |
H A D | host-bridge.c | 49 struct resource *res) pcibios_resource_to_bus() 56 if (resource_contains(window->res, res)) { pcibios_resource_to_bus() 62 region->start = res->start - offset; pcibios_resource_to_bus() 63 region->end = res->end - offset; pcibios_resource_to_bus() 73 void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, pcibios_bus_to_resource() argument 83 if (resource_type(res) != resource_type(window->res)) pcibios_bus_to_resource() 86 bus_region.start = window->res->start - window->offset; pcibios_bus_to_resource() 87 bus_region.end = window->res->end - window->offset; pcibios_bus_to_resource() 95 res->start = region->start + offset; pcibios_bus_to_resource() 96 res->end = region->end + offset; pcibios_bus_to_resource() 48 pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, struct resource *res) pcibios_resource_to_bus() argument
|
H A D | setup-res.c | 2 * drivers/pci/setup-res.c 37 struct resource *res = dev->resource + resno; pci_update_resource() local 43 if (!res->flags) pci_update_resource() 46 if (res->flags & IORESOURCE_UNSET) pci_update_resource() 54 if (res->flags & IORESOURCE_PCI_FIXED) pci_update_resource() 57 pcibios_resource_to_bus(dev->bus, ®ion, res); pci_update_resource() 59 new = region.start | (res->flags & PCI_REGION_FLAG_MASK); pci_update_resource() 60 if (res->flags & IORESOURCE_IO) pci_update_resource() 69 if (!(res->flags & IORESOURCE_ROM_ENABLE)) pci_update_resource() 79 disable = (res->flags & IORESOURCE_MEM_64) && !dev->mmio_always_on; pci_update_resource() 94 if (res->flags & IORESOURCE_MEM_64) { pci_update_resource() 110 struct resource *res = &dev->resource[resource]; pci_claim_resource() local 113 if (res->flags & IORESOURCE_UNSET) { pci_claim_resource() 115 resource, res); pci_claim_resource() 119 root = pci_find_parent_resource(dev, res); pci_claim_resource() 122 resource, res); pci_claim_resource() 123 res->flags |= IORESOURCE_UNSET; pci_claim_resource() 127 conflict = request_resource_conflict(root, res); pci_claim_resource() 130 resource, res, conflict->name, conflict); pci_claim_resource() 131 res->flags |= IORESOURCE_UNSET; pci_claim_resource() 166 static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, pci_revert_fw_address() argument 176 start = res->start; pci_revert_fw_address() 177 end = res->end; pci_revert_fw_address() 178 res->start = fw_addr; pci_revert_fw_address() 179 res->end = res->start + size - 1; pci_revert_fw_address() 181 root = pci_find_parent_resource(dev, res); pci_revert_fw_address() 183 if (res->flags & IORESOURCE_IO) pci_revert_fw_address() 190 resno, res); pci_revert_fw_address() 191 conflict = request_resource_conflict(root, res); pci_revert_fw_address() 194 resno, res, conflict->name, conflict); pci_revert_fw_address() 195 res->start = start; pci_revert_fw_address() 196 res->end = end; pci_revert_fw_address() 205 struct resource *res = dev->resource + resno; __pci_assign_resource() local 209 min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; __pci_assign_resource() 218 ret = pci_bus_alloc_resource(bus, res, size, align, min, __pci_assign_resource() 228 if ((res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) == __pci_assign_resource() 230 ret = pci_bus_alloc_resource(bus, res, size, align, min, __pci_assign_resource() 243 if (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) __pci_assign_resource() 244 ret = pci_bus_alloc_resource(bus, res, size, align, min, 0, __pci_assign_resource() 268 struct resource *res = dev->resource + resno; pci_assign_resource() local 272 res->flags |= IORESOURCE_UNSET; pci_assign_resource() 273 align = pci_resource_alignment(dev, res); pci_assign_resource() 276 resno, res); pci_assign_resource() 280 size = resource_size(res); pci_assign_resource() 289 dev_info(&dev->dev, "BAR %d: no space for %pR\n", resno, res); pci_assign_resource() 290 ret = pci_revert_fw_address(res, dev, resno, size); pci_assign_resource() 295 res); pci_assign_resource() 299 res->flags &= ~IORESOURCE_UNSET; pci_assign_resource() 300 res->flags &= ~IORESOURCE_STARTALIGN; pci_assign_resource() 301 dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); pci_assign_resource() 312 struct resource *res = dev->resource + resno; pci_reassign_resource() local 317 flags = res->flags; pci_reassign_resource() 318 res->flags |= IORESOURCE_UNSET; pci_reassign_resource() 319 if (!res->parent) { pci_reassign_resource() 321 resno, res); pci_reassign_resource() 326 new_size = resource_size(res) + addsize; pci_reassign_resource() 329 res->flags = flags; pci_reassign_resource() 331 resno, res, (unsigned long long) addsize); pci_reassign_resource() 335 res->flags &= ~IORESOURCE_UNSET; pci_reassign_resource() 336 res->flags &= ~IORESOURCE_STARTALIGN; pci_reassign_resource() 338 resno, res, (unsigned long long) addsize); pci_reassign_resource()
|
H A D | bus.c | 4 * From setup-res.c, by: 20 void pci_add_resource_offset(struct list_head *resources, struct resource *res, pci_add_resource_offset() argument 25 entry = resource_list_create_entry(res, 0); pci_add_resource_offset() 27 printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res); pci_add_resource_offset() 36 void pci_add_resource(struct list_head *resources, struct resource *res) pci_add_resource() argument 38 pci_add_resource_offset(resources, res, 0); pci_add_resource() 48 void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, pci_bus_add_resource() argument 55 dev_err(&bus->dev, "can't add %pR resource\n", res); pci_bus_add_resource() 59 bus_res->res = res; pci_bus_add_resource() 74 return bus_res->res; pci_bus_resource_n() 103 * @res contains CPU addresses. Clip it so the corresponding bus addresses 109 struct resource *res, pci_clip_resource_to_region() 114 pcibios_resource_to_bus(bus, &r, res); pci_clip_resource_to_region() 121 res->end = res->start - 1; pci_clip_resource_to_region() 123 pcibios_bus_to_resource(bus, res, &r); pci_clip_resource_to_region() 126 static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res, pci_bus_alloc_from_region() argument 149 if ((res->flags ^ r->flags) & type_mask) pci_bus_for_each_resource() 155 !(res->flags & IORESOURCE_PREFETCH)) pci_bus_for_each_resource() 173 ret = allocate_resource(r, res, size, min_used, max, pci_bus_for_each_resource() 184 * @res: resource to allocate 196 int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, pci_bus_alloc_resource() argument 208 if (res->flags & IORESOURCE_MEM_64) { pci_bus_alloc_resource() 209 rc = pci_bus_alloc_from_region(bus, res, size, align, min, pci_bus_alloc_resource() 215 return pci_bus_alloc_from_region(bus, res, size, align, min, pci_bus_alloc_resource() 221 return pci_bus_alloc_from_region(bus, res, size, align, min, pci_bus_alloc_resource() 236 struct resource *res = &dev->resource[idx]; pci_bus_clip_resource() local 237 struct resource orig_res = *res; pci_bus_clip_resource() 247 if (resource_type(res) != resource_type(r)) pci_bus_for_each_resource() 250 start = max(r->start, res->start); pci_bus_for_each_resource() 251 end = min(r->end, res->end); pci_bus_for_each_resource() 256 if (res->start == start && res->end == end) pci_bus_for_each_resource() 259 res->start = start; pci_bus_for_each_resource() 260 res->end = end; pci_bus_for_each_resource() 261 res->flags &= ~IORESOURCE_UNSET; pci_bus_for_each_resource() 264 &orig_res, res); pci_bus_for_each_resource() 108 pci_clip_resource_to_region(struct pci_bus *bus, struct resource *res, struct pci_bus_region *region) pci_clip_resource_to_region() argument
|
H A D | setup-bus.c | 35 struct resource *res; member in struct:pci_dev_resource 59 * @res: The resource to be tracked 64 struct pci_dev *dev, struct resource *res, add_to_list() 75 tmp->res = res; add_to_list() 77 tmp->start = res->start; add_to_list() 78 tmp->end = res->end; add_to_list() 79 tmp->flags = res->flags; add_to_list() 89 struct resource *res) remove_from_list() 94 if (dev_res->res == res) { list_for_each_entry_safe() 103 struct resource *res) res_to_dev_res() 108 if (dev_res->res == res) { list_for_each_entry() 109 int idx = res - &dev_res->dev->resource[0]; list_for_each_entry() 112 "res[%d]=%pR res_to_dev_res add_size %llx min_align %llx\n", list_for_each_entry() 113 idx, dev_res->res, list_for_each_entry() 125 struct resource *res) get_res_add_size() 129 dev_res = res_to_dev_res(head, res); get_res_add_size() 134 struct resource *res) get_res_add_align() 138 dev_res = res_to_dev_res(head, res); get_res_add_align() 172 tmp->res = r; pdev_sort_resources() 181 dev_res->res); list_for_each_entry() 213 static inline void reset_resource(struct resource *res) reset_resource() argument 215 res->start = 0; reset_resource() 216 res->end = 0; reset_resource() 217 res->flags = 0; reset_resource() 235 struct resource *res; reassign_resources_sorted() local 244 res = add_res->res; list_for_each_entry_safe() 246 if (!res->flags) list_for_each_entry_safe() 251 if (dev_res->res == res) { list_for_each_entry() 259 idx = res - &add_res->dev->resource[0]; 262 if (!resource_size(res)) { 263 res->start = align; 264 res->end = res->start + add_size - 1; 266 reset_resource(res); 268 res->flags |= add_res->flags & 273 "failed to add %llx res[%d]=%pR\n", 275 idx, res); 296 struct resource *res; assign_requested_resources_sorted() local 301 res = dev_res->res; list_for_each_entry() 302 idx = res - &dev_res->dev->resource[0]; list_for_each_entry() 303 if (resource_size(res) && list_for_each_entry() 307 * if the failed res is for ROM BAR, and it will list_for_each_entry() 311 (!(res->flags & IORESOURCE_ROM_ENABLE)))) list_for_each_entry() 313 dev_res->dev, res, list_for_each_entry() 317 reset_resource(res); list_for_each_entry() 340 static bool pci_need_to_release(unsigned long mask, struct resource *res) pci_need_to_release() argument 342 if (res->flags & IORESOURCE_IO) pci_need_to_release() 346 if (res->flags & IORESOURCE_PREFETCH) { pci_need_to_release() 351 !(res->parent->flags & IORESOURCE_PREFETCH)) pci_need_to_release() 357 if (res->flags & IORESOURCE_MEM) pci_need_to_release() 401 if (add_to_list(&save_head, dev_res->dev, dev_res->res, 0, 0)) { list_for_each_entry() 407 /* Update res in head list with add_size in realloc_head list */ list_for_each_entry_safe() 409 dev_res->res->end += get_res_add_size(realloc_head, list_for_each_entry_safe() 410 dev_res->res); list_for_each_entry_safe() 418 if (!(dev_res->res->flags & IORESOURCE_STARTALIGN)) list_for_each_entry_safe() 421 add_align = get_res_add_align(realloc_head, dev_res->res); list_for_each_entry_safe() 430 if (add_align > dev_res->res->start) { list_for_each_entry_safe() 431 resource_size_t r_size = resource_size(dev_res->res); list_for_each_entry_safe() 433 dev_res->res->start = add_align; list_for_each_entry_safe() 434 dev_res->res->end = add_align + r_size - 1; list_for_each_entry_safe() 438 dev_res2->res); list_for_each_entry() 456 remove_from_list(realloc_head, dev_res->res); 464 /* remove not need to be released assigned res from head list etc */ list_for_each_entry_safe() 466 if (dev_res->res->parent && list_for_each_entry_safe() 467 !pci_need_to_release(fail_type, dev_res->res)) { list_for_each_entry_safe() 469 remove_from_list(realloc_head, dev_res->res); list_for_each_entry_safe() 470 remove_from_list(&save_head, dev_res->res); list_for_each_entry_safe() 478 if (dev_res->res->parent) list_for_each_entry() 479 release_resource(dev_res->res); list_for_each_entry() 482 struct resource *res = save_res->res; list_for_each_entry() local 484 res->start = save_res->start; list_for_each_entry() 485 res->end = save_res->end; list_for_each_entry() 486 res->flags = save_res->flags; list_for_each_entry() 528 struct resource *res; pci_setup_cardbus() local 534 res = bus->resource[0]; pci_setup_cardbus() 535 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_cardbus() 536 if (res->flags & IORESOURCE_IO) { pci_setup_cardbus() 541 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_cardbus() 548 res = bus->resource[1]; pci_setup_cardbus() 549 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_cardbus() 550 if (res->flags & IORESOURCE_IO) { pci_setup_cardbus() 551 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_cardbus() 558 res = bus->resource[2]; pci_setup_cardbus() 559 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_cardbus() 560 if (res->flags & IORESOURCE_MEM) { pci_setup_cardbus() 561 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_cardbus() 568 res = bus->resource[3]; pci_setup_cardbus() 569 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_cardbus() 570 if (res->flags & IORESOURCE_MEM) { pci_setup_cardbus() 571 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_cardbus() 593 struct resource *res; pci_setup_bridge_io() local 605 res = &bridge->resource[PCI_BRIDGE_RESOURCES + 0]; pci_setup_bridge_io() 606 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_bridge_io() 607 if (res->flags & IORESOURCE_IO) { pci_setup_bridge_io() 614 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_bridge_io() 630 struct resource *res; pci_setup_bridge_mmio() local 635 res = &bridge->resource[PCI_BRIDGE_RESOURCES + 1]; pci_setup_bridge_mmio() 636 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_bridge_mmio() 637 if (res->flags & IORESOURCE_MEM) { pci_setup_bridge_mmio() 640 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_bridge_mmio() 649 struct resource *res; pci_setup_bridge_mmio_pref() local 660 res = &bridge->resource[PCI_BRIDGE_RESOURCES + 2]; pci_setup_bridge_mmio_pref() 661 pcibios_resource_to_bus(bridge->bus, ®ion, res); pci_setup_bridge_mmio_pref() 662 if (res->flags & IORESOURCE_PREFETCH) { pci_setup_bridge_mmio_pref() 665 if (res->flags & IORESOURCE_MEM_64) { pci_setup_bridge_mmio_pref() 669 dev_info(&bridge->dev, " bridge window %pR\n", res); pci_setup_bridge_mmio_pref() 1046 /* put SRIOV requested res to the optional list */ pbus_size_mem() 1117 unsigned long pci_cardbus_resource_alignment(struct resource *res) pci_cardbus_resource_alignment() argument 1119 if (res->flags & IORESOURCE_IO) pci_cardbus_resource_alignment() 1121 if (res->flags & IORESOURCE_MEM) pci_cardbus_resource_alignment() 1474 /* for next child res under same bridge */ pci_bridge_release_resources() 1521 struct resource *res; pci_bus_dump_res() local 1524 pci_bus_for_each_resource(bus, res, i) { pci_bus_for_each_resource() 1525 if (!res || !res->end || !res->flags) pci_bus_for_each_resource() 1528 dev_printk(KERN_DEBUG, &bus->dev, "resource %d %pR\n", i, res); pci_bus_for_each_resource() 1640 * first try will not touch pci bridge res 1641 * second and later try will clear small leaf bridge res 1701 "No. %d try to assign unassigned res\n", tried_times + 1); pci_assign_unassigned_root_bus_resources() 1718 struct resource *res = fail_res->res; pci_assign_unassigned_root_bus_resources() local 1720 res->start = fail_res->start; pci_assign_unassigned_root_bus_resources() 1721 res->end = fail_res->end; pci_assign_unassigned_root_bus_resources() 1722 res->flags = fail_res->flags; pci_assign_unassigned_root_bus_resources() 1724 res->flags = 0; pci_assign_unassigned_root_bus_resources() 1770 printk(KERN_DEBUG "PCI: No. %d try to assign unassigned res\n", pci_assign_unassigned_bridge_resources() 1784 struct resource *res = fail_res->res; pci_assign_unassigned_bridge_resources() local 1786 res->start = fail_res->start; pci_assign_unassigned_bridge_resources() 1787 res->end = fail_res->end; pci_assign_unassigned_bridge_resources() 1788 res->flags = fail_res->flags; pci_assign_unassigned_bridge_resources() 1790 res->flags = 0; pci_assign_unassigned_bridge_resources() 63 add_to_list(struct list_head *head, struct pci_dev *dev, struct resource *res, resource_size_t add_size, resource_size_t min_align) add_to_list() argument 88 remove_from_list(struct list_head *head, struct resource *res) remove_from_list() argument 102 res_to_dev_res(struct list_head *head, struct resource *res) res_to_dev_res() argument 124 get_res_add_size(struct list_head *head, struct resource *res) get_res_add_size() argument 133 get_res_add_align(struct list_head *head, struct resource *res) get_res_add_align() argument
|
H A D | rom.c | 27 struct resource *res = pdev->resource + PCI_ROM_RESOURCE; pci_enable_rom() local 31 if (!res->flags) pci_enable_rom() 34 pcibios_resource_to_bus(pdev->bus, ®ion, res); pci_enable_rom() 119 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; pci_map_rom() local 128 if (res->flags & IORESOURCE_ROM_SHADOW) { pci_map_rom() 133 if (res->flags & pci_map_rom() 140 if (res->parent == NULL && pci_map_rom() 157 if (!(res->flags & (IORESOURCE_ROM_ENABLE | pci_map_rom() 183 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; pci_unmap_rom() local 185 if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) pci_unmap_rom() 191 if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) pci_unmap_rom() 204 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; pci_cleanup_rom() local 206 if (res->flags & IORESOURCE_ROM_COPY) { pci_cleanup_rom() 207 kfree((void *)(unsigned long)res->start); pci_cleanup_rom() 208 res->flags |= IORESOURCE_UNSET; pci_cleanup_rom() 209 res->flags &= ~IORESOURCE_ROM_COPY; pci_cleanup_rom() 210 res->start = 0; pci_cleanup_rom() 211 res->end = 0; pci_cleanup_rom()
|
/linux-4.1.27/sound/hda/ |
H A D | trace.h | 31 TP_PROTO(struct hdac_bus *bus, unsigned int addr, unsigned int res), 32 TP_ARGS(bus, addr, res), 37 dev_name((bus)->dev), addr, res); 43 TP_PROTO(struct hdac_bus *bus, u32 res, u32 res_ex), 44 TP_ARGS(bus, res, res_ex), 48 "[%s:%d] res=0x%08x, res_ex=0x%08x", 49 dev_name((bus)->dev), res_ex & 0x0f, res, res_ex);
|
H A D | hdac_bus.c | 48 * @res: pointer to store the response, NULL if performing asynchronously 53 unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb() 58 err = snd_hdac_bus_exec_verb_unlocked(bus, addr, cmd, res); snd_hdac_bus_exec_verb() 68 * @res: pointer to store the response, NULL if performing asynchronously 73 unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb_unlocked() 81 if (res) snd_hdac_bus_exec_verb_unlocked() 82 *res = -1; snd_hdac_bus_exec_verb_unlocked() 84 res = &tmp; snd_hdac_bus_exec_verb_unlocked() 95 if (!err && res) { snd_hdac_bus_exec_verb_unlocked() 96 err = bus->ops->get_response(bus, addr, res); snd_hdac_bus_exec_verb_unlocked() 97 trace_hda_get_response(bus, addr, *res); snd_hdac_bus_exec_verb_unlocked() 106 * @res: unsolicited event (lower 32bit of RIRB entry) 113 void snd_hdac_bus_queue_event(struct hdac_bus *bus, u32 res, u32 res_ex) snd_hdac_bus_queue_event() argument 120 trace_hda_unsol_event(bus, res, res_ex); snd_hdac_bus_queue_event() 125 bus->unsol_queue[wp] = res; snd_hdac_bus_queue_event() 140 unsigned int rp, caddr, res; process_unsol_events() local 146 res = bus->unsol_queue[rp]; process_unsol_events() 155 drv->unsol_event(codec, res); process_unsol_events() 52 snd_hdac_bus_exec_verb(struct hdac_bus *bus, unsigned int addr, unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb() argument 72 snd_hdac_bus_exec_verb_unlocked(struct hdac_bus *bus, unsigned int addr, unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb_unlocked() argument
|
/linux-4.1.27/drivers/gpu/drm/vmwgfx/ |
H A D | vmwgfx_resource.c | 48 struct vmw_resource res; member in struct:vmw_stream 85 struct vmw_resource *vmw_resource_reference(struct vmw_resource *res) vmw_resource_reference() argument 87 kref_get(&res->kref); vmw_resource_reference() 88 return res; vmw_resource_reference() 92 vmw_resource_reference_unless_doomed(struct vmw_resource *res) vmw_resource_reference_unless_doomed() argument 94 return kref_get_unless_zero(&res->kref) ? res : NULL; vmw_resource_reference_unless_doomed() 100 * @res: Pointer to the resource. 104 void vmw_resource_release_id(struct vmw_resource *res) vmw_resource_release_id() argument 106 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_release_id() 107 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; vmw_resource_release_id() 110 if (res->id != -1) vmw_resource_release_id() 111 idr_remove(idr, res->id); vmw_resource_release_id() 112 res->id = -1; vmw_resource_release_id() 118 struct vmw_resource *res = vmw_resource_release() local 120 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_release() 122 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; vmw_resource_release() 124 res->avail = false; vmw_resource_release() 125 list_del_init(&res->lru_head); vmw_resource_release() 127 if (res->backup) { vmw_resource_release() 128 struct ttm_buffer_object *bo = &res->backup->base; vmw_resource_release() 131 if (!list_empty(&res->mob_head) && vmw_resource_release() 132 res->func->unbind != NULL) { vmw_resource_release() 137 res->func->unbind(res, false, &val_buf); vmw_resource_release() 139 res->backup_dirty = false; vmw_resource_release() 140 list_del_init(&res->mob_head); vmw_resource_release() 142 vmw_dmabuf_unreference(&res->backup); vmw_resource_release() 145 if (likely(res->hw_destroy != NULL)) { vmw_resource_release() 146 res->hw_destroy(res); vmw_resource_release() 148 vmw_context_binding_res_list_kill(&res->binding_head); vmw_resource_release() 152 id = res->id; vmw_resource_release() 153 if (res->res_free != NULL) vmw_resource_release() 154 res->res_free(res); vmw_resource_release() 156 kfree(res); vmw_resource_release() 166 struct vmw_resource *res = *p_res; vmw_resource_unreference() local 167 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_unreference() 171 kref_put(&res->kref, vmw_resource_release); vmw_resource_unreference() 179 * @res: Pointer to the resource. 182 * @res->id to that id. Returns 0 on success and -ENOMEM on failure. 184 int vmw_resource_alloc_id(struct vmw_resource *res) vmw_resource_alloc_id() argument 186 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_alloc_id() 188 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; vmw_resource_alloc_id() 190 BUG_ON(res->id != -1); vmw_resource_alloc_id() 195 ret = idr_alloc(idr, res, 1, 0, GFP_NOWAIT); vmw_resource_alloc_id() 197 res->id = ret; vmw_resource_alloc_id() 208 * @res: The struct vmw_resource to initialize. 215 int vmw_resource_init(struct vmw_private *dev_priv, struct vmw_resource *res, vmw_resource_init() argument 217 void (*res_free) (struct vmw_resource *res), vmw_resource_init() 220 kref_init(&res->kref); vmw_resource_init() 221 res->hw_destroy = NULL; vmw_resource_init() 222 res->res_free = res_free; vmw_resource_init() 223 res->avail = false; vmw_resource_init() 224 res->dev_priv = dev_priv; vmw_resource_init() 225 res->func = func; vmw_resource_init() 226 INIT_LIST_HEAD(&res->lru_head); vmw_resource_init() 227 INIT_LIST_HEAD(&res->mob_head); vmw_resource_init() 228 INIT_LIST_HEAD(&res->binding_head); vmw_resource_init() 229 res->id = -1; vmw_resource_init() 230 res->backup = NULL; vmw_resource_init() 231 res->backup_offset = 0; vmw_resource_init() 232 res->backup_dirty = false; vmw_resource_init() 233 res->res_dirty = false; vmw_resource_init() 237 return vmw_resource_alloc_id(res); vmw_resource_init() 243 * @res: Pointer to the newly created resource 252 void vmw_resource_activate(struct vmw_resource *res, vmw_resource_activate() argument 255 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_activate() 258 res->avail = true; vmw_resource_activate() 259 res->hw_destroy = hw_destroy; vmw_resource_activate() 266 struct vmw_resource *res; vmw_resource_lookup() local 269 res = idr_find(idr, id); vmw_resource_lookup() 270 if (res && res->avail) vmw_resource_lookup() 271 kref_get(&res->kref); vmw_resource_lookup() 273 res = NULL; vmw_resource_lookup() 276 if (unlikely(res == NULL)) vmw_resource_lookup() 279 return res; vmw_resource_lookup() 304 struct vmw_resource *res; vmw_user_resource_lookup_handle() local 314 res = converter->base_obj_to_res(base); vmw_user_resource_lookup_handle() 317 if (!res->avail || res->res_free != converter->res_free) { vmw_user_resource_lookup_handle() 322 kref_get(&res->kref); vmw_user_resource_lookup_handle() 325 *p_res = res; vmw_user_resource_lookup_handle() 345 struct vmw_resource *res; vmw_user_lookup_handle() local 352 &res); vmw_user_lookup_handle() 354 *out_surf = vmw_res_to_srf(res); vmw_user_lookup_handle() 787 static void vmw_stream_destroy(struct vmw_resource *res) vmw_stream_destroy() argument 789 struct vmw_private *dev_priv = res->dev_priv; vmw_stream_destroy() 794 stream = container_of(res, struct vmw_stream, res); vmw_stream_destroy() 802 void (*res_free) (struct vmw_resource *res)) vmw_stream_init() 804 struct vmw_resource *res = &stream->res; vmw_stream_init() local 807 ret = vmw_resource_init(dev_priv, res, false, res_free, vmw_stream_init() 814 res_free(&stream->res); vmw_stream_init() 820 vmw_resource_unreference(&res); vmw_stream_init() 826 vmw_resource_activate(&stream->res, vmw_stream_destroy); vmw_stream_init() 830 static void vmw_user_stream_free(struct vmw_resource *res) vmw_user_stream_free() argument 833 container_of(res, struct vmw_user_stream, stream.res); vmw_user_stream_free() 834 struct vmw_private *dev_priv = res->dev_priv; vmw_user_stream_free() 851 struct vmw_resource *res = &stream->stream.res; vmw_user_stream_base_release() local 854 vmw_resource_unreference(&res); vmw_user_stream_base_release() 861 struct vmw_resource *res; vmw_stream_unref_ioctl() local 869 res = vmw_resource_lookup(dev_priv, idr, arg->stream_id); vmw_stream_unref_ioctl() 870 if (unlikely(res == NULL)) vmw_stream_unref_ioctl() 873 if (res->res_free != &vmw_user_stream_free) { vmw_stream_unref_ioctl() 878 stream = container_of(res, struct vmw_user_stream, stream.res); vmw_stream_unref_ioctl() 886 vmw_resource_unreference(&res); vmw_stream_unref_ioctl() 895 struct vmw_resource *res; vmw_stream_claim_ioctl() local 932 res = &stream->stream.res; vmw_stream_claim_ioctl() 944 tmp = vmw_resource_reference(res); vmw_stream_claim_ioctl() 953 arg->stream_id = res->id; vmw_stream_claim_ioctl() 955 vmw_resource_unreference(&res); vmw_stream_claim_ioctl() 966 struct vmw_resource *res; vmw_user_stream_lookup() local 969 res = vmw_resource_lookup(dev_priv, &dev_priv->res_idr[vmw_res_stream], vmw_user_stream_lookup() 971 if (unlikely(res == NULL)) vmw_user_stream_lookup() 974 if (res->res_free != &vmw_user_stream_free) { vmw_user_stream_lookup() 979 stream = container_of(res, struct vmw_user_stream, stream.res); vmw_user_stream_lookup() 986 *out = res; vmw_user_stream_lookup() 989 vmw_resource_unreference(&res); vmw_user_stream_lookup() 1079 * @res: The resource for which to allocate a backup buffer. 1083 static int vmw_resource_buf_alloc(struct vmw_resource *res, vmw_resource_buf_alloc() argument 1087 (res->backup_size + PAGE_SIZE - 1) & PAGE_MASK; vmw_resource_buf_alloc() 1091 if (likely(res->backup)) { vmw_resource_buf_alloc() 1092 BUG_ON(res->backup->base.num_pages * PAGE_SIZE < size); vmw_resource_buf_alloc() 1100 ret = vmw_dmabuf_init(res->dev_priv, backup, res->backup_size, vmw_resource_buf_alloc() 1101 res->func->backup_placement, vmw_resource_buf_alloc() 1107 res->backup = backup; vmw_resource_buf_alloc() 1117 * @res: The resource to make visible to the device. 1124 static int vmw_resource_do_validate(struct vmw_resource *res, vmw_resource_do_validate() argument 1128 const struct vmw_res_func *func = res->func; vmw_resource_do_validate() 1130 if (unlikely(res->id == -1)) { vmw_resource_do_validate() 1131 ret = func->create(res); vmw_resource_do_validate() 1137 ((func->needs_backup && list_empty(&res->mob_head) && vmw_resource_do_validate() 1140 ret = func->bind(res, val_buf); vmw_resource_do_validate() 1144 list_add_tail(&res->mob_head, &res->backup->res_list); vmw_resource_do_validate() 1153 res->res_dirty = true; vmw_resource_do_validate() 1158 func->destroy(res); vmw_resource_do_validate() 1167 * @res: Pointer to the struct vmw_resource to unreserve. 1175 void vmw_resource_unreserve(struct vmw_resource *res, vmw_resource_unreserve() argument 1179 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_unreserve() 1181 if (!list_empty(&res->lru_head)) vmw_resource_unreserve() 1184 if (new_backup && new_backup != res->backup) { vmw_resource_unreserve() 1186 if (res->backup) { vmw_resource_unreserve() 1187 lockdep_assert_held(&res->backup->base.resv->lock.base); vmw_resource_unreserve() 1188 list_del_init(&res->mob_head); vmw_resource_unreserve() 1189 vmw_dmabuf_unreference(&res->backup); vmw_resource_unreserve() 1192 res->backup = vmw_dmabuf_reference(new_backup); vmw_resource_unreserve() 1194 list_add_tail(&res->mob_head, &new_backup->res_list); vmw_resource_unreserve() 1197 res->backup_offset = new_backup_offset; vmw_resource_unreserve() 1199 if (!res->func->may_evict || res->id == -1) vmw_resource_unreserve() 1203 list_add_tail(&res->lru_head, vmw_resource_unreserve() 1204 &res->dev_priv->res_lru[res->func->res_type]); vmw_resource_unreserve() 1213 * @res: The resource for which to allocate a backup buffer. 1220 vmw_resource_check_buffer(struct vmw_resource *res, vmw_resource_check_buffer() argument 1228 if (unlikely(res->backup == NULL)) { vmw_resource_check_buffer() 1229 ret = vmw_resource_buf_alloc(res, interruptible); vmw_resource_check_buffer() 1235 val_buf->bo = ttm_bo_reference(&res->backup->base); vmw_resource_check_buffer() 1242 if (res->func->needs_backup && list_empty(&res->mob_head)) vmw_resource_check_buffer() 1245 backup_dirty = res->backup_dirty; vmw_resource_check_buffer() 1246 ret = ttm_bo_validate(&res->backup->base, vmw_resource_check_buffer() 1247 res->func->backup_placement, vmw_resource_check_buffer() 1260 vmw_dmabuf_unreference(&res->backup); vmw_resource_check_buffer() 1268 * @res: The resource to reserve. 1275 int vmw_resource_reserve(struct vmw_resource *res, bool no_backup) vmw_resource_reserve() argument 1277 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_reserve() 1281 list_del_init(&res->lru_head); vmw_resource_reserve() 1284 if (res->func->needs_backup && res->backup == NULL && vmw_resource_reserve() 1286 ret = vmw_resource_buf_alloc(res, true); vmw_resource_reserve() 1318 * @res: The resource to evict. 1321 int vmw_resource_do_evict(struct vmw_resource *res, bool interruptible) vmw_resource_do_evict() argument 1324 const struct vmw_res_func *func = res->func; vmw_resource_do_evict() 1331 ret = vmw_resource_check_buffer(res, interruptible, &val_buf); vmw_resource_do_evict() 1336 (!func->needs_backup || !list_empty(&res->mob_head)))) { vmw_resource_do_evict() 1337 ret = func->unbind(res, res->res_dirty, &val_buf); vmw_resource_do_evict() 1340 list_del_init(&res->mob_head); vmw_resource_do_evict() 1342 ret = func->destroy(res); vmw_resource_do_evict() 1343 res->backup_dirty = true; vmw_resource_do_evict() 1344 res->res_dirty = false; vmw_resource_do_evict() 1356 * @res: The resource to make visible to the device. 1358 * On succesful return, any backup DMA buffer pointed to by @res->backup will 1363 int vmw_resource_validate(struct vmw_resource *res) vmw_resource_validate() argument 1367 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_validate() 1368 struct list_head *lru_list = &dev_priv->res_lru[res->func->res_type]; vmw_resource_validate() 1372 if (likely(!res->func->may_evict)) vmw_resource_validate() 1377 if (res->backup) vmw_resource_validate() 1378 val_buf.bo = &res->backup->base; vmw_resource_validate() 1380 ret = vmw_resource_do_validate(res, &val_buf); vmw_resource_validate() 1385 if (list_empty(lru_list) || !res->func->may_evict) { vmw_resource_validate() 1387 "for %s.\n", res->func->type_name); vmw_resource_validate() 1417 else if (!res->func->needs_backup && res->backup) { vmw_resource_validate() 1418 list_del_init(&res->mob_head); vmw_resource_validate() 1419 vmw_dmabuf_unreference(&res->backup); vmw_resource_validate() 1467 * resource that remain static while bo::res is !NULL and 1470 * to set @bo::res to NULL, while having @bo reserved when the 1471 * buffer is no longer bound to the resource, so @bo:res can be 1490 struct vmw_resource *res, *n; vmw_resource_move_notify() local 1496 list_for_each_entry_safe(res, n, &dma_buf->res_list, mob_head) { vmw_resource_move_notify() 1498 if (unlikely(res->func->unbind == NULL)) vmw_resource_move_notify() 1501 (void) res->func->unbind(res, true, &val_buf); vmw_resource_move_notify() 1502 res->backup_dirty = true; vmw_resource_move_notify() 1503 res->res_dirty = false; vmw_resource_move_notify() 1504 list_del_init(&res->mob_head); vmw_resource_move_notify() 1514 * @res: The resource being queried. 1516 bool vmw_resource_needs_backup(const struct vmw_resource *res) vmw_resource_needs_backup() argument 1518 return res->func->needs_backup; vmw_resource_needs_backup() 800 vmw_stream_init(struct vmw_private *dev_priv, struct vmw_stream *stream, void (*res_free) (struct vmw_resource *res)) vmw_stream_init() argument
|
H A D | vmwgfx_shader.c | 33 struct vmw_resource res; member in struct:vmw_shader 46 static void vmw_user_shader_free(struct vmw_resource *res); 50 static int vmw_gb_shader_create(struct vmw_resource *res); 51 static int vmw_gb_shader_bind(struct vmw_resource *res, 53 static int vmw_gb_shader_unbind(struct vmw_resource *res, 56 static int vmw_gb_shader_destroy(struct vmw_resource *res); 85 vmw_res_to_shader(struct vmw_resource *res) vmw_res_to_shader() argument 87 return container_of(res, struct vmw_shader, res); vmw_res_to_shader() 90 static void vmw_hw_shader_destroy(struct vmw_resource *res) vmw_hw_shader_destroy() argument 92 (void) vmw_gb_shader_destroy(res); vmw_hw_shader_destroy() 96 struct vmw_resource *res, vmw_gb_shader_init() 101 void (*res_free) (struct vmw_resource *res)) vmw_gb_shader_init() 103 struct vmw_shader *shader = vmw_res_to_shader(res); vmw_gb_shader_init() 106 ret = vmw_resource_init(dev_priv, res, true, vmw_gb_shader_init() 112 res_free(res); vmw_gb_shader_init() 114 kfree(res); vmw_gb_shader_init() 118 res->backup_size = size; vmw_gb_shader_init() 120 res->backup = vmw_dmabuf_reference(byte_code); vmw_gb_shader_init() 121 res->backup_offset = offset; vmw_gb_shader_init() 126 vmw_resource_activate(res, vmw_hw_shader_destroy); vmw_gb_shader_init() 130 static int vmw_gb_shader_create(struct vmw_resource *res) vmw_gb_shader_create() argument 132 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_create() 133 struct vmw_shader *shader = vmw_res_to_shader(res); vmw_gb_shader_create() 140 if (likely(res->id != -1)) vmw_gb_shader_create() 143 ret = vmw_resource_alloc_id(res); vmw_gb_shader_create() 149 if (unlikely(res->id >= VMWGFX_NUM_GB_SHADER)) { vmw_gb_shader_create() 164 cmd->body.shid = res->id; vmw_gb_shader_create() 173 vmw_resource_release_id(res); vmw_gb_shader_create() 178 static int vmw_gb_shader_bind(struct vmw_resource *res, vmw_gb_shader_bind() argument 181 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_bind() 199 cmd->body.shid = res->id; vmw_gb_shader_bind() 201 cmd->body.offsetInBytes = res->backup_offset; vmw_gb_shader_bind() 202 res->backup_dirty = false; vmw_gb_shader_bind() 208 static int vmw_gb_shader_unbind(struct vmw_resource *res, vmw_gb_shader_unbind() argument 212 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_unbind() 219 BUG_ON(res->backup->base.mem.mem_type != VMW_PL_MOB); vmw_gb_shader_unbind() 230 cmd->body.shid = res->id; vmw_gb_shader_unbind() 250 static int vmw_gb_shader_destroy(struct vmw_resource *res) vmw_gb_shader_destroy() argument 252 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_destroy() 258 if (likely(res->id == -1)) vmw_gb_shader_destroy() 262 vmw_context_binding_res_list_scrub(&res->binding_head); vmw_gb_shader_destroy() 274 cmd->body.shid = res->id; vmw_gb_shader_destroy() 277 vmw_resource_release_id(res); vmw_gb_shader_destroy() 291 shader.res); vmw_user_shader_base_to_res() 294 static void vmw_user_shader_free(struct vmw_resource *res) vmw_user_shader_free() argument 297 container_of(res, struct vmw_user_shader, shader.res); vmw_user_shader_free() 298 struct vmw_private *dev_priv = res->dev_priv; vmw_user_shader_free() 305 static void vmw_shader_free(struct vmw_resource *res) vmw_shader_free() argument 307 struct vmw_shader *shader = vmw_res_to_shader(res); vmw_shader_free() 308 struct vmw_private *dev_priv = res->dev_priv; vmw_shader_free() 323 struct vmw_resource *res = vmw_user_shader_base_to_res(base); vmw_user_shader_base_release() local 326 vmw_resource_unreference(&res); vmw_user_shader_base_release() 348 struct vmw_resource *res, *tmp; vmw_user_shader_alloc() local 377 res = &ushader->shader.res; vmw_user_shader_alloc() 385 ret = vmw_gb_shader_init(dev_priv, res, shader_size, vmw_user_shader_alloc() 391 tmp = vmw_resource_reference(res); vmw_user_shader_alloc() 404 vmw_resource_unreference(&res); vmw_user_shader_alloc() 417 struct vmw_resource *res; vmw_shader_alloc() local 446 res = &shader->res; vmw_shader_alloc() 451 ret = vmw_gb_shader_init(dev_priv, res, shader_size, vmw_shader_alloc() 456 return ret ? ERR_PTR(ret) : res; vmw_shader_alloc() 592 struct vmw_resource *res; vmw_compat_shader_add() local 627 res = vmw_shader_alloc(dev_priv, buf, size, 0, shader_type); vmw_compat_shader_add() 633 res, list); vmw_compat_shader_add() 634 vmw_resource_unreference(&res); vmw_compat_shader_add() 95 vmw_gb_shader_init(struct vmw_private *dev_priv, struct vmw_resource *res, uint32_t size, uint64_t offset, SVGA3dShaderType type, struct vmw_dma_buffer *byte_code, void (*res_free) (struct vmw_resource *res)) vmw_gb_shader_init() argument
|
H A D | vmwgfx_context.c | 34 struct vmw_resource res; member in struct:vmw_user_context 43 static void vmw_user_context_free(struct vmw_resource *res); 47 static int vmw_gb_context_create(struct vmw_resource *res); 48 static int vmw_gb_context_bind(struct vmw_resource *res, 50 static int vmw_gb_context_unbind(struct vmw_resource *res, 53 static int vmw_gb_context_destroy(struct vmw_resource *res); 105 static void vmw_hw_context_destroy(struct vmw_resource *res) vmw_hw_context_destroy() argument 108 container_of(res, struct vmw_user_context, res); vmw_hw_context_destroy() 109 struct vmw_private *dev_priv = res->dev_priv; vmw_hw_context_destroy() 116 if (res->func->destroy == vmw_gb_context_destroy) { vmw_hw_context_destroy() 121 (void) vmw_gb_context_destroy(res); vmw_hw_context_destroy() 140 cmd->body.cid = cpu_to_le32(res->id); vmw_hw_context_destroy() 147 struct vmw_resource *res, vmw_gb_context_init() 148 void (*res_free) (struct vmw_resource *res)) vmw_gb_context_init() 152 container_of(res, struct vmw_user_context, res); vmw_gb_context_init() 154 ret = vmw_resource_init(dev_priv, res, true, vmw_gb_context_init() 156 res->backup_size = SVGA3D_CONTEXT_DATA_SIZE; vmw_gb_context_init() 172 vmw_resource_activate(res, vmw_hw_context_destroy); vmw_gb_context_init() 177 res_free(res); vmw_gb_context_init() 179 kfree(res); vmw_gb_context_init() 184 struct vmw_resource *res, vmw_context_init() 185 void (*res_free) (struct vmw_resource *res)) vmw_context_init() 195 return vmw_gb_context_init(dev_priv, res, res_free); vmw_context_init() 197 ret = vmw_resource_init(dev_priv, res, false, vmw_context_init() 205 if (unlikely(res->id >= SVGA3D_MAX_CONTEXT_IDS)) { vmw_context_init() 207 vmw_resource_unreference(&res); vmw_context_init() 214 vmw_resource_unreference(&res); vmw_context_init() 220 cmd->body.cid = cpu_to_le32(res->id); vmw_context_init() 224 vmw_resource_activate(res, vmw_hw_context_destroy); vmw_context_init() 229 kfree(res); vmw_context_init() 231 res_free(res); vmw_context_init() 237 struct vmw_resource *res = kmalloc(sizeof(*res), GFP_KERNEL); vmw_context_alloc() local 240 if (unlikely(res == NULL)) vmw_context_alloc() 243 ret = vmw_context_init(dev_priv, res, NULL); vmw_context_alloc() 245 return (ret == 0) ? res : NULL; vmw_context_alloc() 249 static int vmw_gb_context_create(struct vmw_resource *res) vmw_gb_context_create() argument 251 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_create() 258 if (likely(res->id != -1)) vmw_gb_context_create() 261 ret = vmw_resource_alloc_id(res); vmw_gb_context_create() 267 if (unlikely(res->id >= VMWGFX_NUM_GB_CONTEXT)) { vmw_gb_context_create() 282 cmd->body.cid = res->id; vmw_gb_context_create() 289 vmw_resource_release_id(res); vmw_gb_context_create() 294 static int vmw_gb_context_bind(struct vmw_resource *res, vmw_gb_context_bind() argument 297 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_bind() 315 cmd->body.cid = res->id; vmw_gb_context_bind() 317 cmd->body.validContents = res->backup_dirty; vmw_gb_context_bind() 318 res->backup_dirty = false; vmw_gb_context_bind() 324 static int vmw_gb_context_unbind(struct vmw_resource *res, vmw_gb_context_unbind() argument 328 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_unbind() 332 container_of(res, struct vmw_user_context, res); vmw_gb_context_unbind() 366 cmd1->body.cid = res->id; vmw_gb_context_unbind() 371 cmd2->body.cid = res->id; vmw_gb_context_unbind() 392 static int vmw_gb_context_destroy(struct vmw_resource *res) vmw_gb_context_destroy() argument 394 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_destroy() 400 if (likely(res->id == -1)) vmw_gb_context_destroy() 412 cmd->body.cid = res->id; vmw_gb_context_destroy() 414 if (dev_priv->query_cid == res->id) vmw_gb_context_destroy() 416 vmw_resource_release_id(res); vmw_gb_context_destroy() 429 return &(container_of(base, struct vmw_user_context, base)->res); vmw_user_context_base_to_res() 432 static void vmw_user_context_free(struct vmw_resource *res) vmw_user_context_free() argument 435 container_of(res, struct vmw_user_context, res); vmw_user_context_free() 436 struct vmw_private *dev_priv = res->dev_priv; vmw_user_context_free() 453 struct vmw_resource *res = &ctx->res; vmw_user_context_base_release() local 456 vmw_resource_unreference(&res); vmw_user_context_base_release() 473 struct vmw_resource *res; vmw_context_define_ioctl() local 511 res = &ctx->res; vmw_context_define_ioctl() 519 ret = vmw_context_init(dev_priv, res, vmw_user_context_free); vmw_context_define_ioctl() 523 tmp = vmw_resource_reference(&ctx->res); vmw_context_define_ioctl() 534 vmw_resource_unreference(&res); vmw_context_define_ioctl() 566 cmd->body.shid = ((rebind) ? bi->res->id : SVGA3D_INVALID_ID); vmw_context_scrub_shader() 599 cmd->body.target.sid = ((rebind) ? bi->res->id : SVGA3D_INVALID_ID); vmw_context_scrub_render_target() 641 cmd->body.s1.value = ((rebind) ? bi->res->id : SVGA3D_INVALID_ID); vmw_context_scrub_texture() 750 if (bi->res != NULL) { vmw_context_binding_transfer() 753 list_add_tail(&loc->res_list, &bi->res->binding_head); vmw_context_binding_transfer() 864 container_of(ctx, struct vmw_user_context, res); vmw_context_binding_state_transfer() 883 container_of(ctx, struct vmw_user_context, res); vmw_context_rebind_all() 891 if (WARN_ON(entry->bi.res == NULL || entry->bi.res->id == vmw_context_rebind_all() 915 return &(container_of(ctx, struct vmw_user_context, res)->cbs.list); vmw_context_binding_list() 920 return container_of(ctx, struct vmw_user_context, res)->man; vmw_context_res_man() 146 vmw_gb_context_init(struct vmw_private *dev_priv, struct vmw_resource *res, void (*res_free) (struct vmw_resource *res)) vmw_gb_context_init() argument 183 vmw_context_init(struct vmw_private *dev_priv, struct vmw_resource *res, void (*res_free) (struct vmw_resource *res)) vmw_context_init() argument
|
H A D | vmwgfx_surface.c | 63 static void vmw_user_surface_free(struct vmw_resource *res); 66 static int vmw_legacy_srf_bind(struct vmw_resource *res, 68 static int vmw_legacy_srf_unbind(struct vmw_resource *res, 71 static int vmw_legacy_srf_create(struct vmw_resource *res); 72 static int vmw_legacy_srf_destroy(struct vmw_resource *res); 73 static int vmw_gb_surface_create(struct vmw_resource *res); 74 static int vmw_gb_surface_bind(struct vmw_resource *res, 76 static int vmw_gb_surface_unbind(struct vmw_resource *res, 79 static int vmw_gb_surface_destroy(struct vmw_resource *res); 222 cmd->body.sid = srf->res.id; vmw_surface_define_encode() 273 body->host.sid = srf->res.id; vmw_surface_dma_encode() 303 * @res: Pointer to a struct vmw_resource embedded in a struct 309 static void vmw_hw_surface_destroy(struct vmw_resource *res) vmw_hw_surface_destroy() argument 312 struct vmw_private *dev_priv = res->dev_priv; vmw_hw_surface_destroy() 316 if (res->func->destroy == vmw_gb_surface_destroy) { vmw_hw_surface_destroy() 317 (void) vmw_gb_surface_destroy(res); vmw_hw_surface_destroy() 321 if (res->id != -1) { vmw_hw_surface_destroy() 330 vmw_surface_destroy_encode(res->id, cmd); vmw_hw_surface_destroy() 340 srf = vmw_res_to_srf(res); vmw_hw_surface_destroy() 341 dev_priv->used_memory_size -= res->backup_size; vmw_hw_surface_destroy() 351 * @res: Pointer to a struct vmw_surface. 360 static int vmw_legacy_srf_create(struct vmw_resource *res) vmw_legacy_srf_create() argument 362 struct vmw_private *dev_priv = res->dev_priv; vmw_legacy_srf_create() 368 if (likely(res->id != -1)) vmw_legacy_srf_create() 371 srf = vmw_res_to_srf(res); vmw_legacy_srf_create() 372 if (unlikely(dev_priv->used_memory_size + res->backup_size >= vmw_legacy_srf_create() 380 ret = vmw_resource_alloc_id(res); vmw_legacy_srf_create() 386 if (unlikely(res->id >= SVGA3D_MAX_SURFACE_IDS)) { vmw_legacy_srf_create() 410 dev_priv->used_memory_size += res->backup_size; vmw_legacy_srf_create() 414 vmw_resource_release_id(res); vmw_legacy_srf_create() 422 * @res: Pointer to a struct vmw_res embedded in a struct 435 static int vmw_legacy_srf_dma(struct vmw_resource *res, vmw_legacy_srf_dma() argument 442 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_legacy_srf_dma() 444 struct vmw_private *dev_priv = res->dev_priv; vmw_legacy_srf_dma() 479 * @res: Pointer to a struct vmw_res embedded in a struct 487 static int vmw_legacy_srf_bind(struct vmw_resource *res, vmw_legacy_srf_bind() argument 490 if (!res->backup_dirty) vmw_legacy_srf_bind() 493 return vmw_legacy_srf_dma(res, val_buf, true); vmw_legacy_srf_bind() 501 * @res: Pointer to a struct vmw_res embedded in a struct 508 static int vmw_legacy_srf_unbind(struct vmw_resource *res, vmw_legacy_srf_unbind() argument 513 return vmw_legacy_srf_dma(res, val_buf, false); vmw_legacy_srf_unbind() 521 * @res: Pointer to a struct vmw_res embedded in a struct 524 static int vmw_legacy_srf_destroy(struct vmw_resource *res) vmw_legacy_srf_destroy() argument 526 struct vmw_private *dev_priv = res->dev_priv; vmw_legacy_srf_destroy() 530 BUG_ON(res->id == -1); vmw_legacy_srf_destroy() 544 vmw_surface_destroy_encode(res->id, cmd); vmw_legacy_srf_destroy() 551 dev_priv->used_memory_size -= res->backup_size; vmw_legacy_srf_destroy() 557 vmw_resource_release_id(res); vmw_legacy_srf_destroy() 573 void (*res_free) (struct vmw_resource *res)) vmw_surface_init() 576 struct vmw_resource *res = &srf->res; vmw_surface_init() local 581 ret = vmw_resource_init(dev_priv, res, true, res_free, vmw_surface_init() 588 res_free(res); vmw_surface_init() 597 vmw_resource_activate(res, vmw_hw_surface_destroy); vmw_surface_init() 614 prime.base)->srf.res); vmw_user_surface_base_to_res() 620 * @res: A struct vmw_resource embedded in a struct vmw_surface. 622 static void vmw_user_surface_free(struct vmw_resource *res) vmw_user_surface_free() argument 624 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_user_surface_free() 627 struct vmw_private *dev_priv = srf->res.dev_priv; vmw_user_surface_free() 653 struct vmw_resource *res = &user_srf->srf.res; vmw_user_surface_base_release() local 658 vmw_resource_unreference(&res); vmw_user_surface_base_release() 692 struct vmw_resource *res; vmw_surface_define_ioctl() local 752 res = &srf->res; vmw_surface_define_ioctl() 806 res->backup_size = cur_bo_offset; vmw_surface_define_ioctl() 849 res->backup_size, vmw_surface_define_ioctl() 852 &res->backup, vmw_surface_define_ioctl() 855 vmw_resource_unreference(&res); vmw_surface_define_ioctl() 860 tmp = vmw_resource_reference(&srf->res); vmw_surface_define_ioctl() 861 ret = ttm_prime_object_init(tfile, res->backup_size, &user_srf->prime, vmw_surface_define_ioctl() 867 vmw_resource_unreference(&res); vmw_surface_define_ioctl() 872 vmw_resource_unreference(&res); vmw_surface_define_ioctl() 1021 static int vmw_gb_surface_create(struct vmw_resource *res) vmw_gb_surface_create() argument 1023 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_create() 1024 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_gb_surface_create() 1032 if (likely(res->id != -1)) vmw_gb_surface_create() 1036 ret = vmw_resource_alloc_id(res); vmw_gb_surface_create() 1042 if (unlikely(res->id >= VMWGFX_NUM_GB_SURFACE)) { vmw_gb_surface_create() 1059 cmd->body.sid = srf->res.id; vmw_gb_surface_create() 1073 vmw_resource_release_id(res); vmw_gb_surface_create() 1080 static int vmw_gb_surface_bind(struct vmw_resource *res, vmw_gb_surface_bind() argument 1083 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_bind() 1097 submit_size = sizeof(*cmd1) + (res->backup_dirty ? sizeof(*cmd2) : 0); vmw_gb_surface_bind() 1108 cmd1->body.sid = res->id; vmw_gb_surface_bind() 1110 if (res->backup_dirty) { vmw_gb_surface_bind() 1114 cmd2->body.sid = res->id; vmw_gb_surface_bind() 1115 res->backup_dirty = false; vmw_gb_surface_bind() 1122 static int vmw_gb_surface_unbind(struct vmw_resource *res, vmw_gb_surface_unbind() argument 1126 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_unbind() 1160 cmd1->body.sid = res->id; vmw_gb_surface_unbind() 1166 cmd2->body.sid = res->id; vmw_gb_surface_unbind() 1172 cmd3->body.sid = res->id; vmw_gb_surface_unbind() 1192 static int vmw_gb_surface_destroy(struct vmw_resource *res) vmw_gb_surface_destroy() argument 1194 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_destroy() 1200 if (likely(res->id == -1)) vmw_gb_surface_destroy() 1204 vmw_context_binding_res_list_scrub(&res->binding_head); vmw_gb_surface_destroy() 1216 cmd->body.sid = res->id; vmw_gb_surface_destroy() 1219 vmw_resource_release_id(res); vmw_gb_surface_destroy() 1239 struct vmw_resource *res; vmw_gb_surface_define_ioctl() local 1283 res = &srf->res; vmw_gb_surface_define_ioctl() 1296 res->backup_size = svga3dsurface_get_serialized_size vmw_gb_surface_define_ioctl() 1316 &res->backup, vmw_gb_surface_define_ioctl() 1321 res->backup_size, vmw_gb_surface_define_ioctl() 1325 &res->backup, vmw_gb_surface_define_ioctl() 1329 vmw_resource_unreference(&res); vmw_gb_surface_define_ioctl() 1333 tmp = vmw_resource_reference(&srf->res); vmw_gb_surface_define_ioctl() 1334 ret = ttm_prime_object_init(tfile, res->backup_size, &user_srf->prime, vmw_gb_surface_define_ioctl() 1342 vmw_resource_unreference(&res); vmw_gb_surface_define_ioctl() 1347 rep->backup_size = res->backup_size; vmw_gb_surface_define_ioctl() 1348 if (res->backup) { vmw_gb_surface_define_ioctl() 1350 drm_vma_node_offset_addr(&res->backup->base.vma_node); vmw_gb_surface_define_ioctl() 1351 rep->buffer_size = res->backup->base.num_pages * PAGE_SIZE; vmw_gb_surface_define_ioctl() 1359 vmw_resource_unreference(&res); vmw_gb_surface_define_ioctl() 1400 if (srf->res.backup == NULL) { vmw_gb_surface_reference_ioctl() 1405 mutex_lock(&dev_priv->cmdbuf_mutex); /* Protect res->backup */ vmw_gb_surface_reference_ioctl() 1406 ret = vmw_user_dmabuf_reference(tfile, srf->res.backup, vmw_gb_surface_reference_ioctl() 1427 rep->crep.backup_size = srf->res.backup_size; vmw_gb_surface_reference_ioctl() 1430 drm_vma_node_offset_addr(&srf->res.backup->base.vma_node); vmw_gb_surface_reference_ioctl() 1431 rep->crep.buffer_size = srf->res.backup->base.num_pages * PAGE_SIZE; vmw_gb_surface_reference_ioctl() 571 vmw_surface_init(struct vmw_private *dev_priv, struct vmw_surface *srf, void (*res_free) (struct vmw_resource *res)) vmw_surface_init() argument
|
H A D | vmwgfx_resource_priv.h | 41 void (*res_free) (struct vmw_resource *res); 67 int (*create) (struct vmw_resource *res); 68 int (*destroy) (struct vmw_resource *res); 69 int (*bind) (struct vmw_resource *res, 71 int (*unbind) (struct vmw_resource *res, 76 int vmw_resource_alloc_id(struct vmw_resource *res); 77 void vmw_resource_release_id(struct vmw_resource *res); 78 int vmw_resource_init(struct vmw_private *dev_priv, struct vmw_resource *res, 80 void (*res_free) (struct vmw_resource *res), 82 void vmw_resource_activate(struct vmw_resource *res,
|
/linux-4.1.27/fs/hfsplus/ |
H A D | extents.c | 90 int res; __hfsplus_ext_write_extent() local 98 res = hfs_brec_find(fd, hfs_find_rec_by_key); __hfsplus_ext_write_extent() 100 if (res != -ENOENT) __hfsplus_ext_write_extent() 101 return res; __hfsplus_ext_write_extent() 106 if (res) __hfsplus_ext_write_extent() 107 return res; __hfsplus_ext_write_extent() 126 int res = 0; hfsplus_ext_write_extent_locked() local 131 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->ext_tree, &fd); hfsplus_ext_write_extent_locked() 132 if (res) hfsplus_ext_write_extent_locked() 133 return res; hfsplus_ext_write_extent_locked() 134 res = __hfsplus_ext_write_extent(inode, &fd); hfsplus_ext_write_extent_locked() 137 return res; hfsplus_ext_write_extent_locked() 142 int res; hfsplus_ext_write_extent() local 145 res = hfsplus_ext_write_extent_locked(inode); hfsplus_ext_write_extent() 148 return res; hfsplus_ext_write_extent() 155 int res; __hfsplus_ext_read_extent() local 159 res = hfs_brec_find(fd, hfs_find_rec_by_key); __hfsplus_ext_read_extent() 160 if (res && res != -ENOENT) __hfsplus_ext_read_extent() 161 return res; __hfsplus_ext_read_extent() 176 int res; __hfsplus_ext_cache_extent() local 181 res = __hfsplus_ext_write_extent(inode, fd); __hfsplus_ext_cache_extent() 182 if (res) __hfsplus_ext_cache_extent() 183 return res; __hfsplus_ext_cache_extent() 186 res = __hfsplus_ext_read_extent(fd, hip->cached_extents, inode->i_ino, __hfsplus_ext_cache_extent() 190 if (!res) { __hfsplus_ext_cache_extent() 198 return res; __hfsplus_ext_cache_extent() 205 int res; hfsplus_ext_read_extent() local 211 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->ext_tree, &fd); hfsplus_ext_read_extent() 212 if (!res) { hfsplus_ext_read_extent() 213 res = __hfsplus_ext_cache_extent(&fd, inode, block); hfsplus_ext_read_extent() 216 return res; hfsplus_ext_read_extent() 226 int res = -EIO; hfsplus_get_block() local 238 res = hfsplus_file_extend(inode, false); hfsplus_get_block() 239 if (res) hfsplus_get_block() 240 return res; hfsplus_get_block() 261 res = hfsplus_ext_read_extent(inode, ablock); hfsplus_get_block() 262 if (res) { hfsplus_get_block() 392 int res, i; hfsplus_free_fork() local 402 res = hfsplus_free_extents(sb, fork->extents, blocks, blocks); hfsplus_free_fork() 403 if (res) hfsplus_free_fork() 404 return res; hfsplus_free_fork() 408 res = hfs_find_init(HFSPLUS_SB(sb)->ext_tree, &fd); hfsplus_free_fork() 409 if (res) hfsplus_free_fork() 410 return res; hfsplus_free_fork() 412 res = __hfsplus_ext_read_extent(&fd, ext_entry, cnid, hfsplus_free_fork() 414 if (res) hfsplus_free_fork() 425 return res; hfsplus_free_fork() 434 int res; hfsplus_file_extend() local 449 res = hfsplus_ext_read_extent(inode, hip->alloc_blocks); hfsplus_file_extend() 450 if (res) hfsplus_file_extend() 460 res = -ENOSPC; hfsplus_file_extend() 466 res = sb_issue_zeroout(sb, start, len, GFP_NOFS); hfsplus_file_extend() 467 if (res) hfsplus_file_extend() 479 res = 0; hfsplus_file_extend() 482 res = hfsplus_add_extent(hip->first_extents, hfsplus_file_extend() 485 if (res == -ENOSPC) hfsplus_file_extend() 488 if (!res) { hfsplus_file_extend() 493 res = hfsplus_add_extent(hip->cached_extents, hfsplus_file_extend() 496 if (!res) { hfsplus_file_extend() 500 } else if (res == -ENOSPC) hfsplus_file_extend() 504 if (!res) { hfsplus_file_extend() 511 return res; hfsplus_file_extend() 515 res = hfsplus_ext_write_extent_locked(inode); hfsplus_file_extend() 516 if (res) hfsplus_file_extend() 527 res = 0; hfsplus_file_extend() 537 int res; hfsplus_file_truncate() local 548 res = pagecache_write_begin(NULL, mapping, size, 0, hfsplus_file_truncate() 551 if (res) hfsplus_file_truncate() 553 res = pagecache_write_end(NULL, mapping, size, hfsplus_file_truncate() 555 if (res < 0) hfsplus_file_truncate() 571 res = hfs_find_init(HFSPLUS_SB(sb)->ext_tree, &fd); hfsplus_file_truncate() 572 if (res) { hfsplus_file_truncate() 585 res = __hfsplus_ext_cache_extent(&fd, inode, alloc_cnt); hfsplus_file_truncate() 586 if (res) hfsplus_file_truncate()
|
H A D | dir.c | 304 int res; hfsplus_link() local 318 res = hfsplus_rename_cat(inode->i_ino, hfsplus_link() 321 if (!res) hfsplus_link() 323 if (res != -EEXIST) hfsplus_link() 329 res = hfsplus_create_cat(cnid, src_dir, hfsplus_link() 331 if (res) hfsplus_link() 337 res = hfsplus_create_cat(cnid, dst_dir, &dst_dentry->d_name, inode); hfsplus_link() 338 if (res) hfsplus_link() 350 return res; hfsplus_link() 360 int res; hfsplus_unlink() local 371 res = hfsplus_rename_cat(inode->i_ino, hfsplus_unlink() 374 if (!res) { hfsplus_unlink() 380 res = hfsplus_delete_cat(cnid, dir, &dentry->d_name); hfsplus_unlink() 381 if (res) hfsplus_unlink() 392 res = hfsplus_delete_cat(inode->i_ino, hfsplus_unlink() 395 if (!res) hfsplus_unlink() 407 return res; hfsplus_unlink() 414 int res; hfsplus_rmdir() local 420 res = hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name); hfsplus_rmdir() 421 if (res) hfsplus_rmdir() 429 return res; hfsplus_rmdir() 437 int res = -ENOMEM; hfsplus_symlink() local 444 res = page_symlink(inode, symname, strlen(symname) + 1); hfsplus_symlink() 445 if (res) hfsplus_symlink() 448 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); hfsplus_symlink() 449 if (res) hfsplus_symlink() 452 res = hfsplus_init_inode_security(inode, dir, &dentry->d_name); hfsplus_symlink() 453 if (res == -EOPNOTSUPP) hfsplus_symlink() 454 res = 0; /* Operation is not supported. */ hfsplus_symlink() 455 else if (res) { hfsplus_symlink() 471 return res; hfsplus_symlink() 479 int res = -ENOMEM; hfsplus_mknod() local 489 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); hfsplus_mknod() 490 if (res) hfsplus_mknod() 493 res = hfsplus_init_inode_security(inode, dir, &dentry->d_name); hfsplus_mknod() 494 if (res == -EOPNOTSUPP) hfsplus_mknod() 495 res = 0; /* Operation is not supported. */ hfsplus_mknod() 496 else if (res) { hfsplus_mknod() 512 return res; hfsplus_mknod() 529 int res; hfsplus_rename() local 534 res = hfsplus_rmdir(new_dir, new_dentry); hfsplus_rename() 536 res = hfsplus_unlink(new_dir, new_dentry); hfsplus_rename() 537 if (res) hfsplus_rename() 538 return res; hfsplus_rename() 541 res = hfsplus_rename_cat((u32)(unsigned long)old_dentry->d_fsdata, hfsplus_rename() 544 if (!res) hfsplus_rename() 546 return res; hfsplus_rename()
|
H A D | bfind.c | 119 int res; __hfs_brec_find() local 124 res = -ENOENT; __hfs_brec_find() 130 res = -EINVAL; __hfs_brec_find() 135 res = 0; __hfs_brec_find() 144 res = -EINVAL; __hfs_brec_find() 158 return res; __hfs_brec_find() 169 int height, res; hfs_brec_find() local 179 res = 0; hfs_brec_find() 184 res = PTR_ERR(bnode); hfs_brec_find() 194 res = __hfs_brec_find(bnode, fd, do_key_compare); hfs_brec_find() 206 return res; hfs_brec_find() 211 res = -EIO; hfs_brec_find() 214 return res; hfs_brec_find() 219 int res; hfs_brec_read() local 221 res = hfs_brec_find(fd, hfs_find_rec_by_key); hfs_brec_read() 222 if (res) hfs_brec_read() 223 return res; hfs_brec_read() 234 int idx, res = 0; hfs_brec_goto() local 247 res = -ENOENT; hfs_brec_goto() 253 res = PTR_ERR(bnode); hfs_brec_goto() 265 res = -ENOENT; hfs_brec_goto() 271 res = PTR_ERR(bnode); hfs_brec_goto() 282 res = -EINVAL; hfs_brec_goto() 292 return res; hfs_brec_goto()
|
H A D | xattr.c | 432 int res; hfsplus_setxattr() local 443 res = __hfsplus_setxattr(d_inode(dentry), xattr_name, value, size, hfsplus_setxattr() 446 return res; hfsplus_setxattr() 452 ssize_t res = 0; hfsplus_getxattr_finder_info() local 462 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); hfsplus_getxattr_finder_info() 463 if (res) { hfsplus_getxattr_finder_info() 465 return res; hfsplus_getxattr_finder_info() 467 res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); hfsplus_getxattr_finder_info() 468 if (res) hfsplus_getxattr_finder_info() 478 res = folder_rec_len; hfsplus_getxattr_finder_info() 485 res = file_rec_len; hfsplus_getxattr_finder_info() 487 res = -EOPNOTSUPP; hfsplus_getxattr_finder_info() 491 res = size ? -ERANGE : record_len; hfsplus_getxattr_finder_info() 496 return res; hfsplus_getxattr_finder_info() 507 ssize_t res = 0; __hfsplus_getxattr() local 526 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd); __hfsplus_getxattr() 527 if (res) { __hfsplus_getxattr() 532 res = hfsplus_find_attr(inode->i_sb, inode->i_ino, name, &fd); __hfsplus_getxattr() 533 if (res) { __hfsplus_getxattr() 534 if (res == -ENOENT) __hfsplus_getxattr() 535 res = -ENODATA; __hfsplus_getxattr() 551 res = -EIO; __hfsplus_getxattr() 557 res = -EOPNOTSUPP; __hfsplus_getxattr() 561 res = -EIO; __hfsplus_getxattr() 573 res = record_length; __hfsplus_getxattr() 575 res = size ? -ERANGE : record_length; __hfsplus_getxattr() 582 return res; __hfsplus_getxattr() 589 int res; hfsplus_getxattr() local 603 res = __hfsplus_getxattr(d_inode(dentry), xattr_name, value, size); hfsplus_getxattr() 605 return res; hfsplus_getxattr() 622 ssize_t res = 0; hfsplus_listxattr_finder_info() local 631 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); hfsplus_listxattr_finder_info() 632 if (res) { hfsplus_listxattr_finder_info() 634 return res; hfsplus_listxattr_finder_info() 637 res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); hfsplus_listxattr_finder_info() 638 if (res) hfsplus_listxattr_finder_info() 657 res = -EOPNOTSUPP; hfsplus_listxattr_finder_info() 662 res = 0; hfsplus_listxattr_finder_info() 669 res = xattr_name_len; hfsplus_listxattr_finder_info() 672 res = -ERANGE; hfsplus_listxattr_finder_info() 674 res = copy_name(buffer, hfsplus_listxattr_finder_info() 684 return res; hfsplus_listxattr_finder_info() 690 ssize_t res = 0; hfsplus_listxattr() local 703 res = hfsplus_listxattr_finder_info(dentry, buffer, size); hfsplus_listxattr() 704 if (res < 0) hfsplus_listxattr() 705 return res; hfsplus_listxattr() 707 return (res == 0) ? -EOPNOTSUPP : res; hfsplus_listxattr() 718 res = -ENOMEM; hfsplus_listxattr() 725 if (res == 0) hfsplus_listxattr() 726 res = -ENODATA; hfsplus_listxattr() 729 res = err; hfsplus_listxattr() 738 res = -EIO; hfsplus_listxattr() 753 res = -EIO; hfsplus_listxattr() 759 res += name_len(strbuf, xattr_name_len); hfsplus_listxattr() 761 if (size < (res + name_len(strbuf, xattr_name_len))) { hfsplus_listxattr() 762 res = -ERANGE; hfsplus_listxattr() 765 res += copy_name(buffer + res, hfsplus_listxattr() 777 return res; hfsplus_listxattr()
|
/linux-4.1.27/drivers/rtc/ |
H A D | rtc-ds1343.c | 387 int res; ds1343_read_time() local 389 res = regmap_bulk_read(priv->map, DS1343_SECONDS_REG, buf, 7); ds1343_read_time() 390 if (res) ds1343_read_time() 391 return res; ds1343_read_time() 407 int res; ds1343_set_time() local 409 res = regmap_write(priv->map, DS1343_SECONDS_REG, ds1343_set_time() 411 if (res) ds1343_set_time() 412 return res; ds1343_set_time() 414 res = regmap_write(priv->map, DS1343_MINUTES_REG, ds1343_set_time() 416 if (res) ds1343_set_time() 417 return res; ds1343_set_time() 419 res = regmap_write(priv->map, DS1343_HOURS_REG, ds1343_set_time() 421 if (res) ds1343_set_time() 422 return res; ds1343_set_time() 424 res = regmap_write(priv->map, DS1343_DAY_REG, ds1343_set_time() 426 if (res) ds1343_set_time() 427 return res; ds1343_set_time() 429 res = regmap_write(priv->map, DS1343_DATE_REG, ds1343_set_time() 431 if (res) ds1343_set_time() 432 return res; ds1343_set_time() 434 res = regmap_write(priv->map, DS1343_MONTH_REG, ds1343_set_time() 436 if (res) ds1343_set_time() 437 return res; ds1343_set_time() 441 res = regmap_write(priv->map, DS1343_YEAR_REG, ds1343_set_time() 443 if (res) ds1343_set_time() 444 return res; ds1343_set_time() 454 int res = 0; ds1343_update_alarm() local 456 res = regmap_read(priv->map, DS1343_CONTROL_REG, &control); ds1343_update_alarm() 457 if (res) ds1343_update_alarm() 458 return res; ds1343_update_alarm() 460 res = regmap_read(priv->map, DS1343_STATUS_REG, &stat); ds1343_update_alarm() 461 if (res) ds1343_update_alarm() 462 return res; ds1343_update_alarm() 467 res = regmap_write(priv->map, DS1343_CONTROL_REG, control); ds1343_update_alarm() 468 if (res) ds1343_update_alarm() 469 return res; ds1343_update_alarm() 471 res = regmap_write(priv->map, DS1343_STATUS_REG, stat); ds1343_update_alarm() 472 if (res) ds1343_update_alarm() 473 return res; ds1343_update_alarm() 484 res = regmap_bulk_write(priv->map, DS1343_ALM0_SEC_REG, buf, 4); ds1343_update_alarm() 485 if (res) ds1343_update_alarm() 486 return res; ds1343_update_alarm() 490 res = regmap_write(priv->map, DS1343_CONTROL_REG, control); ds1343_update_alarm() 493 return res; ds1343_update_alarm() 499 int res = 0; ds1343_read_alarm() local 507 res = regmap_read(priv->map, DS1343_STATUS_REG, &stat); ds1343_read_alarm() 508 if (res) ds1343_read_alarm() 527 return res; ds1343_read_alarm() 533 int res = 0; ds1343_set_alarm() local 548 res = ds1343_update_alarm(dev); ds1343_set_alarm() 552 return res; ds1343_set_alarm() 558 int res = 0; ds1343_alarm_irq_enable() local 570 res = ds1343_update_alarm(dev); ds1343_alarm_irq_enable() 574 return res; ds1343_alarm_irq_enable() 581 int res = 0; ds1343_thread() local 585 res = regmap_read(priv->map, DS1343_STATUS_REG, &stat); ds1343_thread() 586 if (res) ds1343_thread() 593 res = regmap_read(priv->map, DS1343_CONTROL_REG, &control); ds1343_thread() 594 if (res) ds1343_thread() 622 int res; ds1343_probe() local 641 res = spi_setup(spi); ds1343_probe() 642 if (res) ds1343_probe() 643 return res; ds1343_probe() 654 res = regmap_read(priv->map, DS1343_SECONDS_REG, &data); ds1343_probe() 655 if (res) ds1343_probe() 656 return res; ds1343_probe() 677 res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, ds1343_probe() 681 if (res) { ds1343_probe() 690 res = ds1343_sysfs_register(&spi->dev); ds1343_probe() 691 if (res) ds1343_probe()
|
/linux-4.1.27/drivers/staging/lustre/lustre/ldlm/ |
H A D | ldlm_resource.c | 160 __u64 res = 0; lprocfs_ns_resources_seq_show() local 166 res += cfs_hash_bd_count_get(&bd); lprocfs_ns_resources_seq_show() 167 return lprocfs_rd_u64(m, &res); lprocfs_ns_resources_seq_show() 438 struct ldlm_resource *res; ldlm_res_hop_key() local 440 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_key() 441 return &res->lr_name; ldlm_res_hop_key() 446 struct ldlm_resource *res; ldlm_res_hop_keycmp() local 448 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_keycmp() 450 (const struct ldlm_res_id *)&res->lr_name); ldlm_res_hop_keycmp() 461 struct ldlm_resource *res; ldlm_res_hop_get_locked() local 463 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_get_locked() 464 ldlm_resource_getref(res); ldlm_res_hop_get_locked() 470 struct ldlm_resource *res; ldlm_res_hop_put_locked() local 472 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_put_locked() 474 ldlm_resource_putref_locked(res); ldlm_res_hop_put_locked() 479 struct ldlm_resource *res; ldlm_res_hop_put() local 481 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_put() 482 ldlm_resource_putref(res); ldlm_res_hop_put() 677 static void cleanup_resource(struct ldlm_resource *res, struct list_head *q, cleanup_resource() argument 681 int rc = 0, client = ns_is_client(ldlm_res_to_ns(res)); cleanup_resource() 689 lock_res(res); list_for_each() 703 unlock_res(res); 722 unlock_res(res); 733 unlock_res(res); 740 unlock_res(res); 751 struct ldlm_resource *res = cfs_hash_object(hs, hnode); ldlm_resource_clean() local 754 cleanup_resource(res, &res->lr_granted, flags); ldlm_resource_clean() 755 cleanup_resource(res, &res->lr_converting, flags); ldlm_resource_clean() 756 cleanup_resource(res, &res->lr_waiting, flags); ldlm_resource_clean() 764 struct ldlm_resource *res = cfs_hash_object(hs, hnode); ldlm_resource_complain() local 766 lock_res(res); ldlm_resource_complain() 769 ldlm_ns_name(ldlm_res_to_ns(res)), PLDLMRES(res), res, ldlm_resource_complain() 770 atomic_read(&res->lr_refcount) - 1); ldlm_resource_complain() 772 ldlm_resource_dump(D_ERROR, res); ldlm_resource_complain() 773 unlock_res(res); ldlm_resource_complain() 1013 struct ldlm_resource *res; ldlm_resource_new() local 1016 OBD_SLAB_ALLOC_PTR_GFP(res, ldlm_resource_slab, GFP_NOFS); ldlm_resource_new() 1017 if (res == NULL) ldlm_resource_new() 1020 INIT_LIST_HEAD(&res->lr_granted); ldlm_resource_new() 1021 INIT_LIST_HEAD(&res->lr_converting); ldlm_resource_new() 1022 INIT_LIST_HEAD(&res->lr_waiting); ldlm_resource_new() 1026 res->lr_itree[idx].lit_size = 0; ldlm_resource_new() 1027 res->lr_itree[idx].lit_mode = 1 << idx; ldlm_resource_new() 1028 res->lr_itree[idx].lit_root = NULL; ldlm_resource_new() 1031 atomic_set(&res->lr_refcount, 1); ldlm_resource_new() 1032 spin_lock_init(&res->lr_lock); ldlm_resource_new() 1033 lu_ref_init(&res->lr_reference); ldlm_resource_new() 1037 mutex_init(&res->lr_lvb_mutex); ldlm_resource_new() 1038 mutex_lock(&res->lr_lvb_mutex); ldlm_resource_new() 1040 return res; ldlm_resource_new() 1046 * Locks: takes and releases NS hash-lock and res->lr_lock 1054 struct ldlm_resource *res; ldlm_resource_get() local 1068 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_resource_get() 1071 mutex_lock(&res->lr_lvb_mutex); ldlm_resource_get() 1072 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get() 1075 if (unlikely(res->lr_lvb_len < 0)) { ldlm_resource_get() 1076 ldlm_resource_putref(res); ldlm_resource_get() 1077 res = NULL; ldlm_resource_get() 1079 return res; ldlm_resource_get() 1090 res = ldlm_resource_new(); ldlm_resource_get() 1091 if (!res) ldlm_resource_get() 1094 res->lr_ns_bucket = cfs_hash_bd_extra_get(ns->ns_rs_hash, &bd); ldlm_resource_get() 1095 res->lr_name = *name; ldlm_resource_get() 1096 res->lr_type = type; ldlm_resource_get() 1097 res->lr_most_restr = LCK_NL; ldlm_resource_get() 1107 lu_ref_fini(&res->lr_reference); ldlm_resource_get() 1109 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get() 1110 OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof(*res)); ldlm_resource_get() 1112 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_resource_get() 1115 mutex_lock(&res->lr_lvb_mutex); ldlm_resource_get() 1116 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get() 1119 if (unlikely(res->lr_lvb_len < 0)) { ldlm_resource_get() 1120 ldlm_resource_putref(res); ldlm_resource_get() 1121 res = NULL; ldlm_resource_get() 1123 return res; ldlm_resource_get() 1126 cfs_hash_bd_add_locked(ns->ns_rs_hash, &bd, &res->lr_hash); ldlm_resource_get() 1135 rc = ns->ns_lvbo->lvbo_init(res); ldlm_resource_get() 1140 if (res->lr_lvb_data) { ldlm_resource_get() 1141 OBD_FREE(res->lr_lvb_data, res->lr_lvb_len); ldlm_resource_get() 1142 res->lr_lvb_data = NULL; ldlm_resource_get() 1144 res->lr_lvb_len = rc; ldlm_resource_get() 1145 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get() 1146 ldlm_resource_putref(res); ldlm_resource_get() 1152 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get() 1164 return res; ldlm_resource_get() 1168 struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res) ldlm_resource_getref() argument 1170 LASSERT(res != NULL); ldlm_resource_getref() 1171 LASSERT(res != LP_POISON); ldlm_resource_getref() 1172 atomic_inc(&res->lr_refcount); ldlm_resource_getref() 1173 CDEBUG(D_INFO, "getref res: %p count: %d\n", res, ldlm_resource_getref() 1174 atomic_read(&res->lr_refcount)); ldlm_resource_getref() 1175 return res; ldlm_resource_getref() 1179 struct ldlm_resource *res) __ldlm_resource_putref_final() 1181 struct ldlm_ns_bucket *nsb = res->lr_ns_bucket; __ldlm_resource_putref_final() 1183 if (!list_empty(&res->lr_granted)) { __ldlm_resource_putref_final() 1184 ldlm_resource_dump(D_ERROR, res); __ldlm_resource_putref_final() 1188 if (!list_empty(&res->lr_converting)) { __ldlm_resource_putref_final() 1189 ldlm_resource_dump(D_ERROR, res); __ldlm_resource_putref_final() 1193 if (!list_empty(&res->lr_waiting)) { __ldlm_resource_putref_final() 1194 ldlm_resource_dump(D_ERROR, res); __ldlm_resource_putref_final() 1199 bd, &res->lr_hash); __ldlm_resource_putref_final() 1200 lu_ref_fini(&res->lr_reference); __ldlm_resource_putref_final() 1206 int ldlm_resource_putref(struct ldlm_resource *res) ldlm_resource_putref() argument 1208 struct ldlm_namespace *ns = ldlm_res_to_ns(res); ldlm_resource_putref() 1211 LASSERT_ATOMIC_GT_LT(&res->lr_refcount, 0, LI_POISON); ldlm_resource_putref() 1212 CDEBUG(D_INFO, "putref res: %p count: %d\n", ldlm_resource_putref() 1213 res, atomic_read(&res->lr_refcount) - 1); ldlm_resource_putref() 1215 cfs_hash_bd_get(ns->ns_rs_hash, &res->lr_name, &bd); ldlm_resource_putref() 1216 if (cfs_hash_bd_dec_and_lock(ns->ns_rs_hash, &bd, &res->lr_refcount)) { ldlm_resource_putref() 1217 __ldlm_resource_putref_final(&bd, res); ldlm_resource_putref() 1220 ns->ns_lvbo->lvbo_free(res); ldlm_resource_putref() 1221 OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof(*res)); ldlm_resource_putref() 1229 int ldlm_resource_putref_locked(struct ldlm_resource *res) ldlm_resource_putref_locked() argument 1231 struct ldlm_namespace *ns = ldlm_res_to_ns(res); ldlm_resource_putref_locked() 1233 LASSERT_ATOMIC_GT_LT(&res->lr_refcount, 0, LI_POISON); ldlm_resource_putref_locked() 1234 CDEBUG(D_INFO, "putref res: %p count: %d\n", ldlm_resource_putref_locked() 1235 res, atomic_read(&res->lr_refcount) - 1); ldlm_resource_putref_locked() 1237 if (atomic_dec_and_test(&res->lr_refcount)) { ldlm_resource_putref_locked() 1240 cfs_hash_bd_get(ldlm_res_to_ns(res)->ns_rs_hash, ldlm_resource_putref_locked() 1241 &res->lr_name, &bd); ldlm_resource_putref_locked() 1242 __ldlm_resource_putref_final(&bd, res); ldlm_resource_putref_locked() 1250 ns->ns_lvbo->lvbo_free(res); ldlm_resource_putref_locked() 1251 OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof(*res)); ldlm_resource_putref_locked() 1262 void ldlm_resource_add_lock(struct ldlm_resource *res, struct list_head *head, ldlm_resource_add_lock() argument 1265 check_res_locked(res); ldlm_resource_add_lock() 1287 struct ldlm_resource *res = original->l_resource; ldlm_resource_insert_lock_after() local 1289 check_res_locked(res); ldlm_resource_insert_lock_after() 1291 ldlm_resource_dump(D_INFO, res); ldlm_resource_insert_lock_after() 1318 void ldlm_res2desc(struct ldlm_resource *res, struct ldlm_resource_desc *desc) ldlm_res2desc() argument 1320 desc->lr_type = res->lr_type; ldlm_res2desc() 1321 desc->lr_name = res->lr_name; ldlm_res2desc() 1351 struct ldlm_resource *res = cfs_hash_object(hs, hnode); ldlm_res_hash_dump() local 1354 lock_res(res); ldlm_res_hash_dump() 1355 ldlm_resource_dump(level, res); ldlm_res_hash_dump() 1356 unlock_res(res); ldlm_res_hash_dump() 1389 void ldlm_resource_dump(int level, struct ldlm_resource *res) ldlm_resource_dump() argument 1400 PLDLMRES(res), res, atomic_read(&res->lr_refcount)); ldlm_resource_dump() 1402 if (!list_empty(&res->lr_granted)) { ldlm_resource_dump() 1404 list_for_each_entry_reverse(lock, &res->lr_granted, ldlm_resource_dump() 1415 if (!list_empty(&res->lr_converting)) { ldlm_resource_dump() 1417 list_for_each_entry(lock, &res->lr_converting, l_res_link) ldlm_resource_dump() 1420 if (!list_empty(&res->lr_waiting)) { ldlm_resource_dump() 1422 list_for_each_entry(lock, &res->lr_waiting, l_res_link) ldlm_resource_dump() 1178 __ldlm_resource_putref_final(struct cfs_hash_bd *bd, struct ldlm_resource *res) __ldlm_resource_putref_final() argument
|
/linux-4.1.27/arch/mips/kernel/ |
H A D | unaligned.c | 110 #define _LoadHW(addr, value, res, type) \ 128 : "=&r" (value), "=r" (res) \ 133 #define _LoadW(addr, value, res, type) \ 149 : "=&r" (value), "=r" (res) \ 155 #define _LoadW(addr, value, res, type) \ 184 : "=&r" (value), "=r" (res) \ 190 #define _LoadHWU(addr, value, res, type) \ 210 : "=&r" (value), "=r" (res) \ 215 #define _LoadWU(addr, value, res, type) \ 233 : "=&r" (value), "=r" (res) \ 237 #define _LoadDW(addr, value, res) \ 253 : "=&r" (value), "=r" (res) \ 259 #define _LoadWU(addr, value, res, type) \ 288 : "=&r" (value), "=r" (res) \ 292 #define _LoadDW(addr, value, res) \ 337 : "=&r" (value), "=r" (res) \ 344 #define _StoreHW(addr, value, res, type) \ 363 : "=r" (res) \ 368 #define _StoreW(addr, value, res, type) \ 384 : "=r" (res) \ 388 #define _StoreDW(addr, value, res) \ 404 : "=r" (res) \ 410 #define _StoreW(addr, value, res, type) \ 436 : "=&r" (res) \ 441 #define _StoreDW(addr, value, res) \ 480 : "=&r" (res) \ 489 #define _LoadHW(addr, value, res, type) \ 507 : "=&r" (value), "=r" (res) \ 512 #define _LoadW(addr, value, res, type) \ 528 : "=&r" (value), "=r" (res) \ 534 #define _LoadW(addr, value, res, type) \ 563 : "=&r" (value), "=r" (res) \ 570 #define _LoadHWU(addr, value, res, type) \ 590 : "=&r" (value), "=r" (res) \ 595 #define _LoadWU(addr, value, res, type) \ 613 : "=&r" (value), "=r" (res) \ 617 #define _LoadDW(addr, value, res) \ 633 : "=&r" (value), "=r" (res) \ 639 #define _LoadWU(addr, value, res, type) \ 668 : "=&r" (value), "=r" (res) \ 672 #define _LoadDW(addr, value, res) \ 717 : "=&r" (value), "=r" (res) \ 722 #define _StoreHW(addr, value, res, type) \ 741 : "=r" (res) \ 746 #define _StoreW(addr, value, res, type) \ 762 : "=r" (res) \ 766 #define _StoreDW(addr, value, res) \ 782 : "=r" (res) \ 788 #define _StoreW(addr, value, res, type) \ 814 : "=&r" (res) \ 819 #define _StoreDW(addr, value, res) \ 858 : "=&r" (res) \ 866 #define LoadHWU(addr, value, res) _LoadHWU(addr, value, res, kernel) 867 #define LoadHWUE(addr, value, res) _LoadHWU(addr, value, res, user) 868 #define LoadWU(addr, value, res) _LoadWU(addr, value, res, kernel) 869 #define LoadWUE(addr, value, res) _LoadWU(addr, value, res, user) 870 #define LoadHW(addr, value, res) _LoadHW(addr, value, res, kernel) 871 #define LoadHWE(addr, value, res) _LoadHW(addr, value, res, user) 872 #define LoadW(addr, value, res) _LoadW(addr, value, res, kernel) 873 #define LoadWE(addr, value, res) _LoadW(addr, value, res, user) 874 #define LoadDW(addr, value, res) _LoadDW(addr, value, res) 876 #define StoreHW(addr, value, res) _StoreHW(addr, value, res, kernel) 877 #define StoreHWE(addr, value, res) _StoreHW(addr, value, res, user) 878 #define StoreW(addr, value, res) _StoreW(addr, value, res, kernel) 879 #define StoreWE(addr, value, res) _StoreW(addr, value, res, user) 880 #define StoreDW(addr, value, res) _StoreDW(addr, value, res) 887 unsigned int res; emulate_load_store_insn() local 953 LoadHWE(addr, value, res); emulate_load_store_insn() 954 if (res) { emulate_load_store_insn() 966 LoadWE(addr, value, res); emulate_load_store_insn() 967 if (res) { emulate_load_store_insn() 979 LoadHWUE(addr, value, res); emulate_load_store_insn() 980 if (res) { emulate_load_store_insn() 994 StoreHWE(addr, value, res); emulate_load_store_insn() 995 if (res) { emulate_load_store_insn() 1007 StoreWE(addr, value, res); emulate_load_store_insn() 1008 if (res) { emulate_load_store_insn() 1026 LoadHW(addr, value, res); emulate_load_store_insn() 1028 LoadHWE(addr, value, res); emulate_load_store_insn() 1030 LoadHW(addr, value, res); emulate_load_store_insn() 1033 if (res) emulate_load_store_insn() 1045 LoadW(addr, value, res); emulate_load_store_insn() 1047 LoadWE(addr, value, res); emulate_load_store_insn() 1049 LoadW(addr, value, res); emulate_load_store_insn() 1052 if (res) emulate_load_store_insn() 1064 LoadHWU(addr, value, res); emulate_load_store_insn() 1066 LoadHWUE(addr, value, res); emulate_load_store_insn() 1068 LoadHWU(addr, value, res); emulate_load_store_insn() 1071 if (res) emulate_load_store_insn() 1089 LoadWU(addr, value, res); emulate_load_store_insn() 1090 if (res) emulate_load_store_insn() 1112 LoadDW(addr, value, res); emulate_load_store_insn() 1113 if (res) emulate_load_store_insn() 1132 StoreHW(addr, value, res); emulate_load_store_insn() 1134 StoreHWE(addr, value, res); emulate_load_store_insn() 1136 StoreHW(addr, value, res); emulate_load_store_insn() 1139 if (res) emulate_load_store_insn() 1152 StoreW(addr, value, res); emulate_load_store_insn() 1154 StoreWE(addr, value, res); emulate_load_store_insn() 1156 StoreW(addr, value, res); emulate_load_store_insn() 1159 if (res) emulate_load_store_insn() 1177 StoreDW(addr, value, res); emulate_load_store_insn() 1178 if (res) emulate_load_store_insn() 1194 res = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 1, emulate_load_store_insn() 1199 process_fpemu_return(res, fault_addr, 0); emulate_load_store_insn() 1201 if (res == 0) emulate_load_store_insn() 1278 unsigned int res; emulate_load_store_microMIPS() local 1355 LoadW(addr, value, res); emulate_load_store_microMIPS() 1356 if (res) emulate_load_store_microMIPS() 1360 LoadW(addr, value, res); emulate_load_store_microMIPS() 1361 if (res) emulate_load_store_microMIPS() 1375 StoreW(addr, value, res); emulate_load_store_microMIPS() 1376 if (res) emulate_load_store_microMIPS() 1380 StoreW(addr, value, res); emulate_load_store_microMIPS() 1381 if (res) emulate_load_store_microMIPS() 1394 LoadDW(addr, value, res); emulate_load_store_microMIPS() 1395 if (res) emulate_load_store_microMIPS() 1399 LoadDW(addr, value, res); emulate_load_store_microMIPS() 1400 if (res) emulate_load_store_microMIPS() 1418 StoreDW(addr, value, res); emulate_load_store_microMIPS() 1419 if (res) emulate_load_store_microMIPS() 1423 StoreDW(addr, value, res); emulate_load_store_microMIPS() 1424 if (res) emulate_load_store_microMIPS() 1447 LoadW(addr, value, res); emulate_load_store_microMIPS() 1448 if (res) emulate_load_store_microMIPS() 1454 LoadW(addr, value, res); emulate_load_store_microMIPS() 1455 if (res) emulate_load_store_microMIPS() 1461 LoadW(addr, value, res); emulate_load_store_microMIPS() 1462 if (res) emulate_load_store_microMIPS() 1485 StoreW(addr, value, res); emulate_load_store_microMIPS() 1486 if (res) emulate_load_store_microMIPS() 1492 StoreW(addr, value, res); emulate_load_store_microMIPS() 1493 if (res) emulate_load_store_microMIPS() 1499 StoreW(addr, value, res); emulate_load_store_microMIPS() 1500 if (res) emulate_load_store_microMIPS() 1523 LoadDW(addr, value, res); emulate_load_store_microMIPS() 1524 if (res) emulate_load_store_microMIPS() 1530 LoadDW(addr, value, res); emulate_load_store_microMIPS() 1531 if (res) emulate_load_store_microMIPS() 1537 LoadDW(addr, value, res); emulate_load_store_microMIPS() 1538 if (res) emulate_load_store_microMIPS() 1566 StoreDW(addr, value, res); emulate_load_store_microMIPS() 1567 if (res) emulate_load_store_microMIPS() 1573 StoreDW(addr, value, res); emulate_load_store_microMIPS() 1574 if (res) emulate_load_store_microMIPS() 1580 StoreDW(addr, value, res); emulate_load_store_microMIPS() 1581 if (res) emulate_load_store_microMIPS() 1629 res = fpu_emulator_cop1Handler(regs, ¤t->thread.fpu, 1, emulate_load_store_microMIPS() 1634 process_fpemu_return(res, fault_addr, 0); emulate_load_store_microMIPS() 1636 if (res == 0) emulate_load_store_microMIPS() 1677 LoadW(addr, value, res); emulate_load_store_microMIPS() 1678 if (res) emulate_load_store_microMIPS() 1683 LoadW(addr, value, res); emulate_load_store_microMIPS() 1684 if (res) emulate_load_store_microMIPS() 1698 StoreW(addr, value, res); emulate_load_store_microMIPS() 1699 if (res) emulate_load_store_microMIPS() 1704 StoreW(addr, value, res); emulate_load_store_microMIPS() 1705 if (res) emulate_load_store_microMIPS() 1750 LoadHW(addr, value, res); emulate_load_store_microMIPS() 1751 if (res) emulate_load_store_microMIPS() 1760 LoadHWU(addr, value, res); emulate_load_store_microMIPS() 1761 if (res) emulate_load_store_microMIPS() 1770 LoadW(addr, value, res); emulate_load_store_microMIPS() 1771 if (res) emulate_load_store_microMIPS() 1788 LoadWU(addr, value, res); emulate_load_store_microMIPS() 1789 if (res) emulate_load_store_microMIPS() 1810 LoadDW(addr, value, res); emulate_load_store_microMIPS() 1811 if (res) emulate_load_store_microMIPS() 1825 StoreHW(addr, value, res); emulate_load_store_microMIPS() 1826 if (res) emulate_load_store_microMIPS() 1835 StoreW(addr, value, res); emulate_load_store_microMIPS() 1836 if (res) emulate_load_store_microMIPS() 1853 StoreDW(addr, value, res); emulate_load_store_microMIPS() 1854 if (res) emulate_load_store_microMIPS() 1898 unsigned int res; emulate_load_store_MIPS16e() local 1975 LoadHW(addr, value, res); emulate_load_store_MIPS16e() 1976 if (res) emulate_load_store_MIPS16e() 1986 LoadHWU(addr, value, res); emulate_load_store_MIPS16e() 1987 if (res) emulate_load_store_MIPS16e() 1999 LoadW(addr, value, res); emulate_load_store_MIPS16e() 2000 if (res) emulate_load_store_MIPS16e() 2018 LoadWU(addr, value, res); emulate_load_store_MIPS16e() 2019 if (res) emulate_load_store_MIPS16e() 2042 LoadDW(addr, value, res); emulate_load_store_MIPS16e() 2043 if (res) emulate_load_store_MIPS16e() 2059 StoreHW(addr, value, res); emulate_load_store_MIPS16e() 2060 if (res) emulate_load_store_MIPS16e() 2072 StoreW(addr, value, res); emulate_load_store_MIPS16e() 2073 if (res) emulate_load_store_MIPS16e() 2092 StoreDW(addr, value, res); emulate_load_store_MIPS16e() 2093 if (res) emulate_load_store_MIPS16e()
|
/linux-4.1.27/drivers/ssb/ |
H A D | embedded.c | 72 u32 res = 0; ssb_gpio_in() local 76 res = ssb_chipco_gpio_in(&bus->chipco, mask); ssb_gpio_in() 78 res = ssb_extif_gpio_in(&bus->extif, mask); ssb_gpio_in() 83 return res; ssb_gpio_in() 90 u32 res = 0; ssb_gpio_out() local 94 res = ssb_chipco_gpio_out(&bus->chipco, mask, value); ssb_gpio_out() 96 res = ssb_extif_gpio_out(&bus->extif, mask, value); ssb_gpio_out() 101 return res; ssb_gpio_out() 108 u32 res = 0; ssb_gpio_outen() local 112 res = ssb_chipco_gpio_outen(&bus->chipco, mask, value); ssb_gpio_outen() 114 res = ssb_extif_gpio_outen(&bus->extif, mask, value); ssb_gpio_outen() 119 return res; ssb_gpio_outen() 126 u32 res = 0; ssb_gpio_control() local 130 res = ssb_chipco_gpio_control(&bus->chipco, mask, value); ssb_gpio_control() 133 return res; ssb_gpio_control() 140 u32 res = 0; ssb_gpio_intmask() local 144 res = ssb_chipco_gpio_intmask(&bus->chipco, mask, value); ssb_gpio_intmask() 146 res = ssb_extif_gpio_intmask(&bus->extif, mask, value); ssb_gpio_intmask() 151 return res; ssb_gpio_intmask() 158 u32 res = 0; ssb_gpio_polarity() local 162 res = ssb_chipco_gpio_polarity(&bus->chipco, mask, value); ssb_gpio_polarity() 164 res = ssb_extif_gpio_polarity(&bus->extif, mask, value); ssb_gpio_polarity() 169 return res; ssb_gpio_polarity() 179 int res; gige_pci_init_callback() local 189 res = ssb_gige_pcibios_plat_dev_init(dev, pdev); gige_pci_init_callback() 190 if (res >= 0) gige_pci_init_callback() 191 return res; gige_pci_init_callback() 221 int res; gige_map_irq_callback() local 231 res = ssb_gige_map_irq(dev, pdev); gige_map_irq_callback() 232 if (res >= 0) gige_map_irq_callback() 233 return res; gige_map_irq_callback() 242 int res; ssb_pcibios_map_irq() local 247 res = ssb_pcicore_pcibios_map_irq(dev, slot, pin); ssb_pcibios_map_irq() 248 if (res >= 0) ssb_pcibios_map_irq() 249 return res; ssb_pcibios_map_irq() 251 res = ssb_for_each_bus_call((unsigned long)dev, gige_map_irq_callback); ssb_pcibios_map_irq() 252 if (res >= 0) ssb_pcibios_map_irq() 253 return res; ssb_pcibios_map_irq()
|
H A D | driver_extif.c | 156 u32 res = 0; ssb_extif_gpio_out() local 159 res = extif_write32_masked(extif, SSB_EXTIF_GPIO_OUT(0), ssb_extif_gpio_out() 163 return res; ssb_extif_gpio_out() 169 u32 res = 0; ssb_extif_gpio_outen() local 172 res = extif_write32_masked(extif, SSB_EXTIF_GPIO_OUTEN(0), ssb_extif_gpio_outen() 176 return res; ssb_extif_gpio_outen() 182 u32 res = 0; ssb_extif_gpio_polarity() local 185 res = extif_write32_masked(extif, SSB_EXTIF_GPIO_INTPOL, mask, value); ssb_extif_gpio_polarity() 188 return res; ssb_extif_gpio_polarity() 194 u32 res = 0; ssb_extif_gpio_intmask() local 197 res = extif_write32_masked(extif, SSB_EXTIF_GPIO_INTMASK, mask, value); ssb_extif_gpio_intmask() 200 return res; ssb_extif_gpio_intmask()
|
/linux-4.1.27/arch/x86/include/asm/ |
H A D | arch_hweight.h | 26 unsigned int res = 0; __arch_hweight32() local 29 : "="REG_OUT (res) __arch_hweight32() 32 return res; __arch_hweight32() 47 unsigned long res = 0; __arch_hweight64() local 54 : "="REG_OUT (res) __arch_hweight64() 58 return res; __arch_hweight64()
|
H A D | olpc_ofw.h | 14 #define olpc_ofw(name, args, res) \ 15 __olpc_ofw((name), ARRAY_SIZE(args), args, ARRAY_SIZE(res), res) 18 void **res);
|
/linux-4.1.27/arch/cris/include/arch-v32/arch/ |
H A D | bitops.h | 14 unsigned long res; cris_swapnwbrlz() local 18 : "=r" (res) : "0" (w)); cris_swapnwbrlz() 20 return res; cris_swapnwbrlz() 26 unsigned long res; cris_swapwbrlz() local 30 : "=r" (res) : "0" (w)); cris_swapwbrlz() 32 return res; cris_swapwbrlz()
|
H A D | checksum.h | 16 __wsum res; csum_tcpudp_nofold() local 22 : "=r" (res) csum_tcpudp_nofold() 26 return res; csum_tcpudp_nofold()
|
/linux-4.1.27/arch/arm/mach-imx/devices/ |
H A D | platform-imx-dma.c | 14 struct resource res[] = { imx_add_imx_dma() local 31 name, -1, res, ARRAY_SIZE(res), NULL, 0); imx_add_imx_dma() 37 struct resource res[] = { imx_add_imx_sdma() local 50 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); imx_add_imx_sdma()
|
H A D | platform-ipu-core.c | 37 struct resource res[] = { imx_add_ipu_core() local 58 res, ARRAY_SIZE(res), NULL, 0); imx_add_ipu_core() 65 struct resource res[] = { imx_alloc_mx3_camera() local 89 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); imx_alloc_mx3_camera() 114 struct resource res[] = { imx_add_mx3_sdc_fb() local 128 res, ARRAY_SIZE(res), pdata, sizeof(*pdata), imx_add_mx3_sdc_fb()
|
H A D | platform-gpio-mxc.c | 14 struct resource res[] = { mxc_register_gpio() local 31 name, id, res, ARRAY_SIZE(res), NULL, 0); mxc_register_gpio()
|
H A D | platform-imx21-hcd.c | 27 struct resource res[] = { imx_add_imx21_hcd() local 39 res, ARRAY_SIZE(res), imx_add_imx21_hcd()
|
H A D | platform-fec.c | 37 struct resource res[] = { imx_add_fec() local 50 res, ARRAY_SIZE(res), imx_add_fec()
|
H A D | platform-flexcan.c | 43 struct resource res[] = { imx_add_flexcan() local 56 res, ARRAY_SIZE(res), NULL, 0); imx_add_flexcan()
|
H A D | platform-fsl-usb2-udc.c | 40 struct resource res[] = { imx_add_fsl_usb2_udc() local 52 res, ARRAY_SIZE(res), imx_add_fsl_usb2_udc()
|
H A D | platform-imx-fb.c | 41 struct resource res[] = { imx_add_imx_fb() local 53 res, ARRAY_SIZE(res), imx_add_imx_fb()
|
H A D | platform-imx-keypad.c | 43 struct resource res[] = { imx_add_imx_keypad() local 56 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); imx_add_imx_keypad()
|
H A D | platform-imx2-wdt.c | 46 struct resource res[] = { imx_add_imx2_wdt() local 54 res, ARRAY_SIZE(res), NULL, 0); imx_add_imx2_wdt()
|
H A D | platform-mxc_rnga.c | 29 struct resource res[] = { imx_add_mxc_rnga() local 37 res, ARRAY_SIZE(res), NULL, 0); imx_add_mxc_rnga()
|
H A D | platform-mxc_rtc.c | 32 struct resource res[] = { imx_add_mxc_rtc() local 45 res, ARRAY_SIZE(res), NULL, 0); imx_add_mxc_rtc()
|
H A D | platform-mxc_w1.c | 40 struct resource res[] = { imx_add_mxc_w1() local 49 res, ARRAY_SIZE(res), NULL, 0); imx_add_mxc_w1()
|
H A D | platform-pata_imx.c | 34 struct resource res[] = { imx_add_pata_imx() local 47 res, ARRAY_SIZE(res), NULL, 0); imx_add_pata_imx()
|
H A D | platform-imx-uart.c | 89 struct resource res[] = { imx_add_imx_uart_3irq() local 109 return imx_add_platform_device("imx1-uart", data->id, res, imx_add_imx_uart_3irq() 110 ARRAY_SIZE(res), pdata, sizeof(*pdata)); imx_add_imx_uart_3irq() 117 struct resource res[] = { imx_add_imx_uart_1irq() local 131 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); imx_add_imx_uart_1irq()
|
/linux-4.1.27/kernel/ |
H A D | resource.c | 131 int res = seq_open(file, &resource_op); ioports_open() local 132 if (!res) { ioports_open() 136 return res; ioports_open() 141 int res = seq_open(file, &resource_op); iomem_open() local 142 if (!res) { iomem_open() 146 return res; iomem_open() 173 static void free_resource(struct resource *res) free_resource() argument 175 if (!res) free_resource() 178 if (!PageSlab(virt_to_head_page(res))) { free_resource() 180 res->sibling = bootmem_resource_free; free_resource() 181 bootmem_resource_free = res; free_resource() 184 kfree(res); free_resource() 190 struct resource *res = NULL; alloc_resource() local 194 res = bootmem_resource_free; alloc_resource() 195 bootmem_resource_free = res->sibling; alloc_resource() 199 if (res) alloc_resource() 200 memset(res, 0, sizeof(struct resource)); alloc_resource() 202 res = kzalloc(sizeof(struct resource), flags); alloc_resource() 204 return res; alloc_resource() 336 * Finds the lowest iomem reosurce exists with-in [res->start.res->end) 337 * the caller must specify res->start, res->end, res->flags and "name". 338 * If found, returns 0, res is overwritten, if not found, returns -1. 342 static int find_next_iomem_res(struct resource *res, char *name, find_next_iomem_res() argument 349 BUG_ON(!res); find_next_iomem_res() 351 start = res->start; find_next_iomem_res() 352 end = res->end; find_next_iomem_res() 361 if (p->flags != res->flags) find_next_iomem_res() 377 if (res->start < p->start) find_next_iomem_res() 378 res->start = p->start; find_next_iomem_res() 379 if (res->end > p->end) find_next_iomem_res() 380 res->end = p->end; find_next_iomem_res() 398 struct resource res; walk_iomem_res() local 402 res.start = start; walk_iomem_res() 403 res.end = end; walk_iomem_res() 404 res.flags = flags; walk_iomem_res() 405 orig_end = res.end; walk_iomem_res() 406 while ((res.start < res.end) && walk_iomem_res() 407 (!find_next_iomem_res(&res, name, false))) { walk_iomem_res() 408 ret = (*func)(res.start, res.end, arg); walk_iomem_res() 411 res.start = res.end + 1; walk_iomem_res() 412 res.end = orig_end; walk_iomem_res() 427 struct resource res; walk_system_ram_res() local 431 res.start = start; walk_system_ram_res() 432 res.end = end; walk_system_ram_res() 433 res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; walk_system_ram_res() 434 orig_end = res.end; walk_system_ram_res() 435 while ((res.start < res.end) && walk_system_ram_res() 436 (!find_next_iomem_res(&res, "System RAM", true))) { walk_system_ram_res() 437 ret = (*func)(res.start, res.end, arg); walk_system_ram_res() 440 res.start = res.end + 1; walk_system_ram_res() 441 res.end = orig_end; walk_system_ram_res() 456 struct resource res; walk_system_ram_range() local 461 res.start = (u64) start_pfn << PAGE_SHIFT; walk_system_ram_range() 462 res.end = ((u64)(start_pfn + nr_pages) << PAGE_SHIFT) - 1; walk_system_ram_range() 463 res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; walk_system_ram_range() 464 orig_end = res.end; walk_system_ram_range() 465 while ((res.start < res.end) && walk_system_ram_range() 466 (find_next_iomem_res(&res, "System RAM", true) >= 0)) { walk_system_ram_range() 467 pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT; walk_system_ram_range() 468 end_pfn = (res.end + 1) >> PAGE_SHIFT; walk_system_ram_range() 473 res.start = res.end + 1; walk_system_ram_range() 474 res.end = orig_end; walk_system_ram_range() 543 static void resource_clip(struct resource *res, resource_size_t min, resource_clip() argument 546 if (res->start < min) resource_clip() 547 res->start = min; resource_clip() 548 if (res->end > max) resource_clip() 549 res->end = max; resource_clip() 728 struct resource *res; lookup_resource() local 731 for (res = root->child; res; res = res->sibling) { lookup_resource() 732 if (res->start == start) lookup_resource() 737 return res; lookup_resource() 865 static int __adjust_resource(struct resource *res, resource_size_t start, __adjust_resource() argument 868 struct resource *tmp, *parent = res->parent; __adjust_resource() 878 if (res->sibling && (res->sibling->start <= end)) __adjust_resource() 882 if (tmp != res) { __adjust_resource() 883 while (tmp->sibling != res) __adjust_resource() 890 for (tmp = res->child; tmp; tmp = tmp->sibling) __adjust_resource() 894 res->start = start; __adjust_resource() 895 res->end = end; __adjust_resource() 904 * @res: resource to modify 912 int adjust_resource(struct resource *res, resource_size_t start, adjust_resource() argument 918 result = __adjust_resource(res, start, size); adjust_resource() 930 struct resource *res = alloc_resource(GFP_ATOMIC); __reserve_region_with_split() local 933 if (!res) __reserve_region_with_split() 936 res->name = name; __reserve_region_with_split() 937 res->start = start; __reserve_region_with_split() 938 res->end = end; __reserve_region_with_split() 939 res->flags = IORESOURCE_BUSY; __reserve_region_with_split() 943 conflict = __request_resource(parent, res); __reserve_region_with_split() 947 res = next_res; __reserve_region_with_split() 953 if (conflict->start <= res->start && __reserve_region_with_split() 954 conflict->end >= res->end) { __reserve_region_with_split() 955 free_resource(res); __reserve_region_with_split() 961 if (conflict->start > res->start) { __reserve_region_with_split() 962 end = res->end; __reserve_region_with_split() 963 res->end = conflict->start - 1; __reserve_region_with_split() 967 free_resource(res); __reserve_region_with_split() 976 res->start = conflict->end + 1; __reserve_region_with_split() 1013 * @res: resource pointer 1017 resource_size_t resource_alignment(struct resource *res) resource_alignment() argument 1019 switch (res->flags & (IORESOURCE_SIZEALIGN | IORESOURCE_STARTALIGN)) { resource_alignment() 1021 return resource_size(res); resource_alignment() 1023 return res->start; resource_alignment() 1055 struct resource *res = alloc_resource(GFP_KERNEL); __request_region() local 1057 if (!res) __request_region() 1060 res->name = name; __request_region() 1061 res->start = start; __request_region() 1062 res->end = start + n - 1; __request_region() 1063 res->flags = resource_type(parent); __request_region() 1064 res->flags |= IORESOURCE_BUSY | flags; __request_region() 1071 conflict = __request_resource(parent, res); __request_region() 1090 free_resource(res); __request_region() 1091 res = NULL; __request_region() 1095 return res; __request_region() 1119 struct resource *res = *p; __release_region() local 1121 if (!res) __release_region() 1123 if (res->start <= start && res->end >= end) { __release_region() 1124 if (!(res->flags & IORESOURCE_BUSY)) { __release_region() 1125 p = &res->child; __release_region() 1128 if (res->start != start || res->end != end) __release_region() 1130 *p = res->sibling; __release_region() 1132 if (res->flags & IORESOURCE_MUXED) __release_region() 1134 free_resource(res); __release_region() 1137 p = &res->sibling; __release_region() 1173 struct resource *res; release_mem_region_adjustable() local 1188 while ((res = *p)) { release_mem_region_adjustable() 1189 if (res->start >= end) release_mem_region_adjustable() 1193 if (res->start > start || res->end < end) { release_mem_region_adjustable() 1194 p = &res->sibling; release_mem_region_adjustable() 1198 if (!(res->flags & IORESOURCE_MEM)) release_mem_region_adjustable() 1201 if (!(res->flags & IORESOURCE_BUSY)) { release_mem_region_adjustable() 1202 p = &res->child; release_mem_region_adjustable() 1207 if (res->start == start && res->end == end) { release_mem_region_adjustable() 1209 *p = res->sibling; release_mem_region_adjustable() 1210 free_resource(res); release_mem_region_adjustable() 1212 } else if (res->start == start && res->end != end) { release_mem_region_adjustable() 1214 ret = __adjust_resource(res, end + 1, release_mem_region_adjustable() 1215 res->end - end); release_mem_region_adjustable() 1216 } else if (res->start != start && res->end == end) { release_mem_region_adjustable() 1218 ret = __adjust_resource(res, res->start, release_mem_region_adjustable() 1219 start - res->start); release_mem_region_adjustable() 1226 new_res->name = res->name; release_mem_region_adjustable() 1228 new_res->end = res->end; release_mem_region_adjustable() 1229 new_res->flags = res->flags; release_mem_region_adjustable() 1230 new_res->parent = res->parent; release_mem_region_adjustable() 1231 new_res->sibling = res->sibling; release_mem_region_adjustable() 1234 ret = __adjust_resource(res, res->start, release_mem_region_adjustable() 1235 start - res->start); release_mem_region_adjustable() 1238 res->sibling = new_res; release_mem_region_adjustable() 1303 static int devm_resource_match(struct device *dev, void *res, void *data) devm_resource_match() argument 1305 struct resource **ptr = res; devm_resource_match() 1330 static void devm_region_release(struct device *dev, void *res) devm_region_release() argument 1332 struct region_devres *this = res; devm_region_release() 1337 static int devm_region_match(struct device *dev, void *res, void *match_data) devm_region_match() argument 1339 struct region_devres *this = res, *match = match_data; devm_region_match() 1350 struct resource *res; __devm_request_region() local 1361 res = __request_region(parent, start, n, name, 0); __devm_request_region() 1362 if (res) __devm_request_region() 1367 return res; __devm_request_region() 1400 struct resource *res = reserve + x; reserve_setup() local 1401 res->name = "reserved"; reserve_setup() 1402 res->start = io_start; reserve_setup() 1403 res->end = io_start + io_num - 1; reserve_setup() 1404 res->flags = IORESOURCE_BUSY; reserve_setup() 1405 res->child = NULL; reserve_setup() 1406 if (request_resource(res->start >= 0x10000 ? &iomem_resource : &ioport_resource, res) == 0) reserve_setup() 1502 struct resource_entry *resource_list_create_entry(struct resource *res, resource_list_create_entry() argument 1510 entry->res = res ? res : &entry->__res; resource_list_create_entry()
|
/linux-4.1.27/drivers/media/platform/omap3isp/ |
H A D | ispresizer.c | 113 * @res : pointer to resizer private structure 120 __resizer_get_format(struct isp_res_device *res, struct v4l2_subdev_pad_config *cfg, __resizer_get_format() argument 124 return v4l2_subdev_get_try_format(&res->subdev, cfg, pad); __resizer_get_format() 126 return &res->formats[pad]; __resizer_get_format() 131 * @res : pointer to resizer private structure 136 __resizer_get_crop(struct isp_res_device *res, struct v4l2_subdev_pad_config *cfg, __resizer_get_crop() argument 140 return v4l2_subdev_get_try_crop(&res->subdev, cfg, RESZ_PAD_SINK); __resizer_get_crop() 142 return &res->crop.request; __resizer_get_crop() 147 * @res: Device context. 152 static void resizer_set_filters(struct isp_res_device *res, const u16 *h_coeff, resizer_set_filters() argument 155 struct isp_device *isp = to_isp_device(res); resizer_set_filters() 176 * @res: Device context. 183 static void resizer_set_bilinear(struct isp_res_device *res, resizer_set_bilinear() argument 186 struct isp_device *isp = to_isp_device(res); resizer_set_bilinear() 198 * @res: Device context. 201 static void resizer_set_ycpos(struct isp_res_device *res, u32 pixelcode) resizer_set_ycpos() argument 203 struct isp_device *isp = to_isp_device(res); resizer_set_ycpos() 221 * @res: Device context. 227 static void resizer_set_phase(struct isp_res_device *res, u32 h_phase, resizer_set_phase() argument 230 struct isp_device *isp = to_isp_device(res); resizer_set_phase() 243 * @res: Device context. 263 static void resizer_set_luma(struct isp_res_device *res, resizer_set_luma() argument 266 struct isp_device *isp = to_isp_device(res); resizer_set_luma() 283 * @res: Device context. 289 static void resizer_set_source(struct isp_res_device *res, resizer_set_source() argument 292 struct isp_device *isp = to_isp_device(res); resizer_set_source() 304 * @res: Device context. 309 static void resizer_set_ratio(struct isp_res_device *res, resizer_set_ratio() argument 312 struct isp_device *isp = to_isp_device(res); resizer_set_ratio() 336 resizer_set_filters(res, h_filter, v_filter); resizer_set_ratio() 341 * @res: Device context. 353 static void resizer_set_output_size(struct isp_res_device *res, resizer_set_output_size() argument 356 struct isp_device *isp = to_isp_device(res); resizer_set_output_size() 368 * @res: Device context. 375 static void resizer_set_output_offset(struct isp_res_device *res, u32 offset) resizer_set_output_offset() argument 377 struct isp_device *isp = to_isp_device(res); resizer_set_output_offset() 384 * @res: Device context. 397 static void resizer_set_start(struct isp_res_device *res, u32 left, u32 top) resizer_set_start() argument 399 struct isp_device *isp = to_isp_device(res); resizer_set_start() 412 * @res: Device context. 416 static void resizer_set_input_size(struct isp_res_device *res, resizer_set_input_size() argument 419 struct isp_device *isp = to_isp_device(res); resizer_set_input_size() 432 * @res: Device context. 439 static void resizer_set_input_offset(struct isp_res_device *res, u32 offset) resizer_set_input_offset() argument 441 struct isp_device *isp = to_isp_device(res); resizer_set_input_offset() 448 * @res: Device context. 451 static void resizer_set_intype(struct isp_res_device *res, resizer_set_intype() argument 454 struct isp_device *isp = to_isp_device(res); resizer_set_intype() 466 * @res : pointer to resizer private data structure 470 static void __resizer_set_inaddr(struct isp_res_device *res, u32 addr) __resizer_set_inaddr() argument 472 struct isp_device *isp = to_isp_device(res); __resizer_set_inaddr() 500 void omap3isp_resizer_max_rate(struct isp_res_device *res, omap3isp_resizer_max_rate() argument 503 struct isp_pipeline *pipe = to_isp_pipeline(&res->subdev.entity); omap3isp_resizer_max_rate() 504 const struct v4l2_mbus_framefmt *ofmt = &res->formats[RESZ_PAD_SOURCE]; omap3isp_resizer_max_rate() 508 clock = div_u64((u64)limit * res->crop.active.height, ofmt->height); omap3isp_resizer_max_rate() 510 *max_rate = div_u64((u64)clock * res->crop.active.width, ofmt->width); omap3isp_resizer_max_rate() 542 static void resizer_adjust_bandwidth(struct isp_res_device *res) resizer_adjust_bandwidth() argument 544 struct isp_pipeline *pipe = to_isp_pipeline(&res->subdev.entity); resizer_adjust_bandwidth() 545 struct isp_device *isp = to_isp_device(res); resizer_adjust_bandwidth() 556 if (res->input != RESIZER_INPUT_MEMORY) { resizer_adjust_bandwidth() 589 requests_per_frame = DIV_ROUND_UP(res->crop.active.width * 2, 256) resizer_adjust_bandwidth() 590 * res->crop.active.height; resizer_adjust_bandwidth() 610 int omap3isp_resizer_busy(struct isp_res_device *res) omap3isp_resizer_busy() argument 612 struct isp_device *isp = to_isp_device(res); omap3isp_resizer_busy() 622 static void resizer_set_inaddr(struct isp_res_device *res, u32 addr) resizer_set_inaddr() argument 624 res->addr_base = addr; resizer_set_inaddr() 627 if (res->crop_offset) resizer_set_inaddr() 628 addr += res->crop_offset & ~0x1f; resizer_set_inaddr() 630 __resizer_set_inaddr(res, addr); resizer_set_inaddr() 639 static void resizer_set_outaddr(struct isp_res_device *res, u32 addr) resizer_set_outaddr() argument 641 struct isp_device *isp = to_isp_device(res); resizer_set_outaddr() 658 static void resizer_print_status(struct isp_res_device *res) resizer_print_status() argument 660 struct isp_device *isp = to_isp_device(res); resizer_print_status() 680 * @res: pointer to resizer private data structure 780 static void resizer_calc_ratios(struct isp_res_device *res, resizer_calc_ratios() argument 785 struct isp_device *isp = to_isp_device(res); resizer_calc_ratios() 906 * @res : resizer private structure 911 static void resizer_set_crop_params(struct isp_res_device *res, resizer_set_crop_params() argument 915 resizer_set_ratio(res, &res->ratio); resizer_set_crop_params() 918 if (res->ratio.horz >= RESIZE_DIVISOR) resizer_set_crop_params() 919 resizer_set_bilinear(res, RSZ_THE_SAME); resizer_set_crop_params() 921 resizer_set_bilinear(res, RSZ_BILINEAR); resizer_set_crop_params() 923 resizer_adjust_bandwidth(res); resizer_set_crop_params() 925 if (res->input == RESIZER_INPUT_MEMORY) { resizer_set_crop_params() 927 res->crop_offset = (res->crop.active.top * input->width + resizer_set_crop_params() 928 res->crop.active.left) * 2; resizer_set_crop_params() 933 resizer_set_start(res, (res->crop_offset / 2) & 0xf, 0); resizer_set_crop_params() 939 __resizer_set_inaddr(res, resizer_set_crop_params() 940 res->addr_base + (res->crop_offset & ~0x1f)); resizer_set_crop_params() 947 resizer_set_start(res, res->crop.active.left * 2, resizer_set_crop_params() 948 res->crop.active.top); resizer_set_crop_params() 950 __resizer_set_inaddr(res, 0); resizer_set_crop_params() 951 resizer_set_input_offset(res, 0); resizer_set_crop_params() 955 resizer_set_input_size(res, res->crop.active.width, resizer_set_crop_params() 956 res->crop.active.height); resizer_set_crop_params() 959 static void resizer_configure(struct isp_res_device *res) resizer_configure() argument 964 resizer_set_source(res, res->input); resizer_configure() 966 informat = &res->formats[RESZ_PAD_SINK]; resizer_configure() 967 outformat = &res->formats[RESZ_PAD_SOURCE]; resizer_configure() 970 if (res->input == RESIZER_INPUT_VP) resizer_configure() 971 resizer_set_input_offset(res, 0); resizer_configure() 973 resizer_set_input_offset(res, ALIGN(informat->width, 0x10) * 2); resizer_configure() 976 resizer_set_intype(res, RSZ_YUV422); resizer_configure() 977 resizer_set_ycpos(res, informat->code); resizer_configure() 978 resizer_set_phase(res, DEFAULT_PHASE, DEFAULT_PHASE); resizer_configure() 979 resizer_set_luma(res, &luma); resizer_configure() 982 resizer_set_output_offset(res, ALIGN(outformat->width * 2, 32)); resizer_configure() 983 resizer_set_output_size(res, outformat->width, outformat->height); resizer_configure() 985 resizer_set_crop_params(res, informat, outformat); resizer_configure() 992 static void resizer_enable_oneshot(struct isp_res_device *res) resizer_enable_oneshot() argument 994 struct isp_device *isp = to_isp_device(res); resizer_enable_oneshot() 1000 void omap3isp_resizer_isr_frame_sync(struct isp_res_device *res) omap3isp_resizer_isr_frame_sync() argument 1008 if (res->state == ISP_PIPELINE_STREAM_CONTINUOUS && omap3isp_resizer_isr_frame_sync() 1009 res->video_out.dmaqueue_flags & ISP_VIDEO_DMAQUEUE_QUEUED) { omap3isp_resizer_isr_frame_sync() 1010 resizer_enable_oneshot(res); omap3isp_resizer_isr_frame_sync() 1011 isp_video_dmaqueue_flags_clr(&res->video_out); omap3isp_resizer_isr_frame_sync() 1015 static void resizer_isr_buffer(struct isp_res_device *res) resizer_isr_buffer() argument 1017 struct isp_pipeline *pipe = to_isp_pipeline(&res->subdev.entity); resizer_isr_buffer() 1021 if (res->state == ISP_PIPELINE_STREAM_STOPPED) resizer_isr_buffer() 1027 buffer = omap3isp_video_buffer_next(&res->video_out); resizer_isr_buffer() 1029 resizer_set_outaddr(res, buffer->dma); resizer_isr_buffer() 1035 if (res->input == RESIZER_INPUT_MEMORY) { resizer_isr_buffer() 1036 buffer = omap3isp_video_buffer_next(&res->video_in); resizer_isr_buffer() 1038 resizer_set_inaddr(res, buffer->dma); resizer_isr_buffer() 1042 if (res->state == ISP_PIPELINE_STREAM_SINGLESHOT) { resizer_isr_buffer() 1051 resizer_enable_oneshot(res); resizer_isr_buffer() 1061 void omap3isp_resizer_isr(struct isp_res_device *res) omap3isp_resizer_isr() argument 1066 if (omap3isp_module_sync_is_stopping(&res->wait, &res->stopping)) omap3isp_resizer_isr() 1069 spin_lock_irqsave(&res->lock, flags); omap3isp_resizer_isr() 1071 if (res->applycrop) { omap3isp_resizer_isr() 1072 outformat = __resizer_get_format(res, NULL, RESZ_PAD_SOURCE, omap3isp_resizer_isr() 1074 informat = __resizer_get_format(res, NULL, RESZ_PAD_SINK, omap3isp_resizer_isr() 1076 resizer_set_crop_params(res, informat, outformat); omap3isp_resizer_isr() 1077 res->applycrop = 0; omap3isp_resizer_isr() 1080 spin_unlock_irqrestore(&res->lock, flags); omap3isp_resizer_isr() 1082 resizer_isr_buffer(res); omap3isp_resizer_isr() 1092 struct isp_res_device *res = &video->isp->isp_res; resizer_video_queue() local 1095 resizer_set_inaddr(res, buffer->dma); resizer_video_queue() 1110 resizer_set_outaddr(res, buffer->dma); resizer_video_queue() 1135 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_set_stream() local 1136 struct isp_video *video_out = &res->video_out; resizer_set_stream() 1137 struct isp_device *isp = to_isp_device(res); resizer_set_stream() 1138 struct device *dev = to_device(res); resizer_set_stream() 1140 if (res->state == ISP_PIPELINE_STREAM_STOPPED) { resizer_set_stream() 1145 resizer_configure(res); resizer_set_stream() 1146 resizer_print_status(res); resizer_set_stream() 1153 resizer_enable_oneshot(res); resizer_set_stream() 1159 if (res->input == RESIZER_INPUT_MEMORY) resizer_set_stream() 1163 resizer_enable_oneshot(res); resizer_set_stream() 1167 if (omap3isp_module_sync_idle(&sd->entity, &res->wait, resizer_set_stream() 1168 &res->stopping)) resizer_set_stream() 1177 res->state = enable; resizer_set_stream() 1229 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_get_selection() local 1237 format_sink = __resizer_get_format(res, cfg, RESZ_PAD_SINK, resizer_get_selection() 1239 format_source = __resizer_get_format(res, cfg, RESZ_PAD_SOURCE, resizer_get_selection() 1250 resizer_calc_ratios(res, &sel->r, format_source, &ratio); resizer_get_selection() 1254 sel->r = *__resizer_get_crop(res, cfg, sel->which); resizer_get_selection() 1255 resizer_calc_ratios(res, &sel->r, format_source, &ratio); resizer_get_selection() 1282 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_set_selection() local 1283 struct isp_device *isp = to_isp_device(res); resizer_set_selection() 1293 format_sink = __resizer_get_format(res, cfg, RESZ_PAD_SINK, resizer_set_selection() 1295 format_source = *__resizer_get_format(res, cfg, RESZ_PAD_SOURCE, resizer_set_selection() 1313 *__resizer_get_crop(res, cfg, sel->which) = sel->r; resizer_set_selection() 1314 resizer_calc_ratios(res, &sel->r, &format_source, &ratio); resizer_set_selection() 1323 *__resizer_get_format(res, cfg, RESZ_PAD_SOURCE, sel->which) = resizer_set_selection() 1332 spin_lock_irqsave(&res->lock, flags); resizer_set_selection() 1334 *__resizer_get_format(res, cfg, RESZ_PAD_SOURCE, sel->which) = resizer_set_selection() 1337 res->ratio = ratio; resizer_set_selection() 1338 res->crop.active = sel->r; resizer_set_selection() 1340 if (res->state != ISP_PIPELINE_STREAM_STOPPED) resizer_set_selection() 1341 res->applycrop = 1; resizer_set_selection() 1343 spin_unlock_irqrestore(&res->lock, flags); resizer_set_selection() 1354 static unsigned int resizer_max_in_width(struct isp_res_device *res) resizer_max_in_width() argument 1356 struct isp_device *isp = to_isp_device(res); resizer_max_in_width() 1358 if (res->input == RESIZER_INPUT_MEMORY) { resizer_max_in_width() 1370 * @res : ISP resizer device 1376 static void resizer_try_format(struct isp_res_device *res, resizer_try_format() argument 1392 resizer_max_in_width(res)); resizer_try_format() 1398 format = __resizer_get_format(res, cfg, RESZ_PAD_SINK, which); resizer_try_format() 1401 crop = *__resizer_get_crop(res, cfg, which); resizer_try_format() 1402 resizer_calc_ratios(res, &crop, fmt, &ratio); resizer_try_format() 1421 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_enum_mbus_code() local 1433 format = __resizer_get_format(res, cfg, RESZ_PAD_SINK, resizer_enum_mbus_code() 1445 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_enum_frame_size() local 1454 resizer_try_format(res, cfg, fse->pad, &format, fse->which); resizer_enum_frame_size() 1464 resizer_try_format(res, cfg, fse->pad, &format, fse->which); resizer_enum_frame_size() 1481 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_get_format() local 1484 format = __resizer_get_format(res, cfg, fmt->pad, fmt->which); resizer_get_format() 1502 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_set_format() local 1506 format = __resizer_get_format(res, cfg, fmt->pad, fmt->which); resizer_set_format() 1510 resizer_try_format(res, cfg, fmt->pad, &fmt->format, fmt->which); resizer_set_format() 1515 crop = __resizer_get_crop(res, cfg, fmt->which); resizer_set_format() 1522 format = __resizer_get_format(res, cfg, RESZ_PAD_SOURCE, resizer_set_format() 1525 resizer_try_format(res, cfg, RESZ_PAD_SOURCE, format, resizer_set_format() 1534 res->crop.active = res->crop.request; resizer_set_format() 1535 resizer_calc_ratios(res, &res->crop.active, format, resizer_set_format() 1536 &res->ratio); resizer_set_format() 1547 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_link_validate() local 1550 omap3isp_resizer_max_rate(res, &pipe->max_rate); resizer_link_validate() 1625 struct isp_res_device *res = v4l2_get_subdevdata(sd); resizer_link_setup() local 1631 if (res->input == RESIZER_INPUT_VP) resizer_link_setup() 1633 res->input = RESIZER_INPUT_MEMORY; resizer_link_setup() 1635 if (res->input == RESIZER_INPUT_MEMORY) resizer_link_setup() 1636 res->input = RESIZER_INPUT_NONE; resizer_link_setup() 1643 if (res->input == RESIZER_INPUT_MEMORY) resizer_link_setup() 1645 res->input = RESIZER_INPUT_VP; resizer_link_setup() 1647 if (res->input == RESIZER_INPUT_VP) resizer_link_setup() 1648 res->input = RESIZER_INPUT_NONE; resizer_link_setup() 1669 void omap3isp_resizer_unregister_entities(struct isp_res_device *res) omap3isp_resizer_unregister_entities() argument 1671 v4l2_device_unregister_subdev(&res->subdev); omap3isp_resizer_unregister_entities() 1672 omap3isp_video_unregister(&res->video_in); omap3isp_resizer_unregister_entities() 1673 omap3isp_video_unregister(&res->video_out); omap3isp_resizer_unregister_entities() 1676 int omap3isp_resizer_register_entities(struct isp_res_device *res, omap3isp_resizer_register_entities() argument 1682 ret = v4l2_device_register_subdev(vdev, &res->subdev); omap3isp_resizer_register_entities() 1686 ret = omap3isp_video_register(&res->video_in, vdev); omap3isp_resizer_register_entities() 1690 ret = omap3isp_video_register(&res->video_out, vdev); omap3isp_resizer_register_entities() 1697 omap3isp_resizer_unregister_entities(res); omap3isp_resizer_register_entities() 1707 * @res : Pointer to resizer device structure 1710 static int resizer_init_entities(struct isp_res_device *res) resizer_init_entities() argument 1712 struct v4l2_subdev *sd = &res->subdev; resizer_init_entities() 1713 struct media_pad *pads = res->pads; resizer_init_entities() 1717 res->input = RESIZER_INPUT_NONE; resizer_init_entities() 1723 v4l2_set_subdevdata(sd, res); resizer_init_entities() 1737 res->video_in.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; resizer_init_entities() 1738 res->video_in.ops = &resizer_video_ops; resizer_init_entities() 1739 res->video_in.isp = to_isp_device(res); resizer_init_entities() 1740 res->video_in.capture_mem = PAGE_ALIGN(4096 * 4096) * 2 * 3; resizer_init_entities() 1741 res->video_in.bpl_alignment = 32; resizer_init_entities() 1742 res->video_out.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; resizer_init_entities() 1743 res->video_out.ops = &resizer_video_ops; resizer_init_entities() 1744 res->video_out.isp = to_isp_device(res); resizer_init_entities() 1745 res->video_out.capture_mem = PAGE_ALIGN(4096 * 4096) * 2 * 3; resizer_init_entities() 1746 res->video_out.bpl_alignment = 32; resizer_init_entities() 1748 ret = omap3isp_video_init(&res->video_in, "resizer"); resizer_init_entities() 1752 ret = omap3isp_video_init(&res->video_out, "resizer"); resizer_init_entities() 1756 res->video_out.video.entity.flags |= MEDIA_ENT_FL_DEFAULT; resizer_init_entities() 1759 ret = media_entity_create_link(&res->video_in.video.entity, 0, resizer_init_entities() 1760 &res->subdev.entity, RESZ_PAD_SINK, 0); resizer_init_entities() 1764 ret = media_entity_create_link(&res->subdev.entity, RESZ_PAD_SOURCE, resizer_init_entities() 1765 &res->video_out.video.entity, 0, 0); resizer_init_entities() 1772 omap3isp_video_cleanup(&res->video_out); resizer_init_entities() 1774 omap3isp_video_cleanup(&res->video_in); resizer_init_entities() 1776 media_entity_cleanup(&res->subdev.entity); resizer_init_entities() 1787 struct isp_res_device *res = &isp->isp_res; omap3isp_resizer_init() local 1789 init_waitqueue_head(&res->wait); omap3isp_resizer_init() 1790 atomic_set(&res->stopping, 0); omap3isp_resizer_init() 1791 spin_lock_init(&res->lock); omap3isp_resizer_init() 1793 return resizer_init_entities(res); omap3isp_resizer_init() 1798 struct isp_res_device *res = &isp->isp_res; omap3isp_resizer_cleanup() local 1800 omap3isp_video_cleanup(&res->video_in); omap3isp_resizer_cleanup() 1801 omap3isp_video_cleanup(&res->video_out); omap3isp_resizer_cleanup() 1802 media_entity_cleanup(&res->subdev.entity); omap3isp_resizer_cleanup()
|
/linux-4.1.27/drivers/staging/board/ |
H A D | board.c | 11 struct resource res; find_by_address() local 14 if (!of_address_to_resource(dn, 0, &res)) { find_by_address() 15 if (res.start == base_address) { find_by_address()
|
/linux-4.1.27/net/hsr/ |
H A D | hsr_netlink.c | 72 int res; hsr_fill_info() local 76 res = 0; hsr_fill_info() 81 res = nla_put_u32(skb, IFLA_HSR_SLAVE1, port->dev->ifindex); hsr_fill_info() 83 if (res) hsr_fill_info() 89 res = nla_put_u32(skb, IFLA_HSR_SLAVE2, port->dev->ifindex); hsr_fill_info() 91 if (res) hsr_fill_info() 153 int res; hsr_nl_ringerror() local 163 res = nla_put(skb, HSR_A_NODE_ADDR, ETH_ALEN, addr); hsr_nl_ringerror() 164 if (res < 0) hsr_nl_ringerror() 167 res = nla_put_u32(skb, HSR_A_IFINDEX, port->dev->ifindex); hsr_nl_ringerror() 168 if (res < 0) hsr_nl_ringerror() 194 int res; hsr_nl_nodedown() local 205 res = nla_put(skb, HSR_A_NODE_ADDR, ETH_ALEN, addr); hsr_nl_nodedown() 206 if (res < 0) hsr_nl_nodedown() 250 int res; hsr_get_node_status() local 274 res = -ENOMEM; hsr_get_node_status() 282 res = -ENOMEM; hsr_get_node_status() 286 res = nla_put_u32(skb_out, HSR_A_IFINDEX, hsr_dev->ifindex); hsr_get_node_status() 287 if (res < 0) hsr_get_node_status() 291 res = hsr_get_node_data(hsr, hsr_get_node_status() 299 if (res < 0) hsr_get_node_status() 302 res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN, hsr_get_node_status() 304 if (res < 0) hsr_get_node_status() 308 res = nla_put(skb_out, HSR_A_NODE_ADDR_B, ETH_ALEN, hsr_get_node_status() 310 if (res < 0) hsr_get_node_status() 313 res = nla_put_u32(skb_out, HSR_A_ADDR_B_IFINDEX, addr_b_ifindex); hsr_get_node_status() 314 if (res < 0) hsr_get_node_status() 318 res = nla_put_u32(skb_out, HSR_A_IF1_AGE, hsr_node_if1_age); hsr_get_node_status() 319 if (res < 0) hsr_get_node_status() 321 res = nla_put_u16(skb_out, HSR_A_IF1_SEQ, hsr_node_if1_seq); hsr_get_node_status() 322 if (res < 0) hsr_get_node_status() 327 res = nla_put_u32(skb_out, HSR_A_IF1_IFINDEX, hsr_get_node_status() 330 if (res < 0) hsr_get_node_status() 333 res = nla_put_u32(skb_out, HSR_A_IF2_AGE, hsr_node_if2_age); hsr_get_node_status() 334 if (res < 0) hsr_get_node_status() 336 res = nla_put_u16(skb_out, HSR_A_IF2_SEQ, hsr_node_if2_seq); hsr_get_node_status() 337 if (res < 0) hsr_get_node_status() 342 res = nla_put_u32(skb_out, HSR_A_IF2_IFINDEX, hsr_get_node_status() 345 if (res < 0) hsr_get_node_status() 362 return res; hsr_get_node_status() 379 int res; hsr_get_node_list() local 400 res = -ENOMEM; hsr_get_node_list() 408 res = -ENOMEM; hsr_get_node_list() 412 res = nla_put_u32(skb_out, HSR_A_IFINDEX, hsr_dev->ifindex); hsr_get_node_list() 413 if (res < 0) hsr_get_node_list() 421 res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN, addr); hsr_get_node_list() 422 if (res < 0) { hsr_get_node_list() 444 return res; hsr_get_node_list()
|
H A D | hsr_slave.c | 103 int res; hsr_portdev_setup() local 106 res = dev_set_promiscuity(dev, 1); hsr_portdev_setup() 107 if (res) hsr_portdev_setup() 112 * res = netdev_master_upper_dev_link(port->dev, port->hsr->dev); ? hsr_portdev_setup() 115 res = netdev_rx_handler_register(dev, hsr_handle_frame, port); hsr_portdev_setup() 116 if (res) hsr_portdev_setup() 127 return res; hsr_portdev_setup() 134 int res; hsr_add_port() local 137 res = hsr_check_dev_ok(dev); hsr_add_port() 138 if (res) hsr_add_port() 139 return res; hsr_add_port() 151 res = hsr_portdev_setup(dev, port); hsr_add_port() 152 if (res) hsr_add_port() 171 return res; hsr_add_port()
|
/linux-4.1.27/include/asm-generic/ |
H A D | pci.h | 10 pcibios_select_root(struct pci_dev *pdev, struct resource *res) pcibios_select_root() argument 14 if (res->flags & IORESOURCE_IO) pcibios_select_root() 16 if (res->flags & IORESOURCE_MEM) pcibios_select_root()
|
/linux-4.1.27/drivers/gpu/drm/exynos/ |
H A D | exynos_mixer.c | 127 static inline u32 vp_reg_read(struct mixer_resources *res, u32 reg_id) vp_reg_read() argument 129 return readl(res->vp_regs + reg_id); vp_reg_read() 132 static inline void vp_reg_write(struct mixer_resources *res, u32 reg_id, vp_reg_write() argument 135 writel(val, res->vp_regs + reg_id); vp_reg_write() 138 static inline void vp_reg_writemask(struct mixer_resources *res, u32 reg_id, vp_reg_writemask() argument 141 u32 old = vp_reg_read(res, reg_id); vp_reg_writemask() 144 writel(val, res->vp_regs + reg_id); vp_reg_writemask() 147 static inline u32 mixer_reg_read(struct mixer_resources *res, u32 reg_id) mixer_reg_read() argument 149 return readl(res->mixer_regs + reg_id); mixer_reg_read() 152 static inline void mixer_reg_write(struct mixer_resources *res, u32 reg_id, mixer_reg_write() argument 155 writel(val, res->mixer_regs + reg_id); mixer_reg_write() 158 static inline void mixer_reg_writemask(struct mixer_resources *res, mixer_reg_writemask() argument 161 u32 old = mixer_reg_read(res, reg_id); mixer_reg_writemask() 164 writel(val, res->mixer_regs + reg_id); mixer_reg_writemask() 234 static inline void vp_filter_set(struct mixer_resources *res, vp_filter_set() argument 242 vp_reg_write(res, reg_id, val); vp_filter_set() 246 static void vp_default_filter(struct mixer_resources *res) vp_default_filter() argument 248 vp_filter_set(res, VP_POLY8_Y0_LL, vp_default_filter() 250 vp_filter_set(res, VP_POLY4_Y0_LL, vp_default_filter() 252 vp_filter_set(res, VP_POLY4_C0_LL, vp_default_filter() 258 struct mixer_resources *res = &ctx->mixer_res; mixer_vsync_set_update() local 261 mixer_reg_writemask(res, MXR_STATUS, enable ? mixer_vsync_set_update() 265 vp_reg_write(res, VP_SHADOW_UPDATE, enable ? mixer_vsync_set_update() 271 struct mixer_resources *res = &ctx->mixer_res; mixer_cfg_scan() local 292 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_SCAN_MASK); mixer_cfg_scan() 297 struct mixer_resources *res = &ctx->mixer_res; mixer_cfg_rgb_fmt() local 306 mixer_reg_write(res, MXR_CM_COEFF_Y, mixer_cfg_rgb_fmt() 309 mixer_reg_write(res, MXR_CM_COEFF_CB, mixer_cfg_rgb_fmt() 311 mixer_reg_write(res, MXR_CM_COEFF_CR, mixer_cfg_rgb_fmt() 315 mixer_reg_write(res, MXR_CM_COEFF_Y, mixer_cfg_rgb_fmt() 318 mixer_reg_write(res, MXR_CM_COEFF_CB, mixer_cfg_rgb_fmt() 320 mixer_reg_write(res, MXR_CM_COEFF_CR, mixer_cfg_rgb_fmt() 324 mixer_reg_write(res, MXR_CM_COEFF_Y, mixer_cfg_rgb_fmt() 327 mixer_reg_write(res, MXR_CM_COEFF_CB, mixer_cfg_rgb_fmt() 329 mixer_reg_write(res, MXR_CM_COEFF_CR, mixer_cfg_rgb_fmt() 333 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK); mixer_cfg_rgb_fmt() 339 struct mixer_resources *res = &ctx->mixer_res; mixer_cfg_layer() local 344 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_GRP0_ENABLE); mixer_cfg_layer() 347 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_GRP1_ENABLE); mixer_cfg_layer() 351 vp_reg_writemask(res, VP_ENABLE, val, VP_ENABLE_ON); mixer_cfg_layer() 352 mixer_reg_writemask(res, MXR_CFG, val, mixer_cfg_layer() 356 mixer_reg_writemask(res, MXR_GRAPHIC_CFG(0), val, mixer_cfg_layer() 366 struct mixer_resources *res = &ctx->mixer_res; mixer_run() local 368 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_REG_RUN); mixer_run() 373 struct mixer_resources *res = &ctx->mixer_res; mixer_stop() local 376 mixer_reg_writemask(res, MXR_STATUS, 0, MXR_STATUS_REG_RUN); mixer_stop() 378 while (!(mixer_reg_read(res, MXR_STATUS) & MXR_STATUS_REG_IDLE) && mixer_stop() 385 struct mixer_resources *res = &ctx->mixer_res; vp_video_buffer() local 426 spin_lock_irqsave(&res->reg_slock, flags); vp_video_buffer() 431 vp_reg_writemask(res, VP_MODE, val, VP_MODE_LINE_SKIP); vp_video_buffer() 436 vp_reg_writemask(res, VP_MODE, val, VP_MODE_FMT_MASK); vp_video_buffer() 439 vp_reg_write(res, VP_IMG_SIZE_Y, VP_IMG_HSIZE(plane->pitch) | vp_video_buffer() 442 vp_reg_write(res, VP_IMG_SIZE_C, VP_IMG_HSIZE(plane->pitch) | vp_video_buffer() 445 vp_reg_write(res, VP_SRC_WIDTH, plane->src_width); vp_video_buffer() 446 vp_reg_write(res, VP_SRC_HEIGHT, plane->src_height); vp_video_buffer() 447 vp_reg_write(res, VP_SRC_H_POSITION, vp_video_buffer() 449 vp_reg_write(res, VP_SRC_V_POSITION, plane->src_y); vp_video_buffer() 451 vp_reg_write(res, VP_DST_WIDTH, plane->crtc_width); vp_video_buffer() 452 vp_reg_write(res, VP_DST_H_POSITION, plane->crtc_x); vp_video_buffer() 454 vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_height / 2); vp_video_buffer() 455 vp_reg_write(res, VP_DST_V_POSITION, plane->crtc_y / 2); vp_video_buffer() 457 vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_height); vp_video_buffer() 458 vp_reg_write(res, VP_DST_V_POSITION, plane->crtc_y); vp_video_buffer() 461 vp_reg_write(res, VP_H_RATIO, plane->h_ratio); vp_video_buffer() 462 vp_reg_write(res, VP_V_RATIO, plane->v_ratio); vp_video_buffer() 464 vp_reg_write(res, VP_ENDIAN_MODE, VP_ENDIAN_MODE_LITTLE); vp_video_buffer() 467 vp_reg_write(res, VP_TOP_Y_PTR, luma_addr[0]); vp_video_buffer() 468 vp_reg_write(res, VP_BOT_Y_PTR, luma_addr[1]); vp_video_buffer() 469 vp_reg_write(res, VP_TOP_C_PTR, chroma_addr[0]); vp_video_buffer() 470 vp_reg_write(res, VP_BOT_C_PTR, chroma_addr[1]); vp_video_buffer() 478 spin_unlock_irqrestore(&res->reg_slock, flags); vp_video_buffer() 486 struct mixer_resources *res = &ctx->mixer_res; mixer_layer_update() local 488 mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE); mixer_layer_update() 517 struct mixer_resources *res = &ctx->mixer_res; mixer_graph_buffer() local 570 spin_lock_irqsave(&res->reg_slock, flags); mixer_graph_buffer() 574 mixer_reg_writemask(res, MXR_GRAPHIC_CFG(win), mixer_graph_buffer() 578 mixer_reg_write(res, MXR_GRAPHIC_SPAN(win), mixer_graph_buffer() 586 mixer_reg_write(res, MXR_RESOLUTION, val); mixer_graph_buffer() 593 mixer_reg_write(res, MXR_GRAPHIC_WH(win), val); mixer_graph_buffer() 598 mixer_reg_write(res, MXR_GRAPHIC_SXY(win), val); mixer_graph_buffer() 603 mixer_reg_write(res, MXR_GRAPHIC_DXY(win), val); mixer_graph_buffer() 606 mixer_reg_write(res, MXR_GRAPHIC_BASE(win), dma_addr); mixer_graph_buffer() 620 spin_unlock_irqrestore(&res->reg_slock, flags); mixer_graph_buffer() 627 struct mixer_resources *res = &ctx->mixer_res; vp_win_reset() local 630 vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING); vp_win_reset() 633 if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING) vp_win_reset() 642 struct mixer_resources *res = &ctx->mixer_res; mixer_win_reset() local 646 spin_lock_irqsave(&res->reg_slock, flags); mixer_win_reset() 649 mixer_reg_writemask(res, MXR_CFG, MXR_CFG_DST_HDMI, MXR_CFG_DST_MASK); mixer_win_reset() 652 mixer_reg_writemask(res, MXR_CFG, MXR_CFG_OUT_RGB888, MXR_CFG_OUT_MASK); mixer_win_reset() 655 mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST, mixer_win_reset() 668 mixer_reg_write(res, MXR_LAYER_CFG, val); mixer_win_reset() 671 mixer_reg_write(res, MXR_BG_COLOR0, 0x008080); mixer_win_reset() 672 mixer_reg_write(res, MXR_BG_COLOR1, 0x008080); mixer_win_reset() 673 mixer_reg_write(res, MXR_BG_COLOR2, 0x008080); mixer_win_reset() 681 mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val); mixer_win_reset() 686 mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val); mixer_win_reset() 690 mixer_reg_write(res, MXR_VIDEO_CFG, val); mixer_win_reset() 695 vp_default_filter(res); mixer_win_reset() 699 mixer_reg_writemask(res, MXR_CFG, 0, MXR_CFG_GRP0_ENABLE); mixer_win_reset() 700 mixer_reg_writemask(res, MXR_CFG, 0, MXR_CFG_GRP1_ENABLE); mixer_win_reset() 702 mixer_reg_writemask(res, MXR_CFG, 0, MXR_CFG_VP_ENABLE); mixer_win_reset() 705 spin_unlock_irqrestore(&res->reg_slock, flags); mixer_win_reset() 711 struct mixer_resources *res = &ctx->mixer_res; mixer_irq_handler() local 714 spin_lock(&res->reg_slock); mixer_irq_handler() 717 val = mixer_reg_read(res, MXR_INT_STATUS); mixer_irq_handler() 723 base = mixer_reg_read(res, MXR_GRAPHIC_BASE(0)); mixer_irq_handler() 724 shadow = mixer_reg_read(res, MXR_GRAPHIC_BASE_S(0)); mixer_irq_handler() 728 base = mixer_reg_read(res, MXR_GRAPHIC_BASE(1)); mixer_irq_handler() 729 shadow = mixer_reg_read(res, MXR_GRAPHIC_BASE_S(1)); mixer_irq_handler() 751 mixer_reg_write(res, MXR_INT_STATUS, val); mixer_irq_handler() 753 spin_unlock(&res->reg_slock); mixer_irq_handler() 762 struct resource *res; mixer_resources_init() local 784 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 0); mixer_resources_init() 785 if (res == NULL) { mixer_resources_init() 790 mixer_res->mixer_regs = devm_ioremap(dev, res->start, mixer_resources_init() 791 resource_size(res)); mixer_resources_init() 797 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_IRQ, 0); mixer_resources_init() 798 if (res == NULL) { mixer_resources_init() 803 ret = devm_request_irq(dev, res->start, mixer_irq_handler, mixer_resources_init() 809 mixer_res->irq = res->start; mixer_resources_init() 818 struct resource *res; vp_resources_init() local 843 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1); vp_resources_init() 844 if (res == NULL) { vp_resources_init() 849 mixer_res->vp_regs = devm_ioremap(dev, res->start, vp_resources_init() 850 resource_size(res)); vp_resources_init() 900 struct mixer_resources *res = &mixer_ctx->mixer_res; mixer_enable_vblank() local 908 mixer_reg_writemask(res, MXR_INT_EN, MXR_INT_EN_VSYNC, mixer_enable_vblank() 917 struct mixer_resources *res = &mixer_ctx->mixer_res; mixer_disable_vblank() local 920 mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); mixer_disable_vblank() 947 struct mixer_resources *res = &mixer_ctx->mixer_res; mixer_win_disable() local 960 spin_lock_irqsave(&res->reg_slock, flags); mixer_win_disable() 966 spin_unlock_irqrestore(&res->reg_slock, flags); mixer_win_disable() 1032 struct mixer_resources *res = &ctx->mixer_res; mixer_poweron() local 1044 clk_prepare_enable(res->mixer); mixer_poweron() 1045 clk_prepare_enable(res->hdmi); mixer_poweron() 1047 clk_prepare_enable(res->vp); mixer_poweron() 1049 clk_prepare_enable(res->sclk_mixer); mixer_poweron() 1056 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET); mixer_poweron() 1058 mixer_reg_write(res, MXR_INT_EN, ctx->int_en); mixer_poweron() 1066 struct mixer_resources *res = &ctx->mixer_res; mixer_poweroff() local 1079 ctx->int_en = mixer_reg_read(res, MXR_INT_EN); mixer_poweroff() 1085 clk_disable_unprepare(res->hdmi); mixer_poweroff() 1086 clk_disable_unprepare(res->mixer); mixer_poweroff() 1088 clk_disable_unprepare(res->vp); mixer_poweroff() 1090 clk_disable_unprepare(res->sclk_mixer); mixer_poweroff()
|
/linux-4.1.27/arch/x86/video/ |
H A D | fbdev.c | 19 struct resource *res = NULL; fb_is_primary_device() local 34 res = &pci_dev->resource[PCI_ROM_RESOURCE]; fb_is_primary_device() 36 if (res && res->flags & IORESOURCE_ROM_SHADOW) fb_is_primary_device()
|
/linux-4.1.27/arch/powerpc/sysdev/ |
H A D | rtc_cmos_setup.c | 24 struct resource res[2]; add_rtc() local 28 memset(&res, 0, sizeof(res)); add_rtc() 34 ret = of_address_to_resource(np, 0, &res[0]); add_rtc() 43 if (res[0].start != RTC_PORT(0)) add_rtc() 56 res[1].start = 8; add_rtc() 57 res[1].end = 8; add_rtc() 58 res[1].flags = IORESOURCE_IRQ; add_rtc() 63 &res[0], num_res); add_rtc()
|
H A D | of_rtc.c | 36 struct resource *res; for_each_compatible_node() local 38 res = kmalloc(sizeof(*res), GFP_KERNEL); for_each_compatible_node() 39 if (!res) { for_each_compatible_node() 46 err = of_address_to_resource(node, 0, res); for_each_compatible_node() 56 (unsigned long long)res->start, for_each_compatible_node() 57 (unsigned long long)res->end); for_each_compatible_node() 58 platform_device_register_simple(plat_name, -1, res, 1); for_each_compatible_node()
|
/linux-4.1.27/arch/mips/pci/ |
H A D | pci-bcm47xx.c | 39 int res; bcm47xx_pcibios_plat_dev_init_ssb() local 42 res = ssb_pcibios_plat_dev_init(dev); bcm47xx_pcibios_plat_dev_init_ssb() 43 if (res < 0) { bcm47xx_pcibios_plat_dev_init_ssb() 46 return res; bcm47xx_pcibios_plat_dev_init_ssb() 51 res = ssb_pcibios_map_irq(dev, slot, pin); bcm47xx_pcibios_plat_dev_init_ssb() 54 if (res < 2) { bcm47xx_pcibios_plat_dev_init_ssb() 57 return res; bcm47xx_pcibios_plat_dev_init_ssb() 60 dev->irq = res; bcm47xx_pcibios_plat_dev_init_ssb() 68 int res; bcm47xx_pcibios_plat_dev_init_bcma() local 70 res = bcma_core_pci_plat_dev_init(dev); bcm47xx_pcibios_plat_dev_init_bcma() 71 if (res < 0) { bcm47xx_pcibios_plat_dev_init_bcma() 74 return res; bcm47xx_pcibios_plat_dev_init_bcma() 77 res = bcma_core_pci_pcibios_map_irq(dev); bcm47xx_pcibios_plat_dev_init_bcma() 80 if (res < 2) { bcm47xx_pcibios_plat_dev_init_bcma() 83 return res; bcm47xx_pcibios_plat_dev_init_bcma() 86 dev->irq = res; bcm47xx_pcibios_plat_dev_init_bcma()
|
H A D | ops-sni.c | 43 int res; pcimt_read() local 45 if ((res = set_config_address(bus->number, devfn, reg))) pcimt_read() 46 return res; pcimt_read() 66 int res; pcimt_write() local 68 if ((res = set_config_address(bus->number, devfn, reg))) pcimt_write() 69 return res; pcimt_write() 103 int res; pcit_read() local 113 if ((res = pcit_set_config_address(0, devfn, 0))) pcit_read() 114 return res; pcit_read() 120 if ((res = pcit_set_config_address(bus->number, devfn, reg))) pcit_read() 121 return res; pcit_read() 140 int res; pcit_write() local 142 if ((res = pcit_set_config_address(bus->number, devfn, reg))) pcit_write() 143 return res; pcit_write()
|
/linux-4.1.27/arch/mips/sgi-ip22/ |
H A D | ip22-platform.c | 67 int res; sgiwd93_devinit() local 72 res = platform_device_register(&sgiwd93_0_device); sgiwd93_devinit() 73 if (res) sgiwd93_devinit() 74 return res; sgiwd93_devinit() 136 int res, i; sgiseeq_devinit() local 148 res = platform_device_register(ð0_device); sgiseeq_devinit() 149 if (res) sgiseeq_devinit() 150 return res; sgiseeq_devinit() 198 struct resource res; sgi_ds1286_devinit() local 200 memset(&res, 0, sizeof(res)); sgi_ds1286_devinit() 201 res.start = HPC3_CHIP0_BASE + offsetof(struct hpc3_regs, rtcregs); sgi_ds1286_devinit() 202 res.end = res.start + sizeof(hpc3c0->rtcregs) - 1; sgi_ds1286_devinit() 203 res.flags = IORESOURCE_MEM; sgi_ds1286_devinit() 206 &res, 1)); sgi_ds1286_devinit()
|
/linux-4.1.27/arch/m68k/lib/ |
H A D | uaccess.c | 13 unsigned long tmp, res; __generic_copy_from_user() local 55 : "=d" (res), "+a" (from), "+a" (to), "=&d" (tmp) __generic_copy_from_user() 58 return res; __generic_copy_from_user() 65 unsigned long tmp, res; __generic_copy_to_user() local 99 : "=d" (res), "+a" (from), "+a" (to), "=&d" (tmp) __generic_copy_to_user() 102 return res; __generic_copy_to_user() 112 unsigned long res; __clear_user() local 143 : "=d" (res), "+a" (to) __clear_user() 146 return res; __clear_user()
|
/linux-4.1.27/arch/arm/mach-mvebu/ |
H A D | cpu-reset.c | 44 struct resource res; mvebu_cpu_reset_map() local 46 if (of_address_to_resource(np, res_idx, &res)) { mvebu_cpu_reset_map() 51 if (!request_mem_region(res.start, resource_size(&res), mvebu_cpu_reset_map() 57 cpu_reset_base = ioremap(res.start, resource_size(&res)); mvebu_cpu_reset_map() 60 release_mem_region(res.start, resource_size(&res)); mvebu_cpu_reset_map() 64 cpu_reset_size = resource_size(&res); mvebu_cpu_reset_map()
|
/linux-4.1.27/drivers/acpi/ |
H A D | ioapic.c | 35 struct resource res; member in struct:acpi_pci_ioapic 45 struct resource *res = data; setup_res() local 48 res->flags = 0; setup_res() 52 if (!acpi_dev_resource_memory(acpi_res, res)) { setup_res() 55 *res = win.res; setup_res() 57 if ((res->flags & IORESOURCE_PREFETCH) || setup_res() 58 (res->flags & IORESOURCE_DISABLED)) setup_res() 59 res->flags = 0; setup_res() 100 struct resource *res = NULL; handle_ioapic_add() local 140 res = &dev->resource[0]; handle_ioapic_add() 146 res = &ioapic->res; handle_ioapic_add() 147 acpi_walk_resources(handle, METHOD_NAME__CRS, setup_res, res); handle_ioapic_add() 148 if (res->flags == 0) { handle_ioapic_add() 151 } else if (request_resource(&iomem_resource, res)) { handle_ioapic_add() 157 if (acpi_register_ioapic(handle, res->start, (u32)gsi_base)) { handle_ioapic_add() 167 type, res, (u32)gsi_base); handle_ioapic_add() 170 type, res, (u32)gsi_base); handle_ioapic_add() 178 release_resource(res); handle_ioapic_add() 220 } else if (ioapic->res.flags && ioapic->res.parent) { acpi_ioapic_remove() 221 release_resource(&ioapic->res); acpi_ioapic_remove()
|
H A D | resource.c | 57 static void acpi_dev_memresource_flags(struct resource *res, u64 len, acpi_dev_memresource_flags() argument 60 res->flags = IORESOURCE_MEM; acpi_dev_memresource_flags() 62 if (!acpi_dev_resource_len_valid(res->start, res->end, len, false)) acpi_dev_memresource_flags() 63 res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_memresource_flags() 66 res->flags |= IORESOURCE_MEM_WRITEABLE; acpi_dev_memresource_flags() 69 static void acpi_dev_get_memresource(struct resource *res, u64 start, u64 len, acpi_dev_get_memresource() argument 72 res->start = start; acpi_dev_get_memresource() 73 res->end = start + len - 1; acpi_dev_get_memresource() 74 acpi_dev_memresource_flags(res, len, write_protect); acpi_dev_get_memresource() 80 * @res: Output generic resource object. 84 * resource object pointed to by @res. 87 * 1) false with res->flags setting to zero: not the expected resource type 88 * 2) false with IORESOURCE_DISABLED in res->flags: valid unassigned resource 91 bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) acpi_dev_resource_memory() argument 100 acpi_dev_get_memresource(res, memory24->minimum << 8, acpi_dev_resource_memory() 106 acpi_dev_get_memresource(res, memory32->minimum, acpi_dev_resource_memory() 112 acpi_dev_get_memresource(res, fixed_memory32->address, acpi_dev_resource_memory() 117 res->flags = 0; acpi_dev_resource_memory() 121 return !(res->flags & IORESOURCE_DISABLED); acpi_dev_resource_memory() 125 static void acpi_dev_ioresource_flags(struct resource *res, u64 len, acpi_dev_ioresource_flags() argument 128 res->flags = IORESOURCE_IO; acpi_dev_ioresource_flags() 130 if (!acpi_dev_resource_len_valid(res->start, res->end, len, true)) acpi_dev_ioresource_flags() 131 res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_ioresource_flags() 133 if (res->end >= 0x10003) acpi_dev_ioresource_flags() 134 res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_ioresource_flags() 137 res->flags |= IORESOURCE_IO_16BIT_ADDR; acpi_dev_ioresource_flags() 140 static void acpi_dev_get_ioresource(struct resource *res, u64 start, u64 len, acpi_dev_get_ioresource() argument 143 res->start = start; acpi_dev_get_ioresource() 144 res->end = start + len - 1; acpi_dev_get_ioresource() 145 acpi_dev_ioresource_flags(res, len, io_decode); acpi_dev_get_ioresource() 151 * @res: Output generic resource object. 155 * resource object pointed to by @res. 158 * 1) false with res->flags setting to zero: not the expected resource type 159 * 2) false with IORESOURCE_DISABLED in res->flags: valid unassigned resource 162 bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) acpi_dev_resource_io() argument 170 acpi_dev_get_ioresource(res, io->minimum, acpi_dev_resource_io() 176 acpi_dev_get_ioresource(res, fixed_io->address, acpi_dev_resource_io() 181 res->flags = 0; acpi_dev_resource_io() 185 return !(res->flags & IORESOURCE_DISABLED); acpi_dev_resource_io() 197 struct resource *res = &win->res; acpi_decode_space() local 224 res->start = start; acpi_decode_space() 225 res->end = end; acpi_decode_space() 227 (offset != win->offset || start != res->start || end != res->end)) { acpi_decode_space() 235 acpi_dev_memresource_flags(res, len, wp); acpi_decode_space() 238 acpi_dev_ioresource_flags(res, len, iodec); acpi_decode_space() 241 res->flags = IORESOURCE_BUS; acpi_decode_space() 248 res->flags |= IORESOURCE_WINDOW; acpi_decode_space() 251 res->flags |= IORESOURCE_PREFETCH; acpi_decode_space() 253 return !(res->flags & IORESOURCE_DISABLED); acpi_decode_space() 266 * 1) false with win->res.flags setting to zero: not the expected resource type 267 * 2) false with IORESOURCE_DISABLED in win->res.flags: valid unassigned 276 win->res.flags = 0; acpi_dev_resource_address_space() 295 * 1) false with win->res.flags setting to zero: not the expected resource type 296 * 2) false with IORESOURCE_DISABLED in win->res.flags: valid unassigned 305 win->res.flags = 0; acpi_dev_resource_ext_address_space() 340 static void acpi_dev_irqresource_disabled(struct resource *res, u32 gsi) acpi_dev_irqresource_disabled() argument 342 res->start = gsi; acpi_dev_irqresource_disabled() 343 res->end = gsi; acpi_dev_irqresource_disabled() 344 res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_irqresource_disabled() 347 static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, acpi_dev_get_irqresource() argument 354 acpi_dev_irqresource_disabled(res, gsi); acpi_dev_get_irqresource() 380 res->flags = acpi_dev_irq_flags(triggering, polarity, shareable); acpi_dev_get_irqresource() 383 res->start = irq; acpi_dev_get_irqresource() 384 res->end = irq; acpi_dev_get_irqresource() 386 acpi_dev_irqresource_disabled(res, gsi); acpi_dev_get_irqresource() 394 * @res: Output generic resource object. 401 * to by @res accordingly. If the registration of the GSI is not successful, 405 * 1) false with res->flags setting to zero: not the expected resource type 406 * 2) false with IORESOURCE_DISABLED in res->flags: valid unassigned resource 410 struct resource *res) acpi_dev_resource_interrupt() 423 acpi_dev_irqresource_disabled(res, 0); acpi_dev_resource_interrupt() 426 acpi_dev_get_irqresource(res, irq->interrupts[index], acpi_dev_resource_interrupt() 433 acpi_dev_irqresource_disabled(res, 0); acpi_dev_resource_interrupt() 436 acpi_dev_get_irqresource(res, ext_irq->interrupts[index], acpi_dev_resource_interrupt() 441 res->flags = 0; acpi_dev_resource_interrupt() 477 *rentry->res = win->res; acpi_dev_new_resource_entry() 489 struct resource *res = &win.res; acpi_dev_process_resource() local 506 if (acpi_dev_resource_memory(ares, res) acpi_dev_process_resource() 507 || acpi_dev_resource_io(ares, res) acpi_dev_process_resource() 512 for (i = 0; acpi_dev_resource_interrupt(ares, i, res); i++) { acpi_dev_process_resource() 409 acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, struct resource *res) acpi_dev_resource_interrupt() argument
|
/linux-4.1.27/arch/m68k/include/asm/ |
H A D | uaccess_mm.h | 60 #define __put_user_asm(res, x, ptr, bwl, reg, err) \ 75 : "+d" (res), "=m" (*(ptr)) \ 131 #define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \ 147 : "+d" (res), "=&" #reg (__gu_val) \ 205 #define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\ 235 : "+d" (res), "+&a" (to), "+a" (from), "=&d" (tmp) \ 241 unsigned long res = 0, tmp; __constant_copy_from_user() local 245 __get_user_asm(res, *(u8 *)to, (u8 __user *)from, u8, b, d, 1); __constant_copy_from_user() 248 __get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w, r, 2); __constant_copy_from_user() 251 __constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,); __constant_copy_from_user() 254 __get_user_asm(res, *(u32 *)to, (u32 __user *)from, u32, l, r, 4); __constant_copy_from_user() 257 __constant_copy_from_user_asm(res, to, from, tmp, 5, l, b,); __constant_copy_from_user() 260 __constant_copy_from_user_asm(res, to, from, tmp, 6, l, w,); __constant_copy_from_user() 263 __constant_copy_from_user_asm(res, to, from, tmp, 7, l, w, b); __constant_copy_from_user() 266 __constant_copy_from_user_asm(res, to, from, tmp, 8, l, l,); __constant_copy_from_user() 269 __constant_copy_from_user_asm(res, to, from, tmp, 9, l, l, b); __constant_copy_from_user() 272 __constant_copy_from_user_asm(res, to, from, tmp, 10, l, l, w); __constant_copy_from_user() 275 __constant_copy_from_user_asm(res, to, from, tmp, 12, l, l, l); __constant_copy_from_user() 282 return res; __constant_copy_from_user() 285 #define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3) \ 316 : "+d" (res), "+a" (to), "+a" (from), "=&d" (tmp) \ 322 unsigned long res = 0, tmp; __constant_copy_to_user() local 326 __put_user_asm(res, *(u8 *)from, (u8 __user *)to, b, d, 1); __constant_copy_to_user() 329 __put_user_asm(res, *(u16 *)from, (u16 __user *)to, w, r, 2); __constant_copy_to_user() 332 __constant_copy_to_user_asm(res, to, from, tmp, 3, w, b,); __constant_copy_to_user() 335 __put_user_asm(res, *(u32 *)from, (u32 __user *)to, l, r, 4); __constant_copy_to_user() 338 __constant_copy_to_user_asm(res, to, from, tmp, 5, l, b,); __constant_copy_to_user() 341 __constant_copy_to_user_asm(res, to, from, tmp, 6, l, w,); __constant_copy_to_user() 344 __constant_copy_to_user_asm(res, to, from, tmp, 7, l, w, b); __constant_copy_to_user() 347 __constant_copy_to_user_asm(res, to, from, tmp, 8, l, l,); __constant_copy_to_user() 350 __constant_copy_to_user_asm(res, to, from, tmp, 9, l, l, b); __constant_copy_to_user() 353 __constant_copy_to_user_asm(res, to, from, tmp, 10, l, l, w); __constant_copy_to_user() 356 __constant_copy_to_user_asm(res, to, from, tmp, 12, l, l, l); __constant_copy_to_user() 363 return res; __constant_copy_to_user()
|
H A D | string.h | 44 char res; strcmp() local 55 : "+a" (cs), "+a" (ct), "=d" (res)); strcmp() 56 return res; strcmp()
|
/linux-4.1.27/drivers/scsi/ |
H A D | a4000t.c | 36 struct resource *res; amiga_a4000t_scsi_probe() local 41 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); amiga_a4000t_scsi_probe() 42 if (!res) amiga_a4000t_scsi_probe() 45 if (!request_mem_region(res->start, resource_size(res), amiga_a4000t_scsi_probe() 56 scsi_addr = res->start + A4000T_SCSI_OFFSET; amiga_a4000t_scsi_probe() 93 release_mem_region(res->start, resource_size(res)); amiga_a4000t_scsi_probe() 101 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); amiga_a4000t_scsi_remove() local 107 release_mem_region(res->start, resource_size(res)); amiga_a4000t_scsi_remove()
|
H A D | ps3rom.c | 101 int res; ps3rom_atapi_request() local 138 res = lv1_storage_send_device_command(dev->sbd.dev_id, ps3rom_atapi_request() 143 if (res == LV1_DENIED_BY_POLICY) { ps3rom_atapi_request() 150 if (res) { ps3rom_atapi_request() 153 __LINE__, opcode, res); ps3rom_atapi_request() 175 int res; ps3rom_read_request() local 180 res = lv1_storage_read(dev->sbd.dev_id, ps3rom_read_request() 183 if (res) { ps3rom_read_request() 185 __LINE__, res); ps3rom_read_request() 196 int res; ps3rom_write_request() local 203 res = lv1_storage_write(dev->sbd.dev_id, ps3rom_write_request() 206 if (res) { ps3rom_write_request() 208 __LINE__, res); ps3rom_write_request() 221 int res; ps3rom_queuecommand_lck() local 234 res = ps3rom_read_request(dev, cmd, srb10_lba(cmd), ps3rom_queuecommand_lck() 239 res = ps3rom_write_request(dev, cmd, srb10_lba(cmd), ps3rom_queuecommand_lck() 244 res = ps3rom_atapi_request(dev, cmd); ps3rom_queuecommand_lck() 248 if (res) { ps3rom_queuecommand_lck() 250 cmd->result = res; ps3rom_queuecommand_lck() 280 int res; ps3rom_interrupt() local 284 res = lv1_storage_get_async_status(dev->sbd.dev_id, &tag, &status); ps3rom_interrupt() 296 if (res) { ps3rom_interrupt() 297 dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n", ps3rom_interrupt() 298 __func__, __LINE__, res, status); ps3rom_interrupt()
|
/linux-4.1.27/arch/mn10300/lib/ |
H A D | usercopy.c | 33 #define __do_strncpy_from_user(dst, src, count, res) \ 63 :"=&r"(res), "=r"(count), "=&r"(w) \ 71 long res; __strncpy_from_user() local 72 __do_strncpy_from_user(dst, src, count, res); __strncpy_from_user() 73 return res; __strncpy_from_user() 79 long res = -EFAULT; strncpy_from_user() local 81 __do_strncpy_from_user(dst, src, count, res); strncpy_from_user() 82 return res; strncpy_from_user() 137 unsigned long res, w; strnlen_user() local 162 :"=d"(res), "=&r"(w) strnlen_user() 165 return res; strnlen_user()
|
/linux-4.1.27/net/mac802154/ |
H A D | mib.c | 92 int res; mac802154_dev_set_page_channel() local 96 res = drv_set_channel(local, page, chan); mac802154_dev_set_page_channel() 97 if (res) { mac802154_dev_set_page_channel() 111 int res; mac802154_get_params() local 116 res = mac802154_llsec_get_params(&sdata->sec, params); mac802154_get_params() 119 return res; mac802154_get_params() 127 int res; mac802154_set_params() local 132 res = mac802154_llsec_set_params(&sdata->sec, params, changed); mac802154_set_params() 135 return res; mac802154_set_params() 143 int res; mac802154_add_key() local 148 res = mac802154_llsec_key_add(&sdata->sec, id, key); mac802154_add_key() 151 return res; mac802154_add_key() 158 int res; mac802154_del_key() local 163 res = mac802154_llsec_key_del(&sdata->sec, id); mac802154_del_key() 166 return res; mac802154_del_key() 173 int res; mac802154_add_dev() local 178 res = mac802154_llsec_dev_add(&sdata->sec, llsec_dev); mac802154_add_dev() 181 return res; mac802154_add_dev() 187 int res; mac802154_del_dev() local 192 res = mac802154_llsec_dev_del(&sdata->sec, dev_addr); mac802154_del_dev() 195 return res; mac802154_del_dev() 203 int res; mac802154_add_devkey() local 208 res = mac802154_llsec_devkey_add(&sdata->sec, device_addr, key); mac802154_add_devkey() 211 return res; mac802154_add_devkey() 219 int res; mac802154_del_devkey() local 224 res = mac802154_llsec_devkey_del(&sdata->sec, device_addr, key); mac802154_del_devkey() 227 return res; mac802154_del_devkey() 234 int res; mac802154_add_seclevel() local 239 res = mac802154_llsec_seclevel_add(&sdata->sec, sl); mac802154_add_seclevel() 242 return res; mac802154_add_seclevel() 249 int res; mac802154_del_seclevel() local 254 res = mac802154_llsec_seclevel_del(&sdata->sec, sl); mac802154_del_seclevel() 257 return res; mac802154_del_seclevel()
|
/linux-4.1.27/drivers/infiniband/hw/usnic/ |
H A D | usnic_vnic.c | 82 struct usnic_vnic_res *res; usnic_vnic_dump() local 106 res = chunk->res[j]; usnic_vnic_dump() 109 usnic_vnic_res_type_to_str(res->type), usnic_vnic_dump() 110 res->vnic_idx, res->ctrl, !!res->owner); usnic_vnic_dump() 112 offset += printrow(res->owner, buf + offset, usnic_vnic_dump() 222 struct usnic_vnic_res *res; usnic_vnic_get_resources() local 235 ret->res = kzalloc(sizeof(*(ret->res))*cnt, GFP_ATOMIC); usnic_vnic_get_resources() 236 if (!ret->res) { usnic_vnic_get_resources() 246 res = src->res[i]; usnic_vnic_get_resources() 247 if (!res->owner) { usnic_vnic_get_resources() 249 res->owner = owner; usnic_vnic_get_resources() 250 ret->res[ret->cnt++] = res; usnic_vnic_get_resources() 265 struct usnic_vnic_res *res; usnic_vnic_put_resources() local 271 res = chunk->res[i]; usnic_vnic_put_resources() 272 chunk->res[i] = NULL; usnic_vnic_put_resources() 273 res->owner = NULL; usnic_vnic_put_resources() 274 vnic->chunks[res->type].free_cnt++; usnic_vnic_put_resources() 278 kfree(chunk->res); usnic_vnic_put_resources() 292 struct usnic_vnic_res *res; usnic_vnic_alloc_res_chunk() local 299 chunk->res = kzalloc(sizeof(*(chunk->res))*cnt, GFP_KERNEL); usnic_vnic_alloc_res_chunk() 300 if (!chunk->res) usnic_vnic_alloc_res_chunk() 304 res = kzalloc(sizeof(*res), GFP_KERNEL); usnic_vnic_alloc_res_chunk() 305 if (!res) { usnic_vnic_alloc_res_chunk() 309 res->type = type; usnic_vnic_alloc_res_chunk() 310 res->vnic_idx = i; usnic_vnic_alloc_res_chunk() 311 res->vnic = vnic; usnic_vnic_alloc_res_chunk() 312 res->ctrl = vnic_dev_get_res(vnic->vdev, usnic_vnic_alloc_res_chunk() 314 chunk->res[i] = res; usnic_vnic_alloc_res_chunk() 321 kfree(chunk->res[i]); usnic_vnic_alloc_res_chunk() 322 kfree(chunk->res); usnic_vnic_alloc_res_chunk() 330 kfree(chunk->res[i]); usnic_vnic_free_res_chunk() 331 kfree(chunk->res); usnic_vnic_free_res_chunk() 369 usnic_err("Failed to alloc res %s with err %d\n", usnic_vnic_discover_resources()
|
/linux-4.1.27/arch/arm/boot/compressed/ |
H A D | string.c | 71 int res = 0; memcmp() local 74 res = *su1++ - *su2++; memcmp() 75 if (res) memcmp() 78 return res; memcmp() 84 int res = 0; strcmp() local 89 res = c1 - c2; strcmp() 90 if (res) strcmp() 93 return res; strcmp()
|
/linux-4.1.27/drivers/i2c/busses/ |
H A D | i2c-pxa-pci.c | 24 struct resource res[2]; add_i2c_device() local 30 memset(&res, 0, sizeof(res)); add_i2c_device() 32 res[0].flags = IORESOURCE_MEM; add_i2c_device() 33 res[0].start = pci_resource_start(dev, bar); add_i2c_device() 34 res[0].end = pci_resource_end(dev, bar); add_i2c_device() 36 res[1].flags = IORESOURCE_IRQ; add_i2c_device() 37 res[1].start = dev->irq; add_i2c_device() 38 res[1].end = dev->irq; add_i2c_device() 48 if (r.start != res[0].start) add_i2c_device() 50 if (r.end != res[0].end) add_i2c_device() 52 if (r.flags != res[0].flags) add_i2c_device() 78 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); add_i2c_device()
|
/linux-4.1.27/drivers/scsi/aic94xx/ |
H A D | aic94xx_tmf.c | 40 int res; asd_enqueue_internal() local 51 res = asd_post_ascb_list(ascb->ha, ascb, 1); asd_enqueue_internal() 52 if (unlikely(res)) asd_enqueue_internal() 54 return res; asd_enqueue_internal() 103 int res; \ 108 res = 1; \ 109 ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); \ 120 res = asd_enqueue_internal(ascb, asd_clear_nexus_tasklet_complete, \ 122 if (res) \ 126 res = tcs.dl_opcode; \ 127 if (res == TC_NO_ERROR) \ 128 res = TMF_RESP_FUNC_COMPLETE; \ 129 return res; \ 132 return res 183 int res, tmp_res, i; asd_I_T_nexus_reset() local 194 res = sas_phy_reset(phy, reset_type); asd_I_T_nexus_reset() 195 if (res == TMF_RESP_FUNC_COMPLETE || res == -ENODEV) { asd_I_T_nexus_reset() 214 res = TMF_RESP_FUNC_FAILED; asd_I_T_nexus_reset() 217 return res; asd_I_T_nexus_reset() 290 int res = TMF_RESP_FUNC_FAILED; asd_get_tmf_resp_tasklet() local 301 return res; asd_get_tmf_resp_tasklet() 308 res = ru->status; asd_get_tmf_resp_tasklet() 310 res = ru->resp_data[3]; asd_get_tmf_resp_tasklet() 317 return res; asd_get_tmf_resp_tasklet() 345 int res = TMF_RESP_FUNC_FAILED; asd_clear_nexus() local 355 res = asd_clear_nexus_tag(task); asd_clear_nexus() 357 res = asd_clear_nexus_index(task); asd_clear_nexus() 364 res = TMF_RESP_FUNC_FAILED; asd_clear_nexus() 366 res = TMF_RESP_FUNC_COMPLETE; asd_clear_nexus() 369 return res; asd_clear_nexus() 409 int res = 1; asd_abort_task() local 423 res = TMF_RESP_FUNC_COMPLETE; asd_abort_task() 429 ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); asd_abort_task() 474 res = asd_enqueue_internal(ascb, asd_tmf_tasklet_complete, asd_abort_task() 476 if (res) asd_abort_task() 487 res = TMF_RESP_FUNC_COMPLETE; asd_abort_task() 497 res = asd_clear_nexus(task); asd_abort_task() 499 res = tcs.tmf_state; asd_abort_task() 503 res = TMF_RESP_FUNC_FAILED; asd_abort_task() 511 res = asd_clear_nexus(task); asd_abort_task() 520 res = TMF_RESP_INVALID_FRAME; asd_abort_task() 523 res = TMF_RESP_FUNC_FAILED; asd_abort_task() 529 res = TMF_RESP_FUNC_FAILED; asd_abort_task() 531 res = TMF_RESP_FUNC_COMPLETE; asd_abort_task() 537 res = TMF_RESP_FUNC_COMPLETE; asd_abort_task() 540 res = TMF_RESP_FUNC_ESUPP; asd_abort_task() 546 if (res == TMF_RESP_FUNC_COMPLETE) { asd_abort_task() 551 ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res); asd_abort_task() 552 return res; asd_abort_task() 556 ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res); asd_abort_task() 557 return res; asd_abort_task() 580 int res = 1; asd_initiate_ssp_tmf() local 588 ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); asd_initiate_ssp_tmf() 622 res = asd_enqueue_internal(ascb, asd_tmf_tasklet_complete, asd_initiate_ssp_tmf() 624 if (res) asd_initiate_ssp_tmf() 630 res = TMF_RESP_FUNC_COMPLETE; asd_initiate_ssp_tmf() 633 res = TMF_RESP_INVALID_FRAME; asd_initiate_ssp_tmf() 636 res = TMF_RESP_FUNC_FAILED; asd_initiate_ssp_tmf() 641 res = TMF_RESP_FUNC_COMPLETE; asd_initiate_ssp_tmf() 644 res = TMF_RESP_FUNC_ESUPP; asd_initiate_ssp_tmf() 648 res = tcs.dl_opcode; asd_initiate_ssp_tmf() 651 return res; asd_initiate_ssp_tmf() 654 return res; asd_initiate_ssp_tmf() 659 int res = asd_initiate_ssp_tmf(dev, lun, TMF_ABORT_TASK_SET, 0); asd_abort_task_set() local 661 if (res == TMF_RESP_FUNC_COMPLETE) asd_abort_task_set() 663 return res; asd_abort_task_set() 668 int res = asd_initiate_ssp_tmf(dev, lun, TMF_CLEAR_ACA, 0); asd_clear_aca() local 670 if (res == TMF_RESP_FUNC_COMPLETE) asd_clear_aca() 672 return res; asd_clear_aca() 677 int res = asd_initiate_ssp_tmf(dev, lun, TMF_CLEAR_TASK_SET, 0); asd_clear_task_set() local 679 if (res == TMF_RESP_FUNC_COMPLETE) asd_clear_task_set() 681 return res; asd_clear_task_set() 686 int res = asd_initiate_ssp_tmf(dev, lun, TMF_LU_RESET, 0); asd_lu_reset() local 688 if (res == TMF_RESP_FUNC_COMPLETE) asd_lu_reset() 690 return res; asd_lu_reset()
|
/linux-4.1.27/drivers/scsi/libsas/ |
H A D | sas_expander.c | 70 int res, retry; smp_execute_task() local 78 res = -ECOMM; smp_execute_task() 84 res = -ENOMEM; smp_execute_task() 99 res = i->dft->lldd_execute_task(task, GFP_KERNEL); smp_execute_task() 101 if (res) { smp_execute_task() 103 SAS_DPRINTK("executing SMP task failed:%d\n", res); smp_execute_task() 108 res = -ECOMM; smp_execute_task() 119 res = 0; smp_execute_task() 126 res = task->task_status.residual; smp_execute_task() 131 res = -EMSGSIZE; smp_execute_task() 151 return res; smp_execute_task() 375 int res; sas_ex_phy_discover_helper() local 379 res = smp_execute_task(dev, disc_req, DISCOVER_REQ_SIZE, sas_ex_phy_discover_helper() 381 if (res) sas_ex_phy_discover_helper() 382 return res; sas_ex_phy_discover_helper() 395 int res = 0; sas_ex_phy_discover() local 412 res = sas_ex_phy_discover_helper(dev, disc_req, disc_resp, single); sas_ex_phy_discover() 417 res = sas_ex_phy_discover_helper(dev, disc_req, sas_ex_phy_discover() 419 if (res) sas_ex_phy_discover() 426 return res; sas_ex_phy_discover() 432 int res = -ENOMEM; sas_expander_discover() local 438 res = sas_ex_phy_discover(dev, -1); sas_expander_discover() 439 if (res) sas_expander_discover() 446 return res; sas_expander_discover() 472 int res; sas_ex_general() local 488 res = smp_execute_task(dev, rg_req, RG_REQ_SIZE, rg_resp, sas_ex_general() 491 if (res) { sas_ex_general() 493 SAS_ADDR(dev->sas_addr), res); sas_ex_general() 498 res = rg_resp->result; sas_ex_general() 514 return res; sas_ex_general() 544 int res; sas_ex_manuf_info() local 558 res = smp_execute_task(dev, mi_req, MI_REQ_SIZE, mi_resp,MI_RESP_SIZE); sas_ex_manuf_info() 559 if (res) { sas_ex_manuf_info() 561 SAS_ADDR(dev->sas_addr), res); sas_ex_manuf_info() 573 return res; sas_ex_manuf_info() 585 int res; sas_smp_phy_control() local 605 res = smp_execute_task(dev, pc_req, PC_REQ_SIZE, pc_resp,PC_RESP_SIZE); sas_smp_phy_control() 609 return res; sas_smp_phy_control() 656 int res; sas_smp_get_phy_events() local 675 res = smp_execute_task(dev, req, RPEL_REQ_SIZE, sas_smp_get_phy_events() 678 if (!res) sas_smp_get_phy_events() 688 return res; sas_smp_get_phy_events() 700 int res; sas_get_report_phy_sata() local 710 res = smp_execute_task(dev, rps_req, RPS_REQ_SIZE, sas_get_report_phy_sata() 718 if (!res && resp[27] == 0x34 && resp[24] != 0x34) { sas_get_report_phy_sata() 734 return res; sas_get_report_phy_sata() 779 int res; sas_ex_discover_end_dev() local 808 res = sas_get_ata_info(child, phy); sas_ex_discover_end_dev() 809 if (res) sas_ex_discover_end_dev() 813 res = sas_ata_init(child); sas_ex_discover_end_dev() 814 if (res) sas_ex_discover_end_dev() 825 res = sas_discover_sata(child); sas_ex_discover_end_dev() 826 if (res) { sas_ex_discover_end_dev() 830 SAS_ADDR(parent->sas_addr), phy_id, res); sas_ex_discover_end_dev() 850 res = sas_discover_end_dev(child); sas_ex_discover_end_dev() 851 if (res) { sas_ex_discover_end_dev() 855 SAS_ADDR(parent->sas_addr), phy_id, res); sas_ex_discover_end_dev() 915 int res; sas_ex_discover_expander() local 971 res = sas_discover_expander(child); sas_ex_discover_expander() 972 if (res) { sas_ex_discover_expander() 989 int res = 0; sas_ex_discover_dev() local 994 res = sas_ex_phy_discover(dev, phy_id); sas_ex_discover_dev() 995 if (res) sas_ex_discover_dev() 996 return res; sas_ex_discover_dev() 1036 res = sas_configure_routing(dev, ex_phy->attached_sas_addr); sas_ex_discover_dev() 1037 if (res) { sas_ex_discover_dev() 1040 SAS_ADDR(ex_phy->attached_sas_addr), res); sas_ex_discover_dev() 1042 return res; sas_ex_discover_dev() 1048 return res; sas_ex_discover_dev() 1099 return res; sas_ex_discover_dev() 1171 int res = 0; sas_ex_discover_devices() local 1192 res = sas_ex_discover_dev(dev, i); sas_ex_discover_devices() 1193 if (res) sas_ex_discover_devices() 1199 if (!res) sas_ex_discover_devices() 1202 return res; sas_ex_discover_devices() 1272 int res = 0; sas_check_eeds() local 1276 res = -ENODEV; sas_check_eeds() 1300 res = -ENODEV; sas_check_eeds() 1309 return res; sas_check_eeds() 1319 int res = 0; sas_check_parent_topology() local 1349 res = -ENODEV; sas_check_parent_topology() 1353 res = sas_check_eeds(child, parent_phy, child_phy); sas_check_parent_topology() 1356 res = -ENODEV; sas_check_parent_topology() 1365 res = -ENODEV; sas_check_parent_topology() 1373 res = -ENODEV; sas_check_parent_topology() 1381 return res; sas_check_parent_topology() 1390 int i, res = 0; sas_configure_present() local 1414 res = smp_execute_task(dev, rri_req, RRI_REQ_SIZE, rri_resp, sas_configure_present() 1416 if (res) sas_configure_present() 1418 res = rri_resp[2]; sas_configure_present() 1419 if (res == SMP_RESP_NO_INDEX) { sas_configure_present() 1424 } else if (res != SMP_RESP_FUNC_ACC) { sas_configure_present() 1427 SAS_ADDR(dev->sas_addr), phy_id, i, res); sas_configure_present() 1451 res = -1; sas_configure_present() 1455 return res; sas_configure_present() 1464 int res; sas_configure_set() local 1485 res = smp_execute_task(dev, cri_req, CRI_REQ_SIZE, cri_resp, sas_configure_set() 1487 if (res) sas_configure_set() 1489 res = cri_resp[2]; sas_configure_set() 1490 if (res == SMP_RESP_NO_INDEX) { sas_configure_set() 1498 return res; sas_configure_set() 1506 int res; sas_configure_phy() local 1508 res = sas_configure_present(dev, phy_id, sas_addr, &index, &present); sas_configure_phy() 1509 if (res) sas_configure_phy() 1510 return res; sas_configure_phy() 1514 return res; sas_configure_phy() 1528 int res = 0; sas_configure_parent() local 1532 res = sas_configure_parent(parent->parent, parent, sas_addr, sas_configure_parent() 1534 if (res) sas_configure_parent() 1535 return res; sas_configure_parent() 1550 res = sas_configure_phy(parent, i, sas_addr, include); sas_configure_parent() 1551 if (res) sas_configure_parent() 1552 return res; sas_configure_parent() 1556 return res; sas_configure_parent() 1586 int res; sas_discover_expander() local 1588 res = sas_notify_lldd_dev_found(dev); sas_discover_expander() 1589 if (res) sas_discover_expander() 1590 return res; sas_discover_expander() 1592 res = sas_ex_general(dev); sas_discover_expander() 1593 if (res) sas_discover_expander() 1595 res = sas_ex_manuf_info(dev); sas_discover_expander() 1596 if (res) sas_discover_expander() 1599 res = sas_expander_discover(dev); sas_discover_expander() 1600 if (res) { sas_discover_expander() 1602 SAS_ADDR(dev->sas_addr), res); sas_discover_expander() 1607 res = sas_check_parent_topology(dev); sas_discover_expander() 1608 if (res) sas_discover_expander() 1613 return res; sas_discover_expander() 1618 int res = 0; sas_ex_level_discovery() local 1628 res = sas_ex_discover_devices(dev, -1); sas_ex_level_discovery() 1630 res = sas_ex_discover_devices(port->port_dev, -1); sas_ex_level_discovery() 1635 return res; sas_ex_level_discovery() 1640 int res; sas_ex_bfs_disc() local 1645 res = sas_ex_level_discovery(port, level); sas_ex_bfs_disc() 1649 return res; sas_ex_bfs_disc() 1654 int res; sas_discover_root_expander() local 1657 res = sas_rphy_add(dev->rphy); sas_discover_root_expander() 1658 if (res) sas_discover_root_expander() 1662 res = sas_discover_expander(dev); sas_discover_root_expander() 1663 if (res) sas_discover_root_expander() 1668 return res; sas_discover_root_expander() 1673 return res; sas_discover_root_expander() 1681 int res; sas_get_phy_discover() local 1691 res = smp_execute_task(dev, disc_req, DISCOVER_REQ_SIZE, sas_get_phy_discover() 1693 if (res) sas_get_phy_discover() 1696 res = disc_resp->result; sas_get_phy_discover() 1701 return res; sas_get_phy_discover() 1707 int res; sas_get_phy_change_count() local 1714 res = sas_get_phy_discover(dev, phy_id, disc_resp); sas_get_phy_change_count() 1715 if (!res) sas_get_phy_change_count() 1719 return res; sas_get_phy_change_count() 1725 int res; sas_get_phy_attached_dev() local 1734 res = sas_get_phy_discover(dev, phy_id, disc_resp); sas_get_phy_attached_dev() 1735 if (res == 0) { sas_get_phy_attached_dev() 1742 return res; sas_get_phy_attached_dev() 1749 int res = 0; sas_find_bcast_phy() local 1755 res = sas_get_phy_change_count(dev, i, &phy_change_count); sas_find_bcast_phy() 1756 switch (res) { sas_find_bcast_phy() 1763 return res; sas_find_bcast_phy() 1779 int res; sas_get_ex_change_count() local 1795 res = smp_execute_task(dev, rg_req, RG_REQ_SIZE, rg_resp, sas_get_ex_change_count() 1797 if (res) sas_get_ex_change_count() 1800 res = rg_resp->result; sas_get_ex_change_count() 1808 return res; sas_get_ex_change_count() 1831 int res; sas_find_bcast_dev() local 1834 res = sas_get_ex_change_count(dev, &ex_change_count); sas_find_bcast_dev() 1835 if (res) sas_find_bcast_dev() 1842 res = sas_find_bcast_phy(dev, &phy_id, 0, false); sas_find_bcast_dev() 1847 return res; sas_find_bcast_dev() 1853 res = sas_find_bcast_dev(ch, src_dev); sas_find_bcast_dev() 1855 return res; sas_find_bcast_dev() 1859 return res; sas_find_bcast_dev() 1916 int res = 0; sas_discover_bfs_by_root_level() local 1925 res = sas_discover_bfs_by_root_level(child, sas_discover_bfs_by_root_level() 1928 res = sas_ex_discover_devices(child, -1); sas_discover_bfs_by_root_level() 1931 return res; sas_discover_bfs_by_root_level() 1936 int res; sas_discover_bfs_by_root() local 1940 res = sas_ex_discover_devices(dev, -1); sas_discover_bfs_by_root() 1941 if (res) sas_discover_bfs_by_root() 1944 res = sas_discover_bfs_by_root_level(dev, level); sas_discover_bfs_by_root() 1949 return res; sas_discover_bfs_by_root() 1956 int res; sas_discover_new() local 1960 res = sas_ex_phy_discover(dev, phy_id); sas_discover_new() 1961 if (res) sas_discover_new() 1962 return res; sas_discover_new() 1967 res = sas_ex_discover_devices(dev, phy_id); sas_discover_new() 1968 if (res) sas_discover_new() 1969 return res; sas_discover_new() 1975 res = sas_discover_bfs_by_root(child); sas_discover_new() 1979 return res; sas_discover_new() 2003 int res; sas_rediscover_dev() local 2006 res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type); sas_rediscover_dev() 2007 switch (res) { sas_rediscover_dev() 2011 return res; sas_rediscover_dev() 2015 return res; sas_rediscover_dev() 2021 return res; sas_rediscover_dev() 2024 if ((SAS_ADDR(sas_addr) == 0) || (res == -ECOMM)) { sas_rediscover_dev() 2027 return res; sas_rediscover_dev() 2039 return res; sas_rediscover_dev() 2072 int res = 0; sas_rediscover() local 2093 res = sas_rediscover_dev(dev, phy_id, last); sas_rediscover() 2095 res = sas_discover_new(dev, phy_id); sas_rediscover() 2096 return res; sas_rediscover() 2110 int res; sas_ex_revalidate_domain() local 2113 res = sas_find_bcast_dev(port_dev, &dev); sas_ex_revalidate_domain() 2114 while (res == 0 && dev) { sas_ex_revalidate_domain() 2120 res = sas_find_bcast_phy(dev, &phy_id, i, true); sas_ex_revalidate_domain() 2123 res = sas_rediscover(dev, phy_id); sas_ex_revalidate_domain() 2128 res = sas_find_bcast_dev(port_dev, &dev); sas_ex_revalidate_domain() 2130 return res; sas_ex_revalidate_domain()
|
/linux-4.1.27/arch/powerpc/platforms/52xx/ |
H A D | mpc52xx_pci.c | 241 struct resource *res; mpc52xx_pci_setup() local 258 res = &hose->mem_resources[0]; mpc52xx_pci_setup() 259 if (res->flags) { mpc52xx_pci_setup() 262 (unsigned long long)res->start, mpc52xx_pci_setup() 263 (unsigned long long)res->end, mpc52xx_pci_setup() 264 (unsigned long long)res->flags); mpc52xx_pci_setup() 266 MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, mpc52xx_pci_setup() 267 resource_size(res))); mpc52xx_pci_setup() 269 if (res->flags & IORESOURCE_PREFETCH) mpc52xx_pci_setup() 275 res = &hose->mem_resources[1]; mpc52xx_pci_setup() 276 if (res->flags) { mpc52xx_pci_setup() 278 res->start, res->end, res->flags); mpc52xx_pci_setup() 280 MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, mpc52xx_pci_setup() 281 resource_size(res))); mpc52xx_pci_setup() 283 if (res->flags & IORESOURCE_PREFETCH) mpc52xx_pci_setup() 290 res = &hose->io_resource; mpc52xx_pci_setup() 291 if (!res) { mpc52xx_pci_setup() 297 (unsigned long long)res->start, mpc52xx_pci_setup() 298 (unsigned long long)res->end, mpc52xx_pci_setup() 299 (unsigned long long)res->flags, (void*)hose->io_base_phys); mpc52xx_pci_setup() 302 res->start, mpc52xx_pci_setup() 303 resource_size(res))); mpc52xx_pci_setup() 345 struct resource *res = &dev->resource[i]; mpc52xx_pci_fixup_resources() local 346 if (res->end > res->start) { /* Only valid resources */ mpc52xx_pci_fixup_resources() 347 res->end -= res->start; mpc52xx_pci_fixup_resources() 348 res->start = 0; mpc52xx_pci_fixup_resources() 349 res->flags |= IORESOURCE_UNSET; mpc52xx_pci_fixup_resources() 358 struct resource *res = &dev->resource[1]; mpc52xx_pci_fixup_resources() local 359 res->start = res->end = res->flags = 0; mpc52xx_pci_fixup_resources()
|
/linux-4.1.27/arch/x86/lib/ |
H A D | string_32.c | 97 int res; strcmp() local 108 : "=a" (res), "=&S" (d0), "=&D" (d1) strcmp() 111 return res; strcmp() 119 int res; strncmp() local 133 : "=a" (res), "=&S" (d0), "=&D" (d1), "=&c" (d2) strncmp() 136 return res; strncmp() 145 char *res; strchr() local 155 : "=a" (res), "=&S" (d0) strchr() 158 return res; strchr() 167 size_t res; strlen() local 170 : "=c" (res), "=&D" (d0) strlen() 173 return ~res - 1; strlen() 182 void *res; memchr() local 190 : "=D" (res), "=&c" (d0) memchr() 193 return res; memchr() 219 int res; strnlen() local 229 : "=a" (res), "=&d" (d0) strnlen() 232 return res; strnlen()
|
H A D | csum-partial_64.c | 71 asm("addq 0*8(%[src]),%[res]\n\t" do_csum() 72 "adcq 1*8(%[src]),%[res]\n\t" do_csum() 73 "adcq 2*8(%[src]),%[res]\n\t" do_csum() 74 "adcq 3*8(%[src]),%[res]\n\t" do_csum() 75 "adcq 4*8(%[src]),%[res]\n\t" do_csum() 76 "adcq 5*8(%[src]),%[res]\n\t" do_csum() 77 "adcq 6*8(%[src]),%[res]\n\t" do_csum() 78 "adcq 7*8(%[src]),%[res]\n\t" do_csum() 79 "adcq %[zero],%[res]" do_csum() 80 : [res] "=r" (result) do_csum() 82 "[res]" (result)); do_csum()
|
/linux-4.1.27/fs/nfs/ |
H A D | nfs42xdr.c | 140 static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) decode_allocate() argument 145 static int decode_deallocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) decode_deallocate() argument 150 static int decode_seek(struct xdr_stream *xdr, struct nfs42_seek_res *res) decode_seek() argument 163 res->sr_eof = be32_to_cpup(p++); decode_seek() 164 p = xdr_decode_hyper(p, &res->sr_offset); decode_seek() 177 struct nfs42_falloc_res *res) nfs4_xdr_dec_allocate() 185 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_allocate() 191 status = decode_allocate(xdr, res); nfs4_xdr_dec_allocate() 194 decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); nfs4_xdr_dec_allocate() 204 struct nfs42_falloc_res *res) nfs4_xdr_dec_deallocate() 212 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_deallocate() 218 status = decode_deallocate(xdr, res); nfs4_xdr_dec_deallocate() 221 decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); nfs4_xdr_dec_deallocate() 231 struct nfs42_seek_res *res) nfs4_xdr_dec_seek() 239 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_seek() 245 status = decode_seek(xdr, res); nfs4_xdr_dec_seek() 175 nfs4_xdr_dec_allocate(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_falloc_res *res) nfs4_xdr_dec_allocate() argument 202 nfs4_xdr_dec_deallocate(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_falloc_res *res) nfs4_xdr_dec_deallocate() argument 229 nfs4_xdr_dec_seek(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_seek_res *res) nfs4_xdr_dec_seek() argument
|
H A D | callback_proc.c | 25 struct cb_getattrres *res, nfs4_callback_getattr() 32 res->status = htonl(NFS4ERR_OP_NOT_IN_SESSION); nfs4_callback_getattr() 36 res->bitmap[0] = res->bitmap[1] = 0; nfs4_callback_getattr() 37 res->status = htonl(NFS4ERR_BADHANDLE); nfs4_callback_getattr() 50 res->size = i_size_read(inode); nfs4_callback_getattr() 51 res->change_attr = delegation->change_attr; nfs4_callback_getattr() 53 res->change_attr++; nfs4_callback_getattr() 54 res->ctime = inode->i_ctime; nfs4_callback_getattr() 55 res->mtime = inode->i_mtime; nfs4_callback_getattr() 56 res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & nfs4_callback_getattr() 58 res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & nfs4_callback_getattr() 60 res->status = 0; nfs4_callback_getattr() 65 dprintk("%s: exit with status = %d\n", __func__, ntohl(res->status)); nfs4_callback_getattr() 66 return res->status; nfs4_callback_getattr() 73 __be32 res; nfs4_callback_recall() local 75 res = htonl(NFS4ERR_OP_NOT_IN_SESSION); nfs4_callback_recall() 82 res = htonl(NFS4ERR_BADHANDLE); nfs4_callback_recall() 89 res = 0; nfs4_callback_recall() 92 res = htonl(NFS4ERR_BAD_STATEID); nfs4_callback_recall() 95 res = htonl(NFS4ERR_RESOURCE); nfs4_callback_recall() 97 trace_nfs4_recall_delegation(inode, -ntohl(res)); nfs4_callback_recall() 100 dprintk("%s: exit with status = %d\n", __func__, ntohl(res)); nfs4_callback_recall() 101 return res; nfs4_callback_recall() 219 u32 res; do_callback_layoutrecall() local 223 res = initiate_file_draining(clp, args); do_callback_layoutrecall() 225 res = initiate_bulk_draining(clp, args); do_callback_layoutrecall() 226 dprintk("%s returning %i\n", __func__, res); do_callback_layoutrecall() 227 return res; do_callback_layoutrecall() 234 u32 res; nfs4_callback_layoutrecall() local 239 res = do_callback_layoutrecall(cps->clp, args); nfs4_callback_layoutrecall() 241 res = NFS4ERR_OP_NOT_IN_SESSION; nfs4_callback_layoutrecall() 243 dprintk("%s: exit with status = %d\n", __func__, res); nfs4_callback_layoutrecall() 244 return cpu_to_be32(res); nfs4_callback_layoutrecall() 262 __be32 res = 0; nfs4_callback_devicenotify() local 269 res = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION); nfs4_callback_devicenotify() 298 __func__, be32_to_cpu(res)); nfs4_callback_devicenotify() 299 return res; nfs4_callback_devicenotify() 417 struct cb_sequenceres *res, nfs4_callback_sequence() 464 memcpy(&res->csr_sessionid, &args->csa_sessionid, nfs4_callback_sequence() 465 sizeof(res->csr_sessionid)); nfs4_callback_sequence() 466 res->csr_sequenceid = args->csa_sequenceid; nfs4_callback_sequence() 467 res->csr_slotid = args->csa_slotid; nfs4_callback_sequence() 468 res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; nfs4_callback_sequence() 469 res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; nfs4_callback_sequence() 481 res->csr_status = status; nfs4_callback_sequence() 483 trace_nfs4_cb_sequence(args, res, status); nfs4_callback_sequence() 484 dprintk("%s: exit with status = %d res->csr_status %d\n", __func__, nfs4_callback_sequence() 485 ntohl(status), ntohl(res->csr_status)); nfs4_callback_sequence() 24 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res, struct cb_process_state *cps) nfs4_callback_getattr() argument 416 nfs4_callback_sequence(struct cb_sequenceargs *args, struct cb_sequenceres *res, struct cb_process_state *cps) nfs4_callback_sequence() argument
|
H A D | nfs3proc.c | 33 int res; nfs3_rpc_wrapper() local 35 res = rpc_call_sync(clnt, msg, flags); nfs3_rpc_wrapper() 36 if (res != -EJUKEBOX) nfs3_rpc_wrapper() 39 res = -ERESTARTSYS; nfs3_rpc_wrapper() 41 return res; nfs3_rpc_wrapper() 156 struct nfs3_diropres res = { nfs3_proc_lookup() local 163 .rpc_resp = &res, nfs3_proc_lookup() 168 res.dir_attr = nfs_alloc_fattr(); nfs3_proc_lookup() 169 if (res.dir_attr == NULL) nfs3_proc_lookup() 174 nfs_refresh_inode(dir, res.dir_attr); nfs3_proc_lookup() 181 nfs_free_fattr(res.dir_attr); nfs3_proc_lookup() 191 struct nfs3_accessres res; nfs3_proc_access() local 195 .rpc_resp = &res, nfs3_proc_access() 217 res.fattr = nfs_alloc_fattr(); nfs3_proc_access() 218 if (res.fattr == NULL) nfs3_proc_access() 222 nfs_refresh_inode(inode, res.fattr); nfs3_proc_access() 225 if (res.access & NFS3_ACCESS_READ) nfs3_proc_access() 227 if (res.access & (NFS3_ACCESS_MODIFY | NFS3_ACCESS_EXTEND | NFS3_ACCESS_DELETE)) nfs3_proc_access() 229 if (res.access & (NFS3_ACCESS_LOOKUP|NFS3_ACCESS_EXECUTE)) nfs3_proc_access() 232 nfs_free_fattr(res.fattr); nfs3_proc_access() 276 struct nfs3_diropres res; member in struct:nfs3_createdata 289 data->msg.rpc_resp = &data->res; nfs3_alloc_createdata() 290 data->res.fh = &data->fh; nfs3_alloc_createdata() 291 data->res.fattr = &data->fattr; nfs3_alloc_createdata() 292 data->res.dir_attr = &data->dir_attr; nfs3_alloc_createdata() 293 nfs_fattr_init(data->res.fattr); nfs3_alloc_createdata() 294 nfs_fattr_init(data->res.dir_attr); nfs3_alloc_createdata() 304 nfs_post_op_update_inode(dir, data->res.dir_attr); nfs3_do_create() 306 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, NULL); nfs3_do_create() 368 nfs_fattr_init(data->res.dir_attr); nfs3_proc_create() 369 nfs_fattr_init(data->res.fattr); nfs3_proc_create() 388 status = nfs3_proc_setattr(dentry, data->res.fattr, sattr); nfs3_proc_create() 389 nfs_post_op_update_inode(d_inode(dentry), data->res.fattr); nfs3_proc_create() 413 struct nfs_removeres res; nfs3_proc_remove() local 417 .rpc_resp = &res, nfs3_proc_remove() 422 res.dir_attr = nfs_alloc_fattr(); nfs3_proc_remove() 423 if (res.dir_attr == NULL) nfs3_proc_remove() 427 nfs_post_op_update_inode(dir, res.dir_attr); nfs3_proc_remove() 428 nfs_free_fattr(res.dir_attr); nfs3_proc_remove() 448 struct nfs_removeres *res; nfs3_proc_unlink_done() local 451 res = task->tk_msg.rpc_resp; nfs3_proc_unlink_done() 452 nfs_post_op_update_inode(dir, res->dir_attr); nfs3_proc_unlink_done() 471 struct nfs_renameres *res; nfs3_proc_rename_done() local 475 res = task->tk_msg.rpc_resp; nfs3_proc_rename_done() 477 nfs_post_op_update_inode(old_dir, res->old_fattr); nfs3_proc_rename_done() 478 nfs_post_op_update_inode(new_dir, res->new_fattr); nfs3_proc_rename_done() 491 struct nfs3_linkres res; nfs3_proc_link() local 495 .rpc_resp = &res, nfs3_proc_link() 500 res.fattr = nfs_alloc_fattr(); nfs3_proc_link() 501 res.dir_attr = nfs_alloc_fattr(); nfs3_proc_link() 502 if (res.fattr == NULL || res.dir_attr == NULL) nfs3_proc_link() 506 nfs_post_op_update_inode(dir, res.dir_attr); nfs3_proc_link() 507 nfs_post_op_update_inode(inode, res.fattr); nfs3_proc_link() 509 nfs_free_fattr(res.dir_attr); nfs3_proc_link() 510 nfs_free_fattr(res.fattr); nfs3_proc_link() 636 struct nfs3_readdirres res = { nfs3_proc_readdir() local 643 .rpc_resp = &res, nfs3_proc_readdir() 654 res.dir_attr = nfs_alloc_fattr(); nfs3_proc_readdir() 655 if (res.dir_attr == NULL) nfs3_proc_readdir() 661 nfs_refresh_inode(dir, res.dir_attr); nfs3_proc_readdir() 663 nfs_free_fattr(res.dir_attr); nfs3_proc_readdir() 859 nfs_refresh_inode(data->inode, data->res.fattr); nfs3_commit_done()
|
H A D | nfs42proc.c | 46 struct nfs42_falloc_res res = { _nfs42_proc_fallocate() local 52 msg->rpc_resp = &res; _nfs42_proc_fallocate() 58 res.falloc_fattr = nfs_alloc_fattr(); _nfs42_proc_fallocate() 59 if (!res.falloc_fattr) _nfs42_proc_fallocate() 63 &args.seq_args, &res.seq_res, 0); _nfs42_proc_fallocate() 65 status = nfs_post_op_update_inode(inode, res.falloc_fattr); _nfs42_proc_fallocate() 67 kfree(res.falloc_fattr); _nfs42_proc_fallocate() 142 struct nfs42_seek_res res; nfs42_proc_llseek() local 146 .rpc_resp = &res, nfs42_proc_llseek() 160 &args.seq_args, &res.seq_res, 0); nfs42_proc_llseek() 166 return vfs_setpos(filep, res.sr_offset, inode->i_sb->s_maxbytes); nfs42_proc_llseek()
|
H A D | nfs3acl.c | 23 struct nfs3_getaclres res = { nfs3_get_acl() local 28 .rpc_resp = &res, nfs3_get_acl() 54 res.fattr = nfs_alloc_fattr(); nfs3_get_acl() 55 if (res.fattr == NULL) nfs3_get_acl() 67 status = nfs_refresh_inode(inode, res.fattr); nfs3_get_acl() 78 if ((args.mask & res.mask) != args.mask) { nfs3_get_acl() 83 if (res.acl_access != NULL) { nfs3_get_acl() 84 if ((posix_acl_equiv_mode(res.acl_access, NULL) == 0) || nfs3_get_acl() 85 res.acl_access->a_count == 0) { nfs3_get_acl() 86 posix_acl_release(res.acl_access); nfs3_get_acl() 87 res.acl_access = NULL; nfs3_get_acl() 91 if (res.mask & NFS_ACL) nfs3_get_acl() 92 set_cached_acl(inode, ACL_TYPE_ACCESS, res.acl_access); nfs3_get_acl() 96 if (res.mask & NFS_DFACL) nfs3_get_acl() 97 set_cached_acl(inode, ACL_TYPE_DEFAULT, res.acl_default); nfs3_get_acl() 101 nfs_free_fattr(res.fattr); nfs3_get_acl() 103 posix_acl_release(res.acl_default); nfs3_get_acl() 104 return res.acl_access; nfs3_get_acl() 106 posix_acl_release(res.acl_access); nfs3_get_acl() 107 return res.acl_default; nfs3_get_acl() 111 posix_acl_release(res.acl_access); nfs3_get_acl() 112 posix_acl_release(res.acl_default); nfs3_get_acl() 113 nfs_free_fattr(res.fattr); nfs3_get_acl()
|
H A D | nfs4xdr.c | 3258 static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_link_support() argument 3262 *res = 0; decode_attr_link_support() 3269 *res = be32_to_cpup(p); decode_attr_link_support() 3272 dprintk("%s: link support=%s\n", __func__, *res == 0 ? "false" : "true"); decode_attr_link_support() 3279 static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_symlink_support() argument 3283 *res = 0; decode_attr_symlink_support() 3290 *res = be32_to_cpup(p); decode_attr_symlink_support() 3293 dprintk("%s: symlink support=%s\n", __func__, *res == 0 ? "false" : "true"); decode_attr_symlink_support() 3327 static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_lease_time() argument 3331 *res = 60; decode_attr_lease_time() 3338 *res = be32_to_cpup(p); decode_attr_lease_time() 3341 dprintk("%s: file size=%u\n", __func__, (unsigned int)*res); decode_attr_lease_time() 3348 static int decode_attr_error(struct xdr_stream *xdr, uint32_t *bitmap, int32_t *res) decode_attr_error() argument 3359 *res = -be32_to_cpup(p); decode_attr_error() 3399 static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_aclsupport() argument 3403 *res = 0; decode_attr_aclsupport() 3410 *res = be32_to_cpup(p); decode_attr_aclsupport() 3413 dprintk("%s: ACLs supported=%u\n", __func__, (unsigned int)*res); decode_attr_aclsupport() 3466 static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_files_avail() argument 3471 *res = 0; decode_attr_files_avail() 3478 xdr_decode_hyper(p, res); decode_attr_files_avail() 3481 dprintk("%s: files avail=%Lu\n", __func__, (unsigned long long)*res); decode_attr_files_avail() 3488 static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_files_free() argument 3493 *res = 0; decode_attr_files_free() 3500 xdr_decode_hyper(p, res); decode_attr_files_free() 3503 dprintk("%s: files free=%Lu\n", __func__, (unsigned long long)*res); decode_attr_files_free() 3510 static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_files_total() argument 3515 *res = 0; decode_attr_files_total() 3522 xdr_decode_hyper(p, res); decode_attr_files_total() 3525 dprintk("%s: files total=%Lu\n", __func__, (unsigned long long)*res); decode_attr_files_total() 3577 static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res) decode_attr_fs_locations() argument 3590 if (unlikely(res == NULL)) decode_attr_fs_locations() 3593 status = decode_pathname(xdr, &res->fs_path); decode_attr_fs_locations() 3602 for (res->nlocations = 0; res->nlocations < n; res->nlocations++) { decode_attr_fs_locations() 3606 if (res->nlocations == NFS4_FS_LOCATIONS_MAXENTRIES) decode_attr_fs_locations() 3608 loc = &res->locations[res->nlocations]; decode_attr_fs_locations() 3624 m, res->nlocations); decode_attr_fs_locations() 3644 if (res->nlocations != 0) decode_attr_fs_locations() 3656 static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_maxfilesize() argument 3661 *res = 0; decode_attr_maxfilesize() 3668 xdr_decode_hyper(p, res); decode_attr_maxfilesize() 3671 dprintk("%s: maxfilesize=%Lu\n", __func__, (unsigned long long)*res); decode_attr_maxfilesize() 3722 static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_maxread() argument 3727 *res = 1024; decode_attr_maxread() 3738 *res = (uint32_t)maxread; decode_attr_maxread() 3741 dprintk("%s: maxread=%lu\n", __func__, (unsigned long)*res); decode_attr_maxread() 3748 static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_maxwrite() argument 3753 *res = 1024; decode_attr_maxwrite() 3764 *res = (uint32_t)maxwrite; decode_attr_maxwrite() 3767 dprintk("%s: maxwrite=%lu\n", __func__, (unsigned long)*res); decode_attr_maxwrite() 3938 static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_space_avail() argument 3943 *res = 0; decode_attr_space_avail() 3950 xdr_decode_hyper(p, res); decode_attr_space_avail() 3953 dprintk("%s: space avail=%Lu\n", __func__, (unsigned long long)*res); decode_attr_space_avail() 3960 static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_space_free() argument 3965 *res = 0; decode_attr_space_free() 3972 xdr_decode_hyper(p, res); decode_attr_space_free() 3975 dprintk("%s: space free=%Lu\n", __func__, (unsigned long long)*res); decode_attr_space_free() 3982 static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_space_total() argument 3987 *res = 0; decode_attr_space_total() 3994 xdr_decode_hyper(p, res); decode_attr_space_total() 3997 dprintk("%s: space total=%Lu\n", __func__, (unsigned long long)*res); decode_attr_space_total() 4242 static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res) decode_close() argument 4248 nfs_increment_open_seqid(status, res->seqid); decode_close() 4250 status = decode_stateid(xdr, &res->stateid); decode_close() 4264 static int decode_commit(struct xdr_stream *xdr, struct nfs_commitres *res) decode_commit() argument 4270 status = decode_write_verifier(xdr, &res->verf->verifier); decode_commit() 4297 static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_res *res) decode_server_caps() argument 4309 if ((status = decode_attr_supported(xdr, bitmap, res->attr_bitmask)) != 0) decode_server_caps() 4312 &res->fh_expire_type)) != 0) decode_server_caps() 4314 if ((status = decode_attr_link_support(xdr, bitmap, &res->has_links)) != 0) decode_server_caps() 4316 if ((status = decode_attr_symlink_support(xdr, bitmap, &res->has_symlinks)) != 0) decode_server_caps() 4318 if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0) decode_server_caps() 4384 uint64_t *res, decode_threshold_hint() 4389 *res = 0; decode_threshold_hint() 4394 xdr_decode_hyper(p, res); decode_threshold_hint() 4403 struct nfs4_threshold *res) decode_first_threshold_item4() 4416 res->l_type = be32_to_cpup(p); decode_first_threshold_item4() 4428 status = decode_threshold_hint(xdr, bitmap, &res->rd_sz, THRESHOLD_RD); decode_first_threshold_item4() 4431 status = decode_threshold_hint(xdr, bitmap, &res->wr_sz, THRESHOLD_WR); decode_first_threshold_item4() 4434 status = decode_threshold_hint(xdr, bitmap, &res->rd_io_sz, decode_first_threshold_item4() 4438 status = decode_threshold_hint(xdr, bitmap, &res->wr_io_sz, decode_first_threshold_item4() 4444 res->bm = bitmap[0]; decode_first_threshold_item4() 4447 __func__, res->bm, res->rd_sz, res->wr_sz, res->rd_io_sz, decode_first_threshold_item4() 4448 res->wr_io_sz); decode_first_threshold_item4() 4459 struct nfs4_threshold *res) decode_attr_mdsthreshold() 4469 if (unlikely(res == NULL)) decode_attr_mdsthreshold() 4482 status = decode_first_threshold_item4(xdr, res); decode_attr_mdsthreshold() 4716 uint32_t *res) decode_attr_layout_blksize() 4721 *res = 0; decode_attr_layout_blksize() 4728 *res = be32_to_cpup(p); decode_attr_layout_blksize() 4850 static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res) decode_lock() argument 4858 status = decode_stateid(xdr, &res->stateid); decode_lock() 4863 if (res->open_seqid != NULL) decode_lock() 4864 nfs_increment_open_seqid(status, res->open_seqid); decode_lock() 4865 nfs_increment_lock_seqid(status, res->lock_seqid); decode_lock() 4870 static int decode_lockt(struct xdr_stream *xdr, struct nfs_lockt_res *res) decode_lockt() argument 4875 return decode_lock_denied(xdr, res->denied); decode_lockt() 4879 static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res) decode_locku() argument 4885 nfs_increment_lock_seqid(status, res->seqid); decode_locku() 4887 status = decode_stateid(xdr, &res->stateid); decode_locku() 4928 struct nfs_openres *res) decode_rw_delegation() 4933 status = decode_stateid(xdr, &res->delegation); decode_rw_delegation() 4939 res->do_recall = be32_to_cpup(p); decode_rw_delegation() 4943 res->delegation_type = FMODE_READ; decode_rw_delegation() 4946 res->delegation_type = FMODE_WRITE|FMODE_READ; decode_rw_delegation() 4947 if (decode_space_limit(xdr, &res->maxsize) < 0) decode_rw_delegation() 4950 return decode_ace(xdr, NULL, res->server->nfs_client); decode_rw_delegation() 4956 static int decode_no_delegation(struct xdr_stream *xdr, struct nfs_openres *res) decode_no_delegation() argument 4977 static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res) decode_delegation() argument 4986 res->delegation_type = 0; decode_delegation() 4992 return decode_rw_delegation(xdr, delegation_type, res); decode_delegation() 4994 return decode_no_delegation(xdr, res); decode_delegation() 5002 static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res) decode_open() argument 5010 nfs_increment_open_seqid(status, res->seqid); decode_open() 5013 status = decode_stateid(xdr, &res->stateid); decode_open() 5017 decode_change_info(xdr, &res->cinfo); decode_open() 5022 res->rflags = be32_to_cpup(p++); decode_open() 5032 res->attrset[i] = be32_to_cpup(p++); decode_open() 5034 res->attrset[i] = 0; decode_open() 5036 return decode_delegation(xdr, res); decode_open() 5045 static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res) decode_open_confirm() argument 5051 nfs_increment_open_seqid(status, res->seqid); decode_open_confirm() 5053 status = decode_stateid(xdr, &res->stateid); decode_open_confirm() 5057 static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res) decode_open_downgrade() argument 5063 nfs_increment_open_seqid(status, res->seqid); decode_open_downgrade() 5065 status = decode_stateid(xdr, &res->stateid); decode_open_downgrade() 5080 struct nfs_pgio_res *res) decode_read() 5101 res->eof = eof; decode_read() 5102 res->count = count; decode_read() 5204 struct nfs_getaclres *res) decode_getacl() 5212 res->acl_len = 0; decode_getacl() 5233 res->acl_data_offset = xdr_stream_pos(xdr) - pg_offset; decode_getacl() 5234 res->acl_len = attrlen; decode_getacl() 5237 if (res->acl_len > (xdr->nwords << 2) || decode_getacl() 5238 res->acl_len + res->acl_data_offset > xdr->buf->page_len) { decode_getacl() 5239 res->acl_flags |= NFS4_ACL_TRUNC; decode_getacl() 5277 static int decode_setclientid(struct xdr_stream *xdr, struct nfs4_setclientid_res *res) decode_setclientid() argument 5297 p = xdr_decode_hyper(p, &res->clientid); decode_setclientid() 5298 memcpy(res->confirm.data, p, NFS4_VERIFIER_SIZE); decode_setclientid() 5334 static int decode_write(struct xdr_stream *xdr, struct nfs_pgio_res *res) decode_write() argument 5346 res->count = be32_to_cpup(p++); decode_write() 5347 res->verf->committed = be32_to_cpup(p++); decode_write() 5348 return decode_write_verifier(xdr, &res->verf->verifier); decode_write() 5393 static int decode_secinfo_common(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) decode_secinfo_common() argument 5404 res->flavors->num_flavors = 0; decode_secinfo_common() 5408 sec_flavor = &res->flavors->flavors[i]; decode_secinfo_common() 5409 if ((char *)&sec_flavor[1] - (char *)res->flavors > PAGE_SIZE) decode_secinfo_common() 5422 res->flavors->num_flavors++; decode_secinfo_common() 5433 static int decode_secinfo(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) decode_secinfo() argument 5438 return decode_secinfo_common(xdr, res); decode_secinfo() 5442 static int decode_secinfo_no_name(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) decode_secinfo_no_name() argument 5447 return decode_secinfo_common(xdr, res); decode_secinfo_no_name() 5468 struct nfs41_exchange_id_res *res) decode_exchange_id() 5483 xdr_decode_hyper(p, &res->clientid); decode_exchange_id() 5487 res->seqid = be32_to_cpup(p++); decode_exchange_id() 5488 res->flags = be32_to_cpup(p++); decode_exchange_id() 5490 res->state_protect.how = be32_to_cpup(p); decode_exchange_id() 5491 switch (res->state_protect.how) { decode_exchange_id() 5495 status = decode_op_map(xdr, &res->state_protect.enforce); decode_exchange_id() 5498 status = decode_op_map(xdr, &res->state_protect.allow); decode_exchange_id() 5511 p = xdr_decode_hyper(p, &res->server_owner->minor_id); decode_exchange_id() 5519 memcpy(res->server_owner->major_id, dummy_str, dummy); decode_exchange_id() 5520 res->server_owner->major_id_sz = dummy; decode_exchange_id() 5528 memcpy(res->server_scope->server_scope, dummy_str, dummy); decode_exchange_id() 5529 res->server_scope->server_scope_sz = dummy; decode_exchange_id() 5544 memcpy(res->impl_id->domain, dummy_str, dummy); decode_exchange_id() 5552 memcpy(res->impl_id->name, dummy_str, dummy); decode_exchange_id() 5558 p = xdr_decode_hyper(p, &res->impl_id->date.seconds); decode_exchange_id() 5559 res->impl_id->date.nseconds = be32_to_cpup(p); decode_exchange_id() 5609 struct nfs41_bind_conn_to_session_res *res) decode_bind_conn_to_session() 5616 status = decode_sessionid(xdr, &res->sessionid); decode_bind_conn_to_session() 5625 res->dir = be32_to_cpup(p++); decode_bind_conn_to_session() 5626 if (res->dir == 0 || res->dir > NFS4_CDFS4_BOTH) decode_bind_conn_to_session() 5629 res->use_conn_in_rdma_mode = false; decode_bind_conn_to_session() 5631 res->use_conn_in_rdma_mode = true; decode_bind_conn_to_session() 5640 struct nfs41_create_session_res *res) decode_create_session() 5647 status = decode_sessionid(xdr, &res->sessionid); decode_create_session() 5655 res->seqid = be32_to_cpup(p++); decode_create_session() 5656 res->flags = be32_to_cpup(p); decode_create_session() 5659 status = decode_chan_attrs(xdr, &res->fc_attrs); decode_create_session() 5661 status = decode_chan_attrs(xdr, &res->bc_attrs); decode_create_session() 5685 struct nfs4_sequence_res *res, decode_sequence() 5695 if (res->sr_slot == NULL) decode_sequence() 5697 if (!res->sr_slot->table->session) decode_sequence() 5711 session = res->sr_slot->table->session; decode_sequence() 5725 if (dummy != res->sr_slot->seq_nr) { decode_sequence() 5731 if (dummy != res->sr_slot->slot_nr) { decode_sequence() 5736 res->sr_highest_slotid = be32_to_cpup(p++); decode_sequence() 5738 res->sr_target_highest_slotid = be32_to_cpup(p++); decode_sequence() 5740 res->sr_status_flags = be32_to_cpup(p); decode_sequence() 5743 res->sr_status = status; decode_sequence() 5756 struct nfs4_getdeviceinfo_res *res) decode_getdeviceinfo() 5758 struct pnfs_device *pdev = res->pdev; decode_getdeviceinfo() 5806 res->notification = be32_to_cpup(p++); decode_getdeviceinfo() 5822 struct nfs4_layoutget_res *res) decode_layoutget() 5835 res->return_on_close = be32_to_cpup(p); decode_layoutget() 5836 decode_stateid(xdr, &res->stateid); decode_layoutget() 5850 p = xdr_decode_hyper(p, &res->range.offset); decode_layoutget() 5851 p = xdr_decode_hyper(p, &res->range.length); decode_layoutget() 5852 res->range.iomode = be32_to_cpup(p++); decode_layoutget() 5853 res->type = be32_to_cpup(p++); decode_layoutget() 5854 res->layoutp->len = be32_to_cpup(p); decode_layoutget() 5858 (unsigned long)res->range.offset, decode_layoutget() 5859 (unsigned long)res->range.length, decode_layoutget() 5860 res->range.iomode, decode_layoutget() 5861 res->type, decode_layoutget() 5862 res->layoutp->len); decode_layoutget() 5864 recvd = xdr_read_pages(xdr, res->layoutp->len); decode_layoutget() 5865 if (res->layoutp->len > recvd) { decode_layoutget() 5868 res->layoutp->len, recvd); decode_layoutget() 5889 struct nfs4_layoutreturn_res *res) decode_layoutreturn() 5900 res->lrs_present = be32_to_cpup(p); decode_layoutreturn() 5901 if (res->lrs_present) decode_layoutreturn() 5902 status = decode_stateid(xdr, &res->stateid); decode_layoutreturn() 5911 struct nfs4_layoutcommit_res *res) decode_layoutcommit() 5918 res->status = status; decode_layoutcommit() 5940 struct nfs41_test_stateid_res *res) decode_test_stateid() 5960 res->status = be32_to_cpup(p++); decode_test_stateid() 5970 struct nfs41_free_stateid_res *res) decode_free_stateid() 5972 res->status = decode_op_hdr(xdr, OP_FREE_STATEID); decode_free_stateid() 5973 return res->status; decode_free_stateid() 5986 struct nfs_closeres *res) nfs4_xdr_dec_open_downgrade() 5994 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_open_downgrade() 6000 status = decode_open_downgrade(xdr, res); nfs4_xdr_dec_open_downgrade() 6003 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_open_downgrade() 6012 struct nfs4_accessres *res) nfs4_xdr_dec_access() 6020 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_access() 6026 status = decode_access(xdr, &res->supported, &res->access); nfs4_xdr_dec_access() 6029 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_access() 6038 struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup() 6046 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lookup() 6055 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_lookup() 6058 status = decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_lookup() 6068 struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup_root() 6076 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lookup_root() 6082 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_lookup_root() 6084 status = decode_getfattr_label(xdr, res->fattr, nfs4_xdr_dec_lookup_root() 6085 res->label, res->server); nfs4_xdr_dec_lookup_root() 6094 struct nfs_removeres *res) nfs4_xdr_dec_remove() 6102 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_remove() 6108 status = decode_remove(xdr, &res->cinfo); nfs4_xdr_dec_remove() 6117 struct nfs_renameres *res) nfs4_xdr_dec_rename() 6125 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_rename() 6137 status = decode_rename(xdr, &res->old_cinfo, &res->new_cinfo); nfs4_xdr_dec_rename() 6146 struct nfs4_link_res *res) nfs4_xdr_dec_link() 6154 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_link() 6166 status = decode_link(xdr, &res->cinfo); nfs4_xdr_dec_link() 6176 decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_link() 6185 struct nfs4_create_res *res) nfs4_xdr_dec_create() 6193 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_create() 6199 status = decode_create(xdr, &res->dir_cinfo); nfs4_xdr_dec_create() 6202 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_create() 6205 decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_create() 6214 struct nfs4_create_res *res) nfs4_xdr_dec_symlink() 6216 return nfs4_xdr_dec_create(rqstp, xdr, res); nfs4_xdr_dec_symlink() 6223 struct nfs4_getattr_res *res) nfs4_xdr_dec_getattr() 6231 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_getattr() 6237 status = decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_getattr() 6264 struct nfs_setaclres *res) nfs4_xdr_dec_setacl() 6272 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_setacl() 6288 struct nfs_getaclres *res) nfs4_xdr_dec_getacl() 6293 if (res->acl_scratch != NULL) { nfs4_xdr_dec_getacl() 6294 void *p = page_address(res->acl_scratch); nfs4_xdr_dec_getacl() 6300 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_getacl() 6306 status = decode_getacl(xdr, rqstp, res); nfs4_xdr_dec_getacl() 6316 struct nfs_closeres *res) nfs4_xdr_dec_close() 6324 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_close() 6330 status = decode_close(xdr, res); nfs4_xdr_dec_close() 6339 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_close() 6348 struct nfs_openres *res) nfs4_xdr_dec_open() 6356 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_open() 6362 status = decode_open(xdr, res); nfs4_xdr_dec_open() 6365 status = decode_getfh(xdr, &res->fh); nfs4_xdr_dec_open() 6368 if (res->access_request) nfs4_xdr_dec_open() 6369 decode_access(xdr, &res->access_supported, &res->access_result); nfs4_xdr_dec_open() 6370 decode_getfattr_label(xdr, res->f_attr, res->f_label, res->server); nfs4_xdr_dec_open() 6380 struct nfs_open_confirmres *res) nfs4_xdr_dec_open_confirm() 6391 status = decode_open_confirm(xdr, res); nfs4_xdr_dec_open_confirm() 6401 struct nfs_openres *res) nfs4_xdr_dec_open_noattr() 6409 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_open_noattr() 6415 status = decode_open(xdr, res); nfs4_xdr_dec_open_noattr() 6418 if (res->access_request) nfs4_xdr_dec_open_noattr() 6419 decode_access(xdr, &res->access_supported, &res->access_result); nfs4_xdr_dec_open_noattr() 6420 decode_getfattr(xdr, res->f_attr, res->server); nfs4_xdr_dec_open_noattr() 6430 struct nfs_setattrres *res) nfs4_xdr_dec_setattr() 6438 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_setattr() 6447 decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_setattr() 6456 struct nfs_lock_res *res) nfs4_xdr_dec_lock() 6464 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lock() 6470 status = decode_lock(xdr, res); nfs4_xdr_dec_lock() 6479 struct nfs_lockt_res *res) nfs4_xdr_dec_lockt() 6487 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lockt() 6493 status = decode_lockt(xdr, res); nfs4_xdr_dec_lockt() 6502 struct nfs_locku_res *res) nfs4_xdr_dec_locku() 6510 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_locku() 6516 status = decode_locku(xdr, res); nfs4_xdr_dec_locku() 6538 struct nfs4_readlink_res *res) nfs4_xdr_dec_readlink() 6546 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_readlink() 6561 struct nfs4_readdir_res *res) nfs4_xdr_dec_readdir() 6569 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_readdir() 6575 status = decode_readdir(xdr, rqstp, res); nfs4_xdr_dec_readdir() 6584 struct nfs_pgio_res *res) nfs4_xdr_dec_read() 6590 res->op_status = hdr.status; nfs4_xdr_dec_read() 6593 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_read() 6599 status = decode_read(xdr, rqstp, res); nfs4_xdr_dec_read() 6601 status = res->count; nfs4_xdr_dec_read() 6610 struct nfs_pgio_res *res) nfs4_xdr_dec_write() 6616 res->op_status = hdr.status; nfs4_xdr_dec_write() 6619 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_write() 6625 status = decode_write(xdr, res); nfs4_xdr_dec_write() 6628 if (res->fattr) nfs4_xdr_dec_write() 6629 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_write() 6631 status = res->count; nfs4_xdr_dec_write() 6640 struct nfs_commitres *res) nfs4_xdr_dec_commit() 6646 res->op_status = hdr.status; nfs4_xdr_dec_commit() 6649 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_commit() 6655 status = decode_commit(xdr, res); nfs4_xdr_dec_commit() 6664 struct nfs4_fsinfo_res *res) nfs4_xdr_dec_fsinfo() 6671 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_fsinfo() 6675 status = decode_fsinfo(xdr, res->fsinfo); nfs4_xdr_dec_fsinfo() 6683 struct nfs4_pathconf_res *res) nfs4_xdr_dec_pathconf() 6690 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_pathconf() 6694 status = decode_pathconf(xdr, res->pathconf); nfs4_xdr_dec_pathconf() 6702 struct nfs4_statfs_res *res) nfs4_xdr_dec_statfs() 6709 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_statfs() 6713 status = decode_statfs(xdr, res->fsstat); nfs4_xdr_dec_statfs() 6722 struct nfs4_server_caps_res *res) nfs4_xdr_dec_server_caps() 6730 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_server_caps() 6736 status = decode_server_caps(xdr, res); nfs4_xdr_dec_server_caps() 6761 struct nfs4_setclientid_res *res) nfs4_xdr_dec_setclientid() 6768 status = decode_setclientid(xdr, res); nfs4_xdr_dec_setclientid() 6792 struct nfs4_delegreturnres *res) nfs4_xdr_dec_delegreturn() 6800 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_delegreturn() 6806 status = decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_delegreturn() 6819 struct nfs4_fs_locations_res *res) nfs4_xdr_dec_fs_locations() 6827 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_fs_locations() 6833 if (res->migration) { nfs4_xdr_dec_fs_locations() 6836 &res->fs_locations->fattr, nfs4_xdr_dec_fs_locations() 6837 NULL, res->fs_locations, nfs4_xdr_dec_fs_locations() 6838 NULL, res->fs_locations->server); nfs4_xdr_dec_fs_locations() 6841 if (res->renew) nfs4_xdr_dec_fs_locations() 6849 &res->fs_locations->fattr, nfs4_xdr_dec_fs_locations() 6850 NULL, res->fs_locations, nfs4_xdr_dec_fs_locations() 6851 NULL, res->fs_locations->server); nfs4_xdr_dec_fs_locations() 6862 struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo() 6870 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_secinfo() 6876 status = decode_secinfo(xdr, res); nfs4_xdr_dec_secinfo() 6886 struct nfs4_fsid_present_res *res) nfs4_xdr_dec_fsid_present() 6894 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_fsid_present() 6900 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_fsid_present() 6903 if (res->renew) nfs4_xdr_dec_fsid_present() 6915 void *res) nfs4_xdr_dec_bind_conn_to_session() 6922 status = decode_bind_conn_to_session(xdr, res); nfs4_xdr_dec_bind_conn_to_session() 6931 void *res) nfs4_xdr_dec_exchange_id() 6938 status = decode_exchange_id(xdr, res); nfs4_xdr_dec_exchange_id() 6947 struct nfs41_create_session_res *res) nfs4_xdr_dec_create_session() 6954 status = decode_create_session(xdr, res); nfs4_xdr_dec_create_session() 6963 void *res) nfs4_xdr_dec_destroy_session() 6970 status = decode_destroy_session(xdr, res); nfs4_xdr_dec_destroy_session() 6979 void *res) nfs4_xdr_dec_destroy_clientid() 6986 status = decode_destroy_clientid(xdr, res); nfs4_xdr_dec_destroy_clientid() 6995 struct nfs4_sequence_res *res) nfs4_xdr_dec_sequence() 7002 status = decode_sequence(xdr, res, rqstp); nfs4_xdr_dec_sequence() 7011 struct nfs4_get_lease_time_res *res) nfs4_xdr_dec_get_lease_time() 7018 status = decode_sequence(xdr, &res->lr_seq_res, rqstp); nfs4_xdr_dec_get_lease_time() 7022 status = decode_fsinfo(xdr, res->lr_fsinfo); nfs4_xdr_dec_get_lease_time() 7031 struct nfs41_reclaim_complete_res *res) nfs4_xdr_dec_reclaim_complete() 7038 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_reclaim_complete() 7049 struct nfs4_getdeviceinfo_res *res) nfs4_xdr_dec_getdeviceinfo() 7057 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_getdeviceinfo() 7060 status = decode_getdeviceinfo(xdr, res); nfs4_xdr_dec_getdeviceinfo() 7070 struct nfs4_layoutget_res *res) nfs4_xdr_dec_layoutget() 7078 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutget() 7084 status = decode_layoutget(xdr, rqstp, res); nfs4_xdr_dec_layoutget() 7094 struct nfs4_layoutreturn_res *res) nfs4_xdr_dec_layoutreturn() 7102 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutreturn() 7108 status = decode_layoutreturn(xdr, res); nfs4_xdr_dec_layoutreturn() 7118 struct nfs4_layoutcommit_res *res) nfs4_xdr_dec_layoutcommit() 7126 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutcommit() 7132 status = decode_layoutcommit(xdr, rqstp, res); nfs4_xdr_dec_layoutcommit() 7135 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_layoutcommit() 7145 struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo_no_name() 7153 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_secinfo_no_name() 7159 status = decode_secinfo_no_name(xdr, res); nfs4_xdr_dec_secinfo_no_name() 7169 struct nfs41_test_stateid_res *res) nfs4_xdr_dec_test_stateid() 7177 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_test_stateid() 7180 status = decode_test_stateid(xdr, res); nfs4_xdr_dec_test_stateid() 7190 struct nfs41_free_stateid_res *res) nfs4_xdr_dec_free_stateid() 7198 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_free_stateid() 7201 status = decode_free_stateid(xdr, res); nfs4_xdr_dec_free_stateid() 4382 decode_threshold_hint(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res, uint32_t hint_bit) decode_threshold_hint() argument 4402 decode_first_threshold_item4(struct xdr_stream *xdr, struct nfs4_threshold *res) decode_first_threshold_item4() argument 4457 decode_attr_mdsthreshold(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_threshold *res) decode_attr_mdsthreshold() argument 4715 decode_attr_layout_blksize(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_layout_blksize() argument 4926 decode_rw_delegation(struct xdr_stream *xdr, uint32_t delegation_type, struct nfs_openres *res) decode_rw_delegation() argument 5079 decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_pgio_res *res) decode_read() argument 5203 decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_getaclres *res) decode_getacl() argument 5467 decode_exchange_id(struct xdr_stream *xdr, struct nfs41_exchange_id_res *res) decode_exchange_id() argument 5608 decode_bind_conn_to_session(struct xdr_stream *xdr, struct nfs41_bind_conn_to_session_res *res) decode_bind_conn_to_session() argument 5639 decode_create_session(struct xdr_stream *xdr, struct nfs41_create_session_res *res) decode_create_session() argument 5684 decode_sequence(struct xdr_stream *xdr, struct nfs4_sequence_res *res, struct rpc_rqst *rqstp) decode_sequence() argument 5755 decode_getdeviceinfo(struct xdr_stream *xdr, struct nfs4_getdeviceinfo_res *res) decode_getdeviceinfo() argument 5821 decode_layoutget(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_layoutget_res *res) decode_layoutget() argument 5888 decode_layoutreturn(struct xdr_stream *xdr, struct nfs4_layoutreturn_res *res) decode_layoutreturn() argument 5909 decode_layoutcommit(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_layoutcommit_res *res) decode_layoutcommit() argument 5939 decode_test_stateid(struct xdr_stream *xdr, struct nfs41_test_stateid_res *res) decode_test_stateid() argument 5969 decode_free_stateid(struct xdr_stream *xdr, struct nfs41_free_stateid_res *res) decode_free_stateid() argument 5984 nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_closeres *res) nfs4_xdr_dec_open_downgrade() argument 6011 nfs4_xdr_dec_access(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_accessres *res) nfs4_xdr_dec_access() argument 6037 nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup() argument 6066 nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup_root() argument 6093 nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_removeres *res) nfs4_xdr_dec_remove() argument 6116 nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_renameres *res) nfs4_xdr_dec_rename() argument 6145 nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_link_res *res) nfs4_xdr_dec_link() argument 6184 nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_create_res *res) nfs4_xdr_dec_create() argument 6213 nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_create_res *res) nfs4_xdr_dec_symlink() argument 6222 nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_getattr_res *res) nfs4_xdr_dec_getattr() argument 6263 nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_setaclres *res) nfs4_xdr_dec_setacl() argument 6287 nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_getaclres *res) nfs4_xdr_dec_getacl() argument 6315 nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_closeres *res) nfs4_xdr_dec_close() argument 6347 nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_openres *res) nfs4_xdr_dec_open() argument 6378 nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_open_confirmres *res) nfs4_xdr_dec_open_confirm() argument 6399 nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_openres *res) nfs4_xdr_dec_open_noattr() argument 6428 nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_setattrres *res) nfs4_xdr_dec_setattr() argument 6455 nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_lock_res *res) nfs4_xdr_dec_lock() argument 6478 nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_lockt_res *res) nfs4_xdr_dec_lockt() argument 6501 nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_locku_res *res) nfs4_xdr_dec_locku() argument 6536 nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_readlink_res *res) nfs4_xdr_dec_readlink() argument 6560 nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_readdir_res *res) nfs4_xdr_dec_readdir() argument 6583 nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_pgio_res *res) nfs4_xdr_dec_read() argument 6609 nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_pgio_res *res) nfs4_xdr_dec_write() argument 6639 nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_commitres *res) nfs4_xdr_dec_commit() argument 6663 nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_fsinfo_res *res) nfs4_xdr_dec_fsinfo() argument 6682 nfs4_xdr_dec_pathconf(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_pathconf_res *res) nfs4_xdr_dec_pathconf() argument 6701 nfs4_xdr_dec_statfs(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_statfs_res *res) nfs4_xdr_dec_statfs() argument 6720 nfs4_xdr_dec_server_caps(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_server_caps_res *res) nfs4_xdr_dec_server_caps() argument 6759 nfs4_xdr_dec_setclientid(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_setclientid_res *res) nfs4_xdr_dec_setclientid() argument 6790 nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_delegreturnres *res) nfs4_xdr_dec_delegreturn() argument 6817 nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_fs_locations_res *res) nfs4_xdr_dec_fs_locations() argument 6860 nfs4_xdr_dec_secinfo(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo() argument 6884 nfs4_xdr_dec_fsid_present(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_fsid_present_res *res) nfs4_xdr_dec_fsid_present() argument 6913 nfs4_xdr_dec_bind_conn_to_session(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_bind_conn_to_session() argument 6929 nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_exchange_id() argument 6945 nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs41_create_session_res *res) nfs4_xdr_dec_create_session() argument 6961 nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_destroy_session() argument 6977 nfs4_xdr_dec_destroy_clientid(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_destroy_clientid() argument 6993 nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_sequence_res *res) nfs4_xdr_dec_sequence() argument 7009 nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_get_lease_time_res *res) nfs4_xdr_dec_get_lease_time() argument 7029 nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs41_reclaim_complete_res *res) nfs4_xdr_dec_reclaim_complete() argument 7047 nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_getdeviceinfo_res *res) nfs4_xdr_dec_getdeviceinfo() argument 7068 nfs4_xdr_dec_layoutget(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_layoutget_res *res) nfs4_xdr_dec_layoutget() argument 7092 nfs4_xdr_dec_layoutreturn(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_layoutreturn_res *res) nfs4_xdr_dec_layoutreturn() argument 7116 nfs4_xdr_dec_layoutcommit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_layoutcommit_res *res) nfs4_xdr_dec_layoutcommit() argument 7143 nfs4_xdr_dec_secinfo_no_name(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo_no_name() argument 7167 nfs4_xdr_dec_test_stateid(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs41_test_stateid_res *res) nfs4_xdr_dec_test_stateid() argument 7188 nfs4_xdr_dec_free_stateid(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs41_free_stateid_res *res) nfs4_xdr_dec_free_stateid() argument
|
/linux-4.1.27/drivers/net/ethernet/cisco/enic/ |
H A D | enic_clsf.c | 22 int res; enic_addfltr_5t() local 43 res = vnic_dev_classifier(enic->vdev, CLSF_ADD, &rq, &data); enic_addfltr_5t() 45 res = (res == 0) ? rq : res; enic_addfltr_5t() 47 return res; enic_addfltr_5t() 128 bool res; enic_flow_may_expire() local 139 res = rps_may_expire_flow(enic->netdev, n->rq_id, hlist_for_each_entry_safe() 141 if (res) { hlist_for_each_entry_safe() 142 res = enic_delfltr(enic, n->fltr_id); hlist_for_each_entry_safe() 143 if (unlikely(res)) hlist_for_each_entry_safe() 177 int res, i; enic_rx_flow_steer() local 180 res = skb_flow_dissect(skb, &keys); enic_rx_flow_steer() 181 if (!res || keys.n_proto != htons(ETH_P_IP) || enic_rx_flow_steer() 191 res = -EEXIST; enic_rx_flow_steer() 209 res = enic_delfltr(enic, n->fltr_id); enic_rx_flow_steer() 210 if (unlikely(res < 0)) enic_rx_flow_steer() 212 res = enic_addfltr_5t(enic, &keys, rxq_index); enic_rx_flow_steer() 213 if (res < 0) { enic_rx_flow_steer() 222 res = enic_addfltr_5t(enic, &keys, rxq_index); enic_rx_flow_steer() 223 if (res < 0) { enic_rx_flow_steer() 247 n->fltr_id = res; enic_rx_flow_steer() 254 res = -EBUSY; enic_rx_flow_steer() 260 res = -ENOMEM; enic_rx_flow_steer() 265 res = enic_addfltr_5t(enic, &keys, rxq_index); enic_rx_flow_steer() 266 if (res < 0) { enic_rx_flow_steer() 272 n->fltr_id = res; enic_rx_flow_steer() 281 return res; enic_rx_flow_steer()
|
/linux-4.1.27/arch/xtensa/include/uapi/asm/ |
H A D | swab.h | 21 __u32 res; __arch_swab32() local 28 : "=&a" (res) __arch_swab32() 31 return res; __arch_swab32() 51 * Declaring the temporary variables 'res' and 'tmp' to be 32-bit __arch_swab16() 56 __u32 res; __arch_swab16() local 62 : "=&a" (res), "=&a" (tmp) __arch_swab16() 66 return res; __arch_swab16()
|
/linux-4.1.27/arch/mips/alchemy/common/ |
H A D | platform.c | 219 struct resource *res; alchemy_setup_usb() local 223 if (_new_usbres(&res, &pdev)) alchemy_setup_usb() 226 res[0].start = alchemy_ohci_data[ctype][0]; alchemy_setup_usb() 227 res[0].end = res[0].start + 0x100 - 1; alchemy_setup_usb() 228 res[0].flags = IORESOURCE_MEM; alchemy_setup_usb() 229 res[1].start = alchemy_ohci_data[ctype][1]; alchemy_setup_usb() 230 res[1].end = res[1].start; alchemy_setup_usb() 231 res[1].flags = IORESOURCE_IRQ; alchemy_setup_usb() 243 if (_new_usbres(&res, &pdev)) alchemy_setup_usb() 246 res[0].start = alchemy_ehci_data[ctype][0]; alchemy_setup_usb() 247 res[0].end = res[0].start + 0x100 - 1; alchemy_setup_usb() 248 res[0].flags = IORESOURCE_MEM; alchemy_setup_usb() 249 res[1].start = alchemy_ehci_data[ctype][1]; alchemy_setup_usb() 250 res[1].end = res[1].start; alchemy_setup_usb() 251 res[1].flags = IORESOURCE_IRQ; alchemy_setup_usb() 263 if (_new_usbres(&res, &pdev)) alchemy_setup_usb() 266 res[0].start = AU1300_USB_OHCI1_PHYS_ADDR; alchemy_setup_usb() 267 res[0].end = res[0].start + 0x100 - 1; alchemy_setup_usb() 268 res[0].flags = IORESOURCE_MEM; alchemy_setup_usb() 269 res[1].start = AU1300_USB_INT; alchemy_setup_usb() 270 res[1].end = res[1].start; alchemy_setup_usb() 271 res[1].flags = IORESOURCE_IRQ; alchemy_setup_usb()
|
/linux-4.1.27/arch/mips/ath25/ |
H A D | devices.c | 91 struct resource *res; ath25_add_wmac() local 94 res = &ath25_wmac[nr].resource[0]; ath25_add_wmac() 95 res->start = base; ath25_add_wmac() 96 res->end = base + 0x10000 - 1; ath25_add_wmac() 97 res++; ath25_add_wmac() 98 res->start = irq; ath25_add_wmac() 99 res->end = irq; ath25_add_wmac()
|
/linux-4.1.27/arch/cris/include/arch-v10/arch/ |
H A D | bitops.h | 19 ! : "=r,r" (res), "=r,X" (dummy) : "1,0" (w)); cris_swapnwbrlz() 22 unsigned long res; cris_swapnwbrlz() local 25 : "=r" (res) : "0" (w)); cris_swapnwbrlz() 26 return res; cris_swapnwbrlz() 31 unsigned res; cris_swapwbrlz() local 34 : "=r" (res) cris_swapwbrlz() 36 return res; cris_swapwbrlz()
|
H A D | checksum.h | 15 __wsum res; csum_tcpudp_nofold() local 23 : "=r" (res) csum_tcpudp_nofold() 26 return res; csum_tcpudp_nofold()
|
/linux-4.1.27/arch/arm/mach-omap1/ |
H A D | i2c.c | 55 struct resource *res; omap_i2c_add_bus() local 66 res = i2c_resources; omap_i2c_add_bus() 67 res[0].start = OMAP1_I2C_BASE; omap_i2c_add_bus() 68 res[0].end = res[0].start + OMAP_I2C_SIZE; omap_i2c_add_bus() 69 res[0].flags = IORESOURCE_MEM; omap_i2c_add_bus() 70 res[1].start = OMAP1_INT_I2C; omap_i2c_add_bus() 71 res[1].flags = IORESOURCE_IRQ; omap_i2c_add_bus() 72 pdev->resource = res; omap_i2c_add_bus()
|
H A D | timer.c | 69 struct resource res[2]; omap1_dm_timer_init() local 120 memset(res, 0, 2 * sizeof(struct resource)); omap1_dm_timer_init() 121 res[0].start = base; omap1_dm_timer_init() 122 res[0].end = base + 0x46; omap1_dm_timer_init() 123 res[0].flags = IORESOURCE_MEM; omap1_dm_timer_init() 124 res[1].start = irq; omap1_dm_timer_init() 125 res[1].end = irq; omap1_dm_timer_init() 126 res[1].flags = IORESOURCE_IRQ; omap1_dm_timer_init() 127 ret = platform_device_add_resources(pdev, res, omap1_dm_timer_init() 128 ARRAY_SIZE(res)); omap1_dm_timer_init()
|
/linux-4.1.27/drivers/block/ |
H A D | nvme-scsi.c | 372 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_copy_to_user() local 392 res = -EFAULT; nvme_trans_copy_to_user() 400 return res; nvme_trans_copy_to_user() 404 res = -EFAULT; nvme_trans_copy_to_user() 405 return res; nvme_trans_copy_to_user() 413 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_copy_from_user() local 433 res = -EFAULT; nvme_trans_copy_from_user() 441 return res; nvme_trans_copy_from_user() 446 res = -EFAULT; nvme_trans_copy_from_user() 447 return res; nvme_trans_copy_from_user() 455 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_completion() local 480 res = -EFAULT; nvme_trans_completion() 483 return res; nvme_trans_completion() 489 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_status_code() local 664 res = nvme_trans_completion(hdr, status, sense_key, asc, ascq); nvme_trans_status_code() 666 return res; nvme_trans_status_code() 679 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_standard_inquiry_page() local 690 res = -ENOMEM; nvme_trans_standard_inquiry_page() 696 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_standard_inquiry_page() 698 * If nvme_sc was -ve, res will be -ve here. nvme_trans_standard_inquiry_page() 699 * If nvme_sc was +ve, the status would bace been translated, and res nvme_trans_standard_inquiry_page() 701 * - If 0 && nvme_sc > 0, then go into next if where res gets nvme_sc nvme_trans_standard_inquiry_page() 704 if (res) nvme_trans_standard_inquiry_page() 707 res = nvme_sc; nvme_trans_standard_inquiry_page() 728 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_standard_inquiry_page() 734 return res; nvme_trans_standard_inquiry_page() 741 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_supported_vpd_pages() local 755 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_supported_vpd_pages() 757 return res; nvme_trans_supported_vpd_pages() 765 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_unit_serial_page() local 774 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_unit_serial_page() 776 return res; nvme_trans_unit_serial_page() 785 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_device_id_page() local 793 res = -ENOMEM; nvme_trans_device_id_page() 805 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_device_id_page() 806 if (res) nvme_trans_device_id_page() 809 res = nvme_sc; nvme_trans_device_id_page() 832 res = nvme_trans_completion(hdr, nvme_trans_device_id_page() 851 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_device_id_page() 857 return res; nvme_trans_device_id_page() 864 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_ext_inq_page() local 882 res = -ENOMEM; nvme_trans_ext_inq_page() 889 res = -ENOMEM; nvme_trans_ext_inq_page() 895 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_ext_inq_page() 896 if (res) nvme_trans_ext_inq_page() 899 res = nvme_sc; nvme_trans_ext_inq_page() 911 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_ext_inq_page() 912 if (res) nvme_trans_ext_inq_page() 915 res = nvme_sc; nvme_trans_ext_inq_page() 933 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_ext_inq_page() 941 return res; nvme_trans_ext_inq_page() 968 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_bdev_char_page() local 973 res = -ENOMEM; nvme_trans_bdev_char_page() 985 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_bdev_char_page() 989 return res; nvme_trans_bdev_char_page() 997 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_log_supp_pages() local 1003 res = -ENOMEM; nvme_trans_log_supp_pages() 1015 res = nvme_trans_copy_to_user(hdr, log_response, xfer_len); nvme_trans_log_supp_pages() 1019 return res; nvme_trans_log_supp_pages() 1025 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_log_info_exceptions() local 1038 res = -ENOMEM; nvme_trans_log_info_exceptions() 1046 res = -ENOMEM; nvme_trans_log_info_exceptions() 1057 res = nvme_submit_admin_cmd(dev, &c, NULL); nvme_trans_log_info_exceptions() 1058 if (res != NVME_SC_SUCCESS) { nvme_trans_log_info_exceptions() 1079 res = nvme_trans_copy_to_user(hdr, log_response, xfer_len); nvme_trans_log_info_exceptions() 1086 return res; nvme_trans_log_info_exceptions() 1092 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_log_temperature() local 1106 res = -ENOMEM; nvme_trans_log_temperature() 1114 res = -ENOMEM; nvme_trans_log_temperature() 1125 res = nvme_submit_admin_cmd(dev, &c, NULL); nvme_trans_log_temperature() 1126 if (res != NVME_SC_SUCCESS) { nvme_trans_log_temperature() 1136 res = nvme_get_features(dev, NVME_FEAT_TEMP_THRESH, 0, 0, nvme_trans_log_temperature() 1138 if (res != NVME_SC_SUCCESS) nvme_trans_log_temperature() 1160 res = nvme_trans_copy_to_user(hdr, log_response, xfer_len); nvme_trans_log_temperature() 1167 return res; nvme_trans_log_temperature() 1199 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fill_blk_desc() local 1216 res = -ENOMEM; nvme_trans_fill_blk_desc() 1222 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fill_blk_desc() 1223 if (res) nvme_trans_fill_blk_desc() 1226 res = nvme_sc; nvme_trans_fill_blk_desc() 1253 return res; nvme_trans_fill_blk_desc() 1282 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fill_caching_page() local 1293 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fill_caching_page() 1294 if (res) nvme_trans_fill_caching_page() 1297 res = nvme_sc; nvme_trans_fill_caching_page() 1307 return res; nvme_trans_fill_caching_page() 1314 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fill_pow_cnd_page() local 1323 return res; nvme_trans_fill_pow_cnd_page() 1330 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fill_inf_exc_page() local 1340 return res; nvme_trans_fill_inf_exc_page() 1346 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fill_all_pages() local 1354 res = nvme_trans_fill_caching_page(ns, hdr, &resp[mode_pages_offset_1], nvme_trans_fill_all_pages() 1356 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_fill_all_pages() 1358 res = nvme_trans_fill_control_page(ns, hdr, &resp[mode_pages_offset_2], nvme_trans_fill_all_pages() 1360 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_fill_all_pages() 1362 res = nvme_trans_fill_pow_cnd_page(ns, hdr, &resp[mode_pages_offset_3], nvme_trans_fill_all_pages() 1364 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_fill_all_pages() 1366 res = nvme_trans_fill_inf_exc_page(ns, hdr, &resp[mode_pages_offset_4], nvme_trans_fill_all_pages() 1368 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_fill_all_pages() 1372 return res; nvme_trans_fill_all_pages() 1393 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_mode_page_create() local 1416 res = -ENOMEM; nvme_trans_mode_page_create() 1420 res = nvme_trans_fill_mode_parm_hdr(&response[0], mph_size, cdb10, nvme_trans_mode_page_create() 1422 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_mode_page_create() 1425 res = nvme_trans_fill_blk_desc(ns, hdr, nvme_trans_mode_page_create() 1428 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_mode_page_create() 1431 res = mode_page_fill_func(ns, hdr, &response[mode_pages_offset_1], nvme_trans_mode_page_create() 1433 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_mode_page_create() 1437 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_mode_page_create() 1442 return res; nvme_trans_mode_page_create() 1488 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_power_state() local 1502 res = -ENOMEM; nvme_trans_power_state() 1506 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_power_state() 1507 if (res) nvme_trans_power_state() 1510 res = nvme_sc; nvme_trans_power_state() 1547 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_power_state() 1554 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_power_state() 1555 if (res) nvme_trans_power_state() 1558 res = nvme_sc; nvme_trans_power_state() 1563 return res; nvme_trans_power_state() 1573 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_send_fw_cmd() local 1585 res = nvme_trans_completion(hdr, nvme_trans_send_fw_cmd() 1595 res = PTR_ERR(iod); nvme_trans_send_fw_cmd() 1600 res = -ENOMEM; nvme_trans_send_fw_cmd() 1614 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_send_fw_cmd() 1615 if (res) nvme_trans_send_fw_cmd() 1618 res = nvme_sc; nvme_trans_send_fw_cmd() 1626 return res; nvme_trans_send_fw_cmd() 1689 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_modesel_get_mp() local 1699 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_modesel_get_mp() 1700 if (res) nvme_trans_modesel_get_mp() 1703 res = nvme_sc; nvme_trans_modesel_get_mp() 1712 res = nvme_trans_completion(hdr, nvme_trans_modesel_get_mp() 1717 if (!res) nvme_trans_modesel_get_mp() 1718 res = SNTI_INTERNAL_ERROR; nvme_trans_modesel_get_mp() 1723 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_modesel_get_mp() 1726 if (!res) nvme_trans_modesel_get_mp() 1727 res = SNTI_INTERNAL_ERROR; nvme_trans_modesel_get_mp() 1731 return res; nvme_trans_modesel_get_mp() 1738 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_modesel_data() local 1749 res = -ENOMEM; nvme_trans_modesel_data() 1753 res = nvme_trans_copy_from_user(hdr, parm_list, parm_list_len); nvme_trans_modesel_data() 1754 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_modesel_data() 1775 res = nvme_trans_completion(hdr, nvme_trans_modesel_data() 1790 res = nvme_trans_modesel_get_mp(ns, hdr, &parm_list[index], nvme_trans_modesel_data() 1792 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_modesel_data() 1800 return res; nvme_trans_modesel_data() 1808 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fmt_set_blk_size_count() local 1827 res = -ENOMEM; nvme_trans_fmt_set_blk_size_count() 1832 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fmt_set_blk_size_count() 1833 if (res) nvme_trans_fmt_set_blk_size_count() 1836 res = nvme_sc; nvme_trans_fmt_set_blk_size_count() 1853 return res; nvme_trans_fmt_set_blk_size_count() 1859 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fmt_get_parm_header() local 1865 res = -ENOMEM; nvme_trans_fmt_get_parm_header() 1868 res = nvme_trans_copy_from_user(hdr, parm_list, len); nvme_trans_fmt_get_parm_header() 1869 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_fmt_get_parm_header() 1874 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_get_parm_header() 1882 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_get_parm_header() 1904 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_get_parm_header() 1913 return res; nvme_trans_fmt_get_parm_header() 1919 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_fmt_send_cmd() local 1935 res = -ENOMEM; nvme_trans_fmt_send_cmd() 1940 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fmt_send_cmd() 1941 if (res) nvme_trans_fmt_send_cmd() 1944 res = nvme_sc; nvme_trans_fmt_send_cmd() 1958 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_send_cmd() 1963 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_send_cmd() 1976 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fmt_send_cmd() 1977 if (res) nvme_trans_fmt_send_cmd() 1980 res = nvme_sc; nvme_trans_fmt_send_cmd() 1986 return res; nvme_trans_fmt_send_cmd() 2067 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_do_nvme_io() local 2126 res = PTR_ERR(iod); nvme_trans_do_nvme_io() 2135 res = -ENOMEM; nvme_trans_do_nvme_io() 2149 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_do_nvme_io() 2157 res = nvme_trans_status_code(hdr, NVME_SC_SUCCESS); nvme_trans_do_nvme_io() 2160 return res; nvme_trans_do_nvme_io() 2169 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_io() local 2198 res = SNTI_INTERNAL_ERROR; nvme_trans_io() 2213 res = nvme_trans_completion(hdr, nvme_trans_io() 2230 res = -EINVAL; nvme_trans_io() 2239 res = nvme_trans_do_nvme_io(ns, hdr, &cdb_info, is_write); nvme_trans_io() 2240 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_io() 2244 return res; nvme_trans_io() 2250 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_inquiry() local 2263 res = -ENOMEM; nvme_trans_inquiry() 2269 res = nvme_trans_standard_inquiry_page(ns, hdr, nvme_trans_inquiry() 2272 res = nvme_trans_completion(hdr, nvme_trans_inquiry() 2281 res = nvme_trans_supported_vpd_pages(ns, hdr, nvme_trans_inquiry() 2285 res = nvme_trans_unit_serial_page(ns, hdr, inq_response, nvme_trans_inquiry() 2289 res = nvme_trans_device_id_page(ns, hdr, inq_response, nvme_trans_inquiry() 2293 res = nvme_trans_ext_inq_page(ns, hdr, alloc_len); nvme_trans_inquiry() 2296 res = nvme_trans_bdev_limits_page(ns, hdr, inq_response, nvme_trans_inquiry() 2300 res = nvme_trans_bdev_char_page(ns, hdr, alloc_len); nvme_trans_inquiry() 2303 res = nvme_trans_completion(hdr, nvme_trans_inquiry() 2313 return res; nvme_trans_inquiry() 2319 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_log_sense() local 2327 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_log_sense() 2336 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_log_sense() 2344 res = nvme_trans_log_supp_pages(ns, hdr, alloc_len); nvme_trans_log_sense() 2347 res = nvme_trans_log_info_exceptions(ns, hdr, alloc_len); nvme_trans_log_sense() 2350 res = nvme_trans_log_temperature(ns, hdr, alloc_len); nvme_trans_log_sense() 2353 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_log_sense() 2360 return res; nvme_trans_log_sense() 2366 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_mode_select() local 2392 res = nvme_trans_modesel_data(ns, hdr, cmd, parm_list_len, nvme_trans_mode_select() 2396 return res; nvme_trans_mode_select() 2402 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_mode_sense() local 2419 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_mode_sense() 2429 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense() 2435 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense() 2441 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense() 2447 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense() 2453 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense() 2459 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_mode_sense() 2466 return res; nvme_trans_mode_sense() 2472 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_read_capacity() local 2493 res = -ENOMEM; nvme_trans_read_capacity() 2498 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_read_capacity() 2499 if (res) nvme_trans_read_capacity() 2502 res = nvme_sc; nvme_trans_read_capacity() 2509 res = -ENOMEM; nvme_trans_read_capacity() 2515 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_read_capacity() 2522 return res; nvme_trans_read_capacity() 2528 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_report_luns() local 2547 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_report_luns() 2557 res = -ENOMEM; nvme_trans_report_luns() 2561 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_report_luns() 2562 if (res) nvme_trans_report_luns() 2565 res = nvme_sc; nvme_trans_report_luns() 2573 res = nvme_trans_completion(hdr, nvme_trans_report_luns() 2582 res = -ENOMEM; nvme_trans_report_luns() 2601 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_report_luns() 2608 return res; nvme_trans_report_luns() 2614 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_request_sense() local 2627 res = -ENOMEM; nvme_trans_request_sense() 2654 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_request_sense() 2658 return res; nvme_trans_request_sense() 2673 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_start_stop() local 2691 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_start_stop() 2702 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_start_stop() 2703 if (res) nvme_trans_start_stop() 2706 res = nvme_sc; nvme_trans_start_stop() 2711 res = nvme_trans_power_state(ns, hdr, pc, pcmod, start); nvme_trans_start_stop() 2715 return res; nvme_trans_start_stop() 2721 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_synchronize_cache() local 2731 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_synchronize_cache() 2732 if (res) nvme_trans_synchronize_cache() 2735 res = nvme_sc; nvme_trans_synchronize_cache() 2738 return res; nvme_trans_synchronize_cache() 2744 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_format_unit() local 2768 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_format_unit() 2780 res = nvme_trans_fmt_get_parm_header(hdr, parm_hdr_len, nvme_trans_format_unit() 2782 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_format_unit() 2787 res = nvme_trans_send_fw_cmd(ns, hdr, nvme_admin_activate_fw, 0, 0, 0); nvme_trans_format_unit() 2790 res = nvme_trans_fmt_set_blk_size_count(ns, hdr); nvme_trans_format_unit() 2791 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_format_unit() 2794 res = nvme_trans_fmt_send_cmd(ns, hdr, nvme_pf_code); nvme_trans_format_unit() 2797 return res; nvme_trans_format_unit() 2804 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_test_unit_ready() local 2808 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_test_unit_ready() 2812 res = nvme_trans_completion(hdr, SAM_STAT_GOOD, NO_SENSE, 0, 0); nvme_trans_test_unit_ready() 2814 return res; nvme_trans_test_unit_ready() 2820 int res = SNTI_TRANSLATION_SUCCESS; nvme_trans_write_buffer() local 2828 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_write_buffer() 2835 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_write_buffer() 2847 res = nvme_trans_send_fw_cmd(ns, hdr, nvme_admin_download_fw, nvme_trans_write_buffer() 2850 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_write_buffer() 2852 res = nvme_trans_send_fw_cmd(ns, hdr, nvme_admin_activate_fw, nvme_trans_write_buffer() 2857 res = nvme_trans_send_fw_cmd(ns, hdr, nvme_admin_download_fw, nvme_trans_write_buffer() 2862 res = nvme_trans_send_fw_cmd(ns, hdr, nvme_admin_activate_fw, nvme_trans_write_buffer() 2867 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_write_buffer() 2874 return res; nvme_trans_write_buffer() 2897 int i, nvme_sc, res = -ENOMEM; nvme_trans_unmap() local 2909 res = nvme_trans_copy_from_user(hdr, plist, list_len); nvme_trans_unmap() 2910 if (res != SNTI_TRANSLATION_SUCCESS) nvme_trans_unmap() 2915 res = -EINVAL; nvme_trans_unmap() 2938 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_unmap() 2944 return res; nvme_trans_unmap()
|
/linux-4.1.27/drivers/staging/nvec/ |
H A D | nvec_power.c | 93 struct bat_response *res = (struct bat_response *)data; nvec_power_notifier() local 98 if (res->sub_type == 0) { nvec_power_notifier() 99 if (power->on != res->plu) { nvec_power_notifier() 100 power->on = res->plu; nvec_power_notifier() 129 struct bat_response *res = (struct bat_response *)data; nvec_power_bat_notifier() local 135 switch (res->sub_type) { nvec_power_bat_notifier() 137 if (res->plc[0] & 1) { nvec_power_bat_notifier() 145 switch ((res->plc[0] >> 1) & 3) { nvec_power_bat_notifier() 168 power->bat_cap = res->plc[1]; nvec_power_bat_notifier() 173 power->bat_voltage_now = res->plu * 1000; nvec_power_bat_notifier() 176 power->time_remain = res->plu * 3600; nvec_power_bat_notifier() 179 power->bat_current_now = res->pls * 1000; nvec_power_bat_notifier() 182 power->bat_current_avg = res->pls * 1000; nvec_power_bat_notifier() 185 power->capacity_remain = res->plu * 1000; nvec_power_bat_notifier() 188 power->charge_last_full = res->plu * 1000; nvec_power_bat_notifier() 191 power->charge_full_design = res->plu * 1000; nvec_power_bat_notifier() 194 power->critical_capacity = res->plu * 1000; nvec_power_bat_notifier() 197 power->bat_temperature = res->plu - 2732; nvec_power_bat_notifier() 200 memcpy(power->bat_manu, &res->plc, res->length - 2); nvec_power_bat_notifier() 201 power->bat_model[res->length - 2] = '\0'; nvec_power_bat_notifier() 204 memcpy(power->bat_model, &res->plc, res->length - 2); nvec_power_bat_notifier() 205 power->bat_model[res->length - 2] = '\0'; nvec_power_bat_notifier() 208 memcpy(power->bat_type, &res->plc, res->length - 2); nvec_power_bat_notifier() 209 power->bat_type[res->length - 2] = '\0'; nvec_power_bat_notifier()
|
/linux-4.1.27/drivers/usb/gadget/udc/bdc/ |
H A D | bdc_pci.c | 48 struct resource res[2]; bdc_pci_probe() local 69 memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); bdc_pci_probe() 72 res[0].start = pci_resource_start(pci, 0); bdc_pci_probe() 73 res[0].end = pci_resource_end(pci, 0); bdc_pci_probe() 74 res[0].name = BRCM_BDC_NAME; bdc_pci_probe() 75 res[0].flags = IORESOURCE_MEM; bdc_pci_probe() 77 res[1].start = pci->irq; bdc_pci_probe() 78 res[1].name = BRCM_BDC_NAME; bdc_pci_probe() 79 res[1].flags = IORESOURCE_IRQ; bdc_pci_probe() 81 ret = platform_device_add_resources(bdc, res, ARRAY_SIZE(res)); bdc_pci_probe()
|
/linux-4.1.27/fs/squashfs/ |
H A D | file_cache.c | 28 int res = buffer->error; squashfs_readpage_block() local 30 if (res) squashfs_readpage_block() 37 return res; squashfs_readpage_block()
|
/linux-4.1.27/drivers/char/ |
H A D | ps3flash.c | 49 u64 res = ps3stor_read_write_sectors(dev, dev->bounce_lpar, ps3flash_read_write_sectors() local 52 if (res) { ps3flash_read_write_sectors() 54 __LINE__, write ? "write" : "read", res); ps3flash_read_write_sectors() 63 int res; ps3flash_writeback() local 68 res = ps3flash_read_write_sectors(dev, priv->tag, 1); ps3flash_writeback() 69 if (res) ps3flash_writeback() 70 return res; ps3flash_writeback() 79 int res; ps3flash_fetch() local 84 res = ps3flash_writeback(dev); ps3flash_fetch() 85 if (res) ps3flash_fetch() 86 return res; ps3flash_fetch() 90 res = ps3flash_read_write_sectors(dev, start_sector, 0); ps3flash_fetch() 91 if (res) ps3flash_fetch() 92 return res; ps3flash_fetch() 111 int res; ps3flash_read() local 140 res = ps3flash_fetch(dev, sector); ps3flash_read() 141 if (res) ps3flash_read() 149 res = -EFAULT; ps3flash_read() 171 return res; ps3flash_read() 180 int res = 0; ps3flash_write() local 210 res = ps3flash_fetch(dev, sector); ps3flash_write() 212 res = ps3flash_writeback(dev); ps3flash_write() 213 if (res) ps3flash_write() 221 res = -EFAULT; ps3flash_write() 246 return res; ps3flash_write() 269 ssize_t res; ps3flash_kernel_write() local 272 res = ps3flash_write(NULL, buf, count, &pos); ps3flash_kernel_write() 273 if (res < 0) ps3flash_kernel_write() 274 return res; ps3flash_kernel_write() 281 return res; ps3flash_kernel_write() 302 int res; ps3flash_interrupt() local 305 res = lv1_storage_get_async_status(dev->sbd.dev_id, &tag, &status); ps3flash_interrupt() 312 if (res) { ps3flash_interrupt() 313 dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n", ps3flash_interrupt() 314 __func__, __LINE__, res, status); ps3flash_interrupt()
|
/linux-4.1.27/drivers/acpi/apei/ |
H A D | apei-base.c | 310 struct apei_res *res, *resn, *res_ins = NULL; apei_res_add() local 316 list_for_each_entry_safe(res, resn, res_list, list) { list_for_each_entry_safe() 317 if (res->start > end || res->end < start) list_for_each_entry_safe() 319 else if (end <= res->end && start >= res->start) { list_for_each_entry_safe() 323 list_del(&res->list); list_for_each_entry_safe() 324 res->start = start = min(res->start, start); list_for_each_entry_safe() 325 res->end = end = max(res->end, end); list_for_each_entry_safe() 327 res_ins = res; list_for_each_entry_safe() 334 res_ins = kmalloc(sizeof(*res), GFP_KERNEL); 348 struct apei_res *res1, *resn1, *res2, *res; apei_res_sub() local 363 res = kmalloc(sizeof(*res), GFP_KERNEL); list_for_each_entry() 364 if (!res) list_for_each_entry() 366 res->start = res2->end; list_for_each_entry() 367 res->end = res1->end; list_for_each_entry() 369 list_add(&res->list, &res1->list); list_for_each_entry() 370 resn1 = res; list_for_each_entry() 387 struct apei_res *res, *resn; apei_res_clean() local 389 list_for_each_entry_safe(res, resn, res_list, list) { list_for_each_entry_safe() 390 list_del(&res->list); list_for_each_entry_safe() 391 kfree(res); list_for_each_entry_safe() 406 struct apei_res *res; apei_resources_merge() local 408 list_for_each_entry(res, &resources2->iomem, list) { apei_resources_merge() 409 rc = apei_res_add(&resources1->iomem, res->start, apei_resources_merge() 410 res->end - res->start); apei_resources_merge() 414 list_for_each_entry(res, &resources2->ioport, list) { apei_resources_merge() 415 rc = apei_res_add(&resources1->ioport, res->start, apei_resources_merge() 416 res->end - res->start); apei_resources_merge() 479 struct apei_res *res, *res_bak = NULL; apei_resources_request() local 512 list_for_each_entry(res, &resources->iomem, list) { apei_resources_request() 513 r = request_mem_region(res->start, res->end - res->start, apei_resources_request() 518 (unsigned long long)res->start, apei_resources_request() 519 (unsigned long long)res->end - 1, desc); apei_resources_request() 520 res_bak = res; apei_resources_request() 525 list_for_each_entry(res, &resources->ioport, list) { apei_resources_request() 526 r = request_region(res->start, res->end - res->start, desc); apei_resources_request() 530 (unsigned long long)res->start, apei_resources_request() 531 (unsigned long long)res->end - 1, desc); apei_resources_request() 532 res_bak = res; apei_resources_request() 545 list_for_each_entry(res, &resources->ioport, list) { apei_resources_request() 546 if (res == res_bak) apei_resources_request() 548 release_region(res->start, res->end - res->start); apei_resources_request() 552 list_for_each_entry(res, &resources->iomem, list) { apei_resources_request() 553 if (res == res_bak) apei_resources_request() 555 release_mem_region(res->start, res->end - res->start); apei_resources_request() 568 struct apei_res *res; apei_resources_release() local 570 list_for_each_entry(res, &resources->iomem, list) apei_resources_release() 571 release_mem_region(res->start, res->end - res->start); apei_resources_release() 572 list_for_each_entry(res, &resources->ioport, list) apei_resources_release() 573 release_region(res->start, res->end - res->start); apei_resources_release()
|
/linux-4.1.27/drivers/usb/c67x00/ |
H A D | c67x00-drv.c | 123 struct resource *res, *res2; c67x00_drv_probe() local 126 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); c67x00_drv_probe() 127 if (!res) c67x00_drv_probe() 142 if (!request_mem_region(res->start, resource_size(res), c67x00_drv_probe() 148 c67x00->hpi.base = ioremap(res->start, resource_size(res)); c67x00_drv_probe() 187 release_mem_region(res->start, resource_size(res)); c67x00_drv_probe() 197 struct resource *res; c67x00_drv_remove() local 205 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); c67x00_drv_remove() 206 if (res) c67x00_drv_remove() 207 free_irq(res->start, c67x00); c67x00_drv_remove() 211 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); c67x00_drv_remove() 212 if (res) c67x00_drv_remove() 213 release_mem_region(res->start, resource_size(res)); c67x00_drv_remove()
|
/linux-4.1.27/drivers/hwmon/ |
H A D | i5k_amb.c | 267 int res = 0; i5k_amb_hwmon_init() local 302 res = device_create_file(&pdev->dev, i5k_amb_hwmon_init() 304 if (res) i5k_amb_hwmon_init() 317 res = device_create_file(&pdev->dev, i5k_amb_hwmon_init() 319 if (res) i5k_amb_hwmon_init() 333 res = device_create_file(&pdev->dev, i5k_amb_hwmon_init() 335 if (res) i5k_amb_hwmon_init() 349 res = device_create_file(&pdev->dev, i5k_amb_hwmon_init() 351 if (res) i5k_amb_hwmon_init() 365 res = device_create_file(&pdev->dev, i5k_amb_hwmon_init() 367 if (res) i5k_amb_hwmon_init() 380 res = device_create_file(&pdev->dev, i5k_amb_hwmon_init() 382 if (res) i5k_amb_hwmon_init() 388 res = device_create_file(&pdev->dev, &dev_attr_name); i5k_amb_hwmon_init() 389 if (res) i5k_amb_hwmon_init() 394 res = PTR_ERR(data->hwmon_dev); i5k_amb_hwmon_init() 398 return res; i5k_amb_hwmon_init() 406 return res; i5k_amb_hwmon_init() 411 int res = -ENODEV; i5k_amb_add() local 418 res = platform_device_add(amb_pdev); i5k_amb_add() 419 if (res) i5k_amb_add() 425 return res; i5k_amb_add() 433 int res = -ENODEV; i5k_find_amb_registers() local 456 res = 0; i5k_find_amb_registers() 459 return res; i5k_find_amb_registers() 466 int res = -ENODEV; i5k_channel_probe() local 481 res = 0; i5k_channel_probe() 485 return res; i5k_channel_probe() 510 int i, res; i5k_amb_probe() local 519 res = i5k_find_amb_registers(data, chipset_ids[i].err); i5k_amb_probe() 520 if (res == 0) i5k_amb_probe() 525 if (res) i5k_amb_probe() 529 res = i5k_channel_probe(&data->amb_present[0], chipset_ids[i].fbd0); i5k_amb_probe() 530 if (res) i5k_amb_probe() 539 res = -EBUSY; i5k_amb_probe() 545 res = -EBUSY; i5k_amb_probe() 551 res = i5k_amb_hwmon_init(pdev); i5k_amb_probe() 552 if (res) i5k_amb_probe() 555 return res; i5k_amb_probe() 563 return res; i5k_amb_probe() 592 int res; i5k_amb_init() local 594 res = platform_driver_register(&i5k_amb_driver); i5k_amb_init() 595 if (res) i5k_amb_init() 596 return res; i5k_amb_init() 598 res = i5k_amb_add(); i5k_amb_init() 599 if (res) i5k_amb_init() 602 return res; i5k_amb_init()
|
H A D | acpi_power_meter.c | 160 int res; set_avg_interval() local 165 res = kstrtoul(buf, 10, &temp); set_avg_interval() 166 if (res) set_avg_interval() 167 return res; set_avg_interval() 231 int res; set_cap() local 236 res = kstrtoul(buf, 10, &temp); set_cap() 237 if (res) set_cap() 238 return res; set_cap() 303 int res; set_trip() local 306 res = kstrtoul(buf, 10, &temp); set_trip() 307 if (res) set_trip() 308 return res; set_trip() 314 res = set_acpi_trip(resource); set_trip() 317 if (res) set_trip() 318 return res; set_trip() 553 int res = 0; read_domain_devices() local 571 res = -EFAULT; read_domain_devices() 581 res = -ENOMEM; read_domain_devices() 588 res = -ENOMEM; read_domain_devices() 611 res = sysfs_create_link(resource->holders_dir, &obj->dev.kobj, read_domain_devices() 613 if (res) { read_domain_devices() 619 res = 0; read_domain_devices() 626 return res; read_domain_devices() 636 int res = 0; register_attrs() local 650 res = device_create_file(dev, &sensors->dev_attr); register_attrs() 651 if (res) { register_attrs() 661 return res; register_attrs() 682 int res = 0; setup_attrs() local 684 res = read_domain_devices(resource); setup_attrs() 685 if (res) setup_attrs() 686 return res; setup_attrs() 689 res = register_attrs(resource, meter_attrs); setup_attrs() 690 if (res) setup_attrs() 702 res = register_attrs(resource, rw_cap_attrs); setup_attrs() 704 res = register_attrs(resource, ro_cap_attrs); setup_attrs() 706 if (res) setup_attrs() 709 res = register_attrs(resource, misc_cap_attrs); setup_attrs() 710 if (res) setup_attrs() 716 res = register_attrs(resource, trip_attrs); setup_attrs() 717 if (res) setup_attrs() 721 res = register_attrs(resource, misc_attrs); setup_attrs() 722 if (res) setup_attrs() 725 return res; setup_attrs() 728 return res; setup_attrs() 743 int res = 0; read_capabilities() local 765 res = -EFAULT; read_capabilities() 776 res = -EFAULT; read_capabilities() 784 res = -EINVAL; read_capabilities() 795 res = -EINVAL; read_capabilities() 802 res = -ENOMEM; read_capabilities() 818 return res; read_capabilities() 825 int res; acpi_power_meter_notify() local 836 res = read_capabilities(resource); acpi_power_meter_notify() 837 if (res) acpi_power_meter_notify() 871 int res; acpi_power_meter_add() local 890 res = read_capabilities(resource); acpi_power_meter_add() 891 if (res) acpi_power_meter_add() 896 res = setup_attrs(resource); acpi_power_meter_add() 897 if (res) acpi_power_meter_add() 902 res = PTR_ERR(resource->hwmon_dev); acpi_power_meter_add() 906 res = 0; acpi_power_meter_add() 914 return res; acpi_power_meter_add()
|
/linux-4.1.27/arch/avr32/kernel/ |
H A D | setup.c | 80 struct resource *mem, *res; resource_init() local 95 for (res = reserved; res; res = res->sibling) { resource_init() 97 memcpy(new, res, sizeof(struct resource)); resource_init() 103 res->name, res->start, res->end); resource_init() 178 struct resource *res; find_free_region() local 182 for (res = reserved; res; res = res->sibling) { find_free_region() 183 if ((target + size) <= res->start) find_free_region() 185 if (target <= res->end) find_free_region() 186 target = ALIGN(res->end + 1, align); find_free_region() 476 struct resource *res; setup_bootmem() local 479 for (res = system_ram; res; res = res->sibling) setup_bootmem() 480 printk(" %08x-%08x\n", res->start, res->end); setup_bootmem() 482 for (res = reserved; res; res = res->sibling) setup_bootmem() 484 res->start, res->end, res->name); setup_bootmem() 491 for (res = system_ram; res; res = NULL) { setup_bootmem() 492 first_pfn = PFN_UP(res->start); setup_bootmem() 493 max_low_pfn = max_pfn = PFN_DOWN(res->end + 1); setup_bootmem() 494 bootmap_pfn = find_bootmap_pfn(res); setup_bootmem() 533 for (res = reserved; res; res = res->sibling) { setup_bootmem() 534 if (res->start > PFN_PHYS(max_pfn)) setup_bootmem() 542 if (res->start >= PFN_PHYS(first_pfn) setup_bootmem() 543 && res->end < PFN_PHYS(max_pfn)) setup_bootmem() 545 res->start, setup_bootmem() 546 resource_size(res), setup_bootmem()
|
/linux-4.1.27/include/linux/ |
H A D | pnp.h | 36 static inline int pnp_resource_valid(struct resource *res) pnp_resource_valid() argument 38 if (res) pnp_resource_valid() 43 static inline int pnp_resource_enabled(struct resource *res) pnp_resource_enabled() argument 45 if (res && !(res->flags & IORESOURCE_DISABLED)) pnp_resource_enabled() 50 static inline resource_size_t pnp_resource_len(struct resource *res) pnp_resource_len() argument 52 if (res->start == 0 && res->end == 0) pnp_resource_len() 54 return resource_size(res); pnp_resource_len() 61 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); pnp_port_start() local 63 if (pnp_resource_valid(res)) pnp_port_start() 64 return res->start; pnp_port_start() 71 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); pnp_port_end() local 73 if (pnp_resource_valid(res)) pnp_port_end() 74 return res->end; pnp_port_end() 81 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); pnp_port_flags() local 83 if (pnp_resource_valid(res)) pnp_port_flags() 84 return res->flags; pnp_port_flags() 96 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); pnp_port_len() local 98 if (pnp_resource_valid(res)) pnp_port_len() 99 return pnp_resource_len(res); pnp_port_len() 107 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); pnp_mem_start() local 109 if (pnp_resource_valid(res)) pnp_mem_start() 110 return res->start; pnp_mem_start() 117 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); pnp_mem_end() local 119 if (pnp_resource_valid(res)) pnp_mem_end() 120 return res->end; pnp_mem_end() 126 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); pnp_mem_flags() local 128 if (pnp_resource_valid(res)) pnp_mem_flags() 129 return res->flags; pnp_mem_flags() 141 struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); pnp_mem_len() local 143 if (pnp_resource_valid(res)) pnp_mem_len() 144 return pnp_resource_len(res); pnp_mem_len() 151 struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); pnp_irq() local 153 if (pnp_resource_valid(res)) pnp_irq() 154 return res->start; pnp_irq() 160 struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); pnp_irq_flags() local 162 if (pnp_resource_valid(res)) pnp_irq_flags() 163 return res->flags; pnp_irq_flags() 175 struct resource *res = pnp_get_resource(dev, IORESOURCE_DMA, bar); pnp_dma() local 177 if (pnp_resource_valid(res)) pnp_dma() 178 return res->start; pnp_dma() 184 struct resource *res = pnp_get_resource(dev, IORESOURCE_DMA, bar); pnp_dma_flags() local 186 if (pnp_resource_valid(res)) pnp_dma_flags() 187 return res->flags; pnp_dma_flags()
|
/linux-4.1.27/drivers/clk/ |
H A D | clk-devres.c | 12 static void devm_clk_release(struct device *dev, void *res) devm_clk_release() argument 14 clk_put(*(struct clk **)res); devm_clk_release() 37 static int devm_clk_match(struct device *dev, void *res, void *data) devm_clk_match() argument 39 struct clk **c = res; devm_clk_match()
|
/linux-4.1.27/drivers/usb/host/ |
H A D | ehci-pmcmsp.c | 101 struct resource *res; usb_hcd_msp_map_regs() local 107 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); usb_hcd_msp_map_regs() 108 if (res == NULL) usb_hcd_msp_map_regs() 110 res_len = resource_size(res); usb_hcd_msp_map_regs() 111 if (!request_mem_region(res->start, res_len, "mab regs")) usb_hcd_msp_map_regs() 114 dev->mab_regs = ioremap_nocache(res->start, res_len); usb_hcd_msp_map_regs() 121 res = platform_get_resource(pdev, IORESOURCE_MEM, 2); usb_hcd_msp_map_regs() 122 if (res == NULL) { usb_hcd_msp_map_regs() 126 res_len = resource_size(res); usb_hcd_msp_map_regs() 127 if (!request_mem_region(res->start, res_len, "usbid regs")) { usb_hcd_msp_map_regs() 131 dev->usbid_regs = ioremap_nocache(res->start, res_len); usb_hcd_msp_map_regs() 139 res = platform_get_resource(pdev, IORESOURCE_MEM, 2); usb_hcd_msp_map_regs() 140 res_len = resource_size(res); usb_hcd_msp_map_regs() 141 release_mem_region(res->start, res_len); usb_hcd_msp_map_regs() 145 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); usb_hcd_msp_map_regs() 146 res_len = resource_size(res); usb_hcd_msp_map_regs() 147 release_mem_region(res->start, res_len); usb_hcd_msp_map_regs() 166 struct resource *res; usb_hcd_msp_probe() local 173 res = platform_get_resource(dev, IORESOURCE_MEM, 0); usb_hcd_msp_probe() 174 if (res == NULL) { usb_hcd_msp_probe() 179 hcd->rsrc_start = res->start; usb_hcd_msp_probe() 180 hcd->rsrc_len = resource_size(res); usb_hcd_msp_probe() 192 res = platform_get_resource(dev, IORESOURCE_IRQ, 0); usb_hcd_msp_probe() 193 if (res == NULL) { usb_hcd_msp_probe() 209 retval = usb_add_hcd(hcd, res->start, IRQF_SHARED); usb_hcd_msp_probe()
|
H A D | xhci-mvebu.c | 46 struct resource *res; xhci_mvebu_mbus_init_quirk() local 50 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); xhci_mvebu_mbus_init_quirk() 51 if (!res) xhci_mvebu_mbus_init_quirk() 58 base = ioremap(res->start, resource_size(res)); xhci_mvebu_mbus_init_quirk()
|
/linux-4.1.27/scripts/ |
H A D | setlocalversion | 120 local file res 129 res="$res$(cat "$file")" 132 echo "$res" 137 res=$(scm_version) 138 echo "$res" >.scmversion 151 res="$(collect_files localversion*)" 153 res="$res$(collect_files "$srctree"/localversion*)" 157 res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" 162 res="$res$(scm_version)" 170 res="$res${scm:++}" 174 echo "$res"
|
/linux-4.1.27/drivers/mtd/onenand/ |
H A D | generic.c | 41 struct resource *res = pdev->resource; generic_onenand_probe() local 42 unsigned long size = resource_size(res); generic_onenand_probe() 49 if (!request_mem_region(res->start, size, dev_name(&pdev->dev))) { generic_onenand_probe() 54 info->onenand.base = ioremap(res->start, size); generic_onenand_probe() 83 release_mem_region(res->start, size); generic_onenand_probe() 93 struct resource *res = pdev->resource; generic_onenand_remove() local 94 unsigned long size = resource_size(res); generic_onenand_remove() 98 release_mem_region(res->start, size); generic_onenand_remove()
|
/linux-4.1.27/arch/xtensa/include/asm/ |
H A D | pci-bridge.h | 66 static inline void pcibios_init_resource(struct resource *res, pcibios_init_resource() argument 69 res->start = start; pcibios_init_resource() 70 res->end = end; pcibios_init_resource() 71 res->flags = flags; pcibios_init_resource() 72 res->name = name; pcibios_init_resource() 73 res->parent = NULL; pcibios_init_resource() 74 res->sibling = NULL; pcibios_init_resource() 75 res->child = NULL; pcibios_init_resource()
|
/linux-4.1.27/arch/arm/include/asm/ |
H A D | smp_twd.h | 24 struct resource res[2]; member in struct:twd_local_timer 29 .res = { \
|
/linux-4.1.27/drivers/staging/rtl8188eu/core/ |
H A D | rtw_cmd.c | 118 int res = _FAIL; rtw_enqueue_cmd() local 127 res = rtw_cmd_filter(pcmdpriv, cmd_obj); rtw_enqueue_cmd() 128 if (_FAIL == res) { rtw_enqueue_cmd() 133 res = _rtw_enqueue_cmd(&pcmdpriv->cmd_queue, cmd_obj); rtw_enqueue_cmd() 135 if (res == _SUCCESS) rtw_enqueue_cmd() 141 return res; rtw_enqueue_cmd() 203 pcmd->res = H2C_DROPPED; rtw_cmd_thread() 212 pcmd->res = ret; rtw_cmd_thread() 215 pcmd->res = H2C_PARAMETERS_ERROR; rtw_cmd_thread() 269 u8 res = _FAIL; rtw_sitesurvey_cmd() local 323 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_sitesurvey_cmd() 325 if (res == _SUCCESS) { rtw_sitesurvey_cmd() 339 return res; rtw_sitesurvey_cmd() 355 u8 res = _SUCCESS; rtw_createbss_cmd() local 367 res = _FAIL; rtw_createbss_cmd() 378 res = rtw_enqueue_cmd(pcmdpriv, pcmd); rtw_createbss_cmd() 382 return res; rtw_createbss_cmd() 387 u8 res = _SUCCESS; rtw_joinbss_cmd() local 411 res = _FAIL; rtw_joinbss_cmd() 439 res = _FAIL; rtw_joinbss_cmd() 518 res = rtw_enqueue_cmd(pcmdpriv, pcmd); rtw_joinbss_cmd() 523 return res; rtw_joinbss_cmd() 531 u8 res = _SUCCESS; rtw_disassoc_cmd() local 539 res = _FAIL; rtw_disassoc_cmd() 548 res = _FAIL; rtw_disassoc_cmd() 553 res = rtw_enqueue_cmd(cmdpriv, cmdobj); rtw_disassoc_cmd() 557 res = _FAIL; rtw_disassoc_cmd() 564 return res; rtw_disassoc_cmd() 573 u8 res = _SUCCESS; rtw_setopmode_cmd() local 578 res = false; rtw_setopmode_cmd() 585 res = false; rtw_setopmode_cmd() 592 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_setopmode_cmd() 597 return res; rtw_setopmode_cmd() 610 u8 res = _SUCCESS; rtw_setstakey_cmd() local 615 res = _FAIL; rtw_setstakey_cmd() 622 res = _FAIL; rtw_setstakey_cmd() 630 res = _FAIL; rtw_setstakey_cmd() 653 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_setstakey_cmd() 658 return res; rtw_setstakey_cmd() 668 u8 res = _SUCCESS; rtw_clearstakey_cmd() local 676 res = _FAIL; rtw_clearstakey_cmd() 683 res = _FAIL; rtw_clearstakey_cmd() 691 res = _FAIL; rtw_clearstakey_cmd() 705 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_clearstakey_cmd() 710 return res; rtw_clearstakey_cmd() 718 u8 res = _SUCCESS; rtw_addbareq_cmd() local 723 res = _FAIL; rtw_addbareq_cmd() 730 res = _FAIL; rtw_addbareq_cmd() 742 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_addbareq_cmd() 747 return res; rtw_addbareq_cmd() 755 u8 res = _SUCCESS; rtw_dynamic_chk_wk_cmd() local 760 res = _FAIL; rtw_dynamic_chk_wk_cmd() 767 res = _FAIL; rtw_dynamic_chk_wk_cmd() 779 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_dynamic_chk_wk_cmd() 781 return res; rtw_dynamic_chk_wk_cmd() 790 u8 res = _SUCCESS; rtw_set_chplan_cmd() local 797 res = _FAIL; rtw_set_chplan_cmd() 804 res = _FAIL; rtw_set_chplan_cmd() 814 res = _FAIL; rtw_set_chplan_cmd() 819 res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); rtw_set_chplan_cmd() 823 res = _FAIL; rtw_set_chplan_cmd() 828 /* do something based on res... */ rtw_set_chplan_cmd() 829 if (res == _SUCCESS) rtw_set_chplan_cmd() 835 return res; rtw_set_chplan_cmd() 967 u8 res = _SUCCESS; rtw_lps_ctrl_wk_cmd() local 972 res = _FAIL; rtw_lps_ctrl_wk_cmd() 979 res = _FAIL; rtw_lps_ctrl_wk_cmd() 989 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_lps_ctrl_wk_cmd() 997 return res; rtw_lps_ctrl_wk_cmd() 1011 u8 res = _SUCCESS; rtw_rpt_timer_cfg_cmd() local 1015 res = _FAIL; rtw_rpt_timer_cfg_cmd() 1022 res = _FAIL; rtw_rpt_timer_cfg_cmd() 1030 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_rpt_timer_cfg_cmd() 1034 return res; rtw_rpt_timer_cfg_cmd() 1048 u8 res = _SUCCESS; rtw_antenna_select_cmd() local 1052 return res; rtw_antenna_select_cmd() 1057 res = _FAIL; rtw_antenna_select_cmd() 1064 res = _FAIL; rtw_antenna_select_cmd() 1073 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_antenna_select_cmd() 1080 return res; rtw_antenna_select_cmd() 1089 u8 res = _SUCCESS; rtw_ps_cmd() local 1093 res = _FAIL; rtw_ps_cmd() 1100 res = _FAIL; rtw_ps_cmd() 1108 res = rtw_enqueue_cmd(pcmdpriv, ppscmd); rtw_ps_cmd() 1113 return res; rtw_ps_cmd() 1163 u8 res = _SUCCESS; rtw_chk_hi_queue_cmd() local 1167 res = _FAIL; rtw_chk_hi_queue_cmd() 1174 res = _FAIL; rtw_chk_hi_queue_cmd() 1184 res = rtw_enqueue_cmd(pcmdpriv, ph2c); rtw_chk_hi_queue_cmd() 1186 return res; rtw_chk_hi_queue_cmd() 1235 if (pcmd->res == H2C_DROPPED) { rtw_survey_cmd_callback() 1240 } else if (pcmd->res != H2C_SUCCESS) { rtw_survey_cmd_callback() 1255 if (pcmd->res != H2C_SUCCESS) { rtw_disassoc_cmd_callback() 1273 if (pcmd->res == H2C_DROPPED) { rtw_joinbss_cmd_callback() 1278 } else if (pcmd->res != H2C_SUCCESS) { rtw_joinbss_cmd_callback() 1297 if (pcmd->res != H2C_SUCCESS) { rtw_createbss_cmd_callback()
|
/linux-4.1.27/arch/microblaze/pci/ |
H A D | pci-common.c | 558 struct resource *res; pci_process_bridge_OF_ranges() local 586 res = NULL; pci_process_bridge_OF_ranges() 617 res = &hose->io_resource; pci_process_bridge_OF_ranges() 660 res = &hose->mem_resources[memno++]; pci_process_bridge_OF_ranges() 663 if (res != NULL) { pci_process_bridge_OF_ranges() 664 res->name = dev->full_name; pci_process_bridge_OF_ranges() 665 res->flags = range.flags; pci_process_bridge_OF_ranges() 666 res->start = range.cpu_addr; pci_process_bridge_OF_ranges() 667 res->end = range.cpu_addr + range.size - 1; pci_process_bridge_OF_ranges() 668 res->parent = res->child = res->sibling = NULL; pci_process_bridge_OF_ranges() 707 struct resource *res = dev->resource + i; pcibios_fixup_resources() local 708 if (!res->flags) pcibios_fixup_resources() 710 if (res->start == 0) { pcibios_fixup_resources() 713 (unsigned long long)res->start, pcibios_fixup_resources() 714 (unsigned long long)res->end, pcibios_fixup_resources() 715 (unsigned int)res->flags); pcibios_fixup_resources() 717 res->end -= res->start; pcibios_fixup_resources() 718 res->start = 0; pcibios_fixup_resources() 719 res->flags |= IORESOURCE_UNSET; pcibios_fixup_resources() 725 (unsigned long long)res->start, pcibios_fixup_resources() 726 (unsigned long long)res->end, pcibios_fixup_resources() 727 (unsigned int)res->flags); pcibios_fixup_resources() 738 struct resource *res) pcibios_uninitialized_bridge_resource() 747 if (res->flags & IORESOURCE_MEM) { pcibios_uninitialized_bridge_resource() 748 /* If the BAR is non-0 (res != pci_mem_offset) then it's pcibios_uninitialized_bridge_resource() 751 if (res->start != hose->pci_mem_offset) pcibios_uninitialized_bridge_resource() 778 if (((res->start - offset) & 0xfffffffful) != 0) pcibios_uninitialized_bridge_resource() 801 struct resource *res; pcibios_fixup_bridge() local 806 pci_bus_for_each_resource(bus, res, i) { pci_bus_for_each_resource() 807 if (!res) pci_bus_for_each_resource() 809 if (!res->flags) pci_bus_for_each_resource() 816 (unsigned long long)res->start, pci_bus_for_each_resource() 817 (unsigned long long)res->end, pci_bus_for_each_resource() 818 (unsigned int)res->flags); pci_bus_for_each_resource() 823 if (pcibios_uninitialized_bridge_resource(bus, res)) { pci_bus_for_each_resource() 824 res->flags = 0; pci_bus_for_each_resource() 830 (unsigned long long)res->start, pci_bus_for_each_resource() 831 (unsigned long long)res->end); pci_bus_for_each_resource() 899 resource_size_t pcibios_align_resource(void *data, const struct resource *res, pcibios_align_resource() argument 903 resource_size_t start = res->start; pcibios_align_resource() 905 if (res->flags & IORESOURCE_IO) { pcibios_align_resource() 917 * Reparent resource children of pr that conflict with res 918 * under res, and make res replace those children. 921 struct resource *res) reparent_resources() 927 if (p->end < res->start) reparent_resources() 929 if (res->end < p->start) reparent_resources() 931 if (p->start < res->start || p->end > res->end) reparent_resources() 938 res->parent = parent; reparent_resources() 939 res->child = *firstpp; reparent_resources() 940 res->sibling = *pp; reparent_resources() 941 *firstpp = res; reparent_resources() 943 for (p = res->child; p != NULL; p = p->sibling) { reparent_resources() 944 p->parent = res; reparent_resources() 948 (unsigned long long)p->end, res->name); reparent_resources() 990 struct resource *res, *pr; pcibios_allocate_bus_resources() local 995 pci_bus_for_each_resource(bus, res, i) { pci_bus_for_each_resource() 996 if (!res || !res->flags pci_bus_for_each_resource() 997 || res->start > res->end || res->parent) pci_bus_for_each_resource() 1000 pr = (res->flags & IORESOURCE_IO) ? pci_bus_for_each_resource() 1009 pr = pci_find_parent_resource(bus->self, res); pci_bus_for_each_resource() 1010 if (pr == res) { pci_bus_for_each_resource() 1022 (unsigned long long)res->start, pci_bus_for_each_resource() 1023 (unsigned long long)res->end); pci_bus_for_each_resource() 1025 (unsigned int)res->flags, pci_bus_for_each_resource() 1031 if (request_resource(pr, res) == 0) pci_bus_for_each_resource() 1038 if (reparent_resources(pr, res) == 0) pci_bus_for_each_resource() 1049 res->start = res->end = 0; pci_bus_for_each_resource() 1050 res->flags = 0; pci_bus_for_each_resource() 1136 struct resource *res, *pres; pcibios_reserve_legacy_regions() local 1146 res = kzalloc(sizeof(struct resource), GFP_KERNEL); pcibios_reserve_legacy_regions() 1147 BUG_ON(res == NULL); pcibios_reserve_legacy_regions() 1148 res->name = "Legacy IO"; pcibios_reserve_legacy_regions() 1149 res->flags = IORESOURCE_IO; pcibios_reserve_legacy_regions() 1150 res->start = offset; pcibios_reserve_legacy_regions() 1151 res->end = (offset + 0xfff) & 0xfffffffful; pcibios_reserve_legacy_regions() 1152 pr_debug("Candidate legacy IO: %pR\n", res); pcibios_reserve_legacy_regions() 1153 if (request_resource(&hose->io_resource, res)) { pcibios_reserve_legacy_regions() 1155 pci_domain_nr(bus), bus->number, res); pcibios_reserve_legacy_regions() 1156 kfree(res); pcibios_reserve_legacy_regions() 1167 pr_debug("hose mem res: %pR\n", pres); pcibios_reserve_legacy_regions() 1174 res = kzalloc(sizeof(struct resource), GFP_KERNEL); pcibios_reserve_legacy_regions() 1175 BUG_ON(res == NULL); pcibios_reserve_legacy_regions() 1176 res->name = "Legacy VGA memory"; pcibios_reserve_legacy_regions() 1177 res->flags = IORESOURCE_MEM; pcibios_reserve_legacy_regions() 1178 res->start = 0xa0000 + offset; pcibios_reserve_legacy_regions() 1179 res->end = 0xbffff + offset; pcibios_reserve_legacy_regions() 1180 pr_debug("Candidate VGA memory: %pR\n", res); pcibios_reserve_legacy_regions() 1181 if (request_resource(pres, res)) { pcibios_reserve_legacy_regions() 1183 pci_domain_nr(bus), bus->number, res); pcibios_reserve_legacy_regions() 1184 kfree(res); pcibios_reserve_legacy_regions() 1278 struct resource *res; pcibios_setup_phb_resources() local 1282 res = &hose->io_resource; pcibios_setup_phb_resources() 1286 res->start = (res->start + io_offset) & 0xffffffffu; pcibios_setup_phb_resources() 1287 res->end = (res->end + io_offset) & 0xffffffffu; pcibios_setup_phb_resources() 1289 if (!res->flags) { pcibios_setup_phb_resources() 1294 res->start = (unsigned long)hose->io_base_virt - isa_io_base; pcibios_setup_phb_resources() 1295 res->end = res->start + IO_SPACE_LIMIT; pcibios_setup_phb_resources() 1296 res->flags = IORESOURCE_IO; pcibios_setup_phb_resources() 1298 pci_add_resource_offset(resources, res, pcibios_setup_phb_resources() 1302 (unsigned long long)res->start, pcibios_setup_phb_resources() 1303 (unsigned long long)res->end, pcibios_setup_phb_resources() 1304 (unsigned long)res->flags); pcibios_setup_phb_resources() 1308 res = &hose->mem_resources[i]; pcibios_setup_phb_resources() 1309 if (!res->flags) { pcibios_setup_phb_resources() 1317 res->start = hose->pci_mem_offset; pcibios_setup_phb_resources() 1318 res->end = (resource_size_t)-1LL; pcibios_setup_phb_resources() 1319 res->flags = IORESOURCE_MEM; pcibios_setup_phb_resources() 1322 pci_add_resource_offset(resources, res, hose->pci_mem_offset); pcibios_setup_phb_resources() 1325 i, (unsigned long long)res->start, pcibios_setup_phb_resources() 1326 (unsigned long long)res->end, pcibios_setup_phb_resources() 1327 (unsigned long)res->flags); pcibios_setup_phb_resources() 737 pcibios_uninitialized_bridge_resource(struct pci_bus *bus, struct resource *res) pcibios_uninitialized_bridge_resource() argument 920 reparent_resources(struct resource *parent, struct resource *res) reparent_resources() argument
|
/linux-4.1.27/drivers/rapidio/ |
H A D | rio-access.c | 46 int res; \ 51 res = mport->ops->lcread(mport, mport->id, offset, len, &data); \ 54 return res; \ 70 int res; \ 74 res = mport->ops->lcwrite(mport, mport->id, offset, len, value);\ 76 return res; \ 106 int res; \ 111 res = mport->ops->cread(mport, mport->id, destid, hopcount, offset, len, &data); \ 114 return res; \ 130 int res; \ 134 res = mport->ops->cwrite(mport, mport->id, destid, hopcount, offset, len, value); \ 136 return res; \ 165 int res; rio_mport_send_doorbell() local 169 res = mport->ops->dsend(mport, mport->id, destid, data); rio_mport_send_doorbell() 172 return res; rio_mport_send_doorbell()
|
/linux-4.1.27/drivers/media/radio/ |
H A D | radio-tea5777.c | 190 int res; radio_tea5777_set_freq() local 227 res = tea->ops->write_reg(tea, tea->write_reg); radio_tea5777_set_freq() 228 if (res) radio_tea5777_set_freq() 229 return res; radio_tea5777_set_freq() 240 int res; radio_tea5777_update_read_reg() local 246 res = radio_tea5777_set_freq(tea); radio_tea5777_update_read_reg() 247 if (res) radio_tea5777_update_read_reg() 248 return res; radio_tea5777_update_read_reg() 256 res = tea->ops->read_reg(tea, &tea->read_reg); radio_tea5777_update_read_reg() 257 if (res) radio_tea5777_update_read_reg() 258 return res; radio_tea5777_update_read_reg() 300 int res; vidioc_g_tuner() local 305 res = radio_tea5777_update_read_reg(tea, 0); vidioc_g_tuner() 306 if (res) vidioc_g_tuner() 307 return res; vidioc_g_tuner() 393 int i, res, spacing; vidioc_s_hw_freq_seek() local 417 res = radio_tea5777_set_freq(tea); vidioc_s_hw_freq_seek() 418 if (res) vidioc_s_hw_freq_seek() 419 return res; vidioc_s_hw_freq_seek() 433 res = radio_tea5777_set_freq(tea); vidioc_s_hw_freq_seek() 434 if (res) vidioc_s_hw_freq_seek() 441 res = radio_tea5777_set_freq(tea); vidioc_s_hw_freq_seek() 442 if (res) vidioc_s_hw_freq_seek() 456 res = radio_tea5777_set_freq(tea); vidioc_s_hw_freq_seek() 457 if (res) vidioc_s_hw_freq_seek() 463 res = -ENODATA; vidioc_s_hw_freq_seek() 467 res = radio_tea5777_update_read_reg(tea, 100); vidioc_s_hw_freq_seek() 468 if (res) vidioc_s_hw_freq_seek() 485 res = -ENODATA; vidioc_s_hw_freq_seek() 497 return res; vidioc_s_hw_freq_seek() 549 int res; radio_tea5777_init() local 558 res = radio_tea5777_set_freq(tea); radio_tea5777_init() 559 if (res) { radio_tea5777_init() 560 v4l2_err(tea->v4l2_dev, "can't set initial freq (%d)\n", res); radio_tea5777_init() 561 return res; radio_tea5777_init() 578 res = tea->ctrl_handler.error; radio_tea5777_init() 579 if (res) { radio_tea5777_init() 582 return res; radio_tea5777_init() 586 res = video_register_device(&tea->vd, VFL_TYPE_RADIO, -1); radio_tea5777_init() 587 if (res) { radio_tea5777_init() 590 return res; radio_tea5777_init()
|
H A D | radio-miropcm20.c | 229 int res; vidioc_g_tuner() local 238 res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTATION, -1, -1); vidioc_g_tuner() 239 v->signal = (res & 0x80) ? 0 : 0xffff; vidioc_g_tuner() 242 res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTEREO, -1, -1); vidioc_g_tuner() 243 v->rxsubchans = (res & 0x40) ? V4L2_TUNER_SUB_MONO : vidioc_g_tuner() 248 res = rds_cmd(dev->aci, RDS_RXVALUE, &buf, 1); vidioc_g_tuner() 249 if (res >= 0 && buf) vidioc_g_tuner() 319 int res; pcm20_thread() local 326 res = rds_cmd(dev->aci, RDS_RXVALUE, &buf, 1); pcm20_thread() 327 if (res) pcm20_thread() 351 res = rds_cmd(dev->aci, RDS_STATUS, &buf, 1); pcm20_thread() 352 if (res) pcm20_thread() 355 res = rds_cmd(dev->aci, RDS_STATIONNAME, text_buffer, 8); pcm20_thread() 357 if (!res && sanitize(text_buffer, 8)) pcm20_thread() 363 res = rds_cmd(dev->aci, RDS_PTYTATP, &pty, 1); pcm20_thread() 364 if (!res) { pcm20_thread() 372 res = rds_cmd(dev->aci, RDS_TEXT, text_buffer, 65); pcm20_thread() 374 if (!res && sanitize(text_buffer + 1, 64)) pcm20_thread() 384 int res = v4l2_fh_open(file); pcm20_open() local 386 if (!res && v4l2_fh_is_singular_file(file) && pcm20_open() 396 return res; pcm20_open() 438 int res; pcm20_init() local 449 res = v4l2_device_register(NULL, v4l2_dev); pcm20_init() 450 if (res < 0) { pcm20_init() 473 res = hdl->error; pcm20_init()
|
H A D | radio-shark2.c | 82 int i, res, actual_len; shark_write_reg() local 92 res = usb_interrupt_msg(shark->usbdev, shark_write_reg() 96 if (res < 0) { shark_write_reg() 97 v4l2_err(tea->v4l2_dev, "write error: %d\n", res); shark_write_reg() 98 return res; shark_write_reg() 107 int i, res, actual_len; shark_read_reg() local 112 res = usb_interrupt_msg(shark->usbdev, shark_read_reg() 116 if (res < 0) { shark_read_reg() 117 v4l2_err(tea->v4l2_dev, "request-read error: %d\n", res); shark_read_reg() 118 return res; shark_read_reg() 121 res = usb_interrupt_msg(shark->usbdev, shark_read_reg() 125 if (res < 0) { shark_read_reg() 126 v4l2_err(tea->v4l2_dev, "read error: %d\n", res); shark_read_reg() 127 return res; shark_read_reg() 150 int i, res, brightness, actual_len; shark_led_work() local 160 res = usb_interrupt_msg(shark->usbdev, shark_led_work() 165 if (res < 0) shark_led_work() 167 shark->led_names[i], res); shark_led_work()
|
/linux-4.1.27/arch/mips/ar7/ |
H A D | platform.c | 569 int res; ar7_register_uarts() local 587 res = early_serial_setup(&uart_port); ar7_register_uarts() 588 if (res) ar7_register_uarts() 589 return res; ar7_register_uarts() 598 res = early_serial_setup(&uart_port); ar7_register_uarts() 599 if (res) ar7_register_uarts() 600 return res; ar7_register_uarts() 656 int res; ar7_register_devices() local 658 res = ar7_register_uarts(); ar7_register_devices() 659 if (res) ar7_register_devices() 660 pr_err("unable to setup uart(s): %d\n", res); ar7_register_devices() 662 res = platform_device_register(&physmap_flash); ar7_register_devices() 663 if (res) ar7_register_devices() 664 pr_warn("unable to register physmap-flash: %d\n", res); ar7_register_devices() 670 res = platform_device_register(&vlynq_low); ar7_register_devices() 671 if (res) ar7_register_devices() 672 pr_warn("unable to register vlynq-low: %d\n", res); ar7_register_devices() 676 res = platform_device_register(&vlynq_high); ar7_register_devices() 677 if (res) ar7_register_devices() 678 pr_warn("unable to register vlynq-high: %d\n", res); ar7_register_devices() 682 res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); ar7_register_devices() 683 if (!res) { ar7_register_devices() 686 res = platform_device_register(&cpmac_high); ar7_register_devices() 687 if (res) ar7_register_devices() 689 res); ar7_register_devices() 691 pr_warn("unable to add cpmac-high phy: %d\n", res); ar7_register_devices() 695 res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); ar7_register_devices() 696 if (!res) { ar7_register_devices() 698 res = platform_device_register(&cpmac_low); ar7_register_devices() 699 if (res) ar7_register_devices() 700 pr_warn("unable to register cpmac-low: %d\n", res); ar7_register_devices() 702 pr_warn("unable to add cpmac-low phy: %d\n", res); ar7_register_devices() 705 res = platform_device_register(&ar7_gpio_leds); ar7_register_devices() 706 if (res) ar7_register_devices() 707 pr_warn("unable to register leds: %d\n", res); ar7_register_devices() 709 res = platform_device_register(&ar7_udc); ar7_register_devices() 710 if (res) ar7_register_devices() 711 pr_warn("unable to register usb slave: %d\n", res); ar7_register_devices() 724 res = platform_device_register(&ar7_wdt); ar7_register_devices() 725 if (res) ar7_register_devices() 726 pr_warn("unable to register watchdog: %d\n", res); ar7_register_devices()
|
/linux-4.1.27/drivers/staging/media/omap4iss/ |
H A D | iss.h | 97 struct resource *res[OMAP4_ISS_MEM_LAST]; member in struct:iss_device 146 enum iss_subclk_resource res); 148 enum iss_subclk_resource res); 150 enum iss_isp_subclk_resource res); 152 enum iss_isp_subclk_resource res); 163 * @res: memory resource in which the register is located 169 u32 iss_reg_read(struct iss_device *iss, enum iss_mem_resources res, iss_reg_read() argument 172 return readl(iss->regs[res] + offset); iss_reg_read() 178 * @res: memory resource in which the register is located 183 void iss_reg_write(struct iss_device *iss, enum iss_mem_resources res, iss_reg_write() argument 186 writel(value, iss->regs[res] + offset); iss_reg_write() 192 * @res: memory resource in which the register is located 197 void iss_reg_clr(struct iss_device *iss, enum iss_mem_resources res, iss_reg_clr() argument 200 u32 v = iss_reg_read(iss, res, offset); iss_reg_clr() 202 iss_reg_write(iss, res, offset, v & ~clr); iss_reg_clr() 208 * @res: memory resource in which the register is located 213 void iss_reg_set(struct iss_device *iss, enum iss_mem_resources res, iss_reg_set() argument 216 u32 v = iss_reg_read(iss, res, offset); iss_reg_set() 218 iss_reg_write(iss, res, offset, v | set); iss_reg_set() 224 * @res: memory resource in which the register is located 232 void iss_reg_update(struct iss_device *iss, enum iss_mem_resources res, iss_reg_update() argument 235 u32 v = iss_reg_read(iss, res, offset); iss_reg_update() 237 iss_reg_write(iss, res, offset, (v & ~clr) | set); iss_reg_update()
|
/linux-4.1.27/arch/x86/platform/olpc/ |
H A D | olpc_dt.c | 30 void *res[] = { &node }; olpc_dt_getsibling() local 35 if (olpc_ofw("peer", args, res) || (s32)node == -1) olpc_dt_getsibling() 44 void *res[] = { &node }; olpc_dt_getchild() local 49 if (olpc_ofw("child", args, res) || (s32)node == -1) { olpc_dt_getchild() 61 void *res[] = { &len }; olpc_dt_getproplen() local 66 if (olpc_ofw("getproplen", args, res)) { olpc_dt_getproplen() 84 void *res[] = { &plen }; olpc_dt_getproperty() local 86 if (olpc_ofw("getprop", args, res)) { olpc_dt_getproperty() 99 void *res[] = { &success }; olpc_dt_nextprop() local 106 if (olpc_ofw("nextprop", args, res) || success != 1) olpc_dt_nextprop() 116 void *res[] = { len }; olpc_dt_pkg2path() local 121 if (olpc_ofw("package-to-path", args, res) || *len < 1) olpc_dt_pkg2path() 133 void *res; prom_early_alloc() local 144 res = alloc_bootmem(chunk_size); prom_early_alloc() 145 BUG_ON(!res); prom_early_alloc() 147 memset(res, 0, chunk_size); prom_early_alloc() 149 mem = res; prom_early_alloc() 154 res = mem; prom_early_alloc() 156 return res; prom_early_alloc() 172 void *res[] = { &node }; olpc_dt_finddevice() local 174 if (olpc_ofw("finddevice", args, res)) { olpc_dt_finddevice() 189 void *res[] = { &result }; olpc_dt_interpret() local 191 if (olpc_ofw("interpret", args, res)) { olpc_dt_interpret()
|
/linux-4.1.27/drivers/ide/ |
H A D | gayle.c | 119 struct resource *res; amiga_gayle_ide_probe() local 128 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); amiga_gayle_ide_probe() 129 if (!res) amiga_gayle_ide_probe() 132 if (!request_mem_region(res->start, resource_size(res), "IDE")) amiga_gayle_ide_probe() 164 release_mem_region(res->start, resource_size(res)); amiga_gayle_ide_probe() 171 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); amiga_gayle_ide_remove() local 174 release_mem_region(res->start, resource_size(res)); amiga_gayle_ide_remove()
|
/linux-4.1.27/scripts/kconfig/ |
H A D | nconf.gui.c | 205 int res = 0; get_line_length() local 208 res++; get_line_length() 210 return res; get_line_length() 256 int res = -1; btn_dialog() local 320 while ((res = wgetch(win))) { btn_dialog() 321 switch (res) { btn_dialog() 338 if (res == 10 || res == ' ') { btn_dialog() 339 res = item_index(current_item(menu)); btn_dialog() 341 } else if (res == 27 || res == KEY_F(F_BACK) || btn_dialog() 342 res == KEY_F(F_EXIT)) { btn_dialog() 343 res = KEY_EXIT; btn_dialog() 354 return res; btn_dialog() 368 int res = -1; dialog_inputbox() local 426 while ((res = wgetch(form_win))) { dialog_inputbox() 428 switch (res) { dialog_inputbox() 477 if ((isgraph(res) || isspace(res))) { dialog_inputbox() 488 result[cursor_position] = res; dialog_inputbox() 493 mvprintw(0, 0, "unknown key: %d\n", res); dialog_inputbox() 511 if (res == 10) { dialog_inputbox() 512 res = 0; dialog_inputbox() 514 } else if (res == 27 || res == KEY_F(F_BACK) || dialog_inputbox() 515 res == KEY_F(F_EXIT)) { dialog_inputbox() 516 res = KEY_EXIT; dialog_inputbox() 518 } else if (res == KEY_F(F_HELP)) { dialog_inputbox() 519 res = 1; dialog_inputbox() 530 return res; dialog_inputbox() 546 int res; show_scroll_win() local 605 res = wgetch(win); show_scroll_win() 606 switch (res) { show_scroll_win() 639 if (res == 10 || res == 27 || res == 'q' || show_scroll_win() 640 res == KEY_F(F_HELP) || res == KEY_F(F_BACK) || show_scroll_win() 641 res == KEY_F(F_EXIT)) show_scroll_win() 651 } while (res); show_scroll_win()
|
/linux-4.1.27/drivers/staging/rtl8723au/core/ |
H A D | rtw_cmd.c | 173 int res = _SUCCESS; rtw_init_cmd_priv23a() local 181 res = _FAIL; rtw_init_cmd_priv23a() 183 return res; rtw_init_cmd_priv23a() 221 int res = _FAIL; rtw_enqueue_cmd23a() local 228 res = rtw_cmd_filter(pcmdpriv, cmd_obj); rtw_enqueue_cmd23a() 229 if (res == _FAIL) { rtw_enqueue_cmd23a() 236 res = queue_work(pcmdpriv->wq, &cmd_obj->work); rtw_enqueue_cmd23a() 238 if (!res) { rtw_enqueue_cmd23a() 240 res = _FAIL; rtw_enqueue_cmd23a() 242 res = _SUCCESS; rtw_enqueue_cmd23a() 245 return res; rtw_enqueue_cmd23a() 277 pcmd->res = H2C_DROPPED; rtw_cmd_work() 289 pcmd->res = cmd_hdl(pcmd->padapter, pcmd->parmbuf); rtw_cmd_work() 291 pcmd->res = H2C_DROPPED; rtw_cmd_work() 293 pcmd->res = H2C_PARAMETERS_ERROR; rtw_cmd_work() 323 int res = _FAIL; rtw_sitesurvey_cmd23a() local 382 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_sitesurvey_cmd23a() 384 if (res == _SUCCESS) { rtw_sitesurvey_cmd23a() 392 return res; rtw_sitesurvey_cmd23a() 408 u8 res = _SUCCESS; rtw_createbss_cmd23a() local 424 res = _FAIL; rtw_createbss_cmd23a() 436 res = rtw_enqueue_cmd23a(pcmdpriv, pcmd); rtw_createbss_cmd23a() 440 return res; rtw_createbss_cmd23a() 446 int res = _SUCCESS; rtw_joinbss_cmd23a() local 471 res = _FAIL; rtw_joinbss_cmd23a() 495 res = _FAIL; rtw_joinbss_cmd23a() 585 res = rtw_enqueue_cmd23a(pcmdpriv, pcmd); rtw_joinbss_cmd23a() 588 return res; rtw_joinbss_cmd23a() 597 int res = _SUCCESS; rtw_disassoc_cmd23a() local 605 res = _FAIL; rtw_disassoc_cmd23a() 614 res = _FAIL; rtw_disassoc_cmd23a() 619 res = rtw_enqueue_cmd23a(cmdpriv, cmdobj); rtw_disassoc_cmd23a() 624 res = _FAIL; rtw_disassoc_cmd23a() 629 return res; rtw_disassoc_cmd23a() 638 int res = _SUCCESS; rtw_setopmode_cmd23a() local 642 res = false; rtw_setopmode_cmd23a() 649 res = false; rtw_setopmode_cmd23a() 656 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_setopmode_cmd23a() 658 return res; rtw_setopmode_cmd23a() 670 int res = _SUCCESS; rtw_setstakey_cmd23a() local 674 res = _FAIL; rtw_setstakey_cmd23a() 681 res = _FAIL; rtw_setstakey_cmd23a() 689 res = _FAIL; rtw_setstakey_cmd23a() 719 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_setstakey_cmd23a() 723 return res; rtw_setstakey_cmd23a() 734 int res = _SUCCESS; rtw_clearstakey_cmd23a() local 741 res = _FAIL; rtw_clearstakey_cmd23a() 749 res = _FAIL; rtw_clearstakey_cmd23a() 758 res = _FAIL; rtw_clearstakey_cmd23a() 773 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_clearstakey_cmd23a() 776 return res; rtw_clearstakey_cmd23a() 784 int res = _SUCCESS; rtw_addbareq_cmd23a() local 787 res = _FAIL; rtw_addbareq_cmd23a() 793 res = _FAIL; rtw_addbareq_cmd23a() 800 res = _FAIL; rtw_addbareq_cmd23a() 810 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_addbareq_cmd23a() 812 return res; rtw_addbareq_cmd23a() 820 int res = _SUCCESS; rtw_dynamic_chk_wk_cmd23a() local 824 res = _FAIL; rtw_dynamic_chk_wk_cmd23a() 831 res = _FAIL; rtw_dynamic_chk_wk_cmd23a() 842 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_dynamic_chk_wk_cmd23a() 845 return res; rtw_dynamic_chk_wk_cmd23a() 1002 int res = _SUCCESS; rtw_lps_ctrl_wk_cmd23a() local 1007 res = _FAIL; rtw_lps_ctrl_wk_cmd23a() 1015 res = _FAIL; rtw_lps_ctrl_wk_cmd23a() 1026 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_lps_ctrl_wk_cmd23a() 1031 return res; rtw_lps_ctrl_wk_cmd23a() 1039 int res = _SUCCESS; rtw_ps_cmd23a() local 1043 res = _FAIL; rtw_ps_cmd23a() 1051 res = _FAIL; rtw_ps_cmd23a() 1060 res = rtw_enqueue_cmd23a(pcmdpriv, ppscmd); rtw_ps_cmd23a() 1063 return res; rtw_ps_cmd23a() 1109 int res = _SUCCESS; rtw_chk_hi_queue_cmd23a() local 1113 res = _FAIL; rtw_chk_hi_queue_cmd23a() 1121 res = _FAIL; rtw_chk_hi_queue_cmd23a() 1132 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_chk_hi_queue_cmd23a() 1135 return res; rtw_chk_hi_queue_cmd23a() 1144 int res = _SUCCESS; rtw_c2h_wk_cmd23a() local 1148 res = _FAIL; rtw_c2h_wk_cmd23a() 1156 res = _FAIL; rtw_c2h_wk_cmd23a() 1167 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_c2h_wk_cmd23a() 1171 return res; rtw_c2h_wk_cmd23a() 1283 if (pcmd->res == H2C_DROPPED) { rtw_survey_cmd_callback23a() 1288 } else if (pcmd->res != H2C_SUCCESS) { rtw_survey_cmd_callback23a() 1304 if (pcmd->res != H2C_SUCCESS) { rtw_disassoc_cmd23a_callback() 1322 if (pcmd->res == H2C_DROPPED) { rtw_joinbss_cmd23a_callback() 1327 } else if (pcmd->res != H2C_SUCCESS) { rtw_joinbss_cmd23a_callback() 1346 if (pcmd->res != H2C_SUCCESS) { rtw_createbss_cmd23a_callback()
|
/linux-4.1.27/drivers/net/wireless/hostap/ |
H A D | hostap_cs.c | 224 int res; sandisk_set_iobase() local 227 res = pcmcia_write_config_byte(hw_priv->link, 0x10, sandisk_set_iobase() 229 if (res != 0) { sandisk_set_iobase() 231 " res=%d\n", res); sandisk_set_iobase() 235 res = pcmcia_write_config_byte(hw_priv->link, 0x12, sandisk_set_iobase() 237 if (res != 0) { sandisk_set_iobase() 239 " res=%d\n", res); sandisk_set_iobase() 261 int res, ret = 0; sandisk_enable_wireless() local 288 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, sandisk_enable_wireless() 290 if (res != 0) { sandisk_enable_wireless() 292 dev->name, res); sandisk_enable_wireless() 301 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, sandisk_enable_wireless() 304 if (res != 0) { sandisk_enable_wireless() 306 dev->name, res); sandisk_enable_wireless() 325 int res; prism2_pccard_cor_sreset() local 332 res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &val); prism2_pccard_cor_sreset() 333 if (res != 0) { prism2_pccard_cor_sreset() 335 res); prism2_pccard_cor_sreset() 342 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); prism2_pccard_cor_sreset() 343 if (res != 0) { prism2_pccard_cor_sreset() 345 res); prism2_pccard_cor_sreset() 354 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); prism2_pccard_cor_sreset() 355 if (res != 0) { prism2_pccard_cor_sreset() 357 res); prism2_pccard_cor_sreset() 370 int res; prism2_pccard_genesis_reset() local 382 res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &old_cor); prism2_pccard_genesis_reset() 383 if (res != 0) { prism2_pccard_genesis_reset() 384 printk(KERN_DEBUG "%s failed 1 (%d)\n", __func__, res); prism2_pccard_genesis_reset() 389 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, prism2_pccard_genesis_reset() 391 if (res != 0) { prism2_pccard_genesis_reset() 392 printk(KERN_DEBUG "%s failed 2 (%d)\n", __func__, res); prism2_pccard_genesis_reset() 399 res = pcmcia_write_config_byte(hw_priv->link, CISREG_CCSR, hcr); prism2_pccard_genesis_reset() 400 if (res != 0) { prism2_pccard_genesis_reset() 401 printk(KERN_DEBUG "%s failed 3 (%d)\n", __func__, res); prism2_pccard_genesis_reset() 406 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, prism2_pccard_genesis_reset() 408 if (res != 0) { prism2_pccard_genesis_reset() 409 printk(KERN_DEBUG "%s failed 4 (%d)\n", __func__, res); prism2_pccard_genesis_reset()
|
/linux-4.1.27/drivers/mfd/ |
H A D | lpc_sch.c | 95 struct resource *res, int size) lpc_sch_get_io() 116 res->start = base_addr; lpc_sch_get_io() 117 res->end = base_addr + size - 1; lpc_sch_get_io() 118 res->flags = IORESOURCE_IO; lpc_sch_get_io() 127 struct resource *res; lpc_sch_populate_cell() local 130 res = devm_kcalloc(&pdev->dev, 2, sizeof(*res), GFP_KERNEL); lpc_sch_populate_cell() 131 if (!res) lpc_sch_populate_cell() 134 ret = lpc_sch_get_io(pdev, where, name, res, size); lpc_sch_populate_cell() 141 cell->resources = res; lpc_sch_populate_cell() 150 res++; lpc_sch_populate_cell() 152 res->start = irq; lpc_sch_populate_cell() 153 res->end = irq; lpc_sch_populate_cell() 154 res->flags = IORESOURCE_IRQ; lpc_sch_populate_cell() 94 lpc_sch_get_io(struct pci_dev *pdev, int where, const char *name, struct resource *res, int size) lpc_sch_get_io() argument
|
H A D | davinci_voicecodec.c | 44 struct resource *res; davinci_vc_probe() local 64 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); davinci_vc_probe() 66 davinci_vc->base = devm_ioremap_resource(&pdev->dev, res); davinci_vc_probe() 80 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); davinci_vc_probe() 81 if (!res) { davinci_vc_probe() 87 davinci_vc->davinci_vcif.dma_tx_channel = res->start; davinci_vc_probe() 91 res = platform_get_resource(pdev, IORESOURCE_DMA, 1); davinci_vc_probe() 92 if (!res) { davinci_vc_probe() 98 davinci_vc->davinci_vcif.dma_rx_channel = res->start; davinci_vc_probe()
|
H A D | mfd-core.c | 124 struct resource *res; mfd_add_device() local 140 res = kzalloc(sizeof(*res) * cell->num_resources, GFP_KERNEL); mfd_add_device() 141 if (!res) mfd_add_device() 180 res[r].name = cell->resources[r].name; mfd_add_device() 181 res[r].flags = cell->resources[r].flags; mfd_add_device() 185 res[r].parent = mem_base; mfd_add_device() 186 res[r].start = mem_base->start + mfd_add_device() 188 res[r].end = mem_base->start + mfd_add_device() 195 res[r].start = res[r].end = irq_create_mapping( mfd_add_device() 198 res[r].start = irq_base + mfd_add_device() 200 res[r].end = irq_base + mfd_add_device() 204 res[r].parent = cell->resources[r].parent; mfd_add_device() 205 res[r].start = cell->resources[r].start; mfd_add_device() 206 res[r].end = cell->resources[r].end; mfd_add_device() 210 ret = acpi_check_resource_conflict(&res[r]); mfd_add_device() 216 ret = platform_device_add_resources(pdev, res, cell->num_resources); mfd_add_device() 227 kfree(res); mfd_add_device() 236 kfree(res); mfd_add_device()
|
H A D | janz-cmodio.c | 71 struct resource *res; cmodio_setup_subdevice() local 76 res = &priv->resources[devno * 3]; cmodio_setup_subdevice() 80 cell->resources = res; cmodio_setup_subdevice() 92 res->flags = IORESOURCE_MEM; cmodio_setup_subdevice() 93 res->parent = &pci->resource[3]; cmodio_setup_subdevice() 94 res->start = pci->resource[3].start + (CMODIO_MODULBUS_SIZE * modno); cmodio_setup_subdevice() 95 res->end = res->start + CMODIO_MODULBUS_SIZE - 1; cmodio_setup_subdevice() 96 res++; cmodio_setup_subdevice() 99 res->flags = IORESOURCE_MEM; cmodio_setup_subdevice() 100 res->parent = &pci->resource[4]; cmodio_setup_subdevice() 101 res->start = pci->resource[4].start; cmodio_setup_subdevice() 102 res->end = pci->resource[4].end; cmodio_setup_subdevice() 103 res++; cmodio_setup_subdevice() 112 res->flags = IORESOURCE_IRQ; cmodio_setup_subdevice() 113 res->parent = NULL; cmodio_setup_subdevice() 114 res->start = 0; cmodio_setup_subdevice() 115 res->end = 0; cmodio_setup_subdevice() 116 res++; cmodio_setup_subdevice()
|
/linux-4.1.27/arch/sparc/kernel/ |
H A D | ioport.c | 66 static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz); 69 static void _sparc_free_io(struct resource *res); 139 struct resource *res; iounmap() local 145 if ((res = lookup_resource(&sparc_iomap, vaddr)) == NULL) { iounmap() 149 _sparc_free_io(res); iounmap() 151 if ((char *)res >= (char*)xresv && (char *)res < (char *)&xresv[XNRES]) { iounmap() 152 xres_free((struct xresource *)res); iounmap() 154 kfree(res); iounmap() 159 void __iomem *of_ioremap(struct resource *res, unsigned long offset, of_ioremap() argument 162 return _sparc_alloc_io(res->flags & 0xF, of_ioremap() 163 res->start + offset, of_ioremap() 168 void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) of_iounmap() argument 182 struct resource *res; _sparc_alloc_io() local 191 res = &xres->xres; _sparc_alloc_io() 201 res = (struct resource *) tack; _sparc_alloc_io() 206 res->name = tack; _sparc_alloc_io() 208 va = _sparc_ioremap(res, busno, phys, size); _sparc_alloc_io() 216 _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) _sparc_ioremap() argument 220 if (allocate_resource(&sparc_iomap, res, _sparc_ioremap() 225 (res->name != NULL)? res->name: "???"); _sparc_ioremap() 230 srmmu_mapiorange(bus, pa, res->start, resource_size(res)); _sparc_ioremap() 232 return (void __iomem *)(unsigned long)(res->start + offset); _sparc_ioremap() 238 static void _sparc_free_io(struct resource *res) _sparc_free_io() argument 242 plen = resource_size(res); _sparc_free_io() 244 srmmu_unmapiorange(res->start, plen); _sparc_free_io() 245 release_resource(res); _sparc_free_io() 268 struct resource *res; sbus_alloc_coherent() local 285 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) sbus_alloc_coherent() 288 if (allocate_resource(&_sparc_dvma, res, len_total, sbus_alloc_coherent() 295 // srmmu_mapiorange(0, virt_to_phys(va), res->start, len_total); sbus_alloc_coherent() 300 if (sbus_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) sbus_alloc_coherent() 303 res->name = op->dev.of_node->name; sbus_alloc_coherent() 305 return (void *)(unsigned long)res->start; sbus_alloc_coherent() 308 release_resource(res); sbus_alloc_coherent() 310 kfree(res); sbus_alloc_coherent() 320 struct resource *res; sbus_free_coherent() local 323 if ((res = lookup_resource(&_sparc_dvma, sbus_free_coherent() 335 if (resource_size(res) != n) { sbus_free_coherent() 337 (long)resource_size(res), n); sbus_free_coherent() 341 release_resource(res); sbus_free_coherent() 342 kfree(res); sbus_free_coherent() 436 struct resource *res; pci32_alloc_coherent() local 453 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { pci32_alloc_coherent() 458 if (allocate_resource(&_sparc_dvma, res, len_total, pci32_alloc_coherent() 463 srmmu_mapiorange(0, virt_to_phys(va), res->start, len_total); pci32_alloc_coherent() 466 return (void *) res->start; pci32_alloc_coherent() 469 kfree(res); pci32_alloc_coherent() 487 struct resource *res; pci32_free_coherent() local 489 if ((res = lookup_resource(&_sparc_dvma, pci32_free_coherent() 501 if (resource_size(res) != n) { pci32_free_coherent() 503 (long)resource_size(res), (long)n); pci32_free_coherent() 510 release_resource(res); pci32_free_coherent() 511 kfree(res); pci32_free_coherent()
|
H A D | power.c | 38 struct resource *res = &op->resource[0]; power_probe() local 41 power_reg = of_ioremap(res, 0, 0x4, "power"); power_probe() 44 op->dev.of_node->name, res->start); power_probe()
|
/linux-4.1.27/arch/m68k/atari/ |
H A D | stram.c | 152 struct resource *res; atari_stram_alloc() local 160 res = kzalloc(sizeof(struct resource), GFP_KERNEL); atari_stram_alloc() 161 if (!res) atari_stram_alloc() 164 res->name = owner; atari_stram_alloc() 165 error = allocate_resource(&stram_pool, res, size, 0, UINT_MAX, atari_stram_alloc() 170 kfree(res); atari_stram_alloc() 174 pr_debug("atari_stram_alloc: returning %pR\n", res); atari_stram_alloc() 175 return atari_stram_to_virt(res->start); atari_stram_alloc() 183 struct resource *res; atari_stram_free() local 186 res = lookup_resource(&stram_pool, start); atari_stram_free() 187 if (!res) { atari_stram_free() 193 size = resource_size(res); atari_stram_free() 195 release_resource(res); atari_stram_free() 196 kfree(res); atari_stram_free()
|
/linux-4.1.27/arch/sh/drivers/pci/ |
H A D | fixups-dreamcast.c | 34 struct resource res; gapspci_fixup_resources() local 62 res.start = GAPSPCI_DMA_BASE; gapspci_fixup_resources() 63 res.end = GAPSPCI_DMA_BASE + GAPSPCI_DMA_SIZE - 1; gapspci_fixup_resources() 64 res.flags = IORESOURCE_MEM; gapspci_fixup_resources() 65 pcibios_resource_to_bus(dev->bus, ®ion, &res); gapspci_fixup_resources() 67 res.start, gapspci_fixup_resources() 69 resource_size(&res), gapspci_fixup_resources()
|
/linux-4.1.27/arch/mips/ralink/ |
H A D | of.c | 33 struct resource res; plat_of_remap_node() local 40 if (of_address_to_resource(np, 0, &res)) plat_of_remap_node() 43 if ((request_mem_region(res.start, plat_of_remap_node() 44 resource_size(&res), plat_of_remap_node() 45 res.name) < 0)) plat_of_remap_node() 48 return ioremap_nocache(res.start, resource_size(&res)); plat_of_remap_node()
|
/linux-4.1.27/arch/arm/lib/ |
H A D | delay.c | 80 u64 res; register_current_timer_delay() local 84 res = cyc_to_ns(1ULL, new_mult, new_shift); register_current_timer_delay() 86 if (res > 1000) { register_current_timer_delay() 88 timer, res); register_current_timer_delay() 92 if (!delay_calibrated && (!delay_res || (res < delay_res))) { register_current_timer_delay() 93 pr_info("Switching to timer-based delay loop, resolution %lluns\n", res); register_current_timer_delay() 96 delay_res = res; register_current_timer_delay()
|
/linux-4.1.27/drivers/bcma/ |
H A D | driver_chipcommon.c | 223 u32 res; bcma_chipco_gpio_out() local 226 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOOUT, mask, value); bcma_chipco_gpio_out() 229 return res; bcma_chipco_gpio_out() 236 u32 res; bcma_chipco_gpio_outen() local 239 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOOUTEN, mask, value); bcma_chipco_gpio_outen() 242 return res; bcma_chipco_gpio_outen() 253 u32 res; bcma_chipco_gpio_control() local 256 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOCTL, mask, value); bcma_chipco_gpio_control() 259 return res; bcma_chipco_gpio_control() 266 u32 res; bcma_chipco_gpio_intmask() local 269 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOIRQ, mask, value); bcma_chipco_gpio_intmask() 272 return res; bcma_chipco_gpio_intmask() 278 u32 res; bcma_chipco_gpio_polarity() local 281 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOPOL, mask, value); bcma_chipco_gpio_polarity() 284 return res; bcma_chipco_gpio_polarity() 290 u32 res; bcma_chipco_gpio_pullup() local 296 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOPULLUP, mask, value); bcma_chipco_gpio_pullup() 299 return res; bcma_chipco_gpio_pullup() 305 u32 res; bcma_chipco_gpio_pulldown() local 311 res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOPULLDOWN, mask, value); bcma_chipco_gpio_pulldown() 314 return res; bcma_chipco_gpio_pulldown()
|
/linux-4.1.27/drivers/gpu/drm/sti/ |
H A D | sti_drm_plane.c | 38 int res; sti_drm_update_plane() local 45 res = sti_mixer_set_layer_depth(mixer, layer); sti_drm_update_plane() 46 if (res) { sti_drm_update_plane() 48 return res; sti_drm_update_plane() 52 res = sti_layer_prepare(layer, crtc, fb, sti_drm_update_plane() 57 if (res) { sti_drm_update_plane() 59 return res; sti_drm_update_plane() 62 res = sti_layer_commit(layer); sti_drm_update_plane() 63 if (res) { sti_drm_update_plane() 65 return res; sti_drm_update_plane() 68 res = sti_mixer_set_layer_status(mixer, layer, true); sti_drm_update_plane() 69 if (res) { sti_drm_update_plane() 71 return res; sti_drm_update_plane()
|
/linux-4.1.27/arch/arm/mach-dove/ |
H A D | pcie.c | 31 struct resource res; member in struct:pcie_port 67 pp->res.name = pp->mem_space_name; dove_pcie_setup() 69 pp->res.start = DOVE_PCIE0_MEM_PHYS_BASE; dove_pcie_setup() 70 pp->res.end = pp->res.start + DOVE_PCIE0_MEM_SIZE - 1; dove_pcie_setup() 72 pp->res.start = DOVE_PCIE1_MEM_PHYS_BASE; dove_pcie_setup() 73 pp->res.end = pp->res.start + DOVE_PCIE1_MEM_SIZE - 1; dove_pcie_setup() 75 pp->res.flags = IORESOURCE_MEM; dove_pcie_setup() 76 if (request_resource(&iomem_resource, &pp->res)) dove_pcie_setup() 78 pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); dove_pcie_setup() 199 memset(&pp->res, 0, sizeof(pp->res)); add_pcie_port()
|
/linux-4.1.27/drivers/edac/ |
H A D | highbank_l2_edac.c | 65 int res = 0; highbank_l2_err_probe() local 82 res = -ENODEV; highbank_l2_err_probe() 89 res = -EBUSY; highbank_l2_err_probe() 96 res = -ENOMEM; highbank_l2_err_probe() 109 res = devm_request_irq(&pdev->dev, drvdata->db_irq, highbank_l2_err_probe() 112 if (res < 0) highbank_l2_err_probe() 116 res = devm_request_irq(&pdev->dev, drvdata->sb_irq, highbank_l2_err_probe() 119 if (res < 0) highbank_l2_err_probe() 129 return res; highbank_l2_err_probe()
|
/linux-4.1.27/arch/metag/kernel/ |
H A D | tcm.c | 124 pool->start = reg->res.start; tcm_add_region() 125 pool->end = reg->res.end; tcm_add_region() 139 if (gen_pool_add(pool->pool, reg->res.start, tcm_add_region() 140 reg->res.end - reg->res.start + 1, -1)) { tcm_add_region() 145 reg->res.name, reg->res.end - reg->res.start + 1, tcm_add_region() 146 reg->res.start); tcm_add_region()
|
/linux-4.1.27/drivers/usb/chipidea/ |
H A D | ci_hdrc_pci.c | 62 struct resource res[3]; ci_hdrc_pci_probe() local 91 memset(res, 0, sizeof(res)); ci_hdrc_pci_probe() 92 res[0].start = pci_resource_start(pdev, 0); ci_hdrc_pci_probe() 93 res[0].end = pci_resource_end(pdev, 0); ci_hdrc_pci_probe() 94 res[0].flags = IORESOURCE_MEM; ci_hdrc_pci_probe() 95 res[1].start = pdev->irq; ci_hdrc_pci_probe() 96 res[1].flags = IORESOURCE_IRQ; ci_hdrc_pci_probe() 98 ci->ci = ci_hdrc_add_device(&pdev->dev, res, nres, platdata); ci_hdrc_pci_probe()
|
/linux-4.1.27/arch/score/kernel/ |
H A D | setup.c | 93 struct resource *res; resource_init() local 100 res = alloc_bootmem(sizeof(struct resource)); resource_init() 101 res->name = "System RAM"; resource_init() 102 res->start = MEMORY_START; resource_init() 103 res->end = MEMORY_START + MEMORY_SIZE - 1; resource_init() 104 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; resource_init() 105 request_resource(&iomem_resource, res); resource_init() 107 request_resource(res, &code_resource); resource_init() 108 request_resource(res, &data_resource); resource_init()
|
/linux-4.1.27/arch/mips/vr41xx/common/ |
H A D | siu.c | 79 struct resource *res; vr41xx_siu_add() local 91 res = siu_type1_resource; vr41xx_siu_add() 98 res = siu_type2_resource; vr41xx_siu_add() 106 retval = platform_device_add_resources(pdev, res, num); vr41xx_siu_add() 126 struct resource *res; vr41xx_siu_setup() local 134 res = siu_type1_resource; vr41xx_siu_setup() 140 res = siu_type2_resource; vr41xx_siu_setup() 151 port.mapbase = res[i].start; vr41xx_siu_setup() 152 port.membase = (unsigned char __iomem *)KSEG1ADDR(res[i].start); vr41xx_siu_setup()
|
/linux-4.1.27/drivers/leds/ |
H A D | leds-cobalt-qube.c | 38 struct resource *res; cobalt_qube_led_probe() local 41 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); cobalt_qube_led_probe() 42 if (!res) cobalt_qube_led_probe() 45 led_port = devm_ioremap(&pdev->dev, res->start, resource_size(res)); cobalt_qube_led_probe()
|
/linux-4.1.27/arch/ia64/sn/kernel/ |
H A D | io_init.c | 128 sn_legacy_pci_window_fixup(struct resource *res, sn_legacy_pci_window_fixup() argument 131 res[0].name = "legacy_io"; sn_legacy_pci_window_fixup() 132 res[0].flags = IORESOURCE_IO; sn_legacy_pci_window_fixup() 133 res[0].start = legacy_io; sn_legacy_pci_window_fixup() 134 res[0].end = res[0].start + 0xffff; sn_legacy_pci_window_fixup() 135 res[0].parent = &ioport_resource; sn_legacy_pci_window_fixup() 136 res[1].name = "legacy_mem"; sn_legacy_pci_window_fixup() 137 res[1].flags = IORESOURCE_MEM; sn_legacy_pci_window_fixup() 138 res[1].start = legacy_mem; sn_legacy_pci_window_fixup() 139 res[1].end = res[1].start + (1024 * 1024) - 1; sn_legacy_pci_window_fixup() 140 res[1].parent = &iomem_resource; sn_legacy_pci_window_fixup() 239 struct resource *res; sn_pci_controller_fixup() local 252 res = kcalloc(2, sizeof(struct resource), GFP_KERNEL); sn_pci_controller_fixup() 253 BUG_ON(!res); sn_pci_controller_fixup() 261 sn_legacy_pci_window_fixup(res, sn_pci_controller_fixup() 264 pci_add_resource_offset(&resources, &res[0], sn_pci_controller_fixup() 266 pci_add_resource_offset(&resources, &res[1], sn_pci_controller_fixup() 272 kfree(res); sn_pci_controller_fixup()
|
/linux-4.1.27/arch/arm/plat-pxa/ |
H A D | ssp.c | 118 struct resource *res; pxa_ssp_probe() local 164 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); pxa_ssp_probe() 165 if (res == NULL) { pxa_ssp_probe() 169 ssp->drcmr_rx = res->start; pxa_ssp_probe() 171 res = platform_get_resource(pdev, IORESOURCE_DMA, 1); pxa_ssp_probe() 172 if (res == NULL) { pxa_ssp_probe() 176 ssp->drcmr_tx = res->start; pxa_ssp_probe() 179 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pxa_ssp_probe() 180 if (res == NULL) { pxa_ssp_probe() 185 res = devm_request_mem_region(dev, res->start, resource_size(res), pxa_ssp_probe() 187 if (res == NULL) { pxa_ssp_probe() 192 ssp->phys_base = res->start; pxa_ssp_probe() 194 ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res)); pxa_ssp_probe() 235 struct resource *res; pxa_ssp_remove() local 244 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pxa_ssp_remove() 245 release_mem_region(res->start, resource_size(res)); pxa_ssp_remove()
|
/linux-4.1.27/drivers/pci/host/ |
H A D | pci-versatile.c | 72 struct list_head *res) versatile_pci_parse_request_of_pci_ranges() 79 err = of_pci_get_host_bridge_resources(np, 0, 0xff, res, &iobase); versatile_pci_parse_request_of_pci_ranges() 83 resource_list_for_each_entry(win, res) { resource_list_for_each_entry() 84 struct resource *parent, *res = win->res; resource_list_for_each_entry() local 86 switch (resource_type(res)) { resource_list_for_each_entry() 89 err = pci_remap_iospace(res, iobase); resource_list_for_each_entry() 92 err, res); resource_list_for_each_entry() 98 res_valid |= !(res->flags & IORESOURCE_PREFETCH); resource_list_for_each_entry() 100 writel(res->start >> 28, PCI_IMAP(mem)); resource_list_for_each_entry() 110 err = devm_request_resource(dev, parent, res); resource_list_for_each_entry() 124 pci_free_resource_list(res); 133 struct resource *res; versatile_pci_probe() local 140 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); versatile_pci_probe() 141 versatile_pci_base = devm_ioremap_resource(&pdev->dev, res); versatile_pci_probe() 145 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); versatile_pci_probe() 146 versatile_cfg_base[0] = devm_ioremap_resource(&pdev->dev, res); versatile_pci_probe() 150 res = platform_get_resource(pdev, IORESOURCE_MEM, 2); versatile_pci_probe() 151 versatile_cfg_base[1] = devm_ioremap_resource(&pdev->dev, res); versatile_pci_probe() 71 versatile_pci_parse_request_of_pci_ranges(struct device *dev, struct list_head *res) versatile_pci_parse_request_of_pci_ranges() argument
|
/linux-4.1.27/arch/arm/kernel/ |
H A D | swp_emulate.c | 37 #define __user_swpX_asm(data, addr, res, temp, B) \ 55 : "=&r" (res), "+r" (data), "=&r" (temp) \ 59 #define __user_swp_asm(data, addr, res, temp) \ 60 __user_swpX_asm(data, addr, res, temp, "") 61 #define __user_swpb_asm(data, addr, res, temp) \ 62 __user_swpX_asm(data, addr, res, temp, "b") 134 unsigned int res = 0; emulate_swpX() local 146 __user_swpb_asm(*data, address, res, temp); emulate_swpX() 148 __user_swp_asm(*data, address, res, temp); emulate_swpX() 150 if (likely(res != -EAGAIN) || signal_pending(current)) emulate_swpX() 156 if (res == 0) { emulate_swpX() 163 return res; emulate_swpX() 174 unsigned int res = 0; swp_handler() local 178 res = arm_check_condition(instr, regs->ARM_cpsr); swp_handler() 179 switch (res) { swp_handler() 213 res = -EFAULT; swp_handler() 215 res = emulate_swpX(address, &data, type); swp_handler() 218 if (res == 0) { swp_handler() 226 } else if (res == -EFAULT) { swp_handler()
|
/linux-4.1.27/kernel/power/ |
H A D | user.c | 139 ssize_t res; snapshot_read() local 146 res = -ENODATA; snapshot_read() 150 res = snapshot_read_next(&data->handle); snapshot_read() 151 if (res <= 0) snapshot_read() 154 res = PAGE_SIZE - pg_offp; snapshot_read() 157 res = simple_read_from_buffer(buf, count, &pg_offp, snapshot_read() 158 data_of(data->handle), res); snapshot_read() 159 if (res > 0) snapshot_read() 160 *offp += res; snapshot_read() 165 return res; snapshot_read() 172 ssize_t res; snapshot_write() local 180 res = snapshot_write_next(&data->handle); snapshot_write() 181 if (res <= 0) snapshot_write() 184 res = PAGE_SIZE - pg_offp; snapshot_write() 187 res = simple_write_to_buffer(data_of(data->handle), res, &pg_offp, snapshot_write() 189 if (res > 0) snapshot_write() 190 *offp += res; snapshot_write() 194 return res; snapshot_write()
|
/linux-4.1.27/drivers/cpuidle/ |
H A D | cpuidle-clps711x.c | 44 struct resource *res; clps711x_cpuidle_probe() local 46 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); clps711x_cpuidle_probe() 47 clps711x_halt = devm_ioremap_resource(&pdev->dev, res); clps711x_cpuidle_probe()
|
/linux-4.1.27/arch/um/os-Linux/ |
H A D | tty.c | 15 int res; member in struct:grantpt_info 23 info->res = grantpt(info->fd); grantpt_cb() 43 if (info.res < 0) { get_pty()
|
/linux-4.1.27/drivers/usb/dwc2/ |
H A D | pci.c | 78 struct resource res[2]; dwc2_pci_probe() local 99 memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); dwc2_pci_probe() 101 res[0].start = pci_resource_start(pci, 0); dwc2_pci_probe() 102 res[0].end = pci_resource_end(pci, 0); dwc2_pci_probe() 103 res[0].name = "dwc2"; dwc2_pci_probe() 104 res[0].flags = IORESOURCE_MEM; dwc2_pci_probe() 106 res[1].start = pci->irq; dwc2_pci_probe() 107 res[1].name = "dwc2"; dwc2_pci_probe() 108 res[1].flags = IORESOURCE_IRQ; dwc2_pci_probe() 110 ret = platform_device_add_resources(dwc2, res, ARRAY_SIZE(res)); dwc2_pci_probe()
|
/linux-4.1.27/drivers/usb/dwc3/ |
H A D | dwc3-pci.c | 91 struct resource res[2]; dwc3_pci_probe() local 110 memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); dwc3_pci_probe() 112 res[0].start = pci_resource_start(pci, 0); dwc3_pci_probe() 113 res[0].end = pci_resource_end(pci, 0); dwc3_pci_probe() 114 res[0].name = "dwc_usb3"; dwc3_pci_probe() 115 res[0].flags = IORESOURCE_MEM; dwc3_pci_probe() 117 res[1].start = pci->irq; dwc3_pci_probe() 118 res[1].name = "dwc_usb3"; dwc3_pci_probe() 119 res[1].flags = IORESOURCE_IRQ; dwc3_pci_probe() 121 ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); dwc3_pci_probe()
|
/linux-4.1.27/arch/mips/lantiq/xway/ |
H A D | dcdc.c | 27 struct resource *res; dcdc_probe() local 29 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dcdc_probe() 30 dcdc_membase = devm_ioremap_resource(&pdev->dev, res); dcdc_probe()
|
/linux-4.1.27/arch/mips/lib/ |
H A D | bitops.c | 93 int res; __mips_test_and_set_bit() local 98 res = (mask & *a) != 0; __mips_test_and_set_bit() 101 return res; __mips_test_and_set_bit() 119 int res; __mips_test_and_set_bit_lock() local 124 res = (mask & *a) != 0; __mips_test_and_set_bit_lock() 127 return res; __mips_test_and_set_bit_lock() 144 int res; __mips_test_and_clear_bit() local 149 res = (mask & *a) != 0; __mips_test_and_clear_bit() 152 return res; __mips_test_and_clear_bit() 169 int res; __mips_test_and_change_bit() local 174 res = (mask & *a) != 0; __mips_test_and_change_bit() 177 return res; __mips_test_and_change_bit()
|
/linux-4.1.27/net/core/ |
H A D | sock_diag.c | 19 u64 res = atomic64_read(&sk->sk_cookie); sock_gen_cookie() local 21 if (res) sock_gen_cookie() 22 return res; sock_gen_cookie() 23 res = atomic64_inc_return(&sock_net(sk)->cookie_gen); sock_gen_cookie() 24 atomic64_cmpxchg(&sk->sk_cookie, 0, res); sock_gen_cookie() 30 u64 res; sock_diag_check_cookie() local 35 res = sock_gen_cookie(sk); sock_diag_check_cookie() 36 if ((u32)res != cookie[0] || (u32)(res >> 32) != cookie[1]) sock_diag_check_cookie() 45 u64 res = sock_gen_cookie(sk); sock_diag_save_cookie() local 47 cookie[0] = (u32)res; sock_diag_save_cookie() 48 cookie[1] = (u32)(res >> 32); sock_diag_save_cookie()
|
/linux-4.1.27/drivers/parisc/ |
H A D | eisa_enumerator.c | 87 struct resource *res; configure_memory() local 94 if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) { configure_memory() 97 res->name = name; configure_memory() 98 res->start = mem_parent->start + get_24(buf+len+2); configure_memory() 99 res->end = res->start + get_16(buf+len+5)*1024; configure_memory() 100 res->flags = IORESOURCE_MEM; configure_memory() 101 printk("memory %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); configure_memory() 102 result = request_resource(mem_parent, res); configure_memory() 178 struct resource *res; configure_port() local 186 if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) { configure_port() 187 res->name = board; configure_port() 188 res->start = get_16(buf+len+1); configure_port() 189 res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1; configure_port() 190 res->flags = IORESOURCE_IO; configure_port() 191 printk("ioports %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); configure_port() 192 result = request_resource(io_parent, res); configure_port() 323 int res=0; parse_slot_config() local 404 res=-1; parse_slot_config() 417 res=-1; parse_slot_config() 423 res=-2; parse_slot_config() 426 return res; parse_slot_config()
|
/linux-4.1.27/drivers/eisa/ |
H A D | pci_eisa.c | 25 struct resource *res, *bus_res = NULL; pci_eisa_init() local 42 pci_bus_for_each_resource(pdev->bus, res, i) pci_eisa_init() 43 if (res && (res->flags & IORESOURCE_IO)) { pci_eisa_init() 44 bus_res = res; pci_eisa_init() 54 pci_eisa_root.res = bus_res; pci_eisa_init()
|
/linux-4.1.27/arch/arm/crypto/ |
H A D | sha256_glue.c | 97 int res = crypto_register_shashes(algs, ARRAY_SIZE(algs)); sha256_mod_init() local 99 if (res < 0) sha256_mod_init() 100 return res; sha256_mod_init() 103 res = crypto_register_shashes(sha256_neon_algs, sha256_mod_init() 106 if (res < 0) sha256_mod_init() 110 return res; sha256_mod_init()
|
/linux-4.1.27/drivers/net/wireless/b43/ |
H A D | pcmcia.c | 67 int res = 0; b43_pcmcia_probe() local 81 res = pcmcia_request_window(dev, dev->resource[2], 250); b43_pcmcia_probe() 82 if (res != 0) b43_pcmcia_probe() 85 res = pcmcia_map_mem_page(dev, dev->resource[2], 0); b43_pcmcia_probe() 86 if (res != 0) b43_pcmcia_probe() 92 res = pcmcia_enable_device(dev); b43_pcmcia_probe() 93 if (res != 0) b43_pcmcia_probe() 109 res, err); b43_pcmcia_probe()
|