Searched refs:res (Results 1 - 200 of 2931) sorted by relevance

1234567891011>>

/linux-4.4.14/tools/lib/
H A Dhweight.c19 unsigned int res = w - ((w >> 1) & 0x55555555); __sw_hweight32()
20 res = (res & 0x33333333) + ((res >> 2) & 0x33333333); __sw_hweight32()
21 res = (res + (res >> 4)) & 0x0F0F0F0F; __sw_hweight32()
22 res = res + (res >> 8); __sw_hweight32()
23 return (res + (res >> 16)) & 0x000000FF; __sw_hweight32()
29 unsigned int res = w - ((w >> 1) & 0x5555); __sw_hweight16() local
30 res = (res & 0x3333) + ((res >> 2) & 0x3333); __sw_hweight16()
31 res = (res + (res >> 4)) & 0x0F0F; __sw_hweight16()
32 return (res + (res >> 8)) & 0x00FF; __sw_hweight16()
37 unsigned int res = w - ((w >> 1) & 0x55); __sw_hweight8() local
38 res = (res & 0x33) + ((res >> 2) & 0x33); __sw_hweight8()
39 return (res + (res >> 4)) & 0x0F; __sw_hweight8()
54 __u64 res = w - ((w >> 1) & 0x5555555555555555ul); __sw_hweight64()
55 res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul); __sw_hweight64()
56 res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0Ful; __sw_hweight64()
57 res = res + (res >> 8); __sw_hweight64()
58 res = res + (res >> 16); __sw_hweight64()
59 return (res + (res >> 32)) & 0x00000000000000FFul; __sw_hweight64()
/linux-4.4.14/lib/
H A Dhweight.c20 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 Dkstrtox.h6 unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long *res);
H A Dkstrtox.c49 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 Dstrncpy_from_user.c26 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()
/linux-4.4.14/drivers/pcmcia/
H A Drsrc_iodyn.c30 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 Drsrc_mgr.c37 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 Dpcmcia_resource.c61 * @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()
594 if (s->io[i].res) { pcmcia_enable_device()
597 switch (s->io[i].res->flags & IO_DATA_PATH_WIDTH) { pcmcia_enable_device()
605 iomap.start = s->io[i].res->start; pcmcia_enable_device()
606 iomap.stop = s->io[i].res->end; pcmcia_enable_device()
866 * @res: &struct resource pointing to p_dev->resource[2..5]
870 * &struct resource @res pointing to one of the entries in
875 int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res, pcmcia_request_window() argument
883 dev_dbg(&p_dev->dev, "request_window %pR %d\n", res, speed); pcmcia_request_window()
891 if (res->end == 0) pcmcia_request_window()
892 res->end = s->map_size; pcmcia_request_window()
893 align = (s->features & SS_CAP_MEM_ALIGN) ? res->end : s->map_size; pcmcia_request_window()
894 if (res->end & (s->map_size-1)) { pcmcia_request_window()
898 if ((res->start && (s->features & SS_CAP_STATIC_MAP)) || pcmcia_request_window()
899 (res->start & (align-1))) { pcmcia_request_window()
903 if (res->start) pcmcia_request_window()
920 win->res = pcmcia_find_mem_region(res->start, res->end, align, pcmcia_request_window()
922 if (!win->res) { pcmcia_request_window()
932 win->flags = res->flags & WIN_FLAGS_MAP; pcmcia_request_window()
945 res->start = win->static_start; pcmcia_request_window()
947 res->start = win->res->start; pcmcia_request_window()
950 res->end += res->start - 1; pcmcia_request_window()
951 res->flags &= ~WIN_FLAGS_REQ; pcmcia_request_window()
952 res->flags |= (win->map << 2) | IORESOURCE_MEM; pcmcia_request_window()
953 res->parent = win->res; pcmcia_request_window()
954 if (win->res) pcmcia_request_window()
955 request_resource(&iomem_resource, res); pcmcia_request_window()
957 dev_dbg(&p_dev->dev, "request_window results in %pR\n", res); pcmcia_request_window()
985 struct resource *res = p_dev->resource[MAX_IO_WIN + i]; pcmcia_disable_device() local
986 if (res->flags & WIN_FLAGS_REQ) pcmcia_disable_device()
987 pcmcia_release_window(p_dev, res); pcmcia_disable_device()
H A Drsrc_nonstatic.c79 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
204 res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); do_io_probe()
205 if (!res) do_io_probe()
211 free_region(res); do_io_probe()
221 res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); do_io_probe()
222 if (!res) { do_io_probe()
232 free_region(res); do_io_probe()
266 static int readable(struct pcmcia_socket *s, struct resource *res, readable() argument
276 s->cis_mem.res = res; readable()
277 s->cis_virt = ioremap(res->start, s->map_size); readable()
288 s->cis_mem.res = NULL; readable()
297 static int checksum(struct pcmcia_socket *s, struct resource *res, checksum() argument
304 virt = ioremap(res->start, s->map_size); checksum()
309 map.res = res; checksum()
350 struct resource *res, do_validate_mem()
405 struct resource *res, do_mem_probe()
408 struct resource *res, do_mem_probe()
606 pcmcia_align(void *align_data, const struct resource *res, pcmcia_align() argument
613 start = pcmcia_common_align(data, res->start); pcmcia_align()
631 if (start >= res->end) pcmcia_align()
642 start = res->end; pcmcia_align()
689 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO, __nonstatic_find_io_region() local
702 ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1, __nonstatic_find_io_region()
706 ret = allocate_resource(&ioport_resource, res, num, min, ~0UL, __nonstatic_find_io_region()
710 kfree(res); __nonstatic_find_io_region()
711 res = NULL; __nonstatic_find_io_region()
713 return res; __nonstatic_find_io_region()
727 if (!s->io[i].res) nonstatic_find_io()
733 if ((s->io[i].res->start & (align-1)) == *base) nonstatic_find_io()
738 struct resource *res = s->io[i].res; nonstatic_find_io() local
741 if (res && (res->flags & IORESOURCE_BITS) != nonstatic_find_io()
745 if (!res) { nonstatic_find_io()
749 res = s->io[i].res = __nonstatic_find_io_region(s, nonstatic_find_io()
752 if (!res) nonstatic_find_io()
755 *base = res->start; nonstatic_find_io()
756 s->io[i].res->flags = nonstatic_find_io()
757 ((res->flags & ~IORESOURCE_BITS) | nonstatic_find_io()
760 *parent = res; nonstatic_find_io()
765 try = res->end + 1; nonstatic_find_io()
767 ret = __nonstatic_adjust_io_region(s, res->start, nonstatic_find_io()
768 res->end + num); nonstatic_find_io()
770 ret = adjust_resource(s->io[i].res, res->start, nonstatic_find_io()
771 resource_size(res) + num); nonstatic_find_io()
776 *parent = res; nonstatic_find_io()
782 try = res->start - num; nonstatic_find_io()
785 res->start - num, nonstatic_find_io()
786 res->end); nonstatic_find_io()
788 ret = adjust_resource(s->io[i].res, nonstatic_find_io()
789 res->start - num, nonstatic_find_io()
790 resource_size(res) + num); nonstatic_find_io()
795 *parent = res; nonstatic_find_io()
808 struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_MEM, nonstatic_find_mem_region() local
834 res, num, 1, min, 0, nonstatic_find_mem_region()
840 res, num, min, max, 1, nonstatic_find_mem_region()
853 kfree(res); nonstatic_find_mem_region()
854 res = NULL; nonstatic_find_mem_region()
856 return res; nonstatic_find_mem_region()
933 struct resource *res; local
962 res = s->cb_dev->bus->resource[i];
964 pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
966 if (!res)
969 if (res->flags & IORESOURCE_IO) {
973 if (res == &ioport_resource)
978 res);
979 if (!adjust_io(s, ADD_MANAGED_RESOURCE, res->start, res->end))
984 if (res->flags & IORESOURCE_MEM) {
988 if (res == &iomem_resource)
993 res);
994 if (!adjust_memory(s, ADD_MANAGED_RESOURCE, res->start, res->end))
347 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
403 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.4.14/arch/microblaze/include/asm/
H A Datomic.h15 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.4.14/arch/mips/ath79/
H A Dpci.c138 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 Ddev-common.c100 struct resource res; ath79_register_wdt() local
102 memset(&res, 0, sizeof(res)); ath79_register_wdt()
104 res.flags = IORESOURCE_MEM; ath79_register_wdt()
105 res.start = AR71XX_RESET_BASE + AR71XX_RESET_REG_WDOG_CTRL; ath79_register_wdt()
106 res.end = res.start + 0x8 - 1; ath79_register_wdt()
108 platform_device_register_simple("ath79-wdt", -1, &res, 1); ath79_register_wdt()
/linux-4.4.14/fs/hfs/
H A Dattr.c23 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 Dextent.c112 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 Dbfind.c48 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 Ddir.c26 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.4.14/fs/ocfs2/dlm/
H A Ddlmthread.c59 /* 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()
215 if (!list_empty(&res->tracking)) dlm_purge_lockres()
216 list_del_init(&res->tracking); dlm_purge_lockres()
219 res->lockname.len, res->lockname.name); dlm_purge_lockres()
220 __dlm_print_one_lock_resource(res); dlm_purge_lockres()
227 res->state &= ~DLM_LOCK_RES_DROPPING_REF; dlm_purge_lockres()
228 spin_unlock(&res->spinlock); dlm_purge_lockres()
229 wake_up(&res->wq); dlm_purge_lockres()
231 spin_unlock(&res->spinlock); dlm_purge_lockres()
274 mlog(0, "%s: res %.*s is in use or being remastered, " dlm_run_purge_list()
299 struct dlm_lock_resource *res) dlm_shuffle_lists()
311 assert_spin_locked(&res->spinlock); dlm_shuffle_lists()
312 BUG_ON((res->state & (DLM_LOCK_RES_MIGRATING| dlm_shuffle_lists()
317 if (list_empty(&res->converting)) dlm_shuffle_lists()
319 mlog(0, "%s: res %.*s has locks on the convert queue\n", dlm->name, dlm_shuffle_lists()
320 res->lockname.len, res->lockname.name); dlm_shuffle_lists()
322 target = list_entry(res->converting.next, struct dlm_lock, list); dlm_shuffle_lists()
324 mlog(ML_ERROR, "%s: res %.*s converting lock to invalid mode\n", dlm_shuffle_lists()
325 dlm->name, res->lockname.len, res->lockname.name); dlm_shuffle_lists()
328 list_for_each_entry(lock, &res->granted, list) { dlm_shuffle_lists()
336 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists()
346 list_for_each_entry(lock, &res->converting, list) { dlm_shuffle_lists()
353 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists()
367 mlog(0, "%s: res %.*s, AST for Converting lock %u:%llu, type " dlm_shuffle_lists()
368 "%d => %d, node %u\n", dlm->name, res->lockname.len, dlm_shuffle_lists()
369 res->lockname.name, dlm_shuffle_lists()
377 list_move_tail(&target->list, &res->granted); dlm_shuffle_lists()
384 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists()
391 if (list_empty(&res->blocked)) dlm_shuffle_lists()
393 target = list_entry(res->blocked.next, struct dlm_lock, list); dlm_shuffle_lists()
395 list_for_each_entry(lock, &res->granted, list) { dlm_shuffle_lists()
401 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists()
409 list_for_each_entry(lock, &res->converting, list) { dlm_shuffle_lists()
415 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists()
429 mlog(0, "%s: res %.*s, AST for Blocked lock %u:%llu, type %d, " dlm_shuffle_lists()
430 "node %u\n", dlm->name, res->lockname.len, dlm_shuffle_lists()
431 res->lockname.name, dlm_shuffle_lists()
437 list_move_tail(&target->list, &res->granted); dlm_shuffle_lists()
444 __dlm_lockres_reserve_ast(res); dlm_shuffle_lists()
454 /* must have NO locks when calling this with res !=NULL * */ dlm_kick_thread()
455 void dlm_kick_thread(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_kick_thread() argument
457 if (res) { dlm_kick_thread()
459 spin_lock(&res->spinlock); dlm_kick_thread()
460 __dlm_dirty_lockres(dlm, res); dlm_kick_thread()
461 spin_unlock(&res->spinlock); dlm_kick_thread()
467 void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_dirty_lockres() argument
470 assert_spin_locked(&res->spinlock); __dlm_dirty_lockres()
473 if ((res->owner == dlm->node_num)) { __dlm_dirty_lockres()
474 if (res->state & (DLM_LOCK_RES_MIGRATING | __dlm_dirty_lockres()
478 if (list_empty(&res->dirty)) { __dlm_dirty_lockres()
480 dlm_lockres_get(res); __dlm_dirty_lockres()
481 list_add_tail(&res->dirty, &dlm->dirty_list); __dlm_dirty_lockres()
482 res->state |= DLM_LOCK_RES_DIRTY; __dlm_dirty_lockres()
486 mlog(0, "%s: res %.*s\n", dlm->name, res->lockname.len, __dlm_dirty_lockres()
487 res->lockname.name); __dlm_dirty_lockres()
531 struct dlm_lock_resource *res; dlm_flush_asts() local
540 res = lock->lockres; dlm_flush_asts()
541 mlog(0, "%s: res %.*s, Flush AST for lock %u:%llu, type %d, " dlm_flush_asts()
542 "node %u\n", dlm->name, res->lockname.len, dlm_flush_asts()
543 res->lockname.name, dlm_flush_asts()
556 ret = dlm_do_remote_ast(dlm, res, lock); dlm_flush_asts()
560 dlm_do_local_ast(dlm, res, lock); dlm_flush_asts()
567 mlog(0, "%s: res %.*s, AST queued while flushing last " dlm_flush_asts()
568 "one\n", dlm->name, res->lockname.len, dlm_flush_asts()
569 res->lockname.name); dlm_flush_asts()
576 dlm_lockres_release_ast(dlm, res); dlm_flush_asts()
584 res = lock->lockres; dlm_flush_asts()
600 mlog(0, "%s: res %.*s, Flush BAST for lock %u:%llu, " dlm_flush_asts()
602 dlm->name, res->lockname.len, res->lockname.name, dlm_flush_asts()
608 ret = dlm_send_proxy_bast(dlm, res, lock, hi); dlm_flush_asts()
612 dlm_do_local_bast(dlm, res, lock, hi); dlm_flush_asts()
619 mlog(0, "%s: res %.*s, BAST queued while flushing last " dlm_flush_asts()
620 "one\n", dlm->name, res->lockname.len, dlm_flush_asts()
621 res->lockname.name); dlm_flush_asts()
628 dlm_lockres_release_ast(dlm, res); dlm_flush_asts()
641 struct dlm_lock_resource *res; dlm_thread() local
661 * res->spinlock needs to be taken again to protect dlm_thread()
666 res = list_entry(dlm->dirty_list.next, dlm_thread()
671 BUG_ON(!res); dlm_thread()
672 dlm_lockres_get(res); dlm_thread()
674 spin_lock(&res->spinlock); dlm_thread()
676 list_del_init(&res->dirty); dlm_thread()
677 spin_unlock(&res->spinlock); dlm_thread()
680 dlm_lockres_put(res); dlm_thread()
686 spin_lock(&res->spinlock); dlm_thread()
687 if (res->owner != dlm->node_num) { dlm_thread()
688 __dlm_print_one_lock_resource(res); dlm_thread()
691 !!(res->state & DLM_LOCK_RES_IN_PROGRESS), dlm_thread()
692 !!(res->state & DLM_LOCK_RES_MIGRATING), dlm_thread()
693 !!(res->state & DLM_LOCK_RES_RECOVERING), dlm_thread()
694 !!(res->state & DLM_LOCK_RES_DIRTY)); dlm_thread()
696 BUG_ON(res->owner != dlm->node_num); dlm_thread()
701 BUG_ON(res->state & DLM_LOCK_RES_MIGRATING); dlm_thread()
702 if (res->state & (DLM_LOCK_RES_IN_PROGRESS | dlm_thread()
705 res->state &= ~DLM_LOCK_RES_DIRTY; dlm_thread()
706 spin_unlock(&res->spinlock); dlm_thread()
708 mlog(0, "%s: res %.*s, inprogress, delay list " dlm_thread()
710 res->lockname.len, res->lockname.name, dlm_thread()
711 res->state); dlm_thread()
722 dlm_shuffle_lists(dlm, res); dlm_thread()
723 res->state &= ~DLM_LOCK_RES_DIRTY; dlm_thread()
724 spin_unlock(&res->spinlock); dlm_thread()
727 dlm_lockres_calc_usage(dlm, res); dlm_thread()
735 spin_lock(&res->spinlock); dlm_thread()
736 __dlm_dirty_lockres(dlm, res); dlm_thread()
737 spin_unlock(&res->spinlock); dlm_thread()
739 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
298 dlm_shuffle_lists(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_shuffle_lists() argument
H A Ddlmconvert.c54 * 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 Ddlmast.c51 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 Ddlmlock.c61 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 Ddlmmaster.c66 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()
503 if (!hlist_unhashed(&res->hash_node) || dlm_lockres_release()
504 !list_empty(&res->granted) || dlm_lockres_release()
505 !list_empty(&res->converting) || dlm_lockres_release()
506 !list_empty(&res->blocked) || dlm_lockres_release()
507 !list_empty(&res->dirty) || dlm_lockres_release()
508 !list_empty(&res->recovering) || dlm_lockres_release()
509 !list_empty(&res->purge)) { dlm_lockres_release()
513 res->lockname.len, res->lockname.name, dlm_lockres_release()
514 !hlist_unhashed(&res->hash_node) ? 'H' : ' ', dlm_lockres_release()
515 !list_empty(&res->granted) ? 'G' : ' ', dlm_lockres_release()
516 !list_empty(&res->converting) ? 'C' : ' ', dlm_lockres_release()
517 !list_empty(&res->blocked) ? 'B' : ' ', dlm_lockres_release()
518 !list_empty(&res->dirty) ? 'D' : ' ', dlm_lockres_release()
519 !list_empty(&res->recovering) ? 'R' : ' ', dlm_lockres_release()
520 !list_empty(&res->purge) ? 'P' : ' '); dlm_lockres_release()
522 dlm_print_one_lock_resource(res); dlm_lockres_release()
527 BUG_ON(!hlist_unhashed(&res->hash_node)); dlm_lockres_release()
528 BUG_ON(!list_empty(&res->granted)); dlm_lockres_release()
529 BUG_ON(!list_empty(&res->converting)); dlm_lockres_release()
530 BUG_ON(!list_empty(&res->blocked)); dlm_lockres_release()
531 BUG_ON(!list_empty(&res->dirty)); dlm_lockres_release()
532 BUG_ON(!list_empty(&res->recovering)); dlm_lockres_release()
533 BUG_ON(!list_empty(&res->purge)); dlm_lockres_release()
535 kmem_cache_free(dlm_lockname_cache, (void *)res->lockname.name); dlm_lockres_release()
537 kmem_cache_free(dlm_lockres_cache, res); dlm_lockres_release()
540 void dlm_lockres_put(struct dlm_lock_resource *res) dlm_lockres_put() argument
542 kref_put(&res->refs, dlm_lockres_release); dlm_lockres_put()
546 struct dlm_lock_resource *res, dlm_init_lockres()
552 * res->lockname.name, so be sure to init every field dlm_init_lockres()
555 qname = (char *) res->lockname.name; dlm_init_lockres()
558 res->lockname.len = namelen; dlm_init_lockres()
559 res->lockname.hash = dlm_lockid_hash(name, namelen); dlm_init_lockres()
561 init_waitqueue_head(&res->wq); dlm_init_lockres()
562 spin_lock_init(&res->spinlock); dlm_init_lockres()
563 INIT_HLIST_NODE(&res->hash_node); dlm_init_lockres()
564 INIT_LIST_HEAD(&res->granted); dlm_init_lockres()
565 INIT_LIST_HEAD(&res->converting); dlm_init_lockres()
566 INIT_LIST_HEAD(&res->blocked); dlm_init_lockres()
567 INIT_LIST_HEAD(&res->dirty); dlm_init_lockres()
568 INIT_LIST_HEAD(&res->recovering); dlm_init_lockres()
569 INIT_LIST_HEAD(&res->purge); dlm_init_lockres()
570 INIT_LIST_HEAD(&res->tracking); dlm_init_lockres()
571 atomic_set(&res->asts_reserved, 0); dlm_init_lockres()
572 res->migration_pending = 0; dlm_init_lockres()
573 res->inflight_locks = 0; dlm_init_lockres()
574 res->inflight_assert_workers = 0; dlm_init_lockres()
576 res->dlm = dlm; dlm_init_lockres()
578 kref_init(&res->refs); dlm_init_lockres()
584 spin_lock(&res->spinlock); dlm_init_lockres()
585 dlm_set_lockres_owner(dlm, res, DLM_LOCK_RES_OWNER_UNKNOWN); dlm_init_lockres()
586 spin_unlock(&res->spinlock); dlm_init_lockres()
588 res->state = DLM_LOCK_RES_IN_PROGRESS; dlm_init_lockres()
590 res->last_used = 0; dlm_init_lockres()
593 list_add_tail(&res->tracking, &dlm->tracking_list); dlm_init_lockres()
596 memset(res->lvb, 0, DLM_LVB_LEN); dlm_init_lockres()
597 memset(res->refmap, 0, sizeof(res->refmap)); dlm_init_lockres()
604 struct dlm_lock_resource *res = NULL; dlm_new_lockres() local
606 res = kmem_cache_zalloc(dlm_lockres_cache, GFP_NOFS); dlm_new_lockres()
607 if (!res) dlm_new_lockres()
610 res->lockname.name = kmem_cache_zalloc(dlm_lockname_cache, GFP_NOFS); dlm_new_lockres()
611 if (!res->lockname.name) dlm_new_lockres()
614 dlm_init_lockres(dlm, res, name, namelen); dlm_new_lockres()
615 return res; dlm_new_lockres()
618 if (res) dlm_new_lockres()
619 kmem_cache_free(dlm_lockres_cache, res); dlm_new_lockres()
624 struct dlm_lock_resource *res, int bit) dlm_lockres_set_refmap_bit()
626 assert_spin_locked(&res->spinlock); dlm_lockres_set_refmap_bit()
628 mlog(0, "res %.*s, set node %u, %ps()\n", res->lockname.len, dlm_lockres_set_refmap_bit()
629 res->lockname.name, bit, __builtin_return_address(0)); dlm_lockres_set_refmap_bit()
631 set_bit(bit, res->refmap); dlm_lockres_set_refmap_bit()
635 struct dlm_lock_resource *res, int bit) dlm_lockres_clear_refmap_bit()
637 assert_spin_locked(&res->spinlock); dlm_lockres_clear_refmap_bit()
639 mlog(0, "res %.*s, clr node %u, %ps()\n", res->lockname.len, dlm_lockres_clear_refmap_bit()
640 res->lockname.name, bit, __builtin_return_address(0)); dlm_lockres_clear_refmap_bit()
642 clear_bit(bit, res->refmap); dlm_lockres_clear_refmap_bit()
646 struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_ref()
648 res->inflight_locks++; __dlm_lockres_grab_inflight_ref()
650 mlog(0, "%s: res %.*s, inflight++: now %u, %ps()\n", dlm->name, __dlm_lockres_grab_inflight_ref()
651 res->lockname.len, res->lockname.name, res->inflight_locks, __dlm_lockres_grab_inflight_ref()
656 struct dlm_lock_resource *res) dlm_lockres_grab_inflight_ref()
658 assert_spin_locked(&res->spinlock); dlm_lockres_grab_inflight_ref()
659 __dlm_lockres_grab_inflight_ref(dlm, res); dlm_lockres_grab_inflight_ref()
663 struct dlm_lock_resource *res) dlm_lockres_drop_inflight_ref()
665 assert_spin_locked(&res->spinlock); dlm_lockres_drop_inflight_ref()
667 BUG_ON(res->inflight_locks == 0); dlm_lockres_drop_inflight_ref()
669 res->inflight_locks--; dlm_lockres_drop_inflight_ref()
671 mlog(0, "%s: res %.*s, inflight--: now %u, %ps()\n", dlm->name, dlm_lockres_drop_inflight_ref()
672 res->lockname.len, res->lockname.name, res->inflight_locks, dlm_lockres_drop_inflight_ref()
675 wake_up(&res->wq); dlm_lockres_drop_inflight_ref()
679 struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_worker()
681 assert_spin_locked(&res->spinlock); __dlm_lockres_grab_inflight_worker()
682 res->inflight_assert_workers++; __dlm_lockres_grab_inflight_worker()
684 dlm->name, res->lockname.len, res->lockname.name, __dlm_lockres_grab_inflight_worker()
685 res->inflight_assert_workers); __dlm_lockres_grab_inflight_worker()
689 struct dlm_lock_resource *res) __dlm_lockres_drop_inflight_worker()
691 assert_spin_locked(&res->spinlock); __dlm_lockres_drop_inflight_worker()
692 BUG_ON(res->inflight_assert_workers == 0); __dlm_lockres_drop_inflight_worker()
693 res->inflight_assert_workers--; __dlm_lockres_drop_inflight_worker()
695 dlm->name, res->lockname.len, res->lockname.name, __dlm_lockres_drop_inflight_worker()
696 res->inflight_assert_workers); __dlm_lockres_drop_inflight_worker()
700 struct dlm_lock_resource *res) dlm_lockres_drop_inflight_worker()
702 spin_lock(&res->spinlock); dlm_lockres_drop_inflight_worker()
703 __dlm_lockres_drop_inflight_worker(dlm, res); dlm_lockres_drop_inflight_worker()
704 spin_unlock(&res->spinlock); dlm_lockres_drop_inflight_worker()
728 struct dlm_lock_resource *tmpres=NULL, *res=NULL; dlm_get_lock_resource() local
788 if (res) { dlm_get_lock_resource()
790 if (!list_empty(&res->tracking)) dlm_get_lock_resource()
791 list_del_init(&res->tracking); dlm_get_lock_resource()
795 res->lockname.len, dlm_get_lock_resource()
796 res->lockname.name); dlm_get_lock_resource()
798 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 spin_unlock(&res->spinlock); dlm_master_request_handler()
1662 dlm_lockres_put(res); dlm_master_request_handler()
1665 __dlm_lockres_grab_inflight_worker(dlm, res); dlm_master_request_handler()
1666 spin_unlock(&res->spinlock); dlm_master_request_handler()
1669 if (res) dlm_master_request_handler()
1670 dlm_lockres_put(res); dlm_master_request_handler()
1689 struct dlm_lock_resource *res, dlm_do_assert_master()
1697 const char *lockname = res->lockname.name; dlm_do_assert_master()
1698 unsigned int namelen = res->lockname.len; dlm_do_assert_master()
1702 spin_lock(&res->spinlock); dlm_do_assert_master()
1703 res->state |= DLM_LOCK_RES_SETREF_INPROG; dlm_do_assert_master()
1704 spin_unlock(&res->spinlock); dlm_do_assert_master()
1771 spin_lock(&res->spinlock); dlm_do_assert_master()
1772 dlm_lockres_set_refmap_bit(dlm, res, to); dlm_do_assert_master()
1773 spin_unlock(&res->spinlock); dlm_do_assert_master()
1780 spin_lock(&res->spinlock); dlm_do_assert_master()
1781 res->state &= ~DLM_LOCK_RES_SETREF_INPROG; dlm_do_assert_master()
1782 spin_unlock(&res->spinlock); dlm_do_assert_master()
1783 wake_up(&res->wq); dlm_do_assert_master()
1791 * res->spinlock
1803 struct dlm_lock_resource *res = NULL; dlm_assert_master_handler() local
1881 res = __dlm_lookup_lockres(dlm, name, namelen, hash); dlm_assert_master_handler()
1882 if (res) { dlm_assert_master_handler()
1883 spin_lock(&res->spinlock); dlm_assert_master_handler()
1884 if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_assert_master_handler()
1890 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN && dlm_assert_master_handler()
1891 res->owner != assert->node_idx) { dlm_assert_master_handler()
1894 assert->node_idx, res->owner, namelen, dlm_assert_master_handler()
1896 __dlm_print_one_lock_resource(res); dlm_assert_master_handler()
1900 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { dlm_assert_master_handler()
1902 if (res->owner == assert->node_idx) { dlm_assert_master_handler()
1911 res->owner, namelen, name); dlm_assert_master_handler()
1914 if (!(res->state & DLM_LOCK_RES_IN_PROGRESS)) { dlm_assert_master_handler()
1935 spin_unlock(&res->spinlock); dlm_assert_master_handler()
1965 if (res) { dlm_assert_master_handler()
1967 spin_lock(&res->spinlock); dlm_assert_master_handler()
1971 res->lockname.len, res->lockname.name, dlm_assert_master_handler()
1973 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_assert_master_handler()
1975 dlm_change_lockres_owner(dlm, res, mle->new_master); dlm_assert_master_handler()
1976 BUG_ON(res->state & DLM_LOCK_RES_DIRTY); dlm_assert_master_handler()
1978 dlm_change_lockres_owner(dlm, res, mle->master); dlm_assert_master_handler()
1980 spin_unlock(&res->spinlock); dlm_assert_master_handler()
1983 wake_up(&res->wq); dlm_assert_master_handler()
2021 } else if (res) { dlm_assert_master_handler()
2022 if (res->owner != assert->node_idx) { dlm_assert_master_handler()
2025 res->owner, namelen, name); dlm_assert_master_handler()
2032 if (res) { dlm_assert_master_handler()
2033 spin_lock(&res->spinlock); dlm_assert_master_handler()
2034 res->state |= DLM_LOCK_RES_SETREF_INPROG; dlm_assert_master_handler()
2035 spin_unlock(&res->spinlock); dlm_assert_master_handler()
2036 *ret_data = (void *)res; dlm_assert_master_handler()
2061 __dlm_print_one_lock_resource(res); dlm_assert_master_handler()
2062 spin_unlock(&res->spinlock); dlm_assert_master_handler()
2068 *ret_data = (void *)res; dlm_assert_master_handler()
2075 struct dlm_lock_resource *res = (struct dlm_lock_resource *)ret_data; dlm_assert_master_post_handler() local
2078 spin_lock(&res->spinlock); dlm_assert_master_post_handler()
2079 res->state &= ~DLM_LOCK_RES_SETREF_INPROG; dlm_assert_master_post_handler()
2080 spin_unlock(&res->spinlock); dlm_assert_master_post_handler()
2081 wake_up(&res->wq); dlm_assert_master_post_handler()
2082 dlm_lockres_put(res); dlm_assert_master_post_handler()
2088 struct dlm_lock_resource *res, dlm_dispatch_assert_master()
2099 item->u.am.lockres = res; /* already have a ref */ dlm_dispatch_assert_master()
2106 mlog(0, "IGNORE HIGHER: %.*s\n", res->lockname.len, dlm_dispatch_assert_master()
2107 res->lockname.name); dlm_dispatch_assert_master()
2121 struct dlm_lock_resource *res; dlm_assert_master_worker() local
2129 res = item->u.am.lockres; dlm_assert_master_worker()
2160 spin_lock(&res->spinlock); dlm_assert_master_worker()
2161 if (res->state & DLM_LOCK_RES_MIGRATING) { dlm_assert_master_worker()
2165 spin_unlock(&res->spinlock); dlm_assert_master_worker()
2168 __dlm_lockres_reserve_ast(res); dlm_assert_master_worker()
2169 spin_unlock(&res->spinlock); dlm_assert_master_worker()
2174 res->lockname.len, res->lockname.name, dlm->node_num); dlm_assert_master_worker()
2175 ret = dlm_do_assert_master(dlm, res, nodemap, flags); dlm_assert_master_worker()
2183 dlm_lockres_release_ast(dlm, res); dlm_assert_master_worker()
2186 dlm_lockres_drop_inflight_worker(dlm, res); dlm_assert_master_worker()
2188 dlm_lockres_put(res); dlm_assert_master_worker()
2204 struct dlm_lock_resource *res) dlm_pre_master_reco_lockres()
2219 ret = dlm_do_master_requery(dlm, res, nodenum, &master); dlm_pre_master_reco_lockres()
2253 int dlm_drop_lockres_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_drop_lockres_ref() argument
2260 lockname = res->lockname.name; dlm_drop_lockres_ref()
2261 namelen = res->lockname.len; dlm_drop_lockres_ref()
2270 &deref, sizeof(deref), res->owner, &r); dlm_drop_lockres_ref()
2272 mlog(ML_ERROR, "%s: res %.*s, error %d send DEREF to node %u\n", dlm_drop_lockres_ref()
2273 dlm->name, namelen, lockname, ret, res->owner); dlm_drop_lockres_ref()
2276 mlog(ML_ERROR, "%s: res %.*s, DEREF to node %u got %d\n", dlm_drop_lockres_ref()
2277 dlm->name, namelen, lockname, res->owner, r); dlm_drop_lockres_ref()
2278 dlm_print_one_lock_resource(res); dlm_drop_lockres_ref()
2289 struct dlm_lock_resource *res = NULL; dlm_deref_lockres_handler() local
2318 res = __dlm_lookup_lockres_full(dlm, name, namelen, hash); dlm_deref_lockres_handler()
2319 if (!res) { dlm_deref_lockres_handler()
2327 spin_lock(&res->spinlock); dlm_deref_lockres_handler()
2328 if (res->state & DLM_LOCK_RES_SETREF_INPROG) dlm_deref_lockres_handler()
2331 BUG_ON(res->state & DLM_LOCK_RES_DROPPING_REF); dlm_deref_lockres_handler()
2332 if (test_bit(node, res->refmap)) { dlm_deref_lockres_handler()
2333 dlm_lockres_clear_refmap_bit(dlm, res, node); dlm_deref_lockres_handler()
2337 spin_unlock(&res->spinlock); dlm_deref_lockres_handler()
2341 dlm_lockres_calc_usage(dlm, res); dlm_deref_lockres_handler()
2345 res->lockname.len, res->lockname.name, node); dlm_deref_lockres_handler()
2346 dlm_print_one_lock_resource(res); dlm_deref_lockres_handler()
2360 item->u.dl.deref_res = res; dlm_deref_lockres_handler()
2371 if (res) dlm_deref_lockres_handler()
2372 dlm_lockres_put(res); dlm_deref_lockres_handler()
2381 struct dlm_lock_resource *res; dlm_deref_lockres_worker() local
2386 res = item->u.dl.deref_res; dlm_deref_lockres_worker()
2389 spin_lock(&res->spinlock); dlm_deref_lockres_worker()
2390 BUG_ON(res->state & DLM_LOCK_RES_DROPPING_REF); dlm_deref_lockres_worker()
2391 if (test_bit(node, res->refmap)) { dlm_deref_lockres_worker()
2392 __dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_SETREF_INPROG); dlm_deref_lockres_worker()
2393 dlm_lockres_clear_refmap_bit(dlm, res, node); dlm_deref_lockres_worker()
2396 spin_unlock(&res->spinlock); dlm_deref_lockres_worker()
2400 dlm->name, res->lockname.len, res->lockname.name, node); dlm_deref_lockres_worker()
2401 dlm_lockres_calc_usage(dlm, res); dlm_deref_lockres_worker()
2405 res->lockname.len, res->lockname.name, node); dlm_deref_lockres_worker()
2406 dlm_print_one_lock_resource(res); dlm_deref_lockres_worker()
2409 dlm_lockres_put(res); dlm_deref_lockres_worker()
2420 struct dlm_lock_resource *res) dlm_is_lockres_migrateable()
2428 assert_spin_locked(&res->spinlock); dlm_is_lockres_migrateable()
2431 if (res->state & DLM_LOCK_RES_MIGRATING) dlm_is_lockres_migrateable()
2435 if (res->state & DLM_LOCK_RES_RECOVERING) dlm_is_lockres_migrateable()
2438 if (res->owner != dlm->node_num) dlm_is_lockres_migrateable()
2442 queue = dlm_list_idx_to_ptr(res, idx); list_for_each_entry()
2449 mlog(0, "%s: Not migrateable res %.*s, lock %u:%llu on " list_for_each_entry()
2450 "%s list\n", dlm->name, res->lockname.len, list_for_each_entry()
2451 res->lockname.name, list_for_each_entry()
2460 node_ref = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
2465 mlog(0, "%s: res %.*s, Migrateable\n", dlm->name, res->lockname.len,
2466 res->lockname.name);
2477 struct dlm_lock_resource *res, u8 target) dlm_migrate_lockres()
2493 name = res->lockname.name; dlm_migrate_lockres()
2494 namelen = res->lockname.len; dlm_migrate_lockres()
2520 ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, name, dlm_migrate_lockres()
2540 if (dlm_mark_lockres_migrating(dlm, res, target) < 0) { dlm_migrate_lockres()
2542 "the target went down.\n", res->lockname.len, dlm_migrate_lockres()
2543 res->lockname.name, target); dlm_migrate_lockres()
2544 spin_lock(&res->spinlock); dlm_migrate_lockres()
2545 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres()
2547 spin_unlock(&res->spinlock); dlm_migrate_lockres()
2584 ret = dlm_send_one_lockres(dlm, res, mres, target, dlm_migrate_lockres()
2594 spin_lock(&res->spinlock); dlm_migrate_lockres()
2595 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres()
2597 spin_unlock(&res->spinlock); dlm_migrate_lockres()
2623 res->owner == target) dlm_migrate_lockres()
2627 dlm->name, res->lockname.len, res->lockname.name); dlm_migrate_lockres()
2633 dlm->name, res->lockname.len, dlm_migrate_lockres()
2634 res->lockname.name, target); dlm_migrate_lockres()
2640 spin_lock(&res->spinlock); dlm_migrate_lockres()
2641 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres()
2643 spin_unlock(&res->spinlock); dlm_migrate_lockres()
2648 dlm->name, res->lockname.len, res->lockname.name); dlm_migrate_lockres()
2652 spin_lock(&res->spinlock); dlm_migrate_lockres()
2653 dlm_set_lockres_owner(dlm, res, target); dlm_migrate_lockres()
2654 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_migrate_lockres()
2655 dlm_remove_nonlocal_locks(dlm, res); dlm_migrate_lockres()
2656 spin_unlock(&res->spinlock); dlm_migrate_lockres()
2657 wake_up(&res->wq); dlm_migrate_lockres()
2664 dlm_lockres_calc_usage(dlm, res); dlm_migrate_lockres()
2669 dlm_kick_thread(dlm, res); dlm_migrate_lockres()
2674 wake_up(&res->wq); dlm_migrate_lockres()
2698 int dlm_empty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_empty_lockres() argument
2706 spin_lock(&res->spinlock); dlm_empty_lockres()
2707 if (dlm_is_lockres_migrateable(dlm, res)) dlm_empty_lockres()
2708 target = dlm_pick_migration_target(dlm, res); dlm_empty_lockres()
2709 spin_unlock(&res->spinlock); dlm_empty_lockres()
2717 ret = dlm_migrate_lockres(dlm, res, target); dlm_empty_lockres()
2719 mlog(0, "%s: res %.*s, Migrate to node %u failed with %d\n", dlm_empty_lockres()
2720 dlm->name, res->lockname.len, res->lockname.name, dlm_empty_lockres()
2739 struct dlm_lock_resource *res, dlm_migration_can_proceed()
2743 spin_lock(&res->spinlock); dlm_migration_can_proceed()
2744 can_proceed = !!(res->state & DLM_LOCK_RES_MIGRATING); dlm_migration_can_proceed()
2745 spin_unlock(&res->spinlock); dlm_migration_can_proceed()
2757 struct dlm_lock_resource *res) dlm_lockres_is_dirty()
2760 spin_lock(&res->spinlock); dlm_lockres_is_dirty()
2761 ret = !!(res->state & DLM_LOCK_RES_DIRTY); dlm_lockres_is_dirty()
2762 spin_unlock(&res->spinlock); dlm_lockres_is_dirty()
2768 struct dlm_lock_resource *res, dlm_mark_lockres_migrating()
2774 res->lockname.len, res->lockname.name, dlm->node_num, dlm_mark_lockres_migrating()
2778 spin_lock(&res->spinlock); dlm_mark_lockres_migrating()
2779 BUG_ON(res->migration_pending); dlm_mark_lockres_migrating()
2780 res->migration_pending = 1; dlm_mark_lockres_migrating()
2783 __dlm_lockres_reserve_ast(res); dlm_mark_lockres_migrating()
2784 spin_unlock(&res->spinlock); dlm_mark_lockres_migrating()
2787 dlm_kick_thread(dlm, res); dlm_mark_lockres_migrating()
2790 spin_lock(&res->spinlock); dlm_mark_lockres_migrating()
2791 BUG_ON(res->state & DLM_LOCK_RES_BLOCK_DIRTY); dlm_mark_lockres_migrating()
2792 res->state |= DLM_LOCK_RES_BLOCK_DIRTY; dlm_mark_lockres_migrating()
2793 spin_unlock(&res->spinlock); dlm_mark_lockres_migrating()
2795 wait_event(dlm->ast_wq, !dlm_lockres_is_dirty(dlm, res)); dlm_mark_lockres_migrating()
2796 dlm_lockres_release_ast(dlm, res); dlm_mark_lockres_migrating()
2799 res->state & DLM_LOCK_RES_DIRTY ? "yes" : "no"); dlm_mark_lockres_migrating()
2805 dlm_migration_can_proceed(dlm, res, target), dlm_mark_lockres_migrating()
2809 res->state & DLM_LOCK_RES_MIGRATING ? "yes":"no", dlm_mark_lockres_migrating()
2813 res->state & DLM_LOCK_RES_MIGRATING ? "yes":"no", dlm_mark_lockres_migrating()
2816 if (!dlm_migration_can_proceed(dlm, res, target)) { dlm_mark_lockres_migrating()
2836 spin_lock(&res->spinlock); dlm_mark_lockres_migrating()
2837 BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY)); dlm_mark_lockres_migrating()
2838 res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY; dlm_mark_lockres_migrating()
2840 BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING)); dlm_mark_lockres_migrating()
2842 res->migration_pending = 0; dlm_mark_lockres_migrating()
2843 spin_unlock(&res->spinlock); dlm_mark_lockres_migrating()
2860 struct dlm_lock_resource *res) dlm_remove_nonlocal_locks()
2862 struct list_head *queue = &res->granted; dlm_remove_nonlocal_locks()
2866 assert_spin_locked(&res->spinlock); dlm_remove_nonlocal_locks()
2868 BUG_ON(res->owner == dlm->node_num); dlm_remove_nonlocal_locks()
2880 dlm_lockres_clear_refmap_bit(dlm, res, list_for_each_entry_safe()
2893 bit = find_next_bit(res->refmap, O2NM_MAX_NODES, bit);
2901 res->lockname.len, res->lockname.name, bit);
2902 dlm_lockres_clear_refmap_bit(dlm, res, bit);
2914 struct dlm_lock_resource *res) dlm_pick_migration_target()
2917 struct list_head *queue = &res->granted; dlm_pick_migration_target()
2923 assert_spin_locked(&res->spinlock); dlm_pick_migration_target()
2927 queue = dlm_list_idx_to_ptr(res, idx); list_for_each_entry()
2941 noderef = find_next_bit(res->refmap, O2NM_MAX_NODES,
2960 struct dlm_lock_resource *res, dlm_do_migrate_request()
2969 migrate.namelen = res->lockname.len; dlm_do_migrate_request()
2970 memcpy(migrate.name, res->lockname.name, migrate.namelen); dlm_do_migrate_request()
2995 mlog(ML_ERROR, "%s: res %.*s, Error %d send " dlm_do_migrate_request()
3013 dlm->name, res->lockname.len, res->lockname.name, dlm_do_migrate_request()
3015 spin_lock(&res->spinlock); dlm_do_migrate_request()
3016 dlm_lockres_set_refmap_bit(dlm, res, nodenum); dlm_do_migrate_request()
3017 spin_unlock(&res->spinlock); dlm_do_migrate_request()
3040 struct dlm_lock_resource *res = NULL; dlm_migrate_request_handler() local
3064 res = __dlm_lookup_lockres(dlm, name, namelen, hash); dlm_migrate_request_handler()
3065 if (res) { dlm_migrate_request_handler()
3066 spin_lock(&res->spinlock); dlm_migrate_request_handler()
3067 if (res->state & DLM_LOCK_RES_RECOVERING) { dlm_migrate_request_handler()
3071 spin_unlock(&res->spinlock); dlm_migrate_request_handler()
3078 res->state |= DLM_LOCK_RES_MIGRATING; dlm_migrate_request_handler()
3079 spin_unlock(&res->spinlock); dlm_migrate_request_handler()
3084 ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, dlm_migrate_request_handler()
3099 if (res) dlm_migrate_request_handler()
3100 dlm_lockres_put(res); dlm_migrate_request_handler()
3114 struct dlm_lock_resource *res, dlm_add_migration_mle()
3173 dlm_init_mle(mle, DLM_MLE_MIGRATION, dlm, res, name, namelen); dlm_add_migration_mle()
3191 struct dlm_lock_resource *res; dlm_reset_mleres_owner() local
3194 res = __dlm_lookup_lockres(dlm, mle->mname, mle->mnamelen, dlm_reset_mleres_owner()
3196 if (res) { dlm_reset_mleres_owner()
3200 spin_lock(&res->spinlock); dlm_reset_mleres_owner()
3201 dlm_set_lockres_owner(dlm, res, DLM_LOCK_RES_OWNER_UNKNOWN); dlm_reset_mleres_owner()
3202 dlm_move_lockres_to_recovery_list(dlm, res); dlm_reset_mleres_owner()
3203 spin_unlock(&res->spinlock); dlm_reset_mleres_owner()
3204 dlm_lockres_put(res); dlm_reset_mleres_owner()
3215 return res; dlm_reset_mleres_owner()
3263 struct dlm_lock_resource *res; dlm_clean_master_list() local
3332 res = dlm_reset_mleres_owner(dlm, mle); hlist_for_each_entry_safe()
3333 if (res) hlist_for_each_entry_safe()
3344 int dlm_finish_migration(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, dlm_finish_migration() argument
3359 spin_lock(&res->spinlock); dlm_finish_migration()
3360 dlm_lockres_set_refmap_bit(dlm, res, old_master); dlm_finish_migration()
3361 spin_unlock(&res->spinlock); dlm_finish_migration()
3364 ret = dlm_do_migrate_request(dlm, res, old_master, dlm_finish_migration()
3372 res->lockname.len, res->lockname.name); dlm_finish_migration()
3375 ret = dlm_do_assert_master(dlm, res, iter.node_map, dlm_finish_migration()
3386 res->lockname.len, res->lockname.name, old_master); dlm_finish_migration()
3387 ret = dlm_do_assert_master(dlm, res, iter.node_map, dlm_finish_migration()
3398 spin_lock(&res->spinlock); dlm_finish_migration()
3399 dlm_set_lockres_owner(dlm, res, dlm->node_num); dlm_finish_migration()
3400 res->state &= ~DLM_LOCK_RES_MIGRATING; dlm_finish_migration()
3401 spin_unlock(&res->spinlock); dlm_finish_migration()
3403 dlm_kick_thread(dlm, res); dlm_finish_migration()
3404 wake_up(&res->wq); dlm_finish_migration()
3418 void __dlm_lockres_reserve_ast(struct dlm_lock_resource *res) __dlm_lockres_reserve_ast() argument
3420 assert_spin_locked(&res->spinlock); __dlm_lockres_reserve_ast()
3421 if (res->state & DLM_LOCK_RES_MIGRATING) { __dlm_lockres_reserve_ast()
3422 __dlm_print_one_lock_resource(res); __dlm_lockres_reserve_ast()
3424 BUG_ON(res->state & DLM_LOCK_RES_MIGRATING); __dlm_lockres_reserve_ast()
3426 atomic_inc(&res->asts_reserved); __dlm_lockres_reserve_ast()
3443 struct dlm_lock_resource *res) dlm_lockres_release_ast()
3445 if (!atomic_dec_and_lock(&res->asts_reserved, &res->spinlock)) dlm_lockres_release_ast()
3448 if (!res->migration_pending) { dlm_lockres_release_ast()
3449 spin_unlock(&res->spinlock); dlm_lockres_release_ast()
3453 BUG_ON(res->state & DLM_LOCK_RES_MIGRATING); dlm_lockres_release_ast()
3454 res->migration_pending = 0; dlm_lockres_release_ast()
3455 res->state |= DLM_LOCK_RES_MIGRATING; dlm_lockres_release_ast()
3456 spin_unlock(&res->spinlock); dlm_lockres_release_ast()
3457 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
545 dlm_init_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, const char *name, unsigned int namelen) dlm_init_lockres() argument
623 dlm_lockres_set_refmap_bit(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, int bit) dlm_lockres_set_refmap_bit() argument
634 dlm_lockres_clear_refmap_bit(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, int bit) dlm_lockres_clear_refmap_bit() argument
645 __dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_ref() argument
655 dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_grab_inflight_ref() argument
662 dlm_lockres_drop_inflight_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_drop_inflight_ref() argument
678 __dlm_lockres_grab_inflight_worker(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_grab_inflight_worker() argument
688 __dlm_lockres_drop_inflight_worker(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) __dlm_lockres_drop_inflight_worker() argument
699 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
1688 dlm_do_assert_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, void *nodemap, u32 flags) dlm_do_assert_master() argument
2087 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
2203 dlm_pre_master_reco_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_pre_master_reco_lockres() argument
2419 dlm_is_lockres_migrateable(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_is_lockres_migrateable() argument
2476 dlm_migrate_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 target) dlm_migrate_lockres() argument
2738 dlm_migration_can_proceed(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 mig_target) dlm_migration_can_proceed() argument
2756 dlm_lockres_is_dirty(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_is_dirty() argument
2767 dlm_mark_lockres_migrating(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, u8 target) dlm_mark_lockres_migrating() argument
2859 dlm_remove_nonlocal_locks(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_remove_nonlocal_locks() argument
2913 dlm_pick_migration_target(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_pick_migration_target() argument
2959 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
3113 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
3442 dlm_lockres_release_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) dlm_lockres_release_ast() argument
H A Ddlmunlock.c59 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 Ddlmrecovery.c67 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()
1726 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.4.14/drivers/pnp/
H A Dmanager.c26 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_RANGELENGTH; pnp_assign_mem()
103 res->flags |= IORESOURCE_SHADOWABLE; pnp_assign_mem()
106 res->flags |= IORESOURCE_DISABLED; pnp_assign_mem()
111 res->start = rule->min; pnp_assign_mem()
112 res->end = res->start + rule->size - 1; pnp_assign_mem()
114 while (!pnp_check_mem(dev, res)) { pnp_assign_mem()
115 res->start += rule->align; pnp_assign_mem()
116 res->end = res->start + rule->size - 1; pnp_assign_mem()
117 if (res->start > rule->max || !rule->align) { pnp_assign_mem()
127 pnp_add_mem_resource(dev, res->start, res->end, res->flags); pnp_assign_mem()
133 struct resource *res, local_res; pnp_assign_irq() local
141 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IRQ, idx); pnp_assign_irq()
142 if (res) { pnp_assign_irq()
144 idx, (int) res->start, res->flags); pnp_assign_irq()
148 res = &local_res; pnp_assign_irq()
149 res->flags = rule->flags | IORESOURCE_AUTO; pnp_assign_irq()
150 res->start = -1; pnp_assign_irq()
151 res->end = -1; pnp_assign_irq()
154 res->flags |= IORESOURCE_DISABLED; pnp_assign_irq()
160 res->start = find_next_bit(rule->map.bits, PNP_IRQ_NR, 16); pnp_assign_irq()
161 if (res->start < PNP_IRQ_NR) { pnp_assign_irq()
162 res->end = res->start; pnp_assign_irq()
167 res->start = res->end = xtab[i]; pnp_assign_irq()
168 if (pnp_check_irq(dev, res)) pnp_assign_irq()
174 res->start = -1; pnp_assign_irq()
175 res->end = -1; pnp_assign_irq()
176 res->flags |= IORESOURCE_DISABLED; pnp_assign_irq()
185 pnp_add_irq_resource(dev, res->start, res->flags); pnp_assign_irq()
192 struct resource *res, local_res; pnp_assign_dma() local
200 res = pnp_find_resource(dev, rule->flags, IORESOURCE_DMA, idx); pnp_assign_dma()
201 if (res) { pnp_assign_dma()
203 idx, (int) res->start, res->flags); pnp_assign_dma()
207 res = &local_res; pnp_assign_dma()
208 res->flags = rule->flags | IORESOURCE_AUTO; pnp_assign_dma()
209 res->start = -1; pnp_assign_dma()
210 res->end = -1; pnp_assign_dma()
213 res->flags |= IORESOURCE_DISABLED; pnp_assign_dma()
220 res->start = res->end = xtab[i]; pnp_assign_dma()
221 if (pnp_check_dma(dev, res)) pnp_assign_dma()
230 pnp_add_dma_resource(dev, res->start, res->flags); pnp_assign_dma()
245 if (pnp_res->res.flags & IORESOURCE_AUTO) pnp_clean_resource_table()
H A Dsystem.c30 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 Dresource.c165 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 Dquirks.c234 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.4.14/include/net/
H A Ddn_fib.h45 #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 Dip_fib.h162 #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel])
164 #define FIB_RES_NH(res) ((res).fi->fib_nh[0])
175 #define FIB_RES_SADDR(net, res) \
176 ((FIB_RES_NH(res).nh_saddr_genid == \
178 FIB_RES_NH(res).nh_saddr : \
179 fib_info_update_nh_saddr((net), &FIB_RES_NH(res)))
180 #define FIB_RES_GW(res) (FIB_RES_NH(res).nh_gw)
181 #define FIB_RES_DEV(res) (FIB_RES_NH(res).nh_dev)
182 #define FIB_RES_OIF(res) (FIB_RES_NH(res).nh_oif)
184 #define FIB_RES_PREFSRC(net, res) ((res).fi->fib_prefsrc ? : \
185 FIB_RES_SADDR(net, res))
197 struct fib_result *res, int fib_flags);
232 struct fib_result *res, unsigned int flags) fib_lookup()
241 err = fib_table_lookup(tb, flp, res, flags | FIB_LOOKUP_NOREF); fib_lookup()
259 struct fib_result *res, unsigned int flags);
262 struct fib_result *res, unsigned int flags) fib_lookup()
269 return __fib_lookup(net, flp, res, flags); fib_lookup()
273 res->tclassid = 0; fib_lookup()
277 err = fib_table_lookup(tb, flp, res, flags); fib_lookup()
284 err = fib_table_lookup(tb, flp, res, flags); fib_lookup()
304 void fib_select_default(const struct flowi4 *flp, struct fib_result *res);
332 void fib_select_multipath(struct fib_result *res, int hash);
333 void fib_select_path(struct net *net, struct fib_result *res,
340 static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) fib_combine_itag() argument
346 *itag = FIB_RES_NH(*res).nh_tclassid<<16; fib_combine_itag()
348 rtag = res->tclassid; fib_combine_itag()
231 fib_lookup(struct net *net, const struct flowi4 *flp, struct fib_result *res, unsigned int flags) fib_lookup() argument
261 fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res, unsigned int flags) fib_lookup() argument
/linux-4.4.14/drivers/media/platform/s5p-tv/
H A Dmixer_drv.c73 struct mxr_resources *res = &mdev->res; mxr_streamer_get() local
77 clk_set_parent(res->sclk_mixer, res->sclk_dac); mxr_streamer_get()
79 clk_set_parent(res->sclk_mixer, res->sclk_hdmi); mxr_streamer_get()
164 struct resource *res; mxr_acquire_plat_resources() local
167 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mxr"); mxr_acquire_plat_resources()
168 if (res == NULL) { mxr_acquire_plat_resources()
174 mdev->res.mxr_regs = ioremap(res->start, resource_size(res)); mxr_acquire_plat_resources()
175 if (mdev->res.mxr_regs == NULL) { mxr_acquire_plat_resources()
181 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vp"); mxr_acquire_plat_resources()
182 if (res == NULL) { mxr_acquire_plat_resources()
188 mdev->res.vp_regs = ioremap(res->start, resource_size(res)); mxr_acquire_plat_resources()
189 if (mdev->res.vp_regs == NULL) { mxr_acquire_plat_resources()
195 res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "irq"); mxr_acquire_plat_resources()
196 if (res == NULL) { mxr_acquire_plat_resources()
202 ret = request_irq(res->start, mxr_irq_handler, 0, "s5p-mixer", mdev); mxr_acquire_plat_resources()
207 mdev->res.irq = res->start; mxr_acquire_plat_resources()
212 iounmap(mdev->res.vp_regs); mxr_acquire_plat_resources()
215 iounmap(mdev->res.mxr_regs); mxr_acquire_plat_resources()
221 static void mxr_resource_clear_clocks(struct mxr_resources *res) mxr_resource_clear_clocks() argument
223 res->mixer = ERR_PTR(-EINVAL); mxr_resource_clear_clocks()
224 res->vp = ERR_PTR(-EINVAL); mxr_resource_clear_clocks()
225 res->sclk_mixer = ERR_PTR(-EINVAL); mxr_resource_clear_clocks()
226 res->sclk_hdmi = ERR_PTR(-EINVAL); mxr_resource_clear_clocks()
227 res->sclk_dac = ERR_PTR(-EINVAL); mxr_resource_clear_clocks()
232 free_irq(mdev->res.irq, mdev); mxr_release_plat_resources()
233 iounmap(mdev->res.vp_regs); mxr_release_plat_resources()
234 iounmap(mdev->res.mxr_regs); mxr_release_plat_resources()
239 struct mxr_resources *res = &mdev->res; mxr_release_clocks() local
241 if (!IS_ERR(res->sclk_dac)) mxr_release_clocks()
242 clk_put(res->sclk_dac); mxr_release_clocks()
243 if (!IS_ERR(res->sclk_hdmi)) mxr_release_clocks()
244 clk_put(res->sclk_hdmi); mxr_release_clocks()
245 if (!IS_ERR(res->sclk_mixer)) mxr_release_clocks()
246 clk_put(res->sclk_mixer); mxr_release_clocks()
247 if (!IS_ERR(res->vp)) mxr_release_clocks()
248 clk_put(res->vp); mxr_release_clocks()
249 if (!IS_ERR(res->mixer)) mxr_release_clocks()
250 clk_put(res->mixer); mxr_release_clocks()
255 struct mxr_resources *res = &mdev->res; mxr_acquire_clocks() local
258 mxr_resource_clear_clocks(res); mxr_acquire_clocks()
260 res->mixer = clk_get(dev, "mixer"); mxr_acquire_clocks()
261 if (IS_ERR(res->mixer)) { mxr_acquire_clocks()
265 res->vp = clk_get(dev, "vp"); mxr_acquire_clocks()
266 if (IS_ERR(res->vp)) { mxr_acquire_clocks()
270 res->sclk_mixer = clk_get(dev, "sclk_mixer"); mxr_acquire_clocks()
271 if (IS_ERR(res->sclk_mixer)) { mxr_acquire_clocks()
275 res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); mxr_acquire_clocks()
276 if (IS_ERR(res->sclk_hdmi)) { mxr_acquire_clocks()
280 res->sclk_dac = clk_get(dev, "sclk_dac"); mxr_acquire_clocks()
281 if (IS_ERR(res->sclk_dac)) { mxr_acquire_clocks()
319 memset(&mdev->res, 0, sizeof(mdev->res)); mxr_release_resources()
320 mxr_resource_clear_clocks(&mdev->res); mxr_release_resources()
356 struct mxr_resources *res = &mdev->res; mxr_runtime_resume() local
362 ret = clk_prepare_enable(res->mixer); mxr_runtime_resume()
367 ret = clk_prepare_enable(res->vp); mxr_runtime_resume()
372 ret = clk_prepare_enable(res->sclk_mixer); mxr_runtime_resume()
385 clk_disable_unprepare(res->vp); mxr_runtime_resume()
387 clk_disable_unprepare(res->mixer); mxr_runtime_resume()
397 struct mxr_resources *res = &mdev->res; mxr_runtime_suspend() local
401 clk_disable_unprepare(res->sclk_mixer); mxr_runtime_suspend()
402 clk_disable_unprepare(res->vp); mxr_runtime_suspend()
403 clk_disable_unprepare(res->mixer); mxr_runtime_suspend()
H A Dhdmi_drv.c96 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()
742 hdmi_resource_poweroff(&hdev->res); hdmi_runtime_suspend()
756 ret = hdmi_resource_poweron(&hdev->res); hdmi_runtime_resume()
770 hdmi_resource_poweroff(&hdev->res); hdmi_runtime_resume()
781 static void hdmi_resource_clear_clocks(struct hdmi_resources *res) hdmi_resource_clear_clocks() argument
783 res->hdmi = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks()
784 res->sclk_hdmi = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks()
785 res->sclk_pixel = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks()
786 res->sclk_hdmiphy = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks()
787 res->hdmiphy = ERR_PTR(-EINVAL); hdmi_resource_clear_clocks()
792 struct hdmi_resources *res = &hdev->res; hdmi_resources_cleanup() local
796 if (res->regul_count) hdmi_resources_cleanup()
797 regulator_bulk_free(res->regul_count, res->regul_bulk); hdmi_resources_cleanup()
799 kfree(res->regul_bulk); hdmi_resources_cleanup()
800 if (!IS_ERR(res->hdmiphy)) hdmi_resources_cleanup()
801 clk_put(res->hdmiphy); hdmi_resources_cleanup()
802 if (!IS_ERR(res->sclk_hdmiphy)) hdmi_resources_cleanup()
803 clk_put(res->sclk_hdmiphy); hdmi_resources_cleanup()
804 if (!IS_ERR(res->sclk_pixel)) hdmi_resources_cleanup()
805 clk_put(res->sclk_pixel); hdmi_resources_cleanup()
806 if (!IS_ERR(res->sclk_hdmi)) hdmi_resources_cleanup()
807 clk_put(res->sclk_hdmi); hdmi_resources_cleanup()
808 if (!IS_ERR(res->hdmi)) hdmi_resources_cleanup()
809 clk_put(res->hdmi); hdmi_resources_cleanup()
810 memset(res, 0, sizeof(*res)); hdmi_resources_cleanup()
811 hdmi_resource_clear_clocks(res); hdmi_resources_cleanup()
817 struct hdmi_resources *res = &hdev->res; hdmi_resources_init() local
828 memset(res, 0, sizeof(*res)); hdmi_resources_init()
829 hdmi_resource_clear_clocks(res); hdmi_resources_init()
832 res->hdmi = clk_get(dev, "hdmi"); hdmi_resources_init()
833 if (IS_ERR(res->hdmi)) { hdmi_resources_init()
837 res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); hdmi_resources_init()
838 if (IS_ERR(res->sclk_hdmi)) { hdmi_resources_init()
842 res->sclk_pixel = clk_get(dev, "sclk_pixel"); hdmi_resources_init()
843 if (IS_ERR(res->sclk_pixel)) { hdmi_resources_init()
847 res->sclk_hdmiphy = clk_get(dev, "sclk_hdmiphy"); hdmi_resources_init()
848 if (IS_ERR(res->sclk_hdmiphy)) { hdmi_resources_init()
852 res->hdmiphy = clk_get(dev, "hdmiphy"); hdmi_resources_init()
853 if (IS_ERR(res->hdmiphy)) { hdmi_resources_init()
857 res->regul_bulk = kcalloc(ARRAY_SIZE(supply), hdmi_resources_init()
858 sizeof(res->regul_bulk[0]), GFP_KERNEL); hdmi_resources_init()
859 if (!res->regul_bulk) { hdmi_resources_init()
864 res->regul_bulk[i].supply = supply[i]; hdmi_resources_init()
865 res->regul_bulk[i].consumer = NULL; hdmi_resources_init()
868 ret = regulator_bulk_get(dev, ARRAY_SIZE(supply), res->regul_bulk); hdmi_resources_init()
873 res->regul_count = ARRAY_SIZE(supply); hdmi_resources_init()
885 struct resource *res; hdmi_probe() local
914 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hdmi_probe()
915 if (res == NULL) { hdmi_probe()
921 hdmi_dev->regs = devm_ioremap(&pdev->dev, res->start, hdmi_probe()
922 resource_size(res)); hdmi_probe()
929 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); hdmi_probe()
930 if (res == NULL) { hdmi_probe()
936 ret = devm_request_irq(&pdev->dev, res->start, hdmi_irq_handler, 0, hdmi_probe()
942 hdmi_dev->irq = res->start; hdmi_probe()
999 clk_enable(hdmi_dev->res.hdmi); hdmi_probe()
1040 clk_disable(hdmi_dev->res.hdmi); hdmi_remove()
/linux-4.4.14/arch/x86/kernel/
H A Dresource.c4 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 Dsysfb_simplefb.c68 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.4.14/samples/hidraw/
H A Dhid-example.c45 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.4.14/arch/x86/pci/
H A Dbroadcom_bus.c26 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 Dbus_numa.c45 if (window->res->flags & IORESOURCE_BUS) { resource_list_for_each_entry()
54 pci_add_resource(resources, &root_res->res);
97 struct resource *res; update_res() local
114 res = &root_res->res; update_res()
115 if (res->flags != flags) update_res()
118 common_start = max(res->start, start); update_res()
119 common_end = min(res->end, end); update_res()
123 final_start = min(res->start, start); update_res()
124 final_end = max(res->end, end); update_res()
126 res->start = final_start; update_res()
127 res->end = final_end; update_res()
138 res = &root_res->res; update_res()
139 res->name = info->name; update_res()
140 res->flags = flags; update_res()
141 res->start = start; update_res()
142 res->end = end; update_res()
/linux-4.4.14/drivers/thunderbolt/
H A Deeprom.c41 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 Dctl.c204 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 Dcap.c84 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.4.14/drivers/ps3/
H A Dps3av_cmd.c157 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 Dps3av.c223 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.4.14/fs/f2fs/
H A Dcrypto_key.c30 ecr->res = rc; derive_crypt_complete()
46 int res = 0; f2fs_derive_key_aes() local
54 res = PTR_ERR(tfm); f2fs_derive_key_aes()
61 res = -ENOMEM; f2fs_derive_key_aes()
67 res = crypto_ablkcipher_setkey(tfm, deriving_key, f2fs_derive_key_aes()
69 if (res < 0) f2fs_derive_key_aes()
76 res = crypto_ablkcipher_encrypt(req); f2fs_derive_key_aes()
77 if (res == -EINPROGRESS || res == -EBUSY) { f2fs_derive_key_aes()
80 res = ecr.res; f2fs_derive_key_aes()
87 return res; f2fs_derive_key_aes()
130 int res; _f2fs_get_encryption_info() local
132 res = f2fs_crypto_initialize(); _f2fs_get_encryption_info()
133 if (res) _f2fs_get_encryption_info()
134 return res; _f2fs_get_encryption_info()
145 res = f2fs_getxattr(inode, F2FS_XATTR_INDEX_ENCRYPTION, _f2fs_get_encryption_info()
148 if (res < 0) _f2fs_get_encryption_info()
149 return res; _f2fs_get_encryption_info()
150 else if (res != sizeof(ctx)) _f2fs_get_encryption_info()
152 res = 0; _f2fs_get_encryption_info()
183 res = -ENOKEY; _f2fs_get_encryption_info()
196 res = PTR_ERR(keyring_key); _f2fs_get_encryption_info()
204 res = -EINVAL; _f2fs_get_encryption_info()
211 res = f2fs_derive_key_aes(ctx.nonce, master_key->raw, _f2fs_get_encryption_info()
213 if (res) _f2fs_get_encryption_info()
218 res = ctfm ? PTR_ERR(ctfm) : -ENOMEM; _f2fs_get_encryption_info()
221 __func__, res, (unsigned) inode->i_ino); _f2fs_get_encryption_info()
228 res = crypto_ablkcipher_setkey(ctfm, raw_key, _f2fs_get_encryption_info()
230 if (res) _f2fs_get_encryption_info()
241 if (res == -ENOKEY && !S_ISREG(inode->i_mode)) _f2fs_get_encryption_info()
242 res = 0; _f2fs_get_encryption_info()
246 return res; _f2fs_get_encryption_info()
H A Dcrypto_policy.c23 int res = f2fs_getxattr(inode, F2FS_XATTR_INDEX_ENCRYPTION, f2fs_inode_has_encryption_context() local
25 return (res > 0); f2fs_inode_has_encryption_context()
36 int res = f2fs_getxattr(inode, F2FS_XATTR_INDEX_ENCRYPTION, f2fs_is_encryption_context_consistent_with_policy() local
40 if (res != sizeof(ctx)) f2fs_is_encryption_context_consistent_with_policy()
116 int res; f2fs_get_policy() local
121 res = f2fs_getxattr(inode, F2FS_XATTR_INDEX_ENCRYPTION, f2fs_get_policy()
124 if (res != sizeof(ctx)) f2fs_get_policy()
142 int res; f2fs_is_child_context_consistent_with_parent() local
155 res = f2fs_get_encryption_info(parent); f2fs_is_child_context_consistent_with_parent()
156 if (res) f2fs_is_child_context_consistent_with_parent()
158 res = f2fs_get_encryption_info(child); f2fs_is_child_context_consistent_with_parent()
159 if (res) f2fs_is_child_context_consistent_with_parent()
188 int res; f2fs_inherit_context() local
190 res = f2fs_get_encryption_info(parent); f2fs_inherit_context()
191 if (res < 0) f2fs_inherit_context()
192 return res; f2fs_inherit_context()
H A Dcrypto_fname.c41 static void f2fs_dir_crypt_complete(struct crypto_async_request *req, int res) f2fs_dir_crypt_complete() argument
45 if (res == -EINPROGRESS) f2fs_dir_crypt_complete()
47 ecr->res = res; f2fs_dir_crypt_complete()
77 int res = 0; f2fs_fname_encrypt() local
125 res = crypto_ablkcipher_encrypt(req); f2fs_fname_encrypt()
126 if (res == -EINPROGRESS || res == -EBUSY) { f2fs_fname_encrypt()
129 res = ecr.res; f2fs_fname_encrypt()
133 if (res < 0) { f2fs_fname_encrypt()
135 "%s: Error (error code %d)\n", __func__, res); f2fs_fname_encrypt()
138 return res; f2fs_fname_encrypt()
156 int res = 0; f2fs_fname_decrypt() local
181 res = crypto_ablkcipher_decrypt(req); f2fs_fname_decrypt()
182 if (res == -EINPROGRESS || res == -EBUSY) { f2fs_fname_decrypt()
185 res = ecr.res; f2fs_fname_decrypt()
188 if (res < 0) { f2fs_fname_decrypt()
191 __func__, res); f2fs_fname_decrypt()
192 return res; f2fs_fname_decrypt()
350 int res; f2fs_fname_usr_to_disk() local
361 res = f2fs_fname_encrypt(inode, iname, oname); f2fs_fname_usr_to_disk()
362 return res; f2fs_fname_usr_to_disk()
/linux-4.4.14/net/mac802154/
H A Dmib.c33 int res; mac802154_dev_set_page_channel() local
39 res = drv_set_channel(local, page, chan); mac802154_dev_set_page_channel()
40 if (res) { mac802154_dev_set_page_channel()
52 int res; mac802154_get_params() local
57 res = mac802154_llsec_get_params(&sdata->sec, params); mac802154_get_params()
60 return res; mac802154_get_params()
68 int res; mac802154_set_params() local
73 res = mac802154_llsec_set_params(&sdata->sec, params, changed); mac802154_set_params()
76 return res; mac802154_set_params()
84 int res; mac802154_add_key() local
89 res = mac802154_llsec_key_add(&sdata->sec, id, key); mac802154_add_key()
92 return res; mac802154_add_key()
99 int res; mac802154_del_key() local
104 res = mac802154_llsec_key_del(&sdata->sec, id); mac802154_del_key()
107 return res; mac802154_del_key()
114 int res; mac802154_add_dev() local
119 res = mac802154_llsec_dev_add(&sdata->sec, llsec_dev); mac802154_add_dev()
122 return res; mac802154_add_dev()
128 int res; mac802154_del_dev() local
133 res = mac802154_llsec_dev_del(&sdata->sec, dev_addr); mac802154_del_dev()
136 return res; mac802154_del_dev()
144 int res; mac802154_add_devkey() local
149 res = mac802154_llsec_devkey_add(&sdata->sec, device_addr, key); mac802154_add_devkey()
152 return res; mac802154_add_devkey()
160 int res; mac802154_del_devkey() local
165 res = mac802154_llsec_devkey_del(&sdata->sec, device_addr, key); mac802154_del_devkey()
168 return res; mac802154_del_devkey()
175 int res; mac802154_add_seclevel() local
180 res = mac802154_llsec_seclevel_add(&sdata->sec, sl); mac802154_add_seclevel()
183 return res; mac802154_add_seclevel()
190 int res; mac802154_del_seclevel() local
195 res = mac802154_llsec_seclevel_del(&sdata->sec, sl); mac802154_del_seclevel()
198 return res; mac802154_del_seclevel()
H A Dcfg.c309 int res; ieee802154_set_llsec_params() local
312 res = mac802154_llsec_set_params(&sdata->sec, params, changed); ieee802154_set_llsec_params()
315 return res; ieee802154_set_llsec_params()
325 int res; ieee802154_get_llsec_params() local
328 res = mac802154_llsec_get_params(&sdata->sec, params); ieee802154_get_llsec_params()
331 return res; ieee802154_get_llsec_params()
341 int res; ieee802154_add_llsec_key() local
344 res = mac802154_llsec_key_add(&sdata->sec, id, key); ieee802154_add_llsec_key()
347 return res; ieee802154_add_llsec_key()
356 int res; ieee802154_del_llsec_key() local
359 res = mac802154_llsec_key_del(&sdata->sec, id); ieee802154_del_llsec_key()
362 return res; ieee802154_del_llsec_key()
371 int res; ieee802154_add_seclevel() local
374 res = mac802154_llsec_seclevel_add(&sdata->sec, sl); ieee802154_add_seclevel()
377 return res; ieee802154_add_seclevel()
386 int res; ieee802154_del_seclevel() local
389 res = mac802154_llsec_seclevel_del(&sdata->sec, sl); ieee802154_del_seclevel()
392 return res; ieee802154_del_seclevel()
401 int res; ieee802154_add_device() local
404 res = mac802154_llsec_dev_add(&sdata->sec, dev_desc); ieee802154_add_device()
407 return res; ieee802154_add_device()
416 int res; ieee802154_del_device() local
419 res = mac802154_llsec_dev_del(&sdata->sec, extended_addr); ieee802154_del_device()
422 return res; ieee802154_del_device()
432 int res; ieee802154_add_devkey() local
435 res = mac802154_llsec_devkey_add(&sdata->sec, extended_addr, key); ieee802154_add_devkey()
438 return res; ieee802154_add_devkey()
448 int res; ieee802154_del_devkey() local
451 res = mac802154_llsec_devkey_del(&sdata->sec, extended_addr, key); ieee802154_del_devkey()
454 return res; ieee802154_del_devkey()
/linux-4.4.14/drivers/pci/hotplug/
H A Dcpqphp_sysfs.c46 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 Dshpchp_sysfs.c43 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 Dibmphp_res.c467 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.4.14/fs/jffs2/
H A Dwritev.c21 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.4.14/drivers/pci/
H A Dsetup-res.c2 * drivers/pci/setup-res.c
37 struct resource *res = dev->resource + resno; pci_update_resource() local
48 if (!res->flags) pci_update_resource()
51 if (res->flags & IORESOURCE_UNSET) pci_update_resource()
59 if (res->flags & IORESOURCE_PCI_FIXED) pci_update_resource()
62 pcibios_resource_to_bus(dev->bus, &region, res); pci_update_resource()
64 new = region.start | (res->flags & PCI_REGION_FLAG_MASK); pci_update_resource()
65 if (res->flags & IORESOURCE_IO) pci_update_resource()
74 if (!(res->flags & IORESOURCE_ROM_ENABLE)) pci_update_resource()
84 disable = (res->flags & IORESOURCE_MEM_64) && !dev->mmio_always_on; pci_update_resource()
99 if (res->flags & IORESOURCE_MEM_64) { pci_update_resource()
115 struct resource *res = &dev->resource[resource]; pci_claim_resource() local
118 if (res->flags & IORESOURCE_UNSET) { pci_claim_resource()
120 resource, res); pci_claim_resource()
124 root = pci_find_parent_resource(dev, res); pci_claim_resource()
127 resource, res); pci_claim_resource()
128 res->flags |= IORESOURCE_UNSET; pci_claim_resource()
132 conflict = request_resource_conflict(root, res); pci_claim_resource()
135 resource, res, conflict->name, conflict); pci_claim_resource()
136 res->flags |= IORESOURCE_UNSET; pci_claim_resource()
171 static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, pci_revert_fw_address() argument
181 start = res->start; pci_revert_fw_address()
182 end = res->end; pci_revert_fw_address()
183 res->start = fw_addr; pci_revert_fw_address()
184 res->end = res->start + size - 1; pci_revert_fw_address()
185 res->flags &= ~IORESOURCE_UNSET; pci_revert_fw_address()
187 root = pci_find_parent_resource(dev, res); pci_revert_fw_address()
189 if (res->flags & IORESOURCE_IO) pci_revert_fw_address()
196 resno, res); pci_revert_fw_address()
197 conflict = request_resource_conflict(root, res); pci_revert_fw_address()
200 resno, res, conflict->name, conflict); pci_revert_fw_address()
201 res->start = start; pci_revert_fw_address()
202 res->end = end; pci_revert_fw_address()
203 res->flags |= IORESOURCE_UNSET; pci_revert_fw_address()
212 struct resource *res = dev->resource + resno; __pci_assign_resource() local
216 min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; __pci_assign_resource()
225 ret = pci_bus_alloc_resource(bus, res, size, align, min, __pci_assign_resource()
235 if ((res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) == __pci_assign_resource()
237 ret = pci_bus_alloc_resource(bus, res, size, align, min, __pci_assign_resource()
250 if (res->flags & (IORESOURCE_PREFETCH | IORESOURCE_MEM_64)) __pci_assign_resource()
251 ret = pci_bus_alloc_resource(bus, res, size, align, min, 0, __pci_assign_resource()
275 struct resource *res = dev->resource + resno; pci_assign_resource() local
279 res->flags |= IORESOURCE_UNSET; pci_assign_resource()
280 align = pci_resource_alignment(dev, res); pci_assign_resource()
283 resno, res); pci_assign_resource()
287 size = resource_size(res); pci_assign_resource()
296 dev_info(&dev->dev, "BAR %d: no space for %pR\n", resno, res); pci_assign_resource()
297 ret = pci_revert_fw_address(res, dev, resno, size); pci_assign_resource()
302 res); pci_assign_resource()
306 res->flags &= ~IORESOURCE_UNSET; pci_assign_resource()
307 res->flags &= ~IORESOURCE_STARTALIGN; pci_assign_resource()
308 dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); pci_assign_resource()
319 struct resource *res = dev->resource + resno; pci_reassign_resource() local
324 flags = res->flags; pci_reassign_resource()
325 res->flags |= IORESOURCE_UNSET; pci_reassign_resource()
326 if (!res->parent) { pci_reassign_resource()
328 resno, res); pci_reassign_resource()
333 new_size = resource_size(res) + addsize; pci_reassign_resource()
336 res->flags = flags; pci_reassign_resource()
338 resno, res, (unsigned long long) addsize); pci_reassign_resource()
342 res->flags &= ~IORESOURCE_UNSET; pci_reassign_resource()
343 res->flags &= ~IORESOURCE_STARTALIGN; pci_reassign_resource()
345 resno, res, (unsigned long long) addsize); pci_reassign_resource()
H A Dhost-bridge.c49 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 Dbus.c4 * 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 Dsetup-bus.c35 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, &region, 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, &region, 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, &region, 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, &region, 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, &region, 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, &region, 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, &region, 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()
1047 /* put SRIOV requested res to the optional list */ pbus_size_mem()
1118 unsigned long pci_cardbus_resource_alignment(struct resource *res) pci_cardbus_resource_alignment() argument
1120 if (res->flags & IORESOURCE_IO) pci_cardbus_resource_alignment()
1122 if (res->flags & IORESOURCE_MEM) pci_cardbus_resource_alignment()
1518 /* for next child res under same bridge */ pci_bridge_release_resources()
1565 struct resource *res; pci_bus_dump_res() local
1568 pci_bus_for_each_resource(bus, res, i) { pci_bus_for_each_resource()
1569 if (!res || !res->end || !res->flags) pci_bus_for_each_resource()
1572 dev_printk(KERN_DEBUG, &bus->dev, "resource %d %pR\n", i, res); pci_bus_for_each_resource()
1684 * first try will not touch pci bridge res
1685 * second and later try will clear small leaf bridge res
1745 "No. %d try to assign unassigned res\n", tried_times + 1); pci_assign_unassigned_root_bus_resources()
1762 struct resource *res = fail_res->res; pci_assign_unassigned_root_bus_resources() local
1764 res->start = fail_res->start; pci_assign_unassigned_root_bus_resources()
1765 res->end = fail_res->end; pci_assign_unassigned_root_bus_resources()
1766 res->flags = fail_res->flags; pci_assign_unassigned_root_bus_resources()
1768 res->flags = 0; pci_assign_unassigned_root_bus_resources()
1814 printk(KERN_DEBUG "PCI: No. %d try to assign unassigned res\n", pci_assign_unassigned_bridge_resources()
1828 struct resource *res = fail_res->res; pci_assign_unassigned_bridge_resources() local
1830 res->start = fail_res->start; pci_assign_unassigned_bridge_resources()
1831 res->end = fail_res->end; pci_assign_unassigned_bridge_resources()
1832 res->flags = fail_res->flags; pci_assign_unassigned_bridge_resources()
1834 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
/linux-4.4.14/arch/m68k/amiga/
H A Dchipram.c46 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.4.14/drivers/gpu/drm/vmwgfx/
H A Dvmwgfx_context.c35 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);
54 static int vmw_dx_context_create(struct vmw_resource *res);
55 static int vmw_dx_context_bind(struct vmw_resource *res,
57 static int vmw_dx_context_unbind(struct vmw_resource *res,
60 static int vmw_dx_context_destroy(struct vmw_resource *res);
116 struct vmw_resource *res; vmw_context_cotables_unref() local
121 res = uctx->cotables[i]; vmw_context_cotables_unref()
125 if (res) vmw_context_cotables_unref()
126 vmw_resource_unreference(&res); vmw_context_cotables_unref()
130 static void vmw_hw_context_destroy(struct vmw_resource *res) vmw_hw_context_destroy() argument
133 container_of(res, struct vmw_user_context, res); vmw_hw_context_destroy()
134 struct vmw_private *dev_priv = res->dev_priv; vmw_hw_context_destroy()
141 if (res->func->destroy == vmw_gb_context_destroy || vmw_hw_context_destroy()
142 res->func->destroy == vmw_dx_context_destroy) { vmw_hw_context_destroy()
147 (void) res->func->destroy(res); vmw_hw_context_destroy()
167 cmd->body.cid = res->id; vmw_hw_context_destroy()
175 struct vmw_resource *res, vmw_gb_context_init()
176 void (*res_free)(struct vmw_resource *res)) vmw_gb_context_init()
180 container_of(res, struct vmw_user_context, res); vmw_gb_context_init()
182 res->backup_size = (dx ? sizeof(SVGADXContextMobFormat) : vmw_gb_context_init()
184 ret = vmw_resource_init(dev_priv, res, true, vmw_gb_context_init()
211 &uctx->res, i); vmw_gb_context_init()
221 vmw_resource_activate(res, vmw_hw_context_destroy); vmw_gb_context_init()
228 res_free(res); vmw_gb_context_init()
230 kfree(res); vmw_gb_context_init()
235 struct vmw_resource *res, vmw_context_init()
236 void (*res_free)(struct vmw_resource *res), vmw_context_init()
247 return vmw_gb_context_init(dev_priv, dx, res, res_free); vmw_context_init()
249 ret = vmw_resource_init(dev_priv, res, false, vmw_context_init()
257 if (unlikely(res->id >= SVGA3D_MAX_CONTEXT_IDS)) { vmw_context_init()
259 vmw_resource_unreference(&res); vmw_context_init()
266 vmw_resource_unreference(&res); vmw_context_init()
272 cmd->body.cid = res->id; vmw_context_init()
276 vmw_resource_activate(res, vmw_hw_context_destroy); vmw_context_init()
281 kfree(res); vmw_context_init()
283 res_free(res); vmw_context_init()
292 static int vmw_gb_context_create(struct vmw_resource *res) vmw_gb_context_create() argument
294 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_create()
301 if (likely(res->id != -1)) vmw_gb_context_create()
304 ret = vmw_resource_alloc_id(res); vmw_gb_context_create()
310 if (unlikely(res->id >= VMWGFX_NUM_GB_CONTEXT)) { vmw_gb_context_create()
325 cmd->body.cid = res->id; vmw_gb_context_create()
332 vmw_resource_release_id(res); vmw_gb_context_create()
337 static int vmw_gb_context_bind(struct vmw_resource *res, vmw_gb_context_bind() argument
340 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_bind()
357 cmd->body.cid = res->id; vmw_gb_context_bind()
359 cmd->body.validContents = res->backup_dirty; vmw_gb_context_bind()
360 res->backup_dirty = false; vmw_gb_context_bind()
366 static int vmw_gb_context_unbind(struct vmw_resource *res, vmw_gb_context_unbind() argument
370 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_unbind()
374 container_of(res, struct vmw_user_context, res); vmw_gb_context_unbind()
408 cmd1->body.cid = res->id; vmw_gb_context_unbind()
413 cmd2->body.cid = res->id; vmw_gb_context_unbind()
434 static int vmw_gb_context_destroy(struct vmw_resource *res) vmw_gb_context_destroy() argument
436 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_context_destroy()
442 if (likely(res->id == -1)) vmw_gb_context_destroy()
454 cmd->body.cid = res->id; vmw_gb_context_destroy()
456 if (dev_priv->query_cid == res->id) vmw_gb_context_destroy()
458 vmw_resource_release_id(res); vmw_gb_context_destroy()
468 static int vmw_dx_context_create(struct vmw_resource *res) vmw_dx_context_create() argument
470 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_context_create()
477 if (likely(res->id != -1)) vmw_dx_context_create()
480 ret = vmw_resource_alloc_id(res); vmw_dx_context_create()
486 if (unlikely(res->id >= VMWGFX_NUM_DXCONTEXT)) { vmw_dx_context_create()
501 cmd->body.cid = res->id; vmw_dx_context_create()
508 vmw_resource_release_id(res); vmw_dx_context_create()
513 static int vmw_dx_context_bind(struct vmw_resource *res, vmw_dx_context_bind() argument
516 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_context_bind()
534 cmd->body.cid = res->id; vmw_dx_context_bind()
536 cmd->body.validContents = res->backup_dirty; vmw_dx_context_bind()
537 res->backup_dirty = false; vmw_dx_context_bind()
562 container_of(ctx, struct vmw_user_context, res); vmw_dx_context_scrub_cotables()
567 struct vmw_resource *res; vmw_dx_context_scrub_cotables() local
571 res = uctx->cotables[vmw_cotable_scrub_order[i]]; vmw_dx_context_scrub_cotables()
572 if (res) vmw_dx_context_scrub_cotables()
573 res = vmw_resource_reference_unless_doomed(res); vmw_dx_context_scrub_cotables()
575 if (!res) vmw_dx_context_scrub_cotables()
578 WARN_ON(vmw_cotable_scrub(res, readback)); vmw_dx_context_scrub_cotables()
579 vmw_resource_unreference(&res); vmw_dx_context_scrub_cotables()
583 static int vmw_dx_context_unbind(struct vmw_resource *res, vmw_dx_context_unbind() argument
587 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_context_unbind()
591 container_of(res, struct vmw_user_context, res); vmw_dx_context_unbind()
608 vmw_dx_context_scrub_cotables(res, readback); vmw_dx_context_unbind()
612 WARN_ON(uctx->dx_query_mob->dx_query_ctx != res); vmw_dx_context_unbind()
632 cmd1->body.cid = res->id; vmw_dx_context_unbind()
637 cmd2->body.cid = res->id; vmw_dx_context_unbind()
658 static int vmw_dx_context_destroy(struct vmw_resource *res) vmw_dx_context_destroy() argument
660 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_context_destroy()
666 if (likely(res->id == -1)) vmw_dx_context_destroy()
678 cmd->body.cid = res->id; vmw_dx_context_destroy()
680 if (dev_priv->query_cid == res->id) vmw_dx_context_destroy()
682 vmw_resource_release_id(res); vmw_dx_context_destroy()
695 return &(container_of(base, struct vmw_user_context, base)->res); vmw_user_context_base_to_res()
698 static void vmw_user_context_free(struct vmw_resource *res) vmw_user_context_free() argument
701 container_of(res, struct vmw_user_context, res); vmw_user_context_free()
702 struct vmw_private *dev_priv = res->dev_priv; vmw_user_context_free()
707 (void) vmw_context_bind_dx_query(res, NULL); vmw_user_context_free()
724 struct vmw_resource *res = &ctx->res; vmw_user_context_base_release() local
727 vmw_resource_unreference(&res); vmw_user_context_base_release()
744 struct vmw_resource *res; vmw_context_define() local
786 res = &ctx->res; vmw_context_define()
794 ret = vmw_context_init(dev_priv, res, vmw_user_context_free, dx); vmw_context_define()
798 tmp = vmw_resource_reference(&ctx->res); vmw_context_define()
809 vmw_resource_unreference(&res); vmw_context_define()
849 container_of(ctx, struct vmw_user_context, res); vmw_context_binding_list()
856 return container_of(ctx, struct vmw_user_context, res)->man; vmw_context_res_man()
866 (container_of(ctx, struct vmw_user_context, res)-> vmw_context_cotable()
882 return container_of(ctx, struct vmw_user_context, res)->cbs; vmw_context_binding_state()
901 container_of(ctx_res, struct vmw_user_context, res); vmw_context_bind_dx_query()
934 container_of(ctx_res, struct vmw_user_context, res); vmw_context_get_dx_query_mob()
173 vmw_gb_context_init(struct vmw_private *dev_priv, bool dx, struct vmw_resource *res, void (*res_free)(struct vmw_resource *res)) vmw_gb_context_init() argument
234 vmw_context_init(struct vmw_private *dev_priv, struct vmw_resource *res, void (*res_free)(struct vmw_resource *res), bool dx) vmw_context_init() argument
H A Dvmwgfx_resource.c49 struct vmw_resource res; member in struct:vmw_stream
86 struct vmw_resource *vmw_resource_reference(struct vmw_resource *res) vmw_resource_reference() argument
88 kref_get(&res->kref); vmw_resource_reference()
89 return res; vmw_resource_reference()
93 vmw_resource_reference_unless_doomed(struct vmw_resource *res) vmw_resource_reference_unless_doomed() argument
95 return kref_get_unless_zero(&res->kref) ? res : NULL; vmw_resource_reference_unless_doomed()
101 * @res: Pointer to the resource.
105 void vmw_resource_release_id(struct vmw_resource *res) vmw_resource_release_id() argument
107 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_release_id()
108 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; vmw_resource_release_id()
111 if (res->id != -1) vmw_resource_release_id()
112 idr_remove(idr, res->id); vmw_resource_release_id()
113 res->id = -1; vmw_resource_release_id()
119 struct vmw_resource *res = vmw_resource_release() local
121 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_release()
123 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; vmw_resource_release()
126 res->avail = false; vmw_resource_release()
127 list_del_init(&res->lru_head); vmw_resource_release()
129 if (res->backup) { vmw_resource_release()
130 struct ttm_buffer_object *bo = &res->backup->base; vmw_resource_release()
133 if (!list_empty(&res->mob_head) && vmw_resource_release()
134 res->func->unbind != NULL) { vmw_resource_release()
139 res->func->unbind(res, false, &val_buf); vmw_resource_release()
141 res->backup_dirty = false; vmw_resource_release()
142 list_del_init(&res->mob_head); vmw_resource_release()
144 vmw_dmabuf_unreference(&res->backup); vmw_resource_release()
147 if (likely(res->hw_destroy != NULL)) { vmw_resource_release()
149 vmw_binding_res_list_kill(&res->binding_head); vmw_resource_release()
151 res->hw_destroy(res); vmw_resource_release()
154 id = res->id; vmw_resource_release()
155 if (res->res_free != NULL) vmw_resource_release()
156 res->res_free(res); vmw_resource_release()
158 kfree(res); vmw_resource_release()
168 struct vmw_resource *res = *p_res; vmw_resource_unreference() local
171 kref_put(&res->kref, vmw_resource_release); vmw_resource_unreference()
178 * @res: Pointer to the resource.
181 * @res->id to that id. Returns 0 on success and -ENOMEM on failure.
183 int vmw_resource_alloc_id(struct vmw_resource *res) vmw_resource_alloc_id() argument
185 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_alloc_id()
187 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; vmw_resource_alloc_id()
189 BUG_ON(res->id != -1); vmw_resource_alloc_id()
194 ret = idr_alloc(idr, res, 1, 0, GFP_NOWAIT); vmw_resource_alloc_id()
196 res->id = ret; vmw_resource_alloc_id()
207 * @res: The struct vmw_resource to initialize.
214 int vmw_resource_init(struct vmw_private *dev_priv, struct vmw_resource *res, vmw_resource_init() argument
216 void (*res_free) (struct vmw_resource *res), vmw_resource_init()
219 kref_init(&res->kref); vmw_resource_init()
220 res->hw_destroy = NULL; vmw_resource_init()
221 res->res_free = res_free; vmw_resource_init()
222 res->avail = false; vmw_resource_init()
223 res->dev_priv = dev_priv; vmw_resource_init()
224 res->func = func; vmw_resource_init()
225 INIT_LIST_HEAD(&res->lru_head); vmw_resource_init()
226 INIT_LIST_HEAD(&res->mob_head); vmw_resource_init()
227 INIT_LIST_HEAD(&res->binding_head); vmw_resource_init()
228 res->id = -1; vmw_resource_init()
229 res->backup = NULL; vmw_resource_init()
230 res->backup_offset = 0; vmw_resource_init()
231 res->backup_dirty = false; vmw_resource_init()
232 res->res_dirty = false; vmw_resource_init()
236 return vmw_resource_alloc_id(res); vmw_resource_init()
242 * @res: Pointer to the newly created resource
251 void vmw_resource_activate(struct vmw_resource *res, vmw_resource_activate() argument
254 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_activate()
257 res->avail = true; vmw_resource_activate()
258 res->hw_destroy = hw_destroy; vmw_resource_activate()
265 struct vmw_resource *res; vmw_resource_lookup() local
268 res = idr_find(idr, id); vmw_resource_lookup()
269 if (!res || !res->avail || !kref_get_unless_zero(&res->kref)) vmw_resource_lookup()
270 res = NULL; vmw_resource_lookup()
274 if (unlikely(res == NULL)) vmw_resource_lookup()
277 return res; vmw_resource_lookup()
302 struct vmw_resource *res; vmw_user_resource_lookup_handle() local
312 res = converter->base_obj_to_res(base); vmw_user_resource_lookup_handle()
315 if (!res->avail || res->res_free != converter->res_free) { vmw_user_resource_lookup_handle()
320 kref_get(&res->kref); vmw_user_resource_lookup_handle()
323 *p_res = res; vmw_user_resource_lookup_handle()
343 struct vmw_resource *res; vmw_user_lookup_handle() local
350 &res); vmw_user_lookup_handle()
352 *out_surf = vmw_res_to_srf(res); vmw_user_lookup_handle()
785 static void vmw_stream_destroy(struct vmw_resource *res) vmw_stream_destroy() argument
787 struct vmw_private *dev_priv = res->dev_priv; vmw_stream_destroy()
792 stream = container_of(res, struct vmw_stream, res); vmw_stream_destroy()
800 void (*res_free) (struct vmw_resource *res)) vmw_stream_init()
802 struct vmw_resource *res = &stream->res; vmw_stream_init() local
805 ret = vmw_resource_init(dev_priv, res, false, res_free, vmw_stream_init()
812 res_free(&stream->res); vmw_stream_init()
818 vmw_resource_unreference(&res); vmw_stream_init()
824 vmw_resource_activate(&stream->res, vmw_stream_destroy); vmw_stream_init()
828 static void vmw_user_stream_free(struct vmw_resource *res) vmw_user_stream_free() argument
831 container_of(res, struct vmw_user_stream, stream.res); vmw_user_stream_free()
832 struct vmw_private *dev_priv = res->dev_priv; vmw_user_stream_free()
849 struct vmw_resource *res = &stream->stream.res; vmw_user_stream_base_release() local
852 vmw_resource_unreference(&res); vmw_user_stream_base_release()
859 struct vmw_resource *res; vmw_stream_unref_ioctl() local
867 res = vmw_resource_lookup(dev_priv, idr, arg->stream_id); vmw_stream_unref_ioctl()
868 if (unlikely(res == NULL)) vmw_stream_unref_ioctl()
871 if (res->res_free != &vmw_user_stream_free) { vmw_stream_unref_ioctl()
876 stream = container_of(res, struct vmw_user_stream, stream.res); vmw_stream_unref_ioctl()
884 vmw_resource_unreference(&res); vmw_stream_unref_ioctl()
893 struct vmw_resource *res; vmw_stream_claim_ioctl() local
931 res = &stream->stream.res; vmw_stream_claim_ioctl()
943 tmp = vmw_resource_reference(res); vmw_stream_claim_ioctl()
952 arg->stream_id = res->id; vmw_stream_claim_ioctl()
954 vmw_resource_unreference(&res); vmw_stream_claim_ioctl()
964 struct vmw_resource *res; vmw_user_stream_lookup() local
967 res = vmw_resource_lookup(dev_priv, &dev_priv->res_idr[vmw_res_stream], vmw_user_stream_lookup()
969 if (unlikely(res == NULL)) vmw_user_stream_lookup()
972 if (res->res_free != &vmw_user_stream_free) { vmw_user_stream_lookup()
977 stream = container_of(res, struct vmw_user_stream, stream.res); vmw_user_stream_lookup()
984 *out = res; vmw_user_stream_lookup()
987 vmw_resource_unreference(&res); vmw_user_stream_lookup()
1077 * @res: The resource for which to allocate a backup buffer.
1081 static int vmw_resource_buf_alloc(struct vmw_resource *res, vmw_resource_buf_alloc() argument
1085 (res->backup_size + PAGE_SIZE - 1) & PAGE_MASK; vmw_resource_buf_alloc()
1089 if (likely(res->backup)) { vmw_resource_buf_alloc()
1090 BUG_ON(res->backup->base.num_pages * PAGE_SIZE < size); vmw_resource_buf_alloc()
1098 ret = vmw_dmabuf_init(res->dev_priv, backup, res->backup_size, vmw_resource_buf_alloc()
1099 res->func->backup_placement, vmw_resource_buf_alloc()
1105 res->backup = backup; vmw_resource_buf_alloc()
1115 * @res: The resource to make visible to the device.
1122 static int vmw_resource_do_validate(struct vmw_resource *res, vmw_resource_do_validate() argument
1126 const struct vmw_res_func *func = res->func; vmw_resource_do_validate()
1128 if (unlikely(res->id == -1)) { vmw_resource_do_validate()
1129 ret = func->create(res); vmw_resource_do_validate()
1135 ((func->needs_backup && list_empty(&res->mob_head) && vmw_resource_do_validate()
1138 ret = func->bind(res, val_buf); vmw_resource_do_validate()
1142 list_add_tail(&res->mob_head, &res->backup->res_list); vmw_resource_do_validate()
1151 res->res_dirty = true; vmw_resource_do_validate()
1156 func->destroy(res); vmw_resource_do_validate()
1165 * @res: Pointer to the struct vmw_resource to unreserve.
1174 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 (switch_backup && new_backup != res->backup) { vmw_resource_unreserve()
1185 if (res->backup) { vmw_resource_unreserve()
1186 lockdep_assert_held(&res->backup->base.resv->lock.base); vmw_resource_unreserve()
1187 list_del_init(&res->mob_head); vmw_resource_unreserve()
1188 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()
1196 res->backup = NULL; vmw_resource_unreserve()
1200 res->backup_offset = new_backup_offset; vmw_resource_unreserve()
1202 if (!res->func->may_evict || res->id == -1 || res->pin_count) vmw_resource_unreserve()
1206 list_add_tail(&res->lru_head, vmw_resource_unreserve()
1207 &res->dev_priv->res_lru[res->func->res_type]); vmw_resource_unreserve()
1216 * @res: The resource for which to allocate a backup buffer.
1223 vmw_resource_check_buffer(struct vmw_resource *res, vmw_resource_check_buffer() argument
1231 if (unlikely(res->backup == NULL)) { vmw_resource_check_buffer()
1232 ret = vmw_resource_buf_alloc(res, interruptible); vmw_resource_check_buffer()
1238 val_buf->bo = ttm_bo_reference(&res->backup->base); vmw_resource_check_buffer()
1245 if (res->func->needs_backup && list_empty(&res->mob_head)) vmw_resource_check_buffer()
1248 backup_dirty = res->backup_dirty; vmw_resource_check_buffer()
1249 ret = ttm_bo_validate(&res->backup->base, vmw_resource_check_buffer()
1250 res->func->backup_placement, vmw_resource_check_buffer()
1263 vmw_dmabuf_unreference(&res->backup); vmw_resource_check_buffer()
1271 * @res: The resource to reserve.
1278 int vmw_resource_reserve(struct vmw_resource *res, bool interruptible, vmw_resource_reserve() argument
1281 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_reserve()
1285 list_del_init(&res->lru_head); vmw_resource_reserve()
1288 if (res->func->needs_backup && res->backup == NULL && vmw_resource_reserve()
1290 ret = vmw_resource_buf_alloc(res, interruptible); vmw_resource_reserve()
1294 (unsigned long) res->backup_size); vmw_resource_reserve()
1326 * @res: The resource to evict.
1329 static int vmw_resource_do_evict(struct vmw_resource *res, bool interruptible) vmw_resource_do_evict() argument
1332 const struct vmw_res_func *func = res->func; vmw_resource_do_evict()
1339 ret = vmw_resource_check_buffer(res, interruptible, &val_buf); vmw_resource_do_evict()
1344 (!func->needs_backup || !list_empty(&res->mob_head)))) { vmw_resource_do_evict()
1345 ret = func->unbind(res, res->res_dirty, &val_buf); vmw_resource_do_evict()
1348 list_del_init(&res->mob_head); vmw_resource_do_evict()
1350 ret = func->destroy(res); vmw_resource_do_evict()
1351 res->backup_dirty = true; vmw_resource_do_evict()
1352 res->res_dirty = false; vmw_resource_do_evict()
1364 * @res: The resource to make visible to the device.
1366 * On succesful return, any backup DMA buffer pointed to by @res->backup will
1371 int vmw_resource_validate(struct vmw_resource *res) vmw_resource_validate() argument
1375 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_validate()
1376 struct list_head *lru_list = &dev_priv->res_lru[res->func->res_type]; vmw_resource_validate()
1380 if (!res->func->create) vmw_resource_validate()
1385 if (res->backup) vmw_resource_validate()
1386 val_buf.bo = &res->backup->base; vmw_resource_validate()
1388 ret = vmw_resource_do_validate(res, &val_buf); vmw_resource_validate()
1393 if (list_empty(lru_list) || !res->func->may_evict) { vmw_resource_validate()
1395 "for %s.\n", res->func->type_name); vmw_resource_validate()
1425 else if (!res->func->needs_backup && res->backup) { vmw_resource_validate()
1426 list_del_init(&res->mob_head); vmw_resource_validate()
1427 vmw_dmabuf_unreference(&res->backup); vmw_resource_validate()
1475 * resource that remain static while bo::res is !NULL and
1478 * to set @bo::res to NULL, while having @bo reserved when the
1479 * buffer is no longer bound to the resource, so @bo:res can be
1498 struct vmw_resource *res, *n; vmw_resource_move_notify() local
1504 list_for_each_entry_safe(res, n, &dma_buf->res_list, mob_head) { vmw_resource_move_notify()
1506 if (unlikely(res->func->unbind == NULL)) vmw_resource_move_notify()
1509 (void) res->func->unbind(res, true, &val_buf); vmw_resource_move_notify()
1510 res->backup_dirty = true; vmw_resource_move_notify()
1511 res->res_dirty = false; vmw_resource_move_notify()
1512 list_del_init(&res->mob_head); vmw_resource_move_notify()
1617 * @res: The resource being queried.
1619 bool vmw_resource_needs_backup(const struct vmw_resource *res) vmw_resource_needs_backup() argument
1621 return res->func->needs_backup; vmw_resource_needs_backup()
1696 * @res: The resource to add a pin reference on
1703 int vmw_resource_pin(struct vmw_resource *res, bool interruptible) vmw_resource_pin() argument
1705 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_pin()
1710 ret = vmw_resource_reserve(res, interruptible, false); vmw_resource_pin()
1714 if (res->pin_count == 0) { vmw_resource_pin()
1717 if (res->backup) { vmw_resource_pin()
1718 vbo = res->backup; vmw_resource_pin()
1725 res->func->backup_placement, vmw_resource_pin()
1736 ret = vmw_resource_validate(res); vmw_resource_pin()
1742 res->pin_count++; vmw_resource_pin()
1745 vmw_resource_unreserve(res, false, NULL, 0UL); vmw_resource_pin()
1756 * @res: The resource to remove a pin reference from
1761 void vmw_resource_unpin(struct vmw_resource *res) vmw_resource_unpin() argument
1763 struct vmw_private *dev_priv = res->dev_priv; vmw_resource_unpin()
1769 ret = vmw_resource_reserve(res, false, true); vmw_resource_unpin()
1772 WARN_ON(res->pin_count == 0); vmw_resource_unpin()
1773 if (--res->pin_count == 0 && res->backup) { vmw_resource_unpin()
1774 struct vmw_dma_buffer *vbo = res->backup; vmw_resource_unpin()
1781 vmw_resource_unreserve(res, false, NULL, 0UL); vmw_resource_unpin()
1790 * @res: Pointer to the resource
1792 enum vmw_res_type vmw_res_type(const struct vmw_resource *res) vmw_res_type() argument
1794 return res->func->res_type; vmw_res_type()
798 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 Dvmwgfx_cotable.c41 * @res: struct vmw_resource we are deriving from.
50 struct vmw_resource res; member in struct:vmw_cotable
106 static int vmw_cotable_bind(struct vmw_resource *res,
108 static int vmw_cotable_unbind(struct vmw_resource *res,
111 static int vmw_cotable_create(struct vmw_resource *res);
112 static int vmw_cotable_destroy(struct vmw_resource *res);
130 * @res: Pointer to the resource.
132 static struct vmw_cotable *vmw_cotable(struct vmw_resource *res) vmw_cotable() argument
134 return container_of(res, struct vmw_cotable, res); vmw_cotable()
140 * @res: Pointer to the cotable resource.
145 static int vmw_cotable_destroy(struct vmw_resource *res) vmw_cotable_destroy() argument
147 res->id = -1; vmw_cotable_destroy()
154 * @res: Pointer to the cotable resource
160 static int vmw_cotable_unscrub(struct vmw_resource *res) vmw_cotable_unscrub() argument
162 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_unscrub()
163 struct vmw_private *dev_priv = res->dev_priv; vmw_cotable_unscrub()
164 struct ttm_buffer_object *bo = &res->backup->base; vmw_cotable_unscrub()
198 * @res: Pointer to the cotable resource
205 static int vmw_cotable_bind(struct vmw_resource *res, vmw_cotable_bind() argument
209 * The create() callback may have changed @res->backup without vmw_cotable_bind()
215 val_buf->bo = &res->backup->base; vmw_cotable_bind()
217 return vmw_cotable_unscrub(res); vmw_cotable_bind()
223 * @res: Pointer to the cotable resource.
238 int vmw_cotable_scrub(struct vmw_resource *res, bool readback) vmw_cotable_scrub() argument
240 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_scrub()
241 struct vmw_private *dev_priv = res->dev_priv; vmw_cotable_scrub()
279 vcotbl->size_read_back = res->backup_size; vmw_cotable_scrub()
291 res->id = -1; vmw_cotable_scrub()
299 * @res: Pointer to the cotable resource.
306 static int vmw_cotable_unbind(struct vmw_resource *res, vmw_cotable_unbind() argument
310 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_unbind()
311 struct vmw_private *dev_priv = res->dev_priv; vmw_cotable_unbind()
315 if (list_empty(&res->mob_head)) vmw_cotable_unbind()
336 * @res: The cotable resource.
341 static int vmw_cotable_readback(struct vmw_resource *res) vmw_cotable_readback() argument
343 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_readback()
344 struct vmw_private *dev_priv = res->dev_priv; vmw_cotable_readback()
364 vcotbl->size_read_back = res->backup_size; vmw_cotable_readback()
369 vmw_fence_single_bo(&res->backup->base, fence); vmw_cotable_readback()
378 * @res: The cotable resource.
387 static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size) vmw_cotable_resize() argument
389 struct vmw_private *dev_priv = res->dev_priv; vmw_cotable_resize()
390 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_resize()
391 struct vmw_dma_buffer *buf, *old_buf = res->backup; vmw_cotable_resize()
392 struct ttm_buffer_object *bo, *old_bo = &res->backup->base; vmw_cotable_resize()
393 size_t old_size = res->backup_size; vmw_cotable_resize()
400 ret = vmw_cotable_readback(res); vmw_cotable_resize()
463 res->backup = buf; vmw_cotable_resize()
464 res->backup_size = new_size; vmw_cotable_resize()
471 ret = vmw_cotable_unscrub(res); vmw_cotable_resize()
474 res->backup = old_buf; vmw_cotable_resize()
475 res->backup_size = old_size; vmw_cotable_resize()
481 list_del(&res->mob_head); vmw_cotable_resize()
482 list_add_tail(&res->mob_head, &buf->res_list); vmw_cotable_resize()
484 res->id = vcotbl->type; vmw_cotable_resize()
500 * @res: Pointer to a cotable resource.
506 * buffer, that is, if @res->mob_head is non-empty.
509 static int vmw_cotable_create(struct vmw_resource *res) vmw_cotable_create() argument
511 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_create()
512 size_t new_size = res->backup_size; vmw_cotable_create()
521 if (likely(new_size <= res->backup_size)) { vmw_cotable_create()
522 if (vcotbl->scrubbed && !list_empty(&res->mob_head)) { vmw_cotable_create()
523 ret = vmw_cotable_unscrub(res); vmw_cotable_create()
527 res->id = vcotbl->type; vmw_cotable_create()
531 return vmw_cotable_resize(res, new_size); vmw_cotable_create()
537 * @res: Pointer to a cotable resource.
541 static void vmw_hw_cotable_destroy(struct vmw_resource *res) vmw_hw_cotable_destroy() argument
543 (void) vmw_cotable_destroy(res); vmw_hw_cotable_destroy()
551 * @res: Pointer to a cotable resource.
553 static void vmw_cotable_free(struct vmw_resource *res) vmw_cotable_free() argument
555 struct vmw_private *dev_priv = res->dev_priv; vmw_cotable_free()
557 kfree(res); vmw_cotable_free()
591 ret = vmw_resource_init(dev_priv, &vcotbl->res, true, vmw_cotable_alloc()
597 vcotbl->res.id = type; vmw_cotable_alloc()
598 vcotbl->res.backup_size = PAGE_SIZE; vmw_cotable_alloc()
601 vcotbl->res.backup_size = co_info[type].min_initial_entries * vmw_cotable_alloc()
603 vcotbl->res.backup_size = vmw_cotable_alloc()
604 (vcotbl->res.backup_size + PAGE_SIZE - 1) & PAGE_MASK; vmw_cotable_alloc()
612 vmw_resource_activate(&vcotbl->res, vmw_hw_cotable_destroy); vmw_cotable_alloc()
614 return &vcotbl->res; vmw_cotable_alloc()
626 * @res: Pointer to a cotable resource.
629 int vmw_cotable_notify(struct vmw_resource *res, int id) vmw_cotable_notify() argument
631 struct vmw_cotable *vcotbl = vmw_cotable(res); vmw_cotable_notify()
641 res->id = -1; vmw_cotable_notify()
651 * @res: pointer struct vmw_resource representing the cotable.
655 void vmw_cotable_add_resource(struct vmw_resource *res, struct list_head *head) vmw_cotable_add_resource() argument
658 container_of(res, struct vmw_cotable, res); vmw_cotable_add_resource()
H A Dvmwgfx_shader.c34 struct vmw_resource res; member in struct:vmw_shader
47 struct vmw_resource res; member in struct:vmw_dx_shader
59 static void vmw_user_shader_free(struct vmw_resource *res);
63 static int vmw_gb_shader_create(struct vmw_resource *res);
64 static int vmw_gb_shader_bind(struct vmw_resource *res,
66 static int vmw_gb_shader_unbind(struct vmw_resource *res,
69 static int vmw_gb_shader_destroy(struct vmw_resource *res);
71 static int vmw_dx_shader_create(struct vmw_resource *res);
72 static int vmw_dx_shader_bind(struct vmw_resource *res,
74 static int vmw_dx_shader_unbind(struct vmw_resource *res,
77 static void vmw_dx_shader_commit_notify(struct vmw_resource *res,
128 vmw_res_to_shader(struct vmw_resource *res) vmw_res_to_shader() argument
130 return container_of(res, struct vmw_shader, res); vmw_res_to_shader()
137 * @res: Pointer to the struct vmw_resource.
140 vmw_res_to_dx_shader(struct vmw_resource *res) vmw_res_to_dx_shader() argument
142 return container_of(res, struct vmw_dx_shader, res); vmw_res_to_dx_shader()
145 static void vmw_hw_shader_destroy(struct vmw_resource *res) vmw_hw_shader_destroy() argument
147 if (likely(res->func->destroy)) vmw_hw_shader_destroy()
148 (void) res->func->destroy(res); vmw_hw_shader_destroy()
150 res->id = -1; vmw_hw_shader_destroy()
155 struct vmw_resource *res, vmw_gb_shader_init()
162 void (*res_free) (struct vmw_resource *res)) vmw_gb_shader_init()
164 struct vmw_shader *shader = vmw_res_to_shader(res); vmw_gb_shader_init()
167 ret = vmw_resource_init(dev_priv, res, true, res_free, vmw_gb_shader_init()
172 res_free(res); vmw_gb_shader_init()
174 kfree(res); vmw_gb_shader_init()
178 res->backup_size = size; vmw_gb_shader_init()
180 res->backup = vmw_dmabuf_reference(byte_code); vmw_gb_shader_init()
181 res->backup_offset = offset; vmw_gb_shader_init()
188 vmw_resource_activate(res, vmw_hw_shader_destroy); vmw_gb_shader_init()
196 static int vmw_gb_shader_create(struct vmw_resource *res) vmw_gb_shader_create() argument
198 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_create()
199 struct vmw_shader *shader = vmw_res_to_shader(res); vmw_gb_shader_create()
206 if (likely(res->id != -1)) vmw_gb_shader_create()
209 ret = vmw_resource_alloc_id(res); vmw_gb_shader_create()
215 if (unlikely(res->id >= VMWGFX_NUM_GB_SHADER)) { vmw_gb_shader_create()
230 cmd->body.shid = res->id; vmw_gb_shader_create()
239 vmw_resource_release_id(res); vmw_gb_shader_create()
244 static int vmw_gb_shader_bind(struct vmw_resource *res, vmw_gb_shader_bind() argument
247 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_bind()
265 cmd->body.shid = res->id; vmw_gb_shader_bind()
267 cmd->body.offsetInBytes = res->backup_offset; vmw_gb_shader_bind()
268 res->backup_dirty = false; vmw_gb_shader_bind()
274 static int vmw_gb_shader_unbind(struct vmw_resource *res, vmw_gb_shader_unbind() argument
278 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_unbind()
285 BUG_ON(res->backup->base.mem.mem_type != VMW_PL_MOB); vmw_gb_shader_unbind()
296 cmd->body.shid = res->id; vmw_gb_shader_unbind()
316 static int vmw_gb_shader_destroy(struct vmw_resource *res) vmw_gb_shader_destroy() argument
318 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_shader_destroy()
324 if (likely(res->id == -1)) vmw_gb_shader_destroy()
328 vmw_binding_res_list_scrub(&res->binding_head); vmw_gb_shader_destroy()
340 cmd->body.shid = res->id; vmw_gb_shader_destroy()
343 vmw_resource_release_id(res); vmw_gb_shader_destroy()
357 * @res: Pointer to the shader resource.
361 static void vmw_dx_shader_commit_notify(struct vmw_resource *res, vmw_dx_shader_commit_notify() argument
364 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); vmw_dx_shader_commit_notify()
365 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_commit_notify()
372 res->id = shader->id; vmw_dx_shader_commit_notify()
378 res->id = -1; vmw_dx_shader_commit_notify()
386 * @res: The shader resource
390 static int vmw_dx_shader_unscrub(struct vmw_resource *res) vmw_dx_shader_unscrub() argument
392 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); vmw_dx_shader_unscrub()
393 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_unscrub()
414 cmd->body.mobid = res->backup->base.mem.start; vmw_dx_shader_unscrub()
415 cmd->body.offsetInBytes = res->backup_offset; vmw_dx_shader_unscrub()
426 * @res: The DX shader resource
431 static int vmw_dx_shader_create(struct vmw_resource *res) vmw_dx_shader_create() argument
433 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_create()
434 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); vmw_dx_shader_create()
439 if (!list_empty(&res->mob_head)) { vmw_dx_shader_create()
441 ret = vmw_dx_shader_unscrub(res); vmw_dx_shader_create()
445 res->id = shader->id; vmw_dx_shader_create()
452 * @res: The DX shader resource
456 static int vmw_dx_shader_bind(struct vmw_resource *res, vmw_dx_shader_bind() argument
459 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_bind()
464 vmw_dx_shader_unscrub(res); vmw_dx_shader_bind()
473 * @res: The shader resource
480 static int vmw_dx_shader_scrub(struct vmw_resource *res) vmw_dx_shader_scrub() argument
482 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); vmw_dx_shader_scrub()
483 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_scrub()
503 cmd->body.shid = res->id; vmw_dx_shader_scrub()
507 res->id = -1; vmw_dx_shader_scrub()
516 * @res: The shader resource
520 static int vmw_dx_shader_unbind(struct vmw_resource *res, vmw_dx_shader_unbind() argument
524 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_unbind()
528 BUG_ON(res->backup->base.mem.mem_type != VMW_PL_MOB); vmw_dx_shader_unbind()
531 ret = vmw_dx_shader_scrub(res); vmw_dx_shader_unbind()
567 WARN_ON(vmw_dx_shader_scrub(&entry->res)); list_for_each_entry_safe()
576 * @res: The shader resource
580 static void vmw_dx_shader_res_free(struct vmw_resource *res) vmw_dx_shader_res_free() argument
582 struct vmw_private *dev_priv = res->dev_priv; vmw_dx_shader_res_free()
583 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); vmw_dx_shader_res_free()
607 struct vmw_resource *res; vmw_dx_shader_add() local
632 res = &shader->res; vmw_dx_shader_add()
638 ret = vmw_resource_init(dev_priv, res, true, vmw_dx_shader_add()
649 res, list); vmw_dx_shader_add()
653 res->id = shader->id; vmw_dx_shader_add()
654 vmw_resource_activate(res, vmw_hw_shader_destroy); vmw_dx_shader_add()
657 vmw_resource_unreference(&res); vmw_dx_shader_add()
672 shader.res); vmw_user_shader_base_to_res()
675 static void vmw_user_shader_free(struct vmw_resource *res) vmw_user_shader_free() argument
678 container_of(res, struct vmw_user_shader, shader.res); vmw_user_shader_free()
679 struct vmw_private *dev_priv = res->dev_priv; vmw_user_shader_free()
686 static void vmw_shader_free(struct vmw_resource *res) vmw_shader_free() argument
688 struct vmw_shader *shader = vmw_res_to_shader(res); vmw_shader_free()
689 struct vmw_private *dev_priv = res->dev_priv; vmw_shader_free()
704 struct vmw_resource *res = vmw_user_shader_base_to_res(base); vmw_user_shader_base_release() local
707 vmw_resource_unreference(&res); vmw_user_shader_base_release()
731 struct vmw_resource *res, *tmp; vmw_user_shader_alloc() local
760 res = &ushader->shader.res; vmw_user_shader_alloc()
768 ret = vmw_gb_shader_init(dev_priv, res, shader_size, vmw_user_shader_alloc()
775 tmp = vmw_resource_reference(res); vmw_user_shader_alloc()
788 vmw_resource_unreference(&res); vmw_user_shader_alloc()
801 struct vmw_resource *res; vmw_shader_alloc() local
830 res = &shader->res; vmw_shader_alloc()
835 ret = vmw_gb_shader_init(dev_priv, res, shader_size, vmw_shader_alloc()
840 return ret ? ERR_PTR(ret) : res; vmw_shader_alloc()
976 struct vmw_resource *res; vmw_compat_shader_add() local
1011 res = vmw_shader_alloc(dev_priv, buf, size, 0, shader_type); vmw_compat_shader_add()
1017 res, list); vmw_compat_shader_add()
1018 vmw_resource_unreference(&res); vmw_compat_shader_add()
154 vmw_gb_shader_init(struct vmw_private *dev_priv, struct vmw_resource *res, uint32_t size, uint64_t offset, SVGA3dShaderType type, uint8_t num_input_sig, uint8_t num_output_sig, struct vmw_dma_buffer *byte_code, void (*res_free) (struct vmw_resource *res)) vmw_gb_shader_init() argument
H A Dvmwgfx_resource_priv.h47 void (*res_free) (struct vmw_resource *res);
75 int (*create) (struct vmw_resource *res);
76 int (*destroy) (struct vmw_resource *res);
77 int (*bind) (struct vmw_resource *res,
79 int (*unbind) (struct vmw_resource *res,
82 void (*commit_notify)(struct vmw_resource *res,
86 int vmw_resource_alloc_id(struct vmw_resource *res);
87 void vmw_resource_release_id(struct vmw_resource *res);
88 int vmw_resource_init(struct vmw_private *dev_priv, struct vmw_resource *res,
90 void (*res_free) (struct vmw_resource *res),
92 void vmw_resource_activate(struct vmw_resource *res,
H A Dvmwgfx_surface.c66 static void vmw_user_surface_free(struct vmw_resource *res);
69 static int vmw_legacy_srf_bind(struct vmw_resource *res,
71 static int vmw_legacy_srf_unbind(struct vmw_resource *res,
74 static int vmw_legacy_srf_create(struct vmw_resource *res);
75 static int vmw_legacy_srf_destroy(struct vmw_resource *res);
76 static int vmw_gb_surface_create(struct vmw_resource *res);
77 static int vmw_gb_surface_bind(struct vmw_resource *res,
79 static int vmw_gb_surface_unbind(struct vmw_resource *res,
82 static int vmw_gb_surface_destroy(struct vmw_resource *res);
225 cmd->body.sid = srf->res.id; vmw_surface_define_encode()
276 body->host.sid = srf->res.id; vmw_surface_dma_encode()
306 * @res: Pointer to a struct vmw_resource embedded in a struct
312 static void vmw_hw_surface_destroy(struct vmw_resource *res) vmw_hw_surface_destroy() argument
315 struct vmw_private *dev_priv = res->dev_priv; vmw_hw_surface_destroy()
319 if (res->func->destroy == vmw_gb_surface_destroy) { vmw_hw_surface_destroy()
320 (void) vmw_gb_surface_destroy(res); vmw_hw_surface_destroy()
324 if (res->id != -1) { vmw_hw_surface_destroy()
333 vmw_surface_destroy_encode(res->id, cmd); vmw_hw_surface_destroy()
343 srf = vmw_res_to_srf(res); vmw_hw_surface_destroy()
344 dev_priv->used_memory_size -= res->backup_size; vmw_hw_surface_destroy()
354 * @res: Pointer to a struct vmw_surface.
363 static int vmw_legacy_srf_create(struct vmw_resource *res) vmw_legacy_srf_create() argument
365 struct vmw_private *dev_priv = res->dev_priv; vmw_legacy_srf_create()
371 if (likely(res->id != -1)) vmw_legacy_srf_create()
374 srf = vmw_res_to_srf(res); vmw_legacy_srf_create()
375 if (unlikely(dev_priv->used_memory_size + res->backup_size >= vmw_legacy_srf_create()
383 ret = vmw_resource_alloc_id(res); vmw_legacy_srf_create()
389 if (unlikely(res->id >= SVGA3D_MAX_SURFACE_IDS)) { vmw_legacy_srf_create()
413 dev_priv->used_memory_size += res->backup_size; vmw_legacy_srf_create()
417 vmw_resource_release_id(res); vmw_legacy_srf_create()
425 * @res: Pointer to a struct vmw_res embedded in a struct
438 static int vmw_legacy_srf_dma(struct vmw_resource *res, vmw_legacy_srf_dma() argument
445 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_legacy_srf_dma()
447 struct vmw_private *dev_priv = res->dev_priv; vmw_legacy_srf_dma()
482 * @res: Pointer to a struct vmw_res embedded in a struct
490 static int vmw_legacy_srf_bind(struct vmw_resource *res, vmw_legacy_srf_bind() argument
493 if (!res->backup_dirty) vmw_legacy_srf_bind()
496 return vmw_legacy_srf_dma(res, val_buf, true); vmw_legacy_srf_bind()
504 * @res: Pointer to a struct vmw_res embedded in a struct
511 static int vmw_legacy_srf_unbind(struct vmw_resource *res, vmw_legacy_srf_unbind() argument
516 return vmw_legacy_srf_dma(res, val_buf, false); vmw_legacy_srf_unbind()
524 * @res: Pointer to a struct vmw_res embedded in a struct
527 static int vmw_legacy_srf_destroy(struct vmw_resource *res) vmw_legacy_srf_destroy() argument
529 struct vmw_private *dev_priv = res->dev_priv; vmw_legacy_srf_destroy()
533 BUG_ON(res->id == -1); vmw_legacy_srf_destroy()
547 vmw_surface_destroy_encode(res->id, cmd); vmw_legacy_srf_destroy()
554 dev_priv->used_memory_size -= res->backup_size; vmw_legacy_srf_destroy()
560 vmw_resource_release_id(res); vmw_legacy_srf_destroy()
576 void (*res_free) (struct vmw_resource *res)) vmw_surface_init()
579 struct vmw_resource *res = &srf->res; vmw_surface_init() local
584 ret = vmw_resource_init(dev_priv, res, true, res_free, vmw_surface_init()
591 res_free(res); vmw_surface_init()
601 vmw_resource_activate(res, vmw_hw_surface_destroy); vmw_surface_init()
618 prime.base)->srf.res); vmw_user_surface_base_to_res()
624 * @res: A struct vmw_resource embedded in a struct vmw_surface.
626 static void vmw_user_surface_free(struct vmw_resource *res) vmw_user_surface_free() argument
628 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_user_surface_free()
631 struct vmw_private *dev_priv = srf->res.dev_priv; vmw_user_surface_free()
657 struct vmw_resource *res = &user_srf->srf.res; vmw_user_surface_base_release() local
662 vmw_resource_unreference(&res); vmw_user_surface_base_release()
696 struct vmw_resource *res; vmw_surface_define_ioctl() local
757 res = &srf->res; vmw_surface_define_ioctl()
811 res->backup_size = cur_bo_offset; vmw_surface_define_ioctl()
854 res->backup_size, vmw_surface_define_ioctl()
857 &res->backup, vmw_surface_define_ioctl()
860 vmw_resource_unreference(&res); vmw_surface_define_ioctl()
865 tmp = vmw_resource_reference(&srf->res); vmw_surface_define_ioctl()
866 ret = ttm_prime_object_init(tfile, res->backup_size, &user_srf->prime, vmw_surface_define_ioctl()
872 vmw_resource_unreference(&res); vmw_surface_define_ioctl()
877 vmw_resource_unreference(&res); vmw_surface_define_ioctl()
1032 static int vmw_gb_surface_create(struct vmw_resource *res) vmw_gb_surface_create() argument
1034 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_create()
1035 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_gb_surface_create()
1047 if (likely(res->id != -1)) vmw_gb_surface_create()
1051 ret = vmw_resource_alloc_id(res); vmw_gb_surface_create()
1057 if (unlikely(res->id >= VMWGFX_NUM_GB_SURFACE)) { vmw_gb_surface_create()
1085 cmd2->body.sid = srf->res.id; vmw_gb_surface_create()
1098 cmd->body.sid = srf->res.id; vmw_gb_surface_create()
1114 vmw_resource_release_id(res); vmw_gb_surface_create()
1121 static int vmw_gb_surface_bind(struct vmw_resource *res, vmw_gb_surface_bind() argument
1124 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_bind()
1138 submit_size = sizeof(*cmd1) + (res->backup_dirty ? sizeof(*cmd2) : 0); vmw_gb_surface_bind()
1149 cmd1->body.sid = res->id; vmw_gb_surface_bind()
1151 if (res->backup_dirty) { vmw_gb_surface_bind()
1155 cmd2->body.sid = res->id; vmw_gb_surface_bind()
1156 res->backup_dirty = false; vmw_gb_surface_bind()
1163 static int vmw_gb_surface_unbind(struct vmw_resource *res, vmw_gb_surface_unbind() argument
1167 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_unbind()
1201 cmd1->body.sid = res->id; vmw_gb_surface_unbind()
1207 cmd2->body.sid = res->id; vmw_gb_surface_unbind()
1213 cmd3->body.sid = res->id; vmw_gb_surface_unbind()
1233 static int vmw_gb_surface_destroy(struct vmw_resource *res) vmw_gb_surface_destroy() argument
1235 struct vmw_private *dev_priv = res->dev_priv; vmw_gb_surface_destroy()
1236 struct vmw_surface *srf = vmw_res_to_srf(res); vmw_gb_surface_destroy()
1242 if (likely(res->id == -1)) vmw_gb_surface_destroy()
1247 vmw_binding_res_list_scrub(&res->binding_head); vmw_gb_surface_destroy()
1259 cmd->body.sid = res->id; vmw_gb_surface_destroy()
1262 vmw_resource_release_id(res); vmw_gb_surface_destroy()
1283 struct vmw_resource *res; vmw_gb_surface_define_ioctl() local
1325 res = &user_srf->srf.res; vmw_gb_surface_define_ioctl()
1330 &res->backup, vmw_gb_surface_define_ioctl()
1332 if (ret == 0 && res->backup->base.num_pages * PAGE_SIZE < vmw_gb_surface_define_ioctl()
1333 res->backup_size) { vmw_gb_surface_define_ioctl()
1335 vmw_dmabuf_unreference(&res->backup); vmw_gb_surface_define_ioctl()
1341 res->backup_size, vmw_gb_surface_define_ioctl()
1345 &res->backup, vmw_gb_surface_define_ioctl()
1349 vmw_resource_unreference(&res); vmw_gb_surface_define_ioctl()
1353 tmp = vmw_resource_reference(res); vmw_gb_surface_define_ioctl()
1354 ret = ttm_prime_object_init(tfile, res->backup_size, &user_srf->prime, vmw_gb_surface_define_ioctl()
1362 vmw_resource_unreference(&res); vmw_gb_surface_define_ioctl()
1367 rep->backup_size = res->backup_size; vmw_gb_surface_define_ioctl()
1368 if (res->backup) { vmw_gb_surface_define_ioctl()
1370 drm_vma_node_offset_addr(&res->backup->base.vma_node); vmw_gb_surface_define_ioctl()
1371 rep->buffer_size = res->backup->base.num_pages * PAGE_SIZE; vmw_gb_surface_define_ioctl()
1379 vmw_resource_unreference(&res); vmw_gb_surface_define_ioctl()
1416 if (srf->res.backup == NULL) { vmw_gb_surface_reference_ioctl()
1421 mutex_lock(&dev_priv->cmdbuf_mutex); /* Protect res->backup */ vmw_gb_surface_reference_ioctl()
1422 ret = vmw_user_dmabuf_reference(tfile, srf->res.backup, vmw_gb_surface_reference_ioctl()
1444 rep->crep.backup_size = srf->res.backup_size; vmw_gb_surface_reference_ioctl()
1447 drm_vma_node_offset_addr(&srf->res.backup->base.vma_node); vmw_gb_surface_reference_ioctl()
1448 rep->crep.buffer_size = srf->res.backup->base.num_pages * PAGE_SIZE; vmw_gb_surface_reference_ioctl()
1560 srf->res.backup_size = vmw_surface_gb_priv_define()
1567 srf->res.backup_size += sizeof(SVGA3dDXSOState); vmw_surface_gb_priv_define()
574 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 Dvmwgfx_so.c45 * @res: The struct vmw_resource we derive from
62 struct vmw_resource res; member in struct:vmw_view
75 static int vmw_view_create(struct vmw_resource *res);
76 static int vmw_view_destroy(struct vmw_resource *res);
77 static void vmw_hw_view_destroy(struct vmw_resource *res);
78 static void vmw_view_commit_notify(struct vmw_resource *res,
108 * @res: Pointer to the resource to convert.
112 static struct vmw_view *vmw_view(struct vmw_resource *res) vmw_view() argument
114 return container_of(res, struct vmw_view, res); vmw_view()
121 * @res: Pointer to the view resource.
125 static void vmw_view_commit_notify(struct vmw_resource *res, vmw_view_commit_notify() argument
128 struct vmw_view *view = vmw_view(res); vmw_view_commit_notify()
129 struct vmw_private *dev_priv = res->dev_priv; vmw_view_commit_notify()
138 res->id = view->view_id; vmw_view_commit_notify()
144 res->id = -1; vmw_view_commit_notify()
152 * @res: Pointer to the view resource.
157 static int vmw_view_create(struct vmw_resource *res) vmw_view_create() argument
159 struct vmw_view *view = vmw_view(res); vmw_view_create()
161 struct vmw_private *dev_priv = res->dev_priv; vmw_view_create()
173 cmd = vmw_fifo_reserve_dx(res->dev_priv, view->cmd_size, vmw_view_create()
185 vmw_fifo_commit(res->dev_priv, view->cmd_size); vmw_view_create()
186 res->id = view->view_id; vmw_view_create()
197 * @res: Pointer to the view resource.
202 static int vmw_view_destroy(struct vmw_resource *res) vmw_view_destroy() argument
204 struct vmw_private *dev_priv = res->dev_priv; vmw_view_destroy()
205 struct vmw_view *view = vmw_view(res); vmw_view_destroy()
212 vmw_binding_res_list_scrub(&res->binding_head); vmw_view_destroy()
214 if (!view->committed || res->id == -1) vmw_view_destroy()
228 res->id = -1; vmw_view_destroy()
238 * @res: Pointer to the view resource.
242 static void vmw_hw_view_destroy(struct vmw_resource *res) vmw_hw_view_destroy() argument
244 struct vmw_private *dev_priv = res->dev_priv; vmw_hw_view_destroy()
247 WARN_ON(vmw_view_destroy(res)); vmw_hw_view_destroy()
248 res->id = -1; vmw_hw_view_destroy()
283 * @res: Pointer to a struct vmw_resource
287 static void vmw_view_res_free(struct vmw_resource *res) vmw_view_res_free() argument
289 struct vmw_view *view = vmw_view(res); vmw_view_res_free()
291 struct vmw_private *dev_priv = res->dev_priv; vmw_view_res_free()
330 struct vmw_resource *res; vmw_view_add() local
362 res = &view->res; vmw_view_add()
373 ret = vmw_resource_init(dev_priv, res, true, vmw_view_add()
380 res, list); vmw_view_add()
384 res->id = view->view_id; vmw_view_add()
385 vmw_resource_activate(res, vmw_hw_view_destroy); vmw_view_add()
388 vmw_resource_unreference(&res); vmw_view_add()
441 WARN_ON(vmw_view_destroy(&entry->res)); vmw_view_cotable_list_destroy()
461 WARN_ON(vmw_view_destroy(&entry->res)); vmw_view_surface_list_destroy()
468 * @res: pointer to a view resource.
473 struct vmw_resource *vmw_view_srf(struct vmw_resource *res) vmw_view_srf() argument
475 return vmw_view(res)->srf; vmw_view_srf()
/linux-4.4.14/fs/ext4/
H A Dcrypto_policy.c21 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_inode_has_encryption_context() local
23 return (res > 0); ext4_inode_has_encryption_context()
34 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_is_encryption_context_consistent_with_policy() local
37 if (res != sizeof(ctx)) ext4_is_encryption_context_consistent_with_policy()
54 int res, res2; ext4_create_encryption_context_from_policy() local
56 res = ext4_convert_inline_data(inode); ext4_create_encryption_context_from_policy()
57 if (res) ext4_create_encryption_context_from_policy()
58 return res; ext4_create_encryption_context_from_policy()
87 res = ext4_xattr_set(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_create_encryption_context_from_policy()
90 if (!res) { ext4_create_encryption_context_from_policy()
92 res = ext4_mark_inode_dirty(handle, inode); ext4_create_encryption_context_from_policy()
93 if (res) ext4_create_encryption_context_from_policy()
97 if (!res) ext4_create_encryption_context_from_policy()
98 res = res2; ext4_create_encryption_context_from_policy()
99 return res; ext4_create_encryption_context_from_policy()
129 int res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, ext4_get_policy() local
132 if (res != sizeof(ctx)) ext4_get_policy()
149 int res; ext4_is_child_context_consistent_with_parent() local
162 res = ext4_get_encryption_info(parent); ext4_is_child_context_consistent_with_parent()
163 if (res) ext4_is_child_context_consistent_with_parent()
165 res = ext4_get_encryption_info(child); ext4_is_child_context_consistent_with_parent()
166 if (res) ext4_is_child_context_consistent_with_parent()
194 int res; ext4_inherit_context() local
196 res = ext4_get_encryption_info(parent); ext4_inherit_context()
197 if (res < 0) ext4_inherit_context()
198 return res; ext4_inherit_context()
211 res = 0; ext4_inherit_context()
220 res = ext4_xattr_set(child, EXT4_XATTR_INDEX_ENCRYPTION, ext4_inherit_context()
223 if (!res) { ext4_inherit_context()
226 res = ext4_get_encryption_info(child); ext4_inherit_context()
228 return res; ext4_inherit_context()
H A Dcrypto_key.c27 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()
75 res = ecr.res; ext4_derive_key_aes()
83 return res; ext4_derive_key_aes()
129 int res; _ext4_get_encryption_info() local
132 res = ext4_init_crypto(); _ext4_get_encryption_info()
133 if (res) _ext4_get_encryption_info()
134 return res; _ext4_get_encryption_info()
147 res = ext4_xattr_get(inode, EXT4_XATTR_INDEX_ENCRYPTION, _ext4_get_encryption_info()
150 if (res < 0) { _ext4_get_encryption_info()
152 return res; _ext4_get_encryption_info()
157 } else if (res != sizeof(ctx)) _ext4_get_encryption_info()
159 res = 0; _ext4_get_encryption_info()
189 res = -ENOKEY; _ext4_get_encryption_info()
205 res = PTR_ERR(keyring_key); _ext4_get_encryption_info()
213 res = -ENOKEY; _ext4_get_encryption_info()
219 res = -EINVAL; _ext4_get_encryption_info()
230 res = -ENOKEY; _ext4_get_encryption_info()
234 res = ext4_derive_key_aes(ctx.nonce, master_key->raw, _ext4_get_encryption_info()
237 if (res) _ext4_get_encryption_info()
242 res = ctfm ? PTR_ERR(ctfm) : -ENOMEM; _ext4_get_encryption_info()
245 __func__, res, (unsigned) inode->i_ino); _ext4_get_encryption_info()
252 res = crypto_ablkcipher_setkey(ctfm, raw_key, _ext4_get_encryption_info()
254 if (res) _ext4_get_encryption_info()
264 if (res == -ENOKEY) _ext4_get_encryption_info()
265 res = 0; _ext4_get_encryption_info()
268 return res; _ext4_get_encryption_info()
H A Dsymlink.c34 int res; ext4_encrypted_follow_link() local
37 res = ext4_get_encryption_info(inode); ext4_encrypted_follow_link()
38 if (res) ext4_encrypted_follow_link()
39 return ERR_PTR(res); ext4_encrypted_follow_link()
60 res = -EFSCORRUPTED; ext4_encrypted_follow_link()
67 res = -ENOMEM; ext4_encrypted_follow_link()
72 res = _ext4_fname_disk_to_usr(inode, NULL, &cstr, &pstr); ext4_encrypted_follow_link()
73 if (res < 0) ext4_encrypted_follow_link()
76 if (res <= plen) ext4_encrypted_follow_link()
77 paddr[res] = '\0'; ext4_encrypted_follow_link()
89 return ERR_PTR(res); ext4_encrypted_follow_link()
H A Dcrypto_fname.c35 static void ext4_dir_crypt_complete(struct crypto_async_request *req, int res) ext4_dir_crypt_complete() argument
39 if (res == -EINPROGRESS) ext4_dir_crypt_complete()
41 ecr->res = res; ext4_dir_crypt_complete()
72 int res = 0; ext4_fname_encrypt() local
121 res = crypto_ablkcipher_encrypt(req); ext4_fname_encrypt()
122 if (res == -EINPROGRESS || res == -EBUSY) { ext4_fname_encrypt()
124 res = ecr.res; ext4_fname_encrypt()
128 if (res < 0) { ext4_fname_encrypt()
130 KERN_ERR "%s: Error (error code %d)\n", __func__, res); ext4_fname_encrypt()
133 return res; ext4_fname_encrypt()
153 int res = 0; ext4_fname_decrypt() local
182 res = crypto_ablkcipher_decrypt(req); ext4_fname_decrypt()
183 if (res == -EINPROGRESS || res == -EBUSY) { ext4_fname_decrypt()
185 res = ecr.res; ext4_fname_decrypt()
188 if (res < 0) { ext4_fname_decrypt()
191 __func__, res); ext4_fname_decrypt()
192 return res; ext4_fname_decrypt()
372 int res; ext4_fname_usr_to_disk() local
386 res = ext4_fname_encrypt(inode, iname, oname); ext4_fname_usr_to_disk()
387 return res; ext4_fname_usr_to_disk()
/linux-4.4.14/fs/hfsplus/
H A Dextents.c90 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 Ddir.c304 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 Dbfind.c119 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 Dxattr.c432 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.4.14/drivers/rtc/
H A Drtc-ds1343.c376 int res; ds1343_read_time() local
378 res = regmap_bulk_read(priv->map, DS1343_SECONDS_REG, buf, 7); ds1343_read_time()
379 if (res) ds1343_read_time()
380 return res; ds1343_read_time()
396 int res; ds1343_set_time() local
398 res = regmap_write(priv->map, DS1343_SECONDS_REG, ds1343_set_time()
400 if (res) ds1343_set_time()
401 return res; ds1343_set_time()
403 res = regmap_write(priv->map, DS1343_MINUTES_REG, ds1343_set_time()
405 if (res) ds1343_set_time()
406 return res; ds1343_set_time()
408 res = regmap_write(priv->map, DS1343_HOURS_REG, ds1343_set_time()
410 if (res) ds1343_set_time()
411 return res; ds1343_set_time()
413 res = regmap_write(priv->map, DS1343_DAY_REG, ds1343_set_time()
415 if (res) ds1343_set_time()
416 return res; ds1343_set_time()
418 res = regmap_write(priv->map, DS1343_DATE_REG, ds1343_set_time()
420 if (res) ds1343_set_time()
421 return res; ds1343_set_time()
423 res = regmap_write(priv->map, DS1343_MONTH_REG, ds1343_set_time()
425 if (res) ds1343_set_time()
426 return res; ds1343_set_time()
430 res = regmap_write(priv->map, DS1343_YEAR_REG, ds1343_set_time()
432 if (res) ds1343_set_time()
433 return res; ds1343_set_time()
443 int res = 0; ds1343_update_alarm() local
445 res = regmap_read(priv->map, DS1343_CONTROL_REG, &control); ds1343_update_alarm()
446 if (res) ds1343_update_alarm()
447 return res; ds1343_update_alarm()
449 res = regmap_read(priv->map, DS1343_STATUS_REG, &stat); ds1343_update_alarm()
450 if (res) ds1343_update_alarm()
451 return res; ds1343_update_alarm()
456 res = regmap_write(priv->map, DS1343_CONTROL_REG, control); ds1343_update_alarm()
457 if (res) ds1343_update_alarm()
458 return res; ds1343_update_alarm()
460 res = regmap_write(priv->map, DS1343_STATUS_REG, stat); ds1343_update_alarm()
461 if (res) ds1343_update_alarm()
462 return res; ds1343_update_alarm()
473 res = regmap_bulk_write(priv->map, DS1343_ALM0_SEC_REG, buf, 4); ds1343_update_alarm()
474 if (res) ds1343_update_alarm()
475 return res; ds1343_update_alarm()
479 res = regmap_write(priv->map, DS1343_CONTROL_REG, control); ds1343_update_alarm()
482 return res; ds1343_update_alarm()
488 int res = 0; ds1343_read_alarm() local
496 res = regmap_read(priv->map, DS1343_STATUS_REG, &stat); ds1343_read_alarm()
497 if (res) ds1343_read_alarm()
516 return res; ds1343_read_alarm()
522 int res = 0; ds1343_set_alarm() local
537 res = ds1343_update_alarm(dev); ds1343_set_alarm()
541 return res; ds1343_set_alarm()
547 int res = 0; ds1343_alarm_irq_enable() local
559 res = ds1343_update_alarm(dev); ds1343_alarm_irq_enable()
563 return res; ds1343_alarm_irq_enable()
570 int res = 0; ds1343_thread() local
574 res = regmap_read(priv->map, DS1343_STATUS_REG, &stat); ds1343_thread()
575 if (res) ds1343_thread()
582 res = regmap_read(priv->map, DS1343_CONTROL_REG, &control); ds1343_thread()
583 if (res) ds1343_thread()
611 int res; ds1343_probe() local
630 res = spi_setup(spi); ds1343_probe()
631 if (res) ds1343_probe()
632 return res; ds1343_probe()
643 res = regmap_read(priv->map, DS1343_SECONDS_REG, &data); ds1343_probe()
644 if (res) ds1343_probe()
645 return res; ds1343_probe()
666 res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, ds1343_probe()
669 if (res) { ds1343_probe()
679 res = ds1343_sysfs_register(&spi->dev); ds1343_probe()
680 if (res) ds1343_probe()
/linux-4.4.14/drivers/ssb/
H A Dembedded.c72 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 Dbridge_pcmcia_80211.c32 int res = 0; ssb_host_pcmcia_probe() local
46 res = pcmcia_request_window(dev, dev->resource[2], 250); ssb_host_pcmcia_probe()
47 if (res != 0) ssb_host_pcmcia_probe()
50 res = pcmcia_map_mem_page(dev, dev->resource[2], 0); ssb_host_pcmcia_probe()
51 if (res != 0) ssb_host_pcmcia_probe()
57 res = pcmcia_enable_device(dev); ssb_host_pcmcia_probe()
58 if (res != 0) ssb_host_pcmcia_probe()
73 ssb_err("Initialization failed (%d, %d)\n", res, err); ssb_host_pcmcia_probe()
H A Ddriver_extif.c156 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.4.14/arch/x86/include/asm/
H A Darch_hweight.h26 unsigned int res = 0; __arch_hweight32() local
29 : "="REG_OUT (res) __arch_hweight32()
32 return res; __arch_hweight32()
54 unsigned long res = 0; __arch_hweight64() local
57 : "="REG_OUT (res) __arch_hweight64()
60 return res; __arch_hweight64()
H A Dolpc_ofw.h14 #define olpc_ofw(name, args, res) \
15 __olpc_ofw((name), ARRAY_SIZE(args), args, ARRAY_SIZE(res), res)
18 void **res);
/linux-4.4.14/arch/cris/include/arch-v32/arch/
H A Dbitops.h14 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 Dchecksum.h16 __wsum res; csum_tcpudp_nofold() local
22 : "=r" (res) csum_tcpudp_nofold()
26 return res; csum_tcpudp_nofold()
/linux-4.4.14/arch/arm/mach-imx/devices/
H A Dplatform-imx-dma.c14 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 Dplatform-ipu-core.c37 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 Dplatform-gpio-mxc.c14 struct resource res[] = { mxc_register_gpio() local
31 name, id, res, ARRAY_SIZE(res), NULL, 0); mxc_register_gpio()
H A Dplatform-imx21-hcd.c27 struct resource res[] = { imx_add_imx21_hcd() local
39 res, ARRAY_SIZE(res), imx_add_imx21_hcd()
H A Dplatform-fec.c37 struct resource res[] = { imx_add_fec() local
50 res, ARRAY_SIZE(res), imx_add_fec()
H A Dplatform-flexcan.c43 struct resource res[] = { imx_add_flexcan() local
56 res, ARRAY_SIZE(res), NULL, 0); imx_add_flexcan()
H A Dplatform-fsl-usb2-udc.c40 struct resource res[] = { imx_add_fsl_usb2_udc() local
52 res, ARRAY_SIZE(res), imx_add_fsl_usb2_udc()
H A Dplatform-imx-fb.c41 struct resource res[] = { imx_add_imx_fb() local
53 res, ARRAY_SIZE(res), imx_add_imx_fb()
H A Dplatform-imx-keypad.c43 struct resource res[] = { imx_add_imx_keypad() local
56 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); imx_add_imx_keypad()
H A Dplatform-imx2-wdt.c46 struct resource res[] = { imx_add_imx2_wdt() local
54 res, ARRAY_SIZE(res), NULL, 0); imx_add_imx2_wdt()
/linux-4.4.14/kernel/
H A Dresource.c131 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()
554 static void resource_clip(struct resource *res, resource_size_t min, resource_clip() argument
557 if (res->start < min) resource_clip()
558 res->start = min; resource_clip()
559 if (res->end > max) resource_clip()
560 res->end = max; resource_clip()
739 struct resource *res; lookup_resource() local
742 for (res = root->child; res; res = res->sibling) { lookup_resource()
743 if (res->start == start) lookup_resource()
748 return res; lookup_resource()
876 static int __adjust_resource(struct resource *res, resource_size_t start, __adjust_resource() argument
879 struct resource *tmp, *parent = res->parent; __adjust_resource()
889 if (res->sibling && (res->sibling->start <= end)) __adjust_resource()
893 if (tmp != res) { __adjust_resource()
894 while (tmp->sibling != res) __adjust_resource()
901 for (tmp = res->child; tmp; tmp = tmp->sibling) __adjust_resource()
905 res->start = start; __adjust_resource()
906 res->end = end; __adjust_resource()
915 * @res: resource to modify
923 int adjust_resource(struct resource *res, resource_size_t start, adjust_resource() argument
929 result = __adjust_resource(res, start, size); adjust_resource()
941 struct resource *res = alloc_resource(GFP_ATOMIC); __reserve_region_with_split() local
944 if (!res) __reserve_region_with_split()
947 res->name = name; __reserve_region_with_split()
948 res->start = start; __reserve_region_with_split()
949 res->end = end; __reserve_region_with_split()
950 res->flags = IORESOURCE_BUSY; __reserve_region_with_split()
954 conflict = __request_resource(parent, res); __reserve_region_with_split()
958 res = next_res; __reserve_region_with_split()
964 if (conflict->start <= res->start && __reserve_region_with_split()
965 conflict->end >= res->end) { __reserve_region_with_split()
966 free_resource(res); __reserve_region_with_split()
972 if (conflict->start > res->start) { __reserve_region_with_split()
973 end = res->end; __reserve_region_with_split()
974 res->end = conflict->start - 1; __reserve_region_with_split()
978 free_resource(res); __reserve_region_with_split()
987 res->start = conflict->end + 1; __reserve_region_with_split()
1024 * @res: resource pointer
1028 resource_size_t resource_alignment(struct resource *res) resource_alignment() argument
1030 switch (res->flags & (IORESOURCE_SIZEALIGN | IORESOURCE_STARTALIGN)) { resource_alignment()
1032 return resource_size(res); resource_alignment()
1034 return res->start; resource_alignment()
1066 struct resource *res = alloc_resource(GFP_KERNEL); __request_region() local
1068 if (!res) __request_region()
1071 res->name = name; __request_region()
1072 res->start = start; __request_region()
1073 res->end = start + n - 1; __request_region()
1074 res->flags = resource_type(parent); __request_region()
1075 res->flags |= IORESOURCE_BUSY | flags; __request_region()
1082 conflict = __request_resource(parent, res); __request_region()
1101 free_resource(res); __request_region()
1102 res = NULL; __request_region()
1106 return res; __request_region()
1130 struct resource *res = *p; __release_region() local
1132 if (!res) __release_region()
1134 if (res->start <= start && res->end >= end) { __release_region()
1135 if (!(res->flags & IORESOURCE_BUSY)) { __release_region()
1136 p = &res->child; __release_region()
1139 if (res->start != start || res->end != end) __release_region()
1141 *p = res->sibling; __release_region()
1143 if (res->flags & IORESOURCE_MUXED) __release_region()
1145 free_resource(res); __release_region()
1148 p = &res->sibling; __release_region()
1184 struct resource *res; release_mem_region_adjustable() local
1199 while ((res = *p)) { release_mem_region_adjustable()
1200 if (res->start >= end) release_mem_region_adjustable()
1204 if (res->start > start || res->end < end) { release_mem_region_adjustable()
1205 p = &res->sibling; release_mem_region_adjustable()
1209 if (!(res->flags & IORESOURCE_MEM)) release_mem_region_adjustable()
1212 if (!(res->flags & IORESOURCE_BUSY)) { release_mem_region_adjustable()
1213 p = &res->child; release_mem_region_adjustable()
1218 if (res->start == start && res->end == end) { release_mem_region_adjustable()
1220 *p = res->sibling; release_mem_region_adjustable()
1221 free_resource(res); release_mem_region_adjustable()
1223 } else if (res->start == start && res->end != end) { release_mem_region_adjustable()
1225 ret = __adjust_resource(res, end + 1, release_mem_region_adjustable()
1226 res->end - end); release_mem_region_adjustable()
1227 } else if (res->start != start && res->end == end) { release_mem_region_adjustable()
1229 ret = __adjust_resource(res, res->start, release_mem_region_adjustable()
1230 start - res->start); release_mem_region_adjustable()
1237 new_res->name = res->name; release_mem_region_adjustable()
1239 new_res->end = res->end; release_mem_region_adjustable()
1240 new_res->flags = res->flags; release_mem_region_adjustable()
1241 new_res->parent = res->parent; release_mem_region_adjustable()
1242 new_res->sibling = res->sibling; release_mem_region_adjustable()
1245 ret = __adjust_resource(res, res->start, release_mem_region_adjustable()
1246 start - res->start); release_mem_region_adjustable()
1249 res->sibling = new_res; release_mem_region_adjustable()
1314 static int devm_resource_match(struct device *dev, void *res, void *data) devm_resource_match() argument
1316 struct resource **ptr = res; devm_resource_match()
1341 static void devm_region_release(struct device *dev, void *res) devm_region_release() argument
1343 struct region_devres *this = res; devm_region_release()
1348 static int devm_region_match(struct device *dev, void *res, void *match_data) devm_region_match() argument
1350 struct region_devres *this = res, *match = match_data; devm_region_match()
1361 struct resource *res; __devm_request_region() local
1372 res = __request_region(parent, start, n, name, 0); __devm_request_region()
1373 if (res) __devm_request_region()
1378 return res; __devm_request_region()
1411 struct resource *res = reserve + x; reserve_setup() local
1412 res->name = "reserved"; reserve_setup()
1413 res->start = io_start; reserve_setup()
1414 res->end = io_start + io_num - 1; reserve_setup()
1415 res->flags = IORESOURCE_BUSY; reserve_setup()
1416 res->child = NULL; reserve_setup()
1417 if (request_resource(res->start >= 0x10000 ? &iomem_resource : &ioport_resource, res) == 0) reserve_setup()
1513 struct resource_entry *resource_list_create_entry(struct resource *res, resource_list_create_entry() argument
1521 entry->res = res ? res : &entry->__res; resource_list_create_entry()
H A Dmemremap.c112 static void devm_memremap_release(struct device *dev, void *res) devm_memremap_release() argument
114 memunmap(*(void **)res); devm_memremap_release()
117 static int devm_memremap_match(struct device *dev, void *res, void *match_data) devm_memremap_match() argument
119 return *(void **)res == match_data; devm_memremap_match()
154 struct resource res; member in struct:page_map
157 static void devm_memremap_pages_release(struct device *dev, void *res) devm_memremap_pages_release() argument
159 struct page_map *page_map = res; devm_memremap_pages_release()
162 arch_remove_memory(page_map->res.start, resource_size(&page_map->res)); devm_memremap_pages_release()
165 void *devm_memremap_pages(struct device *dev, struct resource *res) devm_memremap_pages() argument
167 int is_ram = region_intersects(res->start, resource_size(res), devm_memremap_pages()
174 __func__, res); devm_memremap_pages()
179 return __va(res->start); devm_memremap_pages()
186 memcpy(&page_map->res, res, sizeof(*res)); devm_memremap_pages()
192 error = arch_add_memory(nid, res->start, resource_size(res), true); devm_memremap_pages()
199 return __va(res->start); devm_memremap_pages()
/linux-4.4.14/drivers/media/platform/omap3isp/
H A Dispresizer.c113 * @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.4.14/drivers/gpu/drm/exynos/
H A Dexynos_mixer.c143 static inline u32 vp_reg_read(struct mixer_resources *res, u32 reg_id) vp_reg_read() argument
145 return readl(res->vp_regs + reg_id); vp_reg_read()
148 static inline void vp_reg_write(struct mixer_resources *res, u32 reg_id, vp_reg_write() argument
151 writel(val, res->vp_regs + reg_id); vp_reg_write()
154 static inline void vp_reg_writemask(struct mixer_resources *res, u32 reg_id, vp_reg_writemask() argument
157 u32 old = vp_reg_read(res, reg_id); vp_reg_writemask()
160 writel(val, res->vp_regs + reg_id); vp_reg_writemask()
163 static inline u32 mixer_reg_read(struct mixer_resources *res, u32 reg_id) mixer_reg_read() argument
165 return readl(res->mixer_regs + reg_id); mixer_reg_read()
168 static inline void mixer_reg_write(struct mixer_resources *res, u32 reg_id, mixer_reg_write() argument
171 writel(val, res->mixer_regs + reg_id); mixer_reg_write()
174 static inline void mixer_reg_writemask(struct mixer_resources *res, mixer_reg_writemask() argument
177 u32 old = mixer_reg_read(res, reg_id); mixer_reg_writemask()
180 writel(val, res->mixer_regs + reg_id); mixer_reg_writemask()
250 static inline void vp_filter_set(struct mixer_resources *res, vp_filter_set() argument
258 vp_reg_write(res, reg_id, val); vp_filter_set()
262 static void vp_default_filter(struct mixer_resources *res) vp_default_filter() argument
264 vp_filter_set(res, VP_POLY8_Y0_LL, vp_default_filter()
266 vp_filter_set(res, VP_POLY4_Y0_LL, vp_default_filter()
268 vp_filter_set(res, VP_POLY4_C0_LL, vp_default_filter()
274 struct mixer_resources *res = &ctx->mixer_res; mixer_vsync_set_update() local
277 mixer_reg_writemask(res, MXR_STATUS, enable ? mixer_vsync_set_update()
281 vp_reg_write(res, VP_SHADOW_UPDATE, enable ? mixer_vsync_set_update()
287 struct mixer_resources *res = &ctx->mixer_res; mixer_cfg_scan() local
308 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_SCAN_MASK); mixer_cfg_scan()
313 struct mixer_resources *res = &ctx->mixer_res; mixer_cfg_rgb_fmt() local
322 mixer_reg_write(res, MXR_CM_COEFF_Y, mixer_cfg_rgb_fmt()
325 mixer_reg_write(res, MXR_CM_COEFF_CB, mixer_cfg_rgb_fmt()
327 mixer_reg_write(res, MXR_CM_COEFF_CR, mixer_cfg_rgb_fmt()
331 mixer_reg_write(res, MXR_CM_COEFF_Y, mixer_cfg_rgb_fmt()
334 mixer_reg_write(res, MXR_CM_COEFF_CB, mixer_cfg_rgb_fmt()
336 mixer_reg_write(res, MXR_CM_COEFF_CR, mixer_cfg_rgb_fmt()
340 mixer_reg_write(res, MXR_CM_COEFF_Y, mixer_cfg_rgb_fmt()
343 mixer_reg_write(res, MXR_CM_COEFF_CB, mixer_cfg_rgb_fmt()
345 mixer_reg_write(res, MXR_CM_COEFF_CR, mixer_cfg_rgb_fmt()
349 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK); mixer_cfg_rgb_fmt()
355 struct mixer_resources *res = &ctx->mixer_res; mixer_cfg_layer() local
360 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_GRP0_ENABLE); mixer_cfg_layer()
363 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_GRP1_ENABLE); mixer_cfg_layer()
367 vp_reg_writemask(res, VP_ENABLE, val, VP_ENABLE_ON); mixer_cfg_layer()
368 mixer_reg_writemask(res, MXR_CFG, val, mixer_cfg_layer()
372 mixer_reg_writemask(res, MXR_GRAPHIC_CFG(0), val, mixer_cfg_layer()
382 struct mixer_resources *res = &ctx->mixer_res; mixer_run() local
384 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_REG_RUN); mixer_run()
389 struct mixer_resources *res = &ctx->mixer_res; mixer_stop() local
392 mixer_reg_writemask(res, MXR_STATUS, 0, MXR_STATUS_REG_RUN); mixer_stop()
394 while (!(mixer_reg_read(res, MXR_STATUS) & MXR_STATUS_REG_IDLE) && mixer_stop()
402 struct mixer_resources *res = &ctx->mixer_res; vp_video_buffer() local
443 spin_lock_irqsave(&res->reg_slock, flags); vp_video_buffer()
448 vp_reg_writemask(res, VP_MODE, val, VP_MODE_LINE_SKIP); vp_video_buffer()
453 vp_reg_writemask(res, VP_MODE, val, VP_MODE_FMT_MASK); vp_video_buffer()
456 vp_reg_write(res, VP_IMG_SIZE_Y, VP_IMG_HSIZE(fb->pitches[0]) | vp_video_buffer()
459 vp_reg_write(res, VP_IMG_SIZE_C, VP_IMG_HSIZE(fb->pitches[0]) | vp_video_buffer()
462 vp_reg_write(res, VP_SRC_WIDTH, plane->src_w); vp_video_buffer()
463 vp_reg_write(res, VP_SRC_HEIGHT, plane->src_h); vp_video_buffer()
464 vp_reg_write(res, VP_SRC_H_POSITION, vp_video_buffer()
466 vp_reg_write(res, VP_SRC_V_POSITION, plane->src_y); vp_video_buffer()
468 vp_reg_write(res, VP_DST_WIDTH, plane->crtc_w); vp_video_buffer()
469 vp_reg_write(res, VP_DST_H_POSITION, plane->crtc_x); vp_video_buffer()
471 vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_h / 2); vp_video_buffer()
472 vp_reg_write(res, VP_DST_V_POSITION, plane->crtc_y / 2); vp_video_buffer()
474 vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_h); vp_video_buffer()
475 vp_reg_write(res, VP_DST_V_POSITION, plane->crtc_y); vp_video_buffer()
478 vp_reg_write(res, VP_H_RATIO, plane->h_ratio); vp_video_buffer()
479 vp_reg_write(res, VP_V_RATIO, plane->v_ratio); vp_video_buffer()
481 vp_reg_write(res, VP_ENDIAN_MODE, VP_ENDIAN_MODE_LITTLE); vp_video_buffer()
484 vp_reg_write(res, VP_TOP_Y_PTR, luma_addr[0]); vp_video_buffer()
485 vp_reg_write(res, VP_BOT_Y_PTR, luma_addr[1]); vp_video_buffer()
486 vp_reg_write(res, VP_TOP_C_PTR, chroma_addr[0]); vp_video_buffer()
487 vp_reg_write(res, VP_BOT_C_PTR, chroma_addr[1]); vp_video_buffer()
495 spin_unlock_irqrestore(&res->reg_slock, flags); vp_video_buffer()
503 struct mixer_resources *res = &ctx->mixer_res; mixer_layer_update() local
505 mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE); mixer_layer_update()
535 struct mixer_resources *res = &ctx->mixer_res; mixer_graph_buffer() local
589 spin_lock_irqsave(&res->reg_slock, flags); mixer_graph_buffer()
593 mixer_reg_writemask(res, MXR_GRAPHIC_CFG(win), mixer_graph_buffer()
597 mixer_reg_write(res, MXR_GRAPHIC_SPAN(win), mixer_graph_buffer()
605 mixer_reg_write(res, MXR_RESOLUTION, val); mixer_graph_buffer()
612 mixer_reg_write(res, MXR_GRAPHIC_WH(win), val); mixer_graph_buffer()
617 mixer_reg_write(res, MXR_GRAPHIC_SXY(win), val); mixer_graph_buffer()
622 mixer_reg_write(res, MXR_GRAPHIC_DXY(win), val); mixer_graph_buffer()
625 mixer_reg_write(res, MXR_GRAPHIC_BASE(win), dma_addr); mixer_graph_buffer()
639 spin_unlock_irqrestore(&res->reg_slock, flags); mixer_graph_buffer()
646 struct mixer_resources *res = &ctx->mixer_res; vp_win_reset() local
649 vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING); vp_win_reset()
652 if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING) vp_win_reset()
661 struct mixer_resources *res = &ctx->mixer_res; mixer_win_reset() local
665 spin_lock_irqsave(&res->reg_slock, flags); mixer_win_reset()
668 mixer_reg_writemask(res, MXR_CFG, MXR_CFG_DST_HDMI, MXR_CFG_DST_MASK); mixer_win_reset()
671 mixer_reg_writemask(res, MXR_CFG, MXR_CFG_OUT_RGB888, MXR_CFG_OUT_MASK); mixer_win_reset()
674 mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST, mixer_win_reset()
687 mixer_reg_write(res, MXR_LAYER_CFG, val); mixer_win_reset()
690 mixer_reg_write(res, MXR_BG_COLOR0, 0x008080); mixer_win_reset()
691 mixer_reg_write(res, MXR_BG_COLOR1, 0x008080); mixer_win_reset()
692 mixer_reg_write(res, MXR_BG_COLOR2, 0x008080); mixer_win_reset()
700 mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val); mixer_win_reset()
705 mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val); mixer_win_reset()
709 mixer_reg_write(res, MXR_VIDEO_CFG, val); mixer_win_reset()
714 vp_default_filter(res); mixer_win_reset()
718 mixer_reg_writemask(res, MXR_CFG, 0, MXR_CFG_GRP0_ENABLE); mixer_win_reset()
719 mixer_reg_writemask(res, MXR_CFG, 0, MXR_CFG_GRP1_ENABLE); mixer_win_reset()
721 mixer_reg_writemask(res, MXR_CFG, 0, MXR_CFG_VP_ENABLE); mixer_win_reset()
724 spin_unlock_irqrestore(&res->reg_slock, flags); mixer_win_reset()
730 struct mixer_resources *res = &ctx->mixer_res; mixer_irq_handler() local
734 spin_lock(&res->reg_slock); mixer_irq_handler()
737 val = mixer_reg_read(res, MXR_INT_STATUS); mixer_irq_handler()
747 base = mixer_reg_read(res, MXR_GRAPHIC_BASE(0)); mixer_irq_handler()
748 shadow = mixer_reg_read(res, MXR_GRAPHIC_BASE_S(0)); mixer_irq_handler()
752 base = mixer_reg_read(res, MXR_GRAPHIC_BASE(1)); mixer_irq_handler()
753 shadow = mixer_reg_read(res, MXR_GRAPHIC_BASE_S(1)); mixer_irq_handler()
777 mixer_reg_write(res, MXR_INT_STATUS, val); mixer_irq_handler()
779 spin_unlock(&res->reg_slock); mixer_irq_handler()
788 struct resource *res; mixer_resources_init() local
810 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 0); mixer_resources_init()
811 if (res == NULL) { mixer_resources_init()
816 mixer_res->mixer_regs = devm_ioremap(dev, res->start, mixer_resources_init()
817 resource_size(res)); mixer_resources_init()
823 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_IRQ, 0); mixer_resources_init()
824 if (res == NULL) { mixer_resources_init()
829 ret = devm_request_irq(dev, res->start, mixer_irq_handler, mixer_resources_init()
835 mixer_res->irq = res->start; mixer_resources_init()
844 struct resource *res; vp_resources_init() local
869 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1); vp_resources_init()
870 if (res == NULL) { vp_resources_init()
875 mixer_res->vp_regs = devm_ioremap(dev, res->start, vp_resources_init()
876 resource_size(res)); vp_resources_init()
926 struct mixer_resources *res = &mixer_ctx->mixer_res; mixer_enable_vblank() local
933 mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); mixer_enable_vblank()
934 mixer_reg_writemask(res, MXR_INT_EN, ~0, MXR_INT_EN_VSYNC); mixer_enable_vblank()
942 struct mixer_resources *res = &mixer_ctx->mixer_res; mixer_disable_vblank() local
950 mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); mixer_disable_vblank()
951 mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); mixer_disable_vblank()
974 struct mixer_resources *res = &mixer_ctx->mixer_res; mixer_disable_plane() local
982 spin_lock_irqsave(&res->reg_slock, flags); mixer_disable_plane()
988 spin_unlock_irqrestore(&res->reg_slock, flags); mixer_disable_plane()
1022 struct mixer_resources *res = &ctx->mixer_res; mixer_enable() local
1030 ret = clk_prepare_enable(res->mixer); mixer_enable()
1035 ret = clk_prepare_enable(res->hdmi); mixer_enable()
1041 ret = clk_prepare_enable(res->vp); mixer_enable()
1048 ret = clk_prepare_enable(res->sclk_mixer); mixer_enable()
1060 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET); mixer_enable()
1063 mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); mixer_enable()
1064 mixer_reg_writemask(res, MXR_INT_EN, ~0, MXR_INT_EN_VSYNC); mixer_enable()
1072 struct mixer_resources *res = &ctx->mixer_res; mixer_disable() local
1086 clk_disable_unprepare(res->hdmi); mixer_disable()
1087 clk_disable_unprepare(res->mixer); mixer_disable()
1089 clk_disable_unprepare(res->vp); mixer_disable()
1091 clk_disable_unprepare(res->sclk_mixer); mixer_disable()
/linux-4.4.14/net/hsr/
H A Dhsr_netlink.c72 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 Dhsr_slave.c103 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.4.14/arch/x86/video/
H A Dfbdev.c19 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.4.14/arch/powerpc/sysdev/
H A Drtc_cmos_setup.c24 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 Dof_rtc.c36 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.4.14/arch/m68k/lib/
H A Duaccess.c13 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.4.14/arch/mips/pci/
H A Dpci-bcm47xx.c39 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 Dops-sni.c43 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.4.14/arch/mips/sgi-ip22/
H A Dip22-platform.c67 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(&eth0_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.4.14/arch/arm/mach-mvebu/
H A Dcpu-reset.c44 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.4.14/drivers/acpi/
H A Dioapic.c35 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 Dresource.c29 static inline bool acpi_iospace_resource_valid(struct resource *res) acpi_iospace_resource_valid() argument
32 return res->end < 0x10003; acpi_iospace_resource_valid()
42 acpi_iospace_resource_valid(struct resource *res) { return true; } acpi_iospace_resource_valid() argument
65 static void acpi_dev_memresource_flags(struct resource *res, u64 len, acpi_dev_memresource_flags() argument
68 res->flags = IORESOURCE_MEM; acpi_dev_memresource_flags()
70 if (!acpi_dev_resource_len_valid(res->start, res->end, len, false)) acpi_dev_memresource_flags()
71 res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_memresource_flags()
74 res->flags |= IORESOURCE_MEM_WRITEABLE; acpi_dev_memresource_flags()
77 static void acpi_dev_get_memresource(struct resource *res, u64 start, u64 len, acpi_dev_get_memresource() argument
80 res->start = start; acpi_dev_get_memresource()
81 res->end = start + len - 1; acpi_dev_get_memresource()
82 acpi_dev_memresource_flags(res, len, write_protect); acpi_dev_get_memresource()
88 * @res: Output generic resource object.
92 * resource object pointed to by @res.
95 * 1) false with res->flags setting to zero: not the expected resource type
96 * 2) false with IORESOURCE_DISABLED in res->flags: valid unassigned resource
99 bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) acpi_dev_resource_memory() argument
108 acpi_dev_get_memresource(res, memory24->minimum << 8, acpi_dev_resource_memory()
114 acpi_dev_get_memresource(res, memory32->minimum, acpi_dev_resource_memory()
120 acpi_dev_get_memresource(res, fixed_memory32->address, acpi_dev_resource_memory()
125 res->flags = 0; acpi_dev_resource_memory()
129 return !(res->flags & IORESOURCE_DISABLED); acpi_dev_resource_memory()
133 static void acpi_dev_ioresource_flags(struct resource *res, u64 len, acpi_dev_ioresource_flags() argument
136 res->flags = IORESOURCE_IO; acpi_dev_ioresource_flags()
138 if (!acpi_dev_resource_len_valid(res->start, res->end, len, true)) acpi_dev_ioresource_flags()
139 res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_ioresource_flags()
141 if (!acpi_iospace_resource_valid(res)) acpi_dev_ioresource_flags()
142 res->flags |= IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_ioresource_flags()
145 res->flags |= IORESOURCE_IO_16BIT_ADDR; acpi_dev_ioresource_flags()
147 res->flags |= IORESOURCE_IO_SPARSE; acpi_dev_ioresource_flags()
150 static void acpi_dev_get_ioresource(struct resource *res, u64 start, u64 len, acpi_dev_get_ioresource() argument
153 res->start = start; acpi_dev_get_ioresource()
154 res->end = start + len - 1; acpi_dev_get_ioresource()
155 acpi_dev_ioresource_flags(res, len, io_decode, 0); acpi_dev_get_ioresource()
161 * @res: Output generic resource object.
165 * resource object pointed to by @res.
168 * 1) false with res->flags setting to zero: not the expected resource type
169 * 2) false with IORESOURCE_DISABLED in res->flags: valid unassigned resource
172 bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) acpi_dev_resource_io() argument
180 acpi_dev_get_ioresource(res, io->minimum, acpi_dev_resource_io()
186 acpi_dev_get_ioresource(res, fixed_io->address, acpi_dev_resource_io()
191 res->flags = 0; acpi_dev_resource_io()
195 return !(res->flags & IORESOURCE_DISABLED); acpi_dev_resource_io()
207 struct resource *res = &win->res; acpi_decode_space() local
234 res->start = start; acpi_decode_space()
235 res->end = end; acpi_decode_space()
237 (offset != win->offset || start != res->start || end != res->end)) { acpi_decode_space()
245 acpi_dev_memresource_flags(res, len, wp); acpi_decode_space()
248 acpi_dev_ioresource_flags(res, len, iodec, acpi_decode_space()
252 res->flags = IORESOURCE_BUS; acpi_decode_space()
259 res->flags |= IORESOURCE_WINDOW; acpi_decode_space()
262 res->flags |= IORESOURCE_PREFETCH; acpi_decode_space()
264 return !(res->flags & IORESOURCE_DISABLED); acpi_decode_space()
277 * 1) false with win->res.flags setting to zero: not the expected resource type
278 * 2) false with IORESOURCE_DISABLED in win->res.flags: valid unassigned
287 win->res.flags = 0; acpi_dev_resource_address_space()
306 * 1) false with win->res.flags setting to zero: not the expected resource type
307 * 2) false with IORESOURCE_DISABLED in win->res.flags: valid unassigned
316 win->res.flags = 0; acpi_dev_resource_ext_address_space()
351 static void acpi_dev_irqresource_disabled(struct resource *res, u32 gsi) acpi_dev_irqresource_disabled() argument
353 res->start = gsi; acpi_dev_irqresource_disabled()
354 res->end = gsi; acpi_dev_irqresource_disabled()
355 res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; acpi_dev_irqresource_disabled()
358 static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, acpi_dev_get_irqresource() argument
365 acpi_dev_irqresource_disabled(res, gsi); acpi_dev_get_irqresource()
391 res->flags = acpi_dev_irq_flags(triggering, polarity, shareable); acpi_dev_get_irqresource()
394 res->start = irq; acpi_dev_get_irqresource()
395 res->end = irq; acpi_dev_get_irqresource()
397 acpi_dev_irqresource_disabled(res, gsi); acpi_dev_get_irqresource()
405 * @res: Output generic resource object.
412 * to by @res accordingly. If the registration of the GSI is not successful,
416 * 1) false with res->flags setting to zero: not the expected resource type
417 * 2) false with IORESOURCE_DISABLED in res->flags: valid unassigned resource
421 struct resource *res) acpi_dev_resource_interrupt()
434 acpi_dev_irqresource_disabled(res, 0); acpi_dev_resource_interrupt()
437 acpi_dev_get_irqresource(res, irq->interrupts[index], acpi_dev_resource_interrupt()
444 acpi_dev_irqresource_disabled(res, 0); acpi_dev_resource_interrupt()
447 acpi_dev_get_irqresource(res, ext_irq->interrupts[index], acpi_dev_resource_interrupt()
452 res->flags = 0; acpi_dev_resource_interrupt()
488 *rentry->res = win->res; acpi_dev_new_resource_entry()
500 struct resource *res = &win.res; acpi_dev_process_resource() local
517 if (acpi_dev_resource_memory(ares, res) acpi_dev_process_resource()
518 || acpi_dev_resource_io(ares, res) acpi_dev_process_resource()
523 for (i = 0; acpi_dev_resource_interrupt(ares, i, res); i++) { acpi_dev_process_resource()
420 acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, struct resource *res) acpi_dev_resource_interrupt() argument
/linux-4.4.14/tools/testing/nvdimm/test/
H A Diomap.c64 - nfit_res->res->start; __nfit_test_ioremap()
78 - nfit_res->res->start; __wrap_devm_ioremap_nocache()
92 return nfit_res->buf + offset - nfit_res->res->start; __wrap_devm_memremap()
106 return nfit_res->buf + offset - nfit_res->res->start; __wrap_memremap()
173 struct resource *res = nfit_res->res + 1; nfit_test_request_region() local
175 if (start + n > nfit_res->res->start nfit_test_request_region()
176 + resource_size(nfit_res->res)) { nfit_test_request_region()
179 nfit_res->res); nfit_test_request_region()
183 res->start = start; nfit_test_request_region()
184 res->end = start + n - 1; nfit_test_request_region()
185 res->name = name; nfit_test_request_region()
186 res->flags = resource_type(parent); nfit_test_request_region()
187 res->flags |= IORESOURCE_BUSY | flags; nfit_test_request_region()
188 pr_debug("%s: %pr\n", __func__, res); nfit_test_request_region()
189 return res; nfit_test_request_region()
225 struct resource *res = nfit_res->res + 1; __wrap___release_region() local
227 if (start != res->start || resource_size(res) != n) __wrap___release_region()
229 __func__, start, n, res); __wrap___release_region()
231 memset(res, 0, sizeof(*res)); __wrap___release_region()
/linux-4.4.14/drivers/staging/lustre/lustre/ldlm/
H A Dldlm_resource.c160 __u64 res = 0; resource_count_show() local
166 res += cfs_hash_bd_count_get(&bd); resource_count_show()
167 return sprintf(buf, "%lld\n", res); resource_count_show()
433 static struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res) ldlm_resource_getref() argument
435 LASSERT(res); ldlm_resource_getref()
436 LASSERT(res != LP_POISON); ldlm_resource_getref()
437 atomic_inc(&res->lr_refcount); ldlm_resource_getref()
438 CDEBUG(D_INFO, "getref res: %p count: %d\n", res, ldlm_resource_getref()
439 atomic_read(&res->lr_refcount)); ldlm_resource_getref()
440 return res; ldlm_resource_getref()
487 struct ldlm_resource *res; ldlm_res_hop_key() local
489 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_key()
490 return &res->lr_name; ldlm_res_hop_key()
495 struct ldlm_resource *res; ldlm_res_hop_keycmp() local
497 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_keycmp()
499 (const struct ldlm_res_id *)&res->lr_name); ldlm_res_hop_keycmp()
510 struct ldlm_resource *res; ldlm_res_hop_get_locked() local
512 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_get_locked()
513 ldlm_resource_getref(res); ldlm_res_hop_get_locked()
519 struct ldlm_resource *res; ldlm_res_hop_put_locked() local
521 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_put_locked()
523 ldlm_resource_putref_locked(res); ldlm_res_hop_put_locked()
528 struct ldlm_resource *res; ldlm_res_hop_put() local
530 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_res_hop_put()
531 ldlm_resource_putref(res); ldlm_res_hop_put()
740 static void cleanup_resource(struct ldlm_resource *res, struct list_head *q, cleanup_resource() argument
753 lock_res(res); list_for_each()
767 unlock_res(res);
786 unlock_res(res);
794 unlock_res(res);
806 struct ldlm_resource *res = cfs_hash_object(hs, hnode); ldlm_resource_clean() local
809 cleanup_resource(res, &res->lr_granted, flags); ldlm_resource_clean()
810 cleanup_resource(res, &res->lr_waiting, flags); ldlm_resource_clean()
818 struct ldlm_resource *res = cfs_hash_object(hs, hnode); ldlm_resource_complain() local
820 lock_res(res); ldlm_resource_complain()
823 ldlm_ns_name(ldlm_res_to_ns(res)), PLDLMRES(res), res, ldlm_resource_complain()
824 atomic_read(&res->lr_refcount) - 1); ldlm_resource_complain()
826 ldlm_resource_dump(D_ERROR, res); ldlm_resource_complain()
827 unlock_res(res); ldlm_resource_complain()
1031 struct ldlm_resource *res; ldlm_resource_new() local
1034 res = kmem_cache_alloc(ldlm_resource_slab, GFP_NOFS | __GFP_ZERO); ldlm_resource_new()
1035 if (res == NULL) ldlm_resource_new()
1038 INIT_LIST_HEAD(&res->lr_granted); ldlm_resource_new()
1039 INIT_LIST_HEAD(&res->lr_waiting); ldlm_resource_new()
1043 res->lr_itree[idx].lit_size = 0; ldlm_resource_new()
1044 res->lr_itree[idx].lit_mode = 1 << idx; ldlm_resource_new()
1045 res->lr_itree[idx].lit_root = NULL; ldlm_resource_new()
1048 atomic_set(&res->lr_refcount, 1); ldlm_resource_new()
1049 spin_lock_init(&res->lr_lock); ldlm_resource_new()
1050 lu_ref_init(&res->lr_reference); ldlm_resource_new()
1054 mutex_init(&res->lr_lvb_mutex); ldlm_resource_new()
1055 mutex_lock(&res->lr_lvb_mutex); ldlm_resource_new()
1057 return res; ldlm_resource_new()
1063 * Locks: takes and releases NS hash-lock and res->lr_lock
1071 struct ldlm_resource *res; ldlm_resource_get() local
1085 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_resource_get()
1088 mutex_lock(&res->lr_lvb_mutex); ldlm_resource_get()
1089 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get()
1092 if (unlikely(res->lr_lvb_len < 0)) { ldlm_resource_get()
1093 ldlm_resource_putref(res); ldlm_resource_get()
1094 res = NULL; ldlm_resource_get()
1096 return res; ldlm_resource_get()
1107 res = ldlm_resource_new(); ldlm_resource_get()
1108 if (!res) ldlm_resource_get()
1111 res->lr_ns_bucket = cfs_hash_bd_extra_get(ns->ns_rs_hash, &bd); ldlm_resource_get()
1112 res->lr_name = *name; ldlm_resource_get()
1113 res->lr_type = type; ldlm_resource_get()
1114 res->lr_most_restr = LCK_NL; ldlm_resource_get()
1124 lu_ref_fini(&res->lr_reference); ldlm_resource_get()
1126 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get()
1127 kmem_cache_free(ldlm_resource_slab, res); ldlm_resource_get()
1129 res = hlist_entry(hnode, struct ldlm_resource, lr_hash); ldlm_resource_get()
1132 mutex_lock(&res->lr_lvb_mutex); ldlm_resource_get()
1133 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get()
1136 if (unlikely(res->lr_lvb_len < 0)) { ldlm_resource_get()
1137 ldlm_resource_putref(res); ldlm_resource_get()
1138 res = NULL; ldlm_resource_get()
1140 return res; ldlm_resource_get()
1143 cfs_hash_bd_add_locked(ns->ns_rs_hash, &bd, &res->lr_hash); ldlm_resource_get()
1152 rc = ns->ns_lvbo->lvbo_init(res); ldlm_resource_get()
1157 kfree(res->lr_lvb_data); ldlm_resource_get()
1158 res->lr_lvb_data = NULL; ldlm_resource_get()
1159 res->lr_lvb_len = rc; ldlm_resource_get()
1160 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get()
1161 ldlm_resource_putref(res); ldlm_resource_get()
1167 mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_get()
1179 return res; ldlm_resource_get()
1184 struct ldlm_resource *res) __ldlm_resource_putref_final()
1186 struct ldlm_ns_bucket *nsb = res->lr_ns_bucket; __ldlm_resource_putref_final()
1188 if (!list_empty(&res->lr_granted)) { __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 kmem_cache_free(ldlm_resource_slab, 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 kmem_cache_free(ldlm_resource_slab, 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()
1292 void ldlm_res2desc(struct ldlm_resource *res, struct ldlm_resource_desc *desc) ldlm_res2desc() argument
1294 desc->lr_type = res->lr_type; ldlm_res2desc()
1295 desc->lr_name = res->lr_name; ldlm_res2desc()
1325 struct ldlm_resource *res = cfs_hash_object(hs, hnode); ldlm_res_hash_dump() local
1328 lock_res(res); ldlm_res_hash_dump()
1329 ldlm_resource_dump(level, res); ldlm_res_hash_dump()
1330 unlock_res(res); ldlm_res_hash_dump()
1362 void ldlm_resource_dump(int level, struct ldlm_resource *res) ldlm_resource_dump() argument
1373 PLDLMRES(res), res, atomic_read(&res->lr_refcount)); ldlm_resource_dump()
1375 if (!list_empty(&res->lr_granted)) { ldlm_resource_dump()
1377 list_for_each_entry_reverse(lock, &res->lr_granted, ldlm_resource_dump()
1388 if (!list_empty(&res->lr_waiting)) { ldlm_resource_dump()
1390 list_for_each_entry(lock, &res->lr_waiting, l_res_link) ldlm_resource_dump()
1183 __ldlm_resource_putref_final(struct cfs_hash_bd *bd, struct ldlm_resource *res) __ldlm_resource_putref_final() argument
/linux-4.4.14/arch/m68k/include/asm/
H A Duaccess_mm.h60 #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 Dstring.h44 char res; strcmp() local
55 : "+a" (cs), "+a" (ct), "=d" (res)); strcmp()
56 return res; strcmp()
/linux-4.4.14/drivers/scsi/
H A Da4000t.c36 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()
/linux-4.4.14/arch/mn10300/lib/
H A Dusercopy.c33 #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.4.14/drivers/infiniband/hw/usnic/
H A Dusnic_vnic.c97 struct usnic_vnic_res *res; usnic_vnic_dump() local
121 res = chunk->res[j]; usnic_vnic_dump()
124 usnic_vnic_res_type_to_str(res->type), usnic_vnic_dump()
125 res->vnic_idx, res->ctrl, !!res->owner); usnic_vnic_dump()
127 offset += printrow(res->owner, buf + offset, usnic_vnic_dump()
237 struct usnic_vnic_res *res; usnic_vnic_get_resources() local
250 ret->res = kzalloc(sizeof(*(ret->res))*cnt, GFP_ATOMIC); usnic_vnic_get_resources()
251 if (!ret->res) { usnic_vnic_get_resources()
261 res = src->res[i]; usnic_vnic_get_resources()
262 if (!res->owner) { usnic_vnic_get_resources()
264 res->owner = owner; usnic_vnic_get_resources()
265 ret->res[ret->cnt++] = res; usnic_vnic_get_resources()
280 struct usnic_vnic_res *res; usnic_vnic_put_resources() local
286 res = chunk->res[i]; usnic_vnic_put_resources()
287 chunk->res[i] = NULL; usnic_vnic_put_resources()
288 res->owner = NULL; usnic_vnic_put_resources()
289 vnic->chunks[res->type].free_cnt++; usnic_vnic_put_resources()
293 kfree(chunk->res); usnic_vnic_put_resources()
307 struct usnic_vnic_res *res; usnic_vnic_alloc_res_chunk() local
314 chunk->res = kzalloc(sizeof(*(chunk->res))*cnt, GFP_KERNEL); usnic_vnic_alloc_res_chunk()
315 if (!chunk->res) usnic_vnic_alloc_res_chunk()
319 res = kzalloc(sizeof(*res), GFP_KERNEL); usnic_vnic_alloc_res_chunk()
320 if (!res) { usnic_vnic_alloc_res_chunk()
324 res->type = type; usnic_vnic_alloc_res_chunk()
325 res->vnic_idx = i; usnic_vnic_alloc_res_chunk()
326 res->vnic = vnic; usnic_vnic_alloc_res_chunk()
327 res->ctrl = vnic_dev_get_res(vnic->vdev, usnic_vnic_alloc_res_chunk()
329 chunk->res[i] = res; usnic_vnic_alloc_res_chunk()
336 kfree(chunk->res[i]); usnic_vnic_alloc_res_chunk()
337 kfree(chunk->res); usnic_vnic_alloc_res_chunk()
345 kfree(chunk->res[i]); usnic_vnic_free_res_chunk()
346 kfree(chunk->res); usnic_vnic_free_res_chunk()
384 usnic_err("Failed to alloc res %s with err %d\n", usnic_vnic_discover_resources()
/linux-4.4.14/arch/arm/boot/compressed/
H A Dstring.c71 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.4.14/drivers/i2c/busses/
H A Di2c-pxa-pci.c24 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.4.14/drivers/leds/
H A Dleds-cobalt-qube.c38 struct resource *res; cobalt_qube_led_probe() local
40 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); cobalt_qube_led_probe()
41 if (!res) cobalt_qube_led_probe()
44 led_port = devm_ioremap(&pdev->dev, res->start, resource_size(res)); cobalt_qube_led_probe()
/linux-4.4.14/drivers/scsi/aic94xx/
H A Daic94xx_tmf.c40 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.4.14/drivers/scsi/libsas/
H A Dsas_expander.c70 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.4.14/arch/mips/kernel/
H A Dunaligned.c111 #define _LoadHW(addr, value, res, type) \
129 : "=&r" (value), "=r" (res) \
134 #define _LoadW(addr, value, res, type) \
150 : "=&r" (value), "=r" (res) \
156 #define _LoadW(addr, value, res, type) \
185 : "=&r" (value), "=r" (res) \
191 #define _LoadHWU(addr, value, res, type) \
211 : "=&r" (value), "=r" (res) \
216 #define _LoadWU(addr, value, res, type) \
234 : "=&r" (value), "=r" (res) \
238 #define _LoadDW(addr, value, res) \
254 : "=&r" (value), "=r" (res) \
260 #define _LoadWU(addr, value, res, type) \
289 : "=&r" (value), "=r" (res) \
293 #define _LoadDW(addr, value, res) \
338 : "=&r" (value), "=r" (res) \
345 #define _StoreHW(addr, value, res, type) \
364 : "=r" (res) \
369 #define _StoreW(addr, value, res, type) \
385 : "=r" (res) \
389 #define _StoreDW(addr, value, res) \
405 : "=r" (res) \
411 #define _StoreW(addr, value, res, type) \
437 : "=&r" (res) \
442 #define _StoreDW(addr, value, res) \
481 : "=&r" (res) \
490 #define _LoadHW(addr, value, res, type) \
508 : "=&r" (value), "=r" (res) \
513 #define _LoadW(addr, value, res, type) \
529 : "=&r" (value), "=r" (res) \
535 #define _LoadW(addr, value, res, type) \
564 : "=&r" (value), "=r" (res) \
571 #define _LoadHWU(addr, value, res, type) \
591 : "=&r" (value), "=r" (res) \
596 #define _LoadWU(addr, value, res, type) \
614 : "=&r" (value), "=r" (res) \
618 #define _LoadDW(addr, value, res) \
634 : "=&r" (value), "=r" (res) \
640 #define _LoadWU(addr, value, res, type) \
669 : "=&r" (value), "=r" (res) \
673 #define _LoadDW(addr, value, res) \
718 : "=&r" (value), "=r" (res) \
723 #define _StoreHW(addr, value, res, type) \
742 : "=r" (res) \
747 #define _StoreW(addr, value, res, type) \
763 : "=r" (res) \
767 #define _StoreDW(addr, value, res) \
783 : "=r" (res) \
789 #define _StoreW(addr, value, res, type) \
815 : "=&r" (res) \
820 #define _StoreDW(addr, value, res) \
859 : "=&r" (res) \
867 #define LoadHWU(addr, value, res) _LoadHWU(addr, value, res, kernel)
868 #define LoadHWUE(addr, value, res) _LoadHWU(addr, value, res, user)
869 #define LoadWU(addr, value, res) _LoadWU(addr, value, res, kernel)
870 #define LoadWUE(addr, value, res) _LoadWU(addr, value, res, user)
871 #define LoadHW(addr, value, res) _LoadHW(addr, value, res, kernel)
872 #define LoadHWE(addr, value, res) _LoadHW(addr, value, res, user)
873 #define LoadW(addr, value, res) _LoadW(addr, value, res, kernel)
874 #define LoadWE(addr, value, res) _LoadW(addr, value, res, user)
875 #define LoadDW(addr, value, res) _LoadDW(addr, value, res)
877 #define StoreHW(addr, value, res) _StoreHW(addr, value, res, kernel)
878 #define StoreHWE(addr, value, res) _StoreHW(addr, value, res, user)
879 #define StoreW(addr, value, res) _StoreW(addr, value, res, kernel)
880 #define StoreWE(addr, value, res) _StoreW(addr, value, res, user)
881 #define StoreDW(addr, value, res) _StoreDW(addr, value, res)
888 unsigned int res, preempted; emulate_load_store_insn() local
957 LoadHWE(addr, value, res); emulate_load_store_insn()
958 if (res) { emulate_load_store_insn()
970 LoadWE(addr, value, res); emulate_load_store_insn()
971 if (res) { emulate_load_store_insn()
983 LoadHWUE(addr, value, res); emulate_load_store_insn()
984 if (res) { emulate_load_store_insn()
998 StoreHWE(addr, value, res); emulate_load_store_insn()
999 if (res) { emulate_load_store_insn()
1011 StoreWE(addr, value, res); emulate_load_store_insn()
1012 if (res) { emulate_load_store_insn()
1030 LoadHW(addr, value, res); emulate_load_store_insn()
1032 LoadHWE(addr, value, res); emulate_load_store_insn()
1034 LoadHW(addr, value, res); emulate_load_store_insn()
1037 if (res) emulate_load_store_insn()
1049 LoadW(addr, value, res); emulate_load_store_insn()
1051 LoadWE(addr, value, res); emulate_load_store_insn()
1053 LoadW(addr, value, res); emulate_load_store_insn()
1056 if (res) emulate_load_store_insn()
1068 LoadHWU(addr, value, res); emulate_load_store_insn()
1070 LoadHWUE(addr, value, res); emulate_load_store_insn()
1072 LoadHWU(addr, value, res); emulate_load_store_insn()
1075 if (res) emulate_load_store_insn()
1093 LoadWU(addr, value, res); emulate_load_store_insn()
1094 if (res) emulate_load_store_insn()
1116 LoadDW(addr, value, res); emulate_load_store_insn()
1117 if (res) emulate_load_store_insn()
1136 StoreHW(addr, value, res); emulate_load_store_insn()
1138 StoreHWE(addr, value, res); emulate_load_store_insn()
1140 StoreHW(addr, value, res); emulate_load_store_insn()
1143 if (res) emulate_load_store_insn()
1156 StoreW(addr, value, res); emulate_load_store_insn()
1158 StoreWE(addr, value, res); emulate_load_store_insn()
1160 StoreW(addr, value, res); emulate_load_store_insn()
1163 if (res) emulate_load_store_insn()
1181 StoreDW(addr, value, res); emulate_load_store_insn()
1182 if (res) emulate_load_store_insn()
1198 res = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 1, emulate_load_store_insn()
1203 process_fpemu_return(res, fault_addr, 0); emulate_load_store_insn()
1205 if (res == 0) emulate_load_store_insn()
1241 res = __copy_from_user_inatomic(fpr, addr, emulate_load_store_insn()
1243 if (res) emulate_load_store_insn()
1275 res = __copy_to_user_inatomic(addr, fpr, sizeof(*fpr)); emulate_load_store_insn()
1276 if (res) emulate_load_store_insn()
1360 unsigned int res; emulate_load_store_microMIPS() local
1437 LoadW(addr, value, res); emulate_load_store_microMIPS()
1438 if (res) emulate_load_store_microMIPS()
1442 LoadW(addr, value, res); emulate_load_store_microMIPS()
1443 if (res) emulate_load_store_microMIPS()
1457 StoreW(addr, value, res); emulate_load_store_microMIPS()
1458 if (res) emulate_load_store_microMIPS()
1462 StoreW(addr, value, res); emulate_load_store_microMIPS()
1463 if (res) emulate_load_store_microMIPS()
1476 LoadDW(addr, value, res); emulate_load_store_microMIPS()
1477 if (res) emulate_load_store_microMIPS()
1481 LoadDW(addr, value, res); emulate_load_store_microMIPS()
1482 if (res) emulate_load_store_microMIPS()
1500 StoreDW(addr, value, res); emulate_load_store_microMIPS()
1501 if (res) emulate_load_store_microMIPS()
1505 StoreDW(addr, value, res); emulate_load_store_microMIPS()
1506 if (res) emulate_load_store_microMIPS()
1529 LoadW(addr, value, res); emulate_load_store_microMIPS()
1530 if (res) emulate_load_store_microMIPS()
1536 LoadW(addr, value, res); emulate_load_store_microMIPS()
1537 if (res) emulate_load_store_microMIPS()
1543 LoadW(addr, value, res); emulate_load_store_microMIPS()
1544 if (res) emulate_load_store_microMIPS()
1567 StoreW(addr, value, res); emulate_load_store_microMIPS()
1568 if (res) emulate_load_store_microMIPS()
1574 StoreW(addr, value, res); emulate_load_store_microMIPS()
1575 if (res) emulate_load_store_microMIPS()
1581 StoreW(addr, value, res); emulate_load_store_microMIPS()
1582 if (res) emulate_load_store_microMIPS()
1605 LoadDW(addr, value, res); emulate_load_store_microMIPS()
1606 if (res) emulate_load_store_microMIPS()
1612 LoadDW(addr, value, res); emulate_load_store_microMIPS()
1613 if (res) emulate_load_store_microMIPS()
1619 LoadDW(addr, value, res); emulate_load_store_microMIPS()
1620 if (res) emulate_load_store_microMIPS()
1648 StoreDW(addr, value, res); emulate_load_store_microMIPS()
1649 if (res) emulate_load_store_microMIPS()
1655 StoreDW(addr, value, res); emulate_load_store_microMIPS()
1656 if (res) emulate_load_store_microMIPS()
1662 StoreDW(addr, value, res); emulate_load_store_microMIPS()
1663 if (res) emulate_load_store_microMIPS()
1711 res = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 1, emulate_load_store_microMIPS()
1716 process_fpemu_return(res, fault_addr, 0); emulate_load_store_microMIPS()
1718 if (res == 0) emulate_load_store_microMIPS()
1759 LoadW(addr, value, res); emulate_load_store_microMIPS()
1760 if (res) emulate_load_store_microMIPS()
1765 LoadW(addr, value, res); emulate_load_store_microMIPS()
1766 if (res) emulate_load_store_microMIPS()
1780 StoreW(addr, value, res); emulate_load_store_microMIPS()
1781 if (res) emulate_load_store_microMIPS()
1786 StoreW(addr, value, res); emulate_load_store_microMIPS()
1787 if (res) emulate_load_store_microMIPS()
1832 LoadHW(addr, value, res); emulate_load_store_microMIPS()
1833 if (res) emulate_load_store_microMIPS()
1842 LoadHWU(addr, value, res); emulate_load_store_microMIPS()
1843 if (res) emulate_load_store_microMIPS()
1852 LoadW(addr, value, res); emulate_load_store_microMIPS()
1853 if (res) emulate_load_store_microMIPS()
1870 LoadWU(addr, value, res); emulate_load_store_microMIPS()
1871 if (res) emulate_load_store_microMIPS()
1892 LoadDW(addr, value, res); emulate_load_store_microMIPS()
1893 if (res) emulate_load_store_microMIPS()
1907 StoreHW(addr, value, res); emulate_load_store_microMIPS()
1908 if (res) emulate_load_store_microMIPS()
1917 StoreW(addr, value, res); emulate_load_store_microMIPS()
1918 if (res) emulate_load_store_microMIPS()
1935 StoreDW(addr, value, res); emulate_load_store_microMIPS()
1936 if (res) emulate_load_store_microMIPS()
1980 unsigned int res; emulate_load_store_MIPS16e() local
2057 LoadHW(addr, value, res); emulate_load_store_MIPS16e()
2058 if (res) emulate_load_store_MIPS16e()
2068 LoadHWU(addr, value, res); emulate_load_store_MIPS16e()
2069 if (res) emulate_load_store_MIPS16e()
2081 LoadW(addr, value, res); emulate_load_store_MIPS16e()
2082 if (res) emulate_load_store_MIPS16e()
2100 LoadWU(addr, value, res); emulate_load_store_MIPS16e()
2101 if (res) emulate_load_store_MIPS16e()
2124 LoadDW(addr, value, res); emulate_load_store_MIPS16e()
2125 if (res) emulate_load_store_MIPS16e()
2141 StoreHW(addr, value, res); emulate_load_store_MIPS16e()
2142 if (res) emulate_load_store_MIPS16e()
2154 StoreW(addr, value, res); emulate_load_store_MIPS16e()
2155 if (res) emulate_load_store_MIPS16e()
2174 StoreDW(addr, value, res); emulate_load_store_MIPS16e()
2175 if (res) emulate_load_store_MIPS16e()
/linux-4.4.14/fs/nfs/
H A Dcallback_proc.c23 struct cb_getattrres *res, nfs4_callback_getattr()
30 res->status = htonl(NFS4ERR_OP_NOT_IN_SESSION); nfs4_callback_getattr()
34 res->bitmap[0] = res->bitmap[1] = 0; nfs4_callback_getattr()
35 res->status = htonl(NFS4ERR_BADHANDLE); nfs4_callback_getattr()
43 -ntohl(res->status)); nfs4_callback_getattr()
51 res->size = i_size_read(inode); nfs4_callback_getattr()
52 res->change_attr = delegation->change_attr; nfs4_callback_getattr()
54 res->change_attr++; nfs4_callback_getattr()
55 res->ctime = inode->i_ctime; nfs4_callback_getattr()
56 res->mtime = inode->i_mtime; nfs4_callback_getattr()
57 res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & nfs4_callback_getattr()
59 res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & nfs4_callback_getattr()
61 res->status = 0; nfs4_callback_getattr()
64 trace_nfs4_cb_getattr(cps->clp, &args->fh, inode, -ntohl(res->status)); nfs4_callback_getattr()
67 dprintk("%s: exit with status = %d\n", __func__, ntohl(res->status)); nfs4_callback_getattr()
68 return res->status; nfs4_callback_getattr()
75 __be32 res; nfs4_callback_recall() local
77 res = htonl(NFS4ERR_OP_NOT_IN_SESSION); nfs4_callback_recall()
84 res = htonl(NFS4ERR_BADHANDLE); nfs4_callback_recall()
91 res = 0; nfs4_callback_recall()
94 res = htonl(NFS4ERR_BAD_STATEID); nfs4_callback_recall()
97 res = htonl(NFS4ERR_RESOURCE); nfs4_callback_recall()
99 trace_nfs4_recall_delegation(inode, -ntohl(res)); nfs4_callback_recall()
102 dprintk("%s: exit with status = %d\n", __func__, ntohl(res)); nfs4_callback_recall()
103 return res; nfs4_callback_recall()
222 u32 res; do_callback_layoutrecall() local
226 res = initiate_file_draining(clp, args); do_callback_layoutrecall()
228 res = initiate_bulk_draining(clp, args); do_callback_layoutrecall()
229 dprintk("%s returning %i\n", __func__, res); do_callback_layoutrecall()
230 return res; do_callback_layoutrecall()
237 u32 res; nfs4_callback_layoutrecall() local
242 res = do_callback_layoutrecall(cps->clp, args); nfs4_callback_layoutrecall()
244 res = NFS4ERR_OP_NOT_IN_SESSION; nfs4_callback_layoutrecall()
246 dprintk("%s: exit with status = %d\n", __func__, res); nfs4_callback_layoutrecall()
247 return cpu_to_be32(res); nfs4_callback_layoutrecall()
265 __be32 res = 0; nfs4_callback_devicenotify() local
272 res = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION); nfs4_callback_devicenotify()
301 __func__, be32_to_cpu(res)); nfs4_callback_devicenotify()
302 return res; nfs4_callback_devicenotify()
418 struct cb_sequenceres *res, nfs4_callback_sequence()
450 memcpy(&res->csr_sessionid, &args->csa_sessionid, nfs4_callback_sequence()
451 sizeof(res->csr_sessionid)); nfs4_callback_sequence()
452 res->csr_sequenceid = args->csa_sequenceid; nfs4_callback_sequence()
453 res->csr_slotid = args->csa_slotid; nfs4_callback_sequence()
454 res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; nfs4_callback_sequence()
455 res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; nfs4_callback_sequence()
492 res->csr_status = status; nfs4_callback_sequence()
494 trace_nfs4_cb_sequence(args, res, status); nfs4_callback_sequence()
495 dprintk("%s: exit with status = %d res->csr_status %d\n", __func__, nfs4_callback_sequence()
496 ntohl(status), ntohl(res->csr_status)); nfs4_callback_sequence()
22 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res, struct cb_process_state *cps) nfs4_callback_getattr() argument
417 nfs4_callback_sequence(struct cb_sequenceargs *args, struct cb_sequenceres *res, struct cb_process_state *cps) nfs4_callback_sequence() argument
H A Dnfs42xdr.c264 static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) decode_allocate() argument
269 static int decode_deallocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) decode_deallocate() argument
274 static int decode_seek(struct xdr_stream *xdr, struct nfs42_seek_res *res) decode_seek() argument
287 res->sr_eof = be32_to_cpup(p++); decode_seek()
288 p = xdr_decode_hyper(p, &res->sr_offset); decode_seek()
311 struct nfs42_falloc_res *res) nfs4_xdr_dec_allocate()
319 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_allocate()
325 status = decode_allocate(xdr, res); nfs4_xdr_dec_allocate()
328 decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); nfs4_xdr_dec_allocate()
338 struct nfs42_falloc_res *res) nfs4_xdr_dec_deallocate()
346 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_deallocate()
352 status = decode_deallocate(xdr, res); nfs4_xdr_dec_deallocate()
355 decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); nfs4_xdr_dec_deallocate()
365 struct nfs42_seek_res *res) nfs4_xdr_dec_seek()
373 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_seek()
379 status = decode_seek(xdr, res); nfs4_xdr_dec_seek()
389 struct nfs42_layoutstat_res *res) nfs4_xdr_dec_layoutstats()
397 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutstats()
403 WARN_ON(res->num_dev > PNFS_LAYOUTSTATS_MAXDEV); nfs4_xdr_dec_layoutstats()
404 for (i = 0; i < res->num_dev; i++) { nfs4_xdr_dec_layoutstats()
410 res->rpc_status = status; nfs4_xdr_dec_layoutstats()
419 struct nfs42_clone_res *res) nfs4_xdr_dec_clone()
427 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_clone()
442 status = decode_getfattr(xdr, res->dst_fattr, res->server); nfs4_xdr_dec_clone()
445 res->rpc_status = status; nfs4_xdr_dec_clone()
309 nfs4_xdr_dec_allocate(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_falloc_res *res) nfs4_xdr_dec_allocate() argument
336 nfs4_xdr_dec_deallocate(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_falloc_res *res) nfs4_xdr_dec_deallocate() argument
363 nfs4_xdr_dec_seek(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_seek_res *res) nfs4_xdr_dec_seek() argument
387 nfs4_xdr_dec_layoutstats(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_layoutstat_res *res) nfs4_xdr_dec_layoutstats() argument
417 nfs4_xdr_dec_clone(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs42_clone_res *res) nfs4_xdr_dec_clone() argument
H A Dnfs3proc.c33 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 Dnfs3acl.c23 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 Dnfs42proc.c51 struct nfs42_falloc_res res = { _nfs42_proc_fallocate() local
57 msg->rpc_resp = &res; _nfs42_proc_fallocate()
63 res.falloc_fattr = nfs_alloc_fattr(); _nfs42_proc_fallocate()
64 if (!res.falloc_fattr) _nfs42_proc_fallocate()
68 &args.seq_args, &res.seq_res, 0); _nfs42_proc_fallocate()
70 status = nfs_post_op_update_inode(inode, res.falloc_fattr); _nfs42_proc_fallocate()
72 kfree(res.falloc_fattr); _nfs42_proc_fallocate()
147 struct nfs42_seek_res res; _nfs42_proc_llseek() local
151 .rpc_resp = &res, _nfs42_proc_llseek()
165 &args.seq_args, &res.seq_res, 0); _nfs42_proc_llseek()
171 return vfs_setpos(filep, res.sr_offset, inode->i_sb->s_maxbytes); _nfs42_proc_llseek()
200 &data->res.seq_res, task); nfs42_layoutstat_prepare()
208 if (!nfs4_sequence_done(task, &data->res.seq_res)) nfs42_layoutstat_done()
252 .rpc_resp = &data->res, nfs42_proc_layoutstats_generic()
268 nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 0); nfs42_proc_layoutstats_generic()
290 struct nfs42_clone_res res = { _nfs42_proc_clone() local
296 msg->rpc_resp = &res; _nfs42_proc_clone()
306 res.dst_fattr = nfs_alloc_fattr(); _nfs42_proc_clone()
307 if (!res.dst_fattr) _nfs42_proc_clone()
311 &args.seq_args, &res.seq_res, 0); _nfs42_proc_clone()
313 status = nfs_post_op_update_inode(dst_inode, res.dst_fattr); _nfs42_proc_clone()
315 kfree(res.dst_fattr); _nfs42_proc_clone()
H A Dnfs4xdr.c3272 static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_link_support() argument
3276 *res = 0; decode_attr_link_support()
3283 *res = be32_to_cpup(p); decode_attr_link_support()
3286 dprintk("%s: link support=%s\n", __func__, *res == 0 ? "false" : "true"); decode_attr_link_support()
3293 static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_symlink_support() argument
3297 *res = 0; decode_attr_symlink_support()
3304 *res = be32_to_cpup(p); decode_attr_symlink_support()
3307 dprintk("%s: symlink support=%s\n", __func__, *res == 0 ? "false" : "true"); decode_attr_symlink_support()
3341 static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_lease_time() argument
3345 *res = 60; decode_attr_lease_time()
3352 *res = be32_to_cpup(p); decode_attr_lease_time()
3355 dprintk("%s: file size=%u\n", __func__, (unsigned int)*res); decode_attr_lease_time()
3362 static int decode_attr_error(struct xdr_stream *xdr, uint32_t *bitmap, int32_t *res) decode_attr_error() argument
3373 *res = -be32_to_cpup(p); decode_attr_error()
3429 static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_aclsupport() argument
3433 *res = 0; decode_attr_aclsupport()
3440 *res = be32_to_cpup(p); decode_attr_aclsupport()
3443 dprintk("%s: ACLs supported=%u\n", __func__, (unsigned int)*res); decode_attr_aclsupport()
3496 static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_files_avail() argument
3501 *res = 0; decode_attr_files_avail()
3508 xdr_decode_hyper(p, res); decode_attr_files_avail()
3511 dprintk("%s: files avail=%Lu\n", __func__, (unsigned long long)*res); decode_attr_files_avail()
3518 static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_files_free() argument
3523 *res = 0; decode_attr_files_free()
3530 xdr_decode_hyper(p, res); decode_attr_files_free()
3533 dprintk("%s: files free=%Lu\n", __func__, (unsigned long long)*res); decode_attr_files_free()
3540 static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_files_total() argument
3545 *res = 0; decode_attr_files_total()
3552 xdr_decode_hyper(p, res); decode_attr_files_total()
3555 dprintk("%s: files total=%Lu\n", __func__, (unsigned long long)*res); decode_attr_files_total()
3607 static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res) decode_attr_fs_locations() argument
3621 if (unlikely(res == NULL)) decode_attr_fs_locations()
3624 status = decode_pathname(xdr, &res->fs_path); decode_attr_fs_locations()
3633 for (res->nlocations = 0; res->nlocations < n; res->nlocations++) { decode_attr_fs_locations()
3637 if (res->nlocations == NFS4_FS_LOCATIONS_MAXENTRIES) decode_attr_fs_locations()
3639 loc = &res->locations[res->nlocations]; decode_attr_fs_locations()
3655 m, res->nlocations); decode_attr_fs_locations()
3675 if (res->nlocations != 0) decode_attr_fs_locations()
3687 static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_maxfilesize() argument
3692 *res = 0; decode_attr_maxfilesize()
3699 xdr_decode_hyper(p, res); decode_attr_maxfilesize()
3702 dprintk("%s: maxfilesize=%Lu\n", __func__, (unsigned long long)*res); decode_attr_maxfilesize()
3753 static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_maxread() argument
3758 *res = 1024; decode_attr_maxread()
3769 *res = (uint32_t)maxread; decode_attr_maxread()
3772 dprintk("%s: maxread=%lu\n", __func__, (unsigned long)*res); decode_attr_maxread()
3779 static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_maxwrite() argument
3784 *res = 1024; decode_attr_maxwrite()
3795 *res = (uint32_t)maxwrite; decode_attr_maxwrite()
3798 dprintk("%s: maxwrite=%lu\n", __func__, (unsigned long)*res); decode_attr_maxwrite()
3969 static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_space_avail() argument
3974 *res = 0; decode_attr_space_avail()
3981 xdr_decode_hyper(p, res); decode_attr_space_avail()
3984 dprintk("%s: space avail=%Lu\n", __func__, (unsigned long long)*res); decode_attr_space_avail()
3991 static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_space_free() argument
3996 *res = 0; decode_attr_space_free()
4003 xdr_decode_hyper(p, res); decode_attr_space_free()
4006 dprintk("%s: space free=%Lu\n", __func__, (unsigned long long)*res); decode_attr_space_free()
4013 static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) decode_attr_space_total() argument
4018 *res = 0; decode_attr_space_total()
4025 xdr_decode_hyper(p, res); decode_attr_space_total()
4028 dprintk("%s: space total=%Lu\n", __func__, (unsigned long long)*res); decode_attr_space_total()
4273 static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res) decode_close() argument
4279 nfs_increment_open_seqid(status, res->seqid); decode_close()
4281 status = decode_stateid(xdr, &res->stateid); decode_close()
4295 static int decode_commit(struct xdr_stream *xdr, struct nfs_commitres *res) decode_commit() argument
4301 status = decode_write_verifier(xdr, &res->verf->verifier); decode_commit()
4328 static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_res *res) decode_server_caps() argument
4340 if ((status = decode_attr_supported(xdr, bitmap, res->attr_bitmask)) != 0) decode_server_caps()
4343 &res->fh_expire_type)) != 0) decode_server_caps()
4345 if ((status = decode_attr_link_support(xdr, bitmap, &res->has_links)) != 0) decode_server_caps()
4347 if ((status = decode_attr_symlink_support(xdr, bitmap, &res->has_symlinks)) != 0) decode_server_caps()
4349 if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0) decode_server_caps()
4352 res->exclcreat_bitmask)) != 0) decode_server_caps()
4423 uint64_t *res, decode_threshold_hint()
4428 *res = 0; decode_threshold_hint()
4433 xdr_decode_hyper(p, res); decode_threshold_hint()
4442 struct nfs4_threshold *res) decode_first_threshold_item4()
4455 res->l_type = be32_to_cpup(p); decode_first_threshold_item4()
4467 status = decode_threshold_hint(xdr, bitmap, &res->rd_sz, THRESHOLD_RD); decode_first_threshold_item4()
4470 status = decode_threshold_hint(xdr, bitmap, &res->wr_sz, THRESHOLD_WR); decode_first_threshold_item4()
4473 status = decode_threshold_hint(xdr, bitmap, &res->rd_io_sz, decode_first_threshold_item4()
4477 status = decode_threshold_hint(xdr, bitmap, &res->wr_io_sz, decode_first_threshold_item4()
4483 res->bm = bitmap[0]; decode_first_threshold_item4()
4486 __func__, res->bm, res->rd_sz, res->wr_sz, res->rd_io_sz, decode_first_threshold_item4()
4487 res->wr_io_sz); decode_first_threshold_item4()
4498 struct nfs4_threshold *res) decode_attr_mdsthreshold()
4508 if (unlikely(res == NULL)) decode_attr_mdsthreshold()
4521 status = decode_first_threshold_item4(xdr, res); decode_attr_mdsthreshold()
4763 uint32_t *res) decode_attr_layout_blksize()
4768 *res = 0; decode_attr_layout_blksize()
4775 *res = be32_to_cpup(p); decode_attr_layout_blksize()
4785 uint32_t *res) decode_attr_clone_blksize()
4790 *res = 0; decode_attr_clone_blksize()
4797 *res = be32_to_cpup(p); decode_attr_clone_blksize()
4932 static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res) decode_lock() argument
4940 status = decode_stateid(xdr, &res->stateid); decode_lock()
4945 if (res->open_seqid != NULL) decode_lock()
4946 nfs_increment_open_seqid(status, res->open_seqid); decode_lock()
4947 nfs_increment_lock_seqid(status, res->lock_seqid); decode_lock()
4952 static int decode_lockt(struct xdr_stream *xdr, struct nfs_lockt_res *res) decode_lockt() argument
4957 return decode_lock_denied(xdr, res->denied); decode_lockt()
4961 static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res) decode_locku() argument
4967 nfs_increment_lock_seqid(status, res->seqid); decode_locku()
4969 status = decode_stateid(xdr, &res->stateid); decode_locku()
5014 struct nfs_openres *res) decode_rw_delegation()
5019 status = decode_stateid(xdr, &res->delegation); decode_rw_delegation()
5025 res->do_recall = be32_to_cpup(p); decode_rw_delegation()
5029 res->delegation_type = FMODE_READ; decode_rw_delegation()
5032 res->delegation_type = FMODE_WRITE|FMODE_READ; decode_rw_delegation()
5033 if (decode_space_limit(xdr, &res->pagemod_limit) < 0) decode_rw_delegation()
5036 return decode_ace(xdr, NULL, res->server->nfs_client); decode_rw_delegation()
5042 static int decode_no_delegation(struct xdr_stream *xdr, struct nfs_openres *res) decode_no_delegation() argument
5063 static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res) decode_delegation() argument
5072 res->delegation_type = 0; decode_delegation()
5078 return decode_rw_delegation(xdr, delegation_type, res); decode_delegation()
5080 return decode_no_delegation(xdr, res); decode_delegation()
5088 static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res) decode_open() argument
5096 nfs_increment_open_seqid(status, res->seqid); decode_open()
5099 status = decode_stateid(xdr, &res->stateid); decode_open()
5103 decode_change_info(xdr, &res->cinfo); decode_open()
5108 res->rflags = be32_to_cpup(p++); decode_open()
5118 res->attrset[i] = be32_to_cpup(p++); decode_open()
5120 res->attrset[i] = 0; decode_open()
5122 return decode_delegation(xdr, res); decode_open()
5131 static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res) decode_open_confirm() argument
5137 nfs_increment_open_seqid(status, res->seqid); decode_open_confirm()
5139 status = decode_stateid(xdr, &res->stateid); decode_open_confirm()
5143 static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res) decode_open_downgrade() argument
5149 nfs_increment_open_seqid(status, res->seqid); decode_open_downgrade()
5151 status = decode_stateid(xdr, &res->stateid); decode_open_downgrade()
5166 struct nfs_pgio_res *res) decode_read()
5187 res->eof = eof; decode_read()
5188 res->count = count; decode_read()
5290 struct nfs_getaclres *res) decode_getacl()
5298 res->acl_len = 0; decode_getacl()
5319 res->acl_data_offset = xdr_stream_pos(xdr) - pg_offset; decode_getacl()
5320 res->acl_len = attrlen; decode_getacl()
5323 if (res->acl_len > (xdr->nwords << 2) || decode_getacl()
5324 res->acl_len + res->acl_data_offset > xdr->buf->page_len) { decode_getacl()
5325 res->acl_flags |= NFS4_ACL_TRUNC; decode_getacl()
5363 static int decode_setclientid(struct xdr_stream *xdr, struct nfs4_setclientid_res *res) decode_setclientid() argument
5383 p = xdr_decode_hyper(p, &res->clientid); decode_setclientid()
5384 memcpy(res->confirm.data, p, NFS4_VERIFIER_SIZE); decode_setclientid()
5420 static int decode_write(struct xdr_stream *xdr, struct nfs_pgio_res *res) decode_write() argument
5432 res->count = be32_to_cpup(p++); decode_write()
5433 res->verf->committed = be32_to_cpup(p++); decode_write()
5434 return decode_write_verifier(xdr, &res->verf->verifier); decode_write()
5479 static int decode_secinfo_common(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) decode_secinfo_common() argument
5490 res->flavors->num_flavors = 0; decode_secinfo_common()
5494 sec_flavor = &res->flavors->flavors[i]; decode_secinfo_common()
5495 if ((char *)&sec_flavor[1] - (char *)res->flavors > PAGE_SIZE) decode_secinfo_common()
5508 res->flavors->num_flavors++; decode_secinfo_common()
5519 static int decode_secinfo(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) decode_secinfo() argument
5524 return decode_secinfo_common(xdr, res); decode_secinfo()
5528 static int decode_secinfo_no_name(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) decode_secinfo_no_name() argument
5533 return decode_secinfo_common(xdr, res); decode_secinfo_no_name()
5554 struct nfs41_exchange_id_res *res) decode_exchange_id()
5569 xdr_decode_hyper(p, &res->clientid); decode_exchange_id()
5573 res->seqid = be32_to_cpup(p++); decode_exchange_id()
5574 res->flags = be32_to_cpup(p++); decode_exchange_id()
5576 res->state_protect.how = be32_to_cpup(p); decode_exchange_id()
5577 switch (res->state_protect.how) { decode_exchange_id()
5581 status = decode_op_map(xdr, &res->state_protect.enforce); decode_exchange_id()
5584 status = decode_op_map(xdr, &res->state_protect.allow); decode_exchange_id()
5597 p = xdr_decode_hyper(p, &res->server_owner->minor_id); decode_exchange_id()
5605 memcpy(res->server_owner->major_id, dummy_str, dummy); decode_exchange_id()
5606 res->server_owner->major_id_sz = dummy; decode_exchange_id()
5614 memcpy(res->server_scope->server_scope, dummy_str, dummy); decode_exchange_id()
5615 res->server_scope->server_scope_sz = dummy; decode_exchange_id()
5630 memcpy(res->impl_id->domain, dummy_str, dummy); decode_exchange_id()
5638 memcpy(res->impl_id->name, dummy_str, dummy); decode_exchange_id()
5644 p = xdr_decode_hyper(p, &res->impl_id->date.seconds); decode_exchange_id()
5645 res->impl_id->date.nseconds = be32_to_cpup(p); decode_exchange_id()
5695 struct nfs41_bind_conn_to_session_res *res) decode_bind_conn_to_session()
5702 status = decode_sessionid(xdr, &res->sessionid); decode_bind_conn_to_session()
5711 res->dir = be32_to_cpup(p++); decode_bind_conn_to_session()
5712 if (res->dir == 0 || res->dir > NFS4_CDFS4_BOTH) decode_bind_conn_to_session()
5715 res->use_conn_in_rdma_mode = false; decode_bind_conn_to_session()
5717 res->use_conn_in_rdma_mode = true; decode_bind_conn_to_session()
5726 struct nfs41_create_session_res *res) decode_create_session()
5733 status = decode_sessionid(xdr, &res->sessionid); decode_create_session()
5741 res->seqid = be32_to_cpup(p++); decode_create_session()
5742 res->flags = be32_to_cpup(p); decode_create_session()
5745 status = decode_chan_attrs(xdr, &res->fc_attrs); decode_create_session()
5747 status = decode_chan_attrs(xdr, &res->bc_attrs); decode_create_session()
5771 struct nfs4_sequence_res *res, decode_sequence()
5781 if (res->sr_slot == NULL) decode_sequence()
5783 if (!res->sr_slot->table->session) decode_sequence()
5797 session = res->sr_slot->table->session; decode_sequence()
5811 if (dummy != res->sr_slot->seq_nr) { decode_sequence()
5817 if (dummy != res->sr_slot->slot_nr) { decode_sequence()
5822 res->sr_highest_slotid = be32_to_cpup(p++); decode_sequence()
5824 res->sr_target_highest_slotid = be32_to_cpup(p++); decode_sequence()
5826 res->sr_status_flags = be32_to_cpup(p); decode_sequence()
5829 res->sr_status = status; decode_sequence()
5842 struct nfs4_getdeviceinfo_res *res) decode_getdeviceinfo()
5844 struct pnfs_device *pdev = res->pdev; decode_getdeviceinfo()
5892 res->notification = be32_to_cpup(p++); decode_getdeviceinfo()
5908 struct nfs4_layoutget_res *res) decode_layoutget()
5921 res->return_on_close = be32_to_cpup(p); decode_layoutget()
5922 decode_stateid(xdr, &res->stateid); decode_layoutget()
5936 p = xdr_decode_hyper(p, &res->range.offset); decode_layoutget()
5937 p = xdr_decode_hyper(p, &res->range.length); decode_layoutget()
5938 res->range.iomode = be32_to_cpup(p++); decode_layoutget()
5939 res->type = be32_to_cpup(p++); decode_layoutget()
5940 res->layoutp->len = be32_to_cpup(p); decode_layoutget()
5944 (unsigned long)res->range.offset, decode_layoutget()
5945 (unsigned long)res->range.length, decode_layoutget()
5946 res->range.iomode, decode_layoutget()
5947 res->type, decode_layoutget()
5948 res->layoutp->len); decode_layoutget()
5950 recvd = xdr_read_pages(xdr, res->layoutp->len); decode_layoutget()
5951 if (res->layoutp->len > recvd) { decode_layoutget()
5954 res->layoutp->len, recvd); decode_layoutget()
5975 struct nfs4_layoutreturn_res *res) decode_layoutreturn()
5986 res->lrs_present = be32_to_cpup(p); decode_layoutreturn()
5987 if (res->lrs_present) decode_layoutreturn()
5988 status = decode_stateid(xdr, &res->stateid); decode_layoutreturn()
5997 struct nfs4_layoutcommit_res *res) decode_layoutcommit()
6004 res->status = status; decode_layoutcommit()
6026 struct nfs41_test_stateid_res *res) decode_test_stateid()
6046 res->status = be32_to_cpup(p++); decode_test_stateid()
6056 struct nfs41_free_stateid_res *res) decode_free_stateid()
6058 res->status = decode_op_hdr(xdr, OP_FREE_STATEID); decode_free_stateid()
6059 return res->status; decode_free_stateid()
6072 struct nfs_closeres *res) nfs4_xdr_dec_open_downgrade()
6080 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_open_downgrade()
6086 status = decode_open_downgrade(xdr, res); nfs4_xdr_dec_open_downgrade()
6089 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_open_downgrade()
6098 struct nfs4_accessres *res) nfs4_xdr_dec_access()
6106 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_access()
6112 status = decode_access(xdr, &res->supported, &res->access); nfs4_xdr_dec_access()
6115 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_access()
6124 struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup()
6132 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lookup()
6141 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_lookup()
6144 status = decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_lookup()
6154 struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup_root()
6162 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lookup_root()
6168 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_lookup_root()
6170 status = decode_getfattr_label(xdr, res->fattr, nfs4_xdr_dec_lookup_root()
6171 res->label, res->server); nfs4_xdr_dec_lookup_root()
6180 struct nfs_removeres *res) nfs4_xdr_dec_remove()
6188 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_remove()
6194 status = decode_remove(xdr, &res->cinfo); nfs4_xdr_dec_remove()
6203 struct nfs_renameres *res) nfs4_xdr_dec_rename()
6211 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_rename()
6223 status = decode_rename(xdr, &res->old_cinfo, &res->new_cinfo); nfs4_xdr_dec_rename()
6232 struct nfs4_link_res *res) nfs4_xdr_dec_link()
6240 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_link()
6252 status = decode_link(xdr, &res->cinfo); nfs4_xdr_dec_link()
6262 decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_link()
6271 struct nfs4_create_res *res) nfs4_xdr_dec_create()
6279 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_create()
6285 status = decode_create(xdr, &res->dir_cinfo); nfs4_xdr_dec_create()
6288 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_create()
6291 decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_create()
6300 struct nfs4_create_res *res) nfs4_xdr_dec_symlink()
6302 return nfs4_xdr_dec_create(rqstp, xdr, res); nfs4_xdr_dec_symlink()
6309 struct nfs4_getattr_res *res) nfs4_xdr_dec_getattr()
6317 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_getattr()
6323 status = decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_getattr()
6350 struct nfs_setaclres *res) nfs4_xdr_dec_setacl()
6358 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_setacl()
6374 struct nfs_getaclres *res) nfs4_xdr_dec_getacl()
6379 if (res->acl_scratch != NULL) { nfs4_xdr_dec_getacl()
6380 void *p = page_address(res->acl_scratch); nfs4_xdr_dec_getacl()
6386 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_getacl()
6392 status = decode_getacl(xdr, rqstp, res); nfs4_xdr_dec_getacl()
6402 struct nfs_closeres *res) nfs4_xdr_dec_close()
6410 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_close()
6416 status = decode_close(xdr, res); nfs4_xdr_dec_close()
6425 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_close()
6434 struct nfs_openres *res) nfs4_xdr_dec_open()
6442 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_open()
6448 status = decode_open(xdr, res); nfs4_xdr_dec_open()
6451 status = decode_getfh(xdr, &res->fh); nfs4_xdr_dec_open()
6454 if (res->access_request) nfs4_xdr_dec_open()
6455 decode_access(xdr, &res->access_supported, &res->access_result); nfs4_xdr_dec_open()
6456 decode_getfattr_label(xdr, res->f_attr, res->f_label, res->server); nfs4_xdr_dec_open()
6466 struct nfs_open_confirmres *res) nfs4_xdr_dec_open_confirm()
6477 status = decode_open_confirm(xdr, res); nfs4_xdr_dec_open_confirm()
6487 struct nfs_openres *res) nfs4_xdr_dec_open_noattr()
6495 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_open_noattr()
6501 status = decode_open(xdr, res); nfs4_xdr_dec_open_noattr()
6504 if (res->access_request) nfs4_xdr_dec_open_noattr()
6505 decode_access(xdr, &res->access_supported, &res->access_result); nfs4_xdr_dec_open_noattr()
6506 decode_getfattr(xdr, res->f_attr, res->server); nfs4_xdr_dec_open_noattr()
6516 struct nfs_setattrres *res) nfs4_xdr_dec_setattr()
6524 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_setattr()
6533 decode_getfattr_label(xdr, res->fattr, res->label, res->server); nfs4_xdr_dec_setattr()
6542 struct nfs_lock_res *res) nfs4_xdr_dec_lock()
6550 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lock()
6556 status = decode_lock(xdr, res); nfs4_xdr_dec_lock()
6565 struct nfs_lockt_res *res) nfs4_xdr_dec_lockt()
6573 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_lockt()
6579 status = decode_lockt(xdr, res); nfs4_xdr_dec_lockt()
6588 struct nfs_locku_res *res) nfs4_xdr_dec_locku()
6596 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_locku()
6602 status = decode_locku(xdr, res); nfs4_xdr_dec_locku()
6624 struct nfs4_readlink_res *res) nfs4_xdr_dec_readlink()
6632 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_readlink()
6647 struct nfs4_readdir_res *res) nfs4_xdr_dec_readdir()
6655 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_readdir()
6661 status = decode_readdir(xdr, rqstp, res); nfs4_xdr_dec_readdir()
6670 struct nfs_pgio_res *res) nfs4_xdr_dec_read()
6676 res->op_status = hdr.status; nfs4_xdr_dec_read()
6679 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_read()
6685 status = decode_read(xdr, rqstp, res); nfs4_xdr_dec_read()
6687 status = res->count; nfs4_xdr_dec_read()
6696 struct nfs_pgio_res *res) nfs4_xdr_dec_write()
6702 res->op_status = hdr.status; nfs4_xdr_dec_write()
6705 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_write()
6711 status = decode_write(xdr, res); nfs4_xdr_dec_write()
6714 if (res->fattr) nfs4_xdr_dec_write()
6715 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_write()
6717 status = res->count; nfs4_xdr_dec_write()
6726 struct nfs_commitres *res) nfs4_xdr_dec_commit()
6732 res->op_status = hdr.status; nfs4_xdr_dec_commit()
6735 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_commit()
6741 status = decode_commit(xdr, res); nfs4_xdr_dec_commit()
6750 struct nfs4_fsinfo_res *res) nfs4_xdr_dec_fsinfo()
6757 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_fsinfo()
6761 status = decode_fsinfo(xdr, res->fsinfo); nfs4_xdr_dec_fsinfo()
6769 struct nfs4_pathconf_res *res) nfs4_xdr_dec_pathconf()
6776 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_pathconf()
6780 status = decode_pathconf(xdr, res->pathconf); nfs4_xdr_dec_pathconf()
6788 struct nfs4_statfs_res *res) nfs4_xdr_dec_statfs()
6795 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_statfs()
6799 status = decode_statfs(xdr, res->fsstat); nfs4_xdr_dec_statfs()
6808 struct nfs4_server_caps_res *res) nfs4_xdr_dec_server_caps()
6816 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_server_caps()
6822 status = decode_server_caps(xdr, res); nfs4_xdr_dec_server_caps()
6847 struct nfs4_setclientid_res *res) nfs4_xdr_dec_setclientid()
6854 status = decode_setclientid(xdr, res); nfs4_xdr_dec_setclientid()
6878 struct nfs4_delegreturnres *res) nfs4_xdr_dec_delegreturn()
6886 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_delegreturn()
6892 status = decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_delegreturn()
6905 struct nfs4_fs_locations_res *res) nfs4_xdr_dec_fs_locations()
6913 status = decode_sequence(xdr, &res->seq_res, req); nfs4_xdr_dec_fs_locations()
6919 if (res->migration) { nfs4_xdr_dec_fs_locations()
6922 &res->fs_locations->fattr, nfs4_xdr_dec_fs_locations()
6923 NULL, res->fs_locations, nfs4_xdr_dec_fs_locations()
6924 NULL, res->fs_locations->server); nfs4_xdr_dec_fs_locations()
6927 if (res->renew) nfs4_xdr_dec_fs_locations()
6935 &res->fs_locations->fattr, nfs4_xdr_dec_fs_locations()
6936 NULL, res->fs_locations, nfs4_xdr_dec_fs_locations()
6937 NULL, res->fs_locations->server); nfs4_xdr_dec_fs_locations()
6948 struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo()
6956 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_secinfo()
6962 status = decode_secinfo(xdr, res); nfs4_xdr_dec_secinfo()
6972 struct nfs4_fsid_present_res *res) nfs4_xdr_dec_fsid_present()
6980 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_fsid_present()
6986 status = decode_getfh(xdr, res->fh); nfs4_xdr_dec_fsid_present()
6989 if (res->renew) nfs4_xdr_dec_fsid_present()
7001 void *res) nfs4_xdr_dec_bind_conn_to_session()
7008 status = decode_bind_conn_to_session(xdr, res); nfs4_xdr_dec_bind_conn_to_session()
7017 void *res) nfs4_xdr_dec_exchange_id()
7024 status = decode_exchange_id(xdr, res); nfs4_xdr_dec_exchange_id()
7033 struct nfs41_create_session_res *res) nfs4_xdr_dec_create_session()
7040 status = decode_create_session(xdr, res); nfs4_xdr_dec_create_session()
7049 void *res) nfs4_xdr_dec_destroy_session()
7056 status = decode_destroy_session(xdr, res); nfs4_xdr_dec_destroy_session()
7065 void *res) nfs4_xdr_dec_destroy_clientid()
7072 status = decode_destroy_clientid(xdr, res); nfs4_xdr_dec_destroy_clientid()
7081 struct nfs4_sequence_res *res) nfs4_xdr_dec_sequence()
7088 status = decode_sequence(xdr, res, rqstp); nfs4_xdr_dec_sequence()
7097 struct nfs4_get_lease_time_res *res) nfs4_xdr_dec_get_lease_time()
7104 status = decode_sequence(xdr, &res->lr_seq_res, rqstp); nfs4_xdr_dec_get_lease_time()
7108 status = decode_fsinfo(xdr, res->lr_fsinfo); nfs4_xdr_dec_get_lease_time()
7117 struct nfs41_reclaim_complete_res *res) nfs4_xdr_dec_reclaim_complete()
7124 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_reclaim_complete()
7135 struct nfs4_getdeviceinfo_res *res) nfs4_xdr_dec_getdeviceinfo()
7143 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_getdeviceinfo()
7146 status = decode_getdeviceinfo(xdr, res); nfs4_xdr_dec_getdeviceinfo()
7156 struct nfs4_layoutget_res *res) nfs4_xdr_dec_layoutget()
7164 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutget()
7170 status = decode_layoutget(xdr, rqstp, res); nfs4_xdr_dec_layoutget()
7180 struct nfs4_layoutreturn_res *res) nfs4_xdr_dec_layoutreturn()
7188 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutreturn()
7194 status = decode_layoutreturn(xdr, res); nfs4_xdr_dec_layoutreturn()
7204 struct nfs4_layoutcommit_res *res) nfs4_xdr_dec_layoutcommit()
7212 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_layoutcommit()
7218 status = decode_layoutcommit(xdr, rqstp, res); nfs4_xdr_dec_layoutcommit()
7221 decode_getfattr(xdr, res->fattr, res->server); nfs4_xdr_dec_layoutcommit()
7231 struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo_no_name()
7239 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_secinfo_no_name()
7245 status = decode_secinfo_no_name(xdr, res); nfs4_xdr_dec_secinfo_no_name()
7255 struct nfs41_test_stateid_res *res) nfs4_xdr_dec_test_stateid()
7263 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_test_stateid()
7266 status = decode_test_stateid(xdr, res); nfs4_xdr_dec_test_stateid()
7276 struct nfs41_free_stateid_res *res) nfs4_xdr_dec_free_stateid()
7284 status = decode_sequence(xdr, &res->seq_res, rqstp); nfs4_xdr_dec_free_stateid()
7287 status = decode_free_stateid(xdr, res); nfs4_xdr_dec_free_stateid()
4421 decode_threshold_hint(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res, uint32_t hint_bit) decode_threshold_hint() argument
4441 decode_first_threshold_item4(struct xdr_stream *xdr, struct nfs4_threshold *res) decode_first_threshold_item4() argument
4496 decode_attr_mdsthreshold(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_threshold *res) decode_attr_mdsthreshold() argument
4762 decode_attr_layout_blksize(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_layout_blksize() argument
4784 decode_attr_clone_blksize(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) decode_attr_clone_blksize() argument
5012 decode_rw_delegation(struct xdr_stream *xdr, uint32_t delegation_type, struct nfs_openres *res) decode_rw_delegation() argument
5165 decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_pgio_res *res) decode_read() argument
5289 decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_getaclres *res) decode_getacl() argument
5553 decode_exchange_id(struct xdr_stream *xdr, struct nfs41_exchange_id_res *res) decode_exchange_id() argument
5694 decode_bind_conn_to_session(struct xdr_stream *xdr, struct nfs41_bind_conn_to_session_res *res) decode_bind_conn_to_session() argument
5725 decode_create_session(struct xdr_stream *xdr, struct nfs41_create_session_res *res) decode_create_session() argument
5770 decode_sequence(struct xdr_stream *xdr, struct nfs4_sequence_res *res, struct rpc_rqst *rqstp) decode_sequence() argument
5841 decode_getdeviceinfo(struct xdr_stream *xdr, struct nfs4_getdeviceinfo_res *res) decode_getdeviceinfo() argument
5907 decode_layoutget(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_layoutget_res *res) decode_layoutget() argument
5974 decode_layoutreturn(struct xdr_stream *xdr, struct nfs4_layoutreturn_res *res) decode_layoutreturn() argument
5995 decode_layoutcommit(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs4_layoutcommit_res *res) decode_layoutcommit() argument
6025 decode_test_stateid(struct xdr_stream *xdr, struct nfs41_test_stateid_res *res) decode_test_stateid() argument
6055 decode_free_stateid(struct xdr_stream *xdr, struct nfs41_free_stateid_res *res) decode_free_stateid() argument
6070 nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_closeres *res) nfs4_xdr_dec_open_downgrade() argument
6097 nfs4_xdr_dec_access(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_accessres *res) nfs4_xdr_dec_access() argument
6123 nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup() argument
6152 nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_lookup_res *res) nfs4_xdr_dec_lookup_root() argument
6179 nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_removeres *res) nfs4_xdr_dec_remove() argument
6202 nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_renameres *res) nfs4_xdr_dec_rename() argument
6231 nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_link_res *res) nfs4_xdr_dec_link() argument
6270 nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_create_res *res) nfs4_xdr_dec_create() argument
6299 nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_create_res *res) nfs4_xdr_dec_symlink() argument
6308 nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_getattr_res *res) nfs4_xdr_dec_getattr() argument
6349 nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_setaclres *res) nfs4_xdr_dec_setacl() argument
6373 nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_getaclres *res) nfs4_xdr_dec_getacl() argument
6401 nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_closeres *res) nfs4_xdr_dec_close() argument
6433 nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_openres *res) nfs4_xdr_dec_open() argument
6464 nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_open_confirmres *res) nfs4_xdr_dec_open_confirm() argument
6485 nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_openres *res) nfs4_xdr_dec_open_noattr() argument
6514 nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_setattrres *res) nfs4_xdr_dec_setattr() argument
6541 nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_lock_res *res) nfs4_xdr_dec_lock() argument
6564 nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_lockt_res *res) nfs4_xdr_dec_lockt() argument
6587 nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_locku_res *res) nfs4_xdr_dec_locku() argument
6622 nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_readlink_res *res) nfs4_xdr_dec_readlink() argument
6646 nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_readdir_res *res) nfs4_xdr_dec_readdir() argument
6669 nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_pgio_res *res) nfs4_xdr_dec_read() argument
6695 nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_pgio_res *res) nfs4_xdr_dec_write() argument
6725 nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs_commitres *res) nfs4_xdr_dec_commit() argument
6749 nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_fsinfo_res *res) nfs4_xdr_dec_fsinfo() argument
6768 nfs4_xdr_dec_pathconf(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_pathconf_res *res) nfs4_xdr_dec_pathconf() argument
6787 nfs4_xdr_dec_statfs(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_statfs_res *res) nfs4_xdr_dec_statfs() argument
6806 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
6845 nfs4_xdr_dec_setclientid(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_setclientid_res *res) nfs4_xdr_dec_setclientid() argument
6876 nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_delegreturnres *res) nfs4_xdr_dec_delegreturn() argument
6903 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
6946 nfs4_xdr_dec_secinfo(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_secinfo_res *res) nfs4_xdr_dec_secinfo() argument
6970 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
6999 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
7015 nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_exchange_id() argument
7031 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
7047 nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_destroy_session() argument
7063 nfs4_xdr_dec_destroy_clientid(struct rpc_rqst *rqstp, struct xdr_stream *xdr, void *res) nfs4_xdr_dec_destroy_clientid() argument
7079 nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_sequence_res *res) nfs4_xdr_dec_sequence() argument
7095 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
7115 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
7133 nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_getdeviceinfo_res *res) nfs4_xdr_dec_getdeviceinfo() argument
7154 nfs4_xdr_dec_layoutget(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_layoutget_res *res) nfs4_xdr_dec_layoutget() argument
7178 nfs4_xdr_dec_layoutreturn(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_layoutreturn_res *res) nfs4_xdr_dec_layoutreturn() argument
7202 nfs4_xdr_dec_layoutcommit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, struct nfs4_layoutcommit_res *res) nfs4_xdr_dec_layoutcommit() argument
7229 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
7253 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
7274 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.4.14/arch/powerpc/platforms/52xx/
H A Dmpc52xx_pci.c241 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.4.14/arch/x86/lib/
H A Dstring_32.c97 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 Dcsum-partial_64.c71 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.4.14/sound/hda/
H A Dhdac_bus.c64 * @res: pointer to store the response, NULL if performing asynchronously
69 unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb()
74 err = snd_hdac_bus_exec_verb_unlocked(bus, addr, cmd, res); snd_hdac_bus_exec_verb()
84 * @res: pointer to store the response, NULL if performing asynchronously
89 unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb_unlocked()
97 if (res) snd_hdac_bus_exec_verb_unlocked()
98 *res = -1; snd_hdac_bus_exec_verb_unlocked()
100 res = &tmp; snd_hdac_bus_exec_verb_unlocked()
111 if (!err && res) { snd_hdac_bus_exec_verb_unlocked()
112 err = bus->ops->get_response(bus, addr, res); snd_hdac_bus_exec_verb_unlocked()
113 trace_hda_get_response(bus, addr, *res); snd_hdac_bus_exec_verb_unlocked()
122 * @res: unsolicited event (lower 32bit of RIRB entry)
129 void snd_hdac_bus_queue_event(struct hdac_bus *bus, u32 res, u32 res_ex) snd_hdac_bus_queue_event() argument
136 trace_hda_unsol_event(bus, res, res_ex); snd_hdac_bus_queue_event()
141 bus->unsol_queue[wp] = res; snd_hdac_bus_queue_event()
156 unsigned int rp, caddr, res; process_unsol_events() local
162 res = bus->unsol_queue[rp]; process_unsol_events()
171 drv->unsol_event(codec, res); process_unsol_events()
68 snd_hdac_bus_exec_verb(struct hdac_bus *bus, unsigned int addr, unsigned int cmd, unsigned int *res) snd_hdac_bus_exec_verb() argument
88 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
H A Dtrace.h31 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);
/linux-4.4.14/drivers/net/ethernet/cisco/enic/
H A Denic_clsf.c22 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_flow_keys(skb, &keys, 0); enic_rx_flow_steer()
181 if (!res || keys.basic.n_proto != htons(ETH_P_IP) || enic_rx_flow_steer()
192 res = -EEXIST; enic_rx_flow_steer()
210 res = enic_delfltr(enic, n->fltr_id); enic_rx_flow_steer()
211 if (unlikely(res < 0)) enic_rx_flow_steer()
213 res = enic_addfltr_5t(enic, &keys, rxq_index); enic_rx_flow_steer()
214 if (res < 0) { enic_rx_flow_steer()
223 res = enic_addfltr_5t(enic, &keys, rxq_index); enic_rx_flow_steer()
224 if (res < 0) { enic_rx_flow_steer()
248 n->fltr_id = res; enic_rx_flow_steer()
255 res = -EBUSY; enic_rx_flow_steer()
261 res = -ENOMEM; enic_rx_flow_steer()
266 res = enic_addfltr_5t(enic, &keys, rxq_index); enic_rx_flow_steer()
267 if (res < 0) { enic_rx_flow_steer()
273 n->fltr_id = res; enic_rx_flow_steer()
282 return res; enic_rx_flow_steer()
/linux-4.4.14/arch/xtensa/include/uapi/asm/
H A Dswab.h21 __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.4.14/arch/cris/include/arch-v10/arch/
H A Dbitops.h19 ! : "=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 Dchecksum.h15 __wsum res; csum_tcpudp_nofold() local
23 : "=r" (res) csum_tcpudp_nofold()
26 return res; csum_tcpudp_nofold()
/linux-4.4.14/arch/mips/alchemy/common/
H A Dplatform.c219 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.4.14/arch/mips/ath25/
H A Ddevices.c91 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.4.14/arch/arm/mach-omap1/
H A Di2c.c54 struct resource *res; omap_i2c_add_bus() local
65 res = i2c_resources; omap_i2c_add_bus()
66 res[0].start = OMAP1_I2C_BASE; omap_i2c_add_bus()
67 res[0].end = res[0].start + OMAP_I2C_SIZE; omap_i2c_add_bus()
68 res[0].flags = IORESOURCE_MEM; omap_i2c_add_bus()
69 res[1].start = INT_I2C; omap_i2c_add_bus()
70 res[1].flags = IORESOURCE_IRQ; omap_i2c_add_bus()
71 pdev->resource = res; omap_i2c_add_bus()
H A Dtimer.c69 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.4.14/drivers/usb/gadget/udc/bdc/
H A Dbdc_pci.c48 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.4.14/drivers/staging/nvec/
H A Dnvec_power.c93 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.4.14/drivers/nvme/host/
H A Dscsi.c344 int res; nvme_trans_status_code() local
517 res = nvme_trans_completion(hdr, status, sense_key, asc, ascq); nvme_trans_status_code()
518 return res ? res : nvme_sc; nvme_trans_status_code()
529 int res; nvme_trans_standard_inquiry_page() local
539 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_standard_inquiry_page()
540 if (res) nvme_trans_standard_inquiry_page()
541 return res; nvme_trans_standard_inquiry_page()
607 int res; nvme_trans_device_id_page() local
620 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_device_id_page()
621 if (res) nvme_trans_device_id_page()
622 return res; nvme_trans_device_id_page()
673 int res; nvme_trans_ext_inq_page() local
692 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_ext_inq_page()
693 if (res) nvme_trans_ext_inq_page()
708 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_ext_inq_page()
709 if (res) nvme_trans_ext_inq_page()
727 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_ext_inq_page()
731 return res; nvme_trans_ext_inq_page()
758 int res; nvme_trans_bdev_char_page() local
763 res = -ENOMEM; nvme_trans_bdev_char_page()
775 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); nvme_trans_bdev_char_page()
779 return res; nvme_trans_bdev_char_page()
787 int res; nvme_trans_log_supp_pages() local
793 res = -ENOMEM; nvme_trans_log_supp_pages()
805 res = nvme_trans_copy_to_user(hdr, log_response, xfer_len); nvme_trans_log_supp_pages()
809 return res; nvme_trans_log_supp_pages()
815 int res; nvme_trans_log_info_exceptions() local
827 res = nvme_get_log_page(dev, &smart_log); nvme_trans_log_info_exceptions()
828 if (res < 0) nvme_trans_log_info_exceptions()
831 if (res != NVME_SC_SUCCESS) { nvme_trans_log_info_exceptions()
852 res = nvme_trans_copy_to_user(hdr, log_response, xfer_len); nvme_trans_log_info_exceptions()
856 return res; nvme_trans_log_info_exceptions()
862 int res; nvme_trans_log_temperature() local
875 res = nvme_get_log_page(dev, &smart_log); nvme_trans_log_temperature()
876 if (res < 0) nvme_trans_log_temperature()
879 if (res != NVME_SC_SUCCESS) { nvme_trans_log_temperature()
889 res = nvme_get_features(dev, NVME_FEAT_TEMP_THRESH, 0, 0, nvme_trans_log_temperature()
891 if (res != NVME_SC_SUCCESS) nvme_trans_log_temperature()
913 res = nvme_trans_copy_to_user(hdr, log_response, xfer_len); nvme_trans_log_temperature()
917 return res; nvme_trans_log_temperature()
949 int res; nvme_trans_fill_blk_desc() local
962 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fill_blk_desc()
963 if (res) nvme_trans_fill_blk_desc()
964 return res; nvme_trans_fill_blk_desc()
986 return res; nvme_trans_fill_blk_desc()
1015 int res = 0; nvme_trans_fill_caching_page() local
1026 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fill_caching_page()
1027 if (res) nvme_trans_fill_caching_page()
1028 return res; nvme_trans_fill_caching_page()
1070 int res; nvme_trans_fill_all_pages() local
1078 res = nvme_trans_fill_caching_page(ns, hdr, &resp[mode_pages_offset_1], nvme_trans_fill_all_pages()
1080 if (res) nvme_trans_fill_all_pages()
1081 return res; nvme_trans_fill_all_pages()
1082 res = nvme_trans_fill_control_page(ns, hdr, &resp[mode_pages_offset_2], nvme_trans_fill_all_pages()
1084 if (res) nvme_trans_fill_all_pages()
1085 return res; nvme_trans_fill_all_pages()
1086 res = nvme_trans_fill_pow_cnd_page(ns, hdr, &resp[mode_pages_offset_3], nvme_trans_fill_all_pages()
1088 if (res) nvme_trans_fill_all_pages()
1089 return res; nvme_trans_fill_all_pages()
1112 int res; nvme_trans_mode_page_create() local
1136 res = -ENOMEM; nvme_trans_mode_page_create()
1140 res = nvme_trans_fill_mode_parm_hdr(&response[0], mph_size, cdb10, nvme_trans_mode_page_create()
1142 if (res) nvme_trans_mode_page_create()
1145 res = nvme_trans_fill_blk_desc(ns, hdr, nvme_trans_mode_page_create()
1148 if (res) nvme_trans_mode_page_create()
1151 res = mode_page_fill_func(ns, hdr, &response[mode_pages_offset_1], nvme_trans_mode_page_create()
1153 if (res) nvme_trans_mode_page_create()
1157 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_mode_page_create()
1162 return res; nvme_trans_mode_page_create()
1208 int res; nvme_trans_power_state() local
1216 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_power_state()
1217 if (res) nvme_trans_power_state()
1218 return res; nvme_trans_power_state()
1254 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_power_state()
1365 int res = 0; nvme_trans_modesel_get_mp() local
1375 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_modesel_get_mp()
1382 res = nvme_trans_completion(hdr, nvme_trans_modesel_get_mp()
1391 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_modesel_get_mp()
1397 return res; nvme_trans_modesel_get_mp()
1404 int res; nvme_trans_modesel_data() local
1415 res = -ENOMEM; nvme_trans_modesel_data()
1419 res = nvme_trans_copy_from_user(hdr, parm_list, parm_list_len); nvme_trans_modesel_data()
1420 if (res) nvme_trans_modesel_data()
1441 res = nvme_trans_completion(hdr, nvme_trans_modesel_data()
1456 res = nvme_trans_modesel_get_mp(ns, hdr, &parm_list[index], nvme_trans_modesel_data()
1458 if (res) nvme_trans_modesel_data()
1466 return res; nvme_trans_modesel_data()
1474 int res = 0; nvme_trans_fmt_set_blk_size_count() local
1490 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fmt_set_blk_size_count()
1491 if (res) nvme_trans_fmt_set_blk_size_count()
1492 return res; nvme_trans_fmt_set_blk_size_count()
1511 int res; nvme_trans_fmt_get_parm_header() local
1517 res = -ENOMEM; nvme_trans_fmt_get_parm_header()
1520 res = nvme_trans_copy_from_user(hdr, parm_list, len); nvme_trans_fmt_get_parm_header()
1521 if (res) nvme_trans_fmt_get_parm_header()
1526 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_get_parm_header()
1534 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_get_parm_header()
1556 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_get_parm_header()
1565 return res; nvme_trans_fmt_get_parm_header()
1571 int res; nvme_trans_fmt_send_cmd() local
1583 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fmt_send_cmd()
1584 if (res) nvme_trans_fmt_send_cmd()
1585 return res; nvme_trans_fmt_send_cmd()
1597 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_send_cmd()
1602 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_fmt_send_cmd()
1615 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_fmt_send_cmd()
1618 return res; nvme_trans_fmt_send_cmd()
1724 int res = 0; nvme_trans_io() local
1778 res = -EIO; nvme_trans_io()
1793 res = nvme_trans_completion(hdr, nvme_trans_io()
1810 res = -EINVAL; nvme_trans_io()
1819 res = nvme_trans_do_nvme_io(ns, hdr, &cdb_info, is_write); nvme_trans_io()
1820 if (res) nvme_trans_io()
1824 return res; nvme_trans_io()
1830 int res = 0; nvme_trans_inquiry() local
1843 res = -ENOMEM; nvme_trans_inquiry()
1849 res = nvme_trans_standard_inquiry_page(ns, hdr, nvme_trans_inquiry()
1852 res = nvme_trans_completion(hdr, nvme_trans_inquiry()
1861 res = nvme_trans_supported_vpd_pages(ns, hdr, nvme_trans_inquiry()
1865 res = nvme_trans_unit_serial_page(ns, hdr, inq_response, nvme_trans_inquiry()
1869 res = nvme_trans_device_id_page(ns, hdr, inq_response, nvme_trans_inquiry()
1873 res = nvme_trans_ext_inq_page(ns, hdr, alloc_len); nvme_trans_inquiry()
1876 res = nvme_trans_bdev_limits_page(ns, hdr, inq_response, nvme_trans_inquiry()
1880 res = nvme_trans_bdev_char_page(ns, hdr, alloc_len); nvme_trans_inquiry()
1883 res = nvme_trans_completion(hdr, nvme_trans_inquiry()
1893 return res; nvme_trans_inquiry()
1899 int res; nvme_trans_log_sense() local
1905 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_log_sense()
1914 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_log_sense()
1922 res = nvme_trans_log_supp_pages(ns, hdr, alloc_len); nvme_trans_log_sense()
1925 res = nvme_trans_log_info_exceptions(ns, hdr, alloc_len); nvme_trans_log_sense()
1928 res = nvme_trans_log_temperature(ns, hdr, alloc_len); nvme_trans_log_sense()
1931 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_log_sense()
1938 return res; nvme_trans_log_sense()
1974 int res = 0; nvme_trans_mode_sense() local
1987 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_mode_sense()
1995 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense()
2001 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense()
2007 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense()
2013 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense()
2019 res = nvme_trans_mode_page_create(ns, hdr, cmd, alloc_len, nvme_trans_mode_sense()
2025 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_mode_sense()
2032 return res; nvme_trans_mode_sense()
2038 int res; nvme_trans_read_capacity() local
2056 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_read_capacity()
2057 if (res) nvme_trans_read_capacity()
2058 return res; nvme_trans_read_capacity()
2062 res = -ENOMEM; nvme_trans_read_capacity()
2068 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_read_capacity()
2073 return res; nvme_trans_read_capacity()
2079 int res; nvme_trans_report_luns() local
2098 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_report_luns()
2099 if (res) nvme_trans_report_luns()
2100 return res; nvme_trans_report_luns()
2107 res = nvme_trans_completion(hdr, nvme_trans_report_luns()
2116 res = -ENOMEM; nvme_trans_report_luns()
2135 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_report_luns()
2140 return res; nvme_trans_report_luns()
2146 int res; nvme_trans_request_sense() local
2158 res = -ENOMEM; nvme_trans_request_sense()
2185 res = nvme_trans_copy_to_user(hdr, response, xfer_len); nvme_trans_request_sense()
2189 return res; nvme_trans_request_sense()
2233 int res = nvme_trans_synchronize_cache(ns, hdr); nvme_trans_start_stop() local
2234 if (res) nvme_trans_start_stop()
2235 return res; nvme_trans_start_stop()
2245 int res; nvme_trans_format_unit() local
2262 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_format_unit()
2274 res = nvme_trans_fmt_get_parm_header(hdr, parm_hdr_len, nvme_trans_format_unit()
2276 if (res) nvme_trans_format_unit()
2281 res = nvme_trans_send_activate_fw_cmd(ns, hdr, 0); nvme_trans_format_unit()
2284 res = nvme_trans_fmt_set_blk_size_count(ns, hdr); nvme_trans_format_unit()
2285 if (res) nvme_trans_format_unit()
2288 res = nvme_trans_fmt_send_cmd(ns, hdr, nvme_pf_code); nvme_trans_format_unit()
2291 return res; nvme_trans_format_unit()
2311 int res = 0; nvme_trans_write_buffer() local
2318 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_write_buffer()
2325 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_write_buffer()
2335 res = nvme_trans_send_download_fw_cmd(ns, hdr, nvme_admin_download_fw, nvme_trans_write_buffer()
2338 if (res) nvme_trans_write_buffer()
2340 res = nvme_trans_send_activate_fw_cmd(ns, hdr, buffer_id); nvme_trans_write_buffer()
2343 res = nvme_trans_send_download_fw_cmd(ns, hdr, nvme_admin_download_fw, nvme_trans_write_buffer()
2348 res = nvme_trans_send_activate_fw_cmd(ns, hdr, buffer_id); nvme_trans_write_buffer()
2351 res = nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, nvme_trans_write_buffer()
2358 return res; nvme_trans_write_buffer()
2380 int i, nvme_sc, res; nvme_trans_unmap() local
2391 res = nvme_trans_copy_from_user(hdr, plist, list_len); nvme_trans_unmap()
2392 if (res) nvme_trans_unmap()
2397 res = -EINVAL; nvme_trans_unmap()
2403 res = -ENOMEM; nvme_trans_unmap()
2421 res = nvme_trans_status_code(hdr, nvme_sc); nvme_trans_unmap()
2426 return res; nvme_trans_unmap()
/linux-4.4.14/fs/squashfs/
H A Dfile_cache.c28 int res = buffer->error; squashfs_readpage_block() local
30 if (res) squashfs_readpage_block()
37 return res; squashfs_readpage_block()
/linux-4.4.14/tools/include/linux/
H A Dcompiler.h62 static __always_inline void __read_once_size(const volatile void *p, void *res, int size) __read_once_size() argument
65 case 1: *(__u8_alias_t *) res = *(volatile __u8_alias_t *) p; break; __read_once_size()
66 case 2: *(__u16_alias_t *) res = *(volatile __u16_alias_t *) p; break; __read_once_size()
67 case 4: *(__u32_alias_t *) res = *(volatile __u32_alias_t *) p; break; __read_once_size()
68 case 8: *(__u64_alias_t *) res = *(volatile __u64_alias_t *) p; break; __read_once_size()
71 __builtin_memcpy((void *)res, (const void *)p, size); __read_once_size()
76 static __always_inline void __write_once_size(volatile void *p, void *res, int size) __write_once_size() argument
79 case 1: *(volatile __u8_alias_t *) p = *(__u8_alias_t *) res; break; __write_once_size()
80 case 2: *(volatile __u16_alias_t *) p = *(__u16_alias_t *) res; break; __write_once_size()
81 case 4: *(volatile __u32_alias_t *) p = *(__u32_alias_t *) res; break; __write_once_size()
82 case 8: *(volatile __u64_alias_t *) p = *(__u64_alias_t *) res; break; __write_once_size()
85 __builtin_memcpy((void *)p, (const void *)res, size); __write_once_size()
/linux-4.4.14/drivers/char/
H A Dps3flash.c49 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.4.14/drivers/usb/c67x00/
H A Dc67x00-drv.c123 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.4.14/drivers/acpi/apei/
H A Dapei-base.c306 struct apei_res *res, *resn, *res_ins = NULL; apei_res_add() local
312 list_for_each_entry_safe(res, resn, res_list, list) { list_for_each_entry_safe()
313 if (res->start > end || res->end < start) list_for_each_entry_safe()
315 else if (end <= res->end && start >= res->start) { list_for_each_entry_safe()
319 list_del(&res->list); list_for_each_entry_safe()
320 res->start = start = min(res->start, start); list_for_each_entry_safe()
321 res->end = end = max(res->end, end); list_for_each_entry_safe()
323 res_ins = res; list_for_each_entry_safe()
330 res_ins = kmalloc(sizeof(*res), GFP_KERNEL);
344 struct apei_res *res1, *resn1, *res2, *res; apei_res_sub() local
359 res = kmalloc(sizeof(*res), GFP_KERNEL); list_for_each_entry()
360 if (!res) list_for_each_entry()
362 res->start = res2->end; list_for_each_entry()
363 res->end = res1->end; list_for_each_entry()
365 list_add(&res->list, &res1->list); list_for_each_entry()
366 resn1 = res; list_for_each_entry()
383 struct apei_res *res, *resn; apei_res_clean() local
385 list_for_each_entry_safe(res, resn, res_list, list) { list_for_each_entry_safe()
386 list_del(&res->list); list_for_each_entry_safe()
387 kfree(res); list_for_each_entry_safe()
402 struct apei_res *res; apei_resources_merge() local
404 list_for_each_entry(res, &resources2->iomem, list) { apei_resources_merge()
405 rc = apei_res_add(&resources1->iomem, res->start, apei_resources_merge()
406 res->end - res->start); apei_resources_merge()
410 list_for_each_entry(res, &resources2->ioport, list) { apei_resources_merge()
411 rc = apei_res_add(&resources1->ioport, res->start, apei_resources_merge()
412 res->end - res->start); apei_resources_merge()
475 struct apei_res *res, *res_bak = NULL; apei_resources_request() local
508 list_for_each_entry(res, &resources->iomem, list) { apei_resources_request()
509 r = request_mem_region(res->start, res->end - res->start, apei_resources_request()
514 (unsigned long long)res->start, apei_resources_request()
515 (unsigned long long)res->end - 1, desc); apei_resources_request()
516 res_bak = res; apei_resources_request()
521 list_for_each_entry(res, &resources->ioport, list) { apei_resources_request()
522 r = request_region(res->start, res->end - res->start, desc); apei_resources_request()
526 (unsigned long long)res->start, apei_resources_request()
527 (unsigned long long)res->end - 1, desc); apei_resources_request()
528 res_bak = res; apei_resources_request()
541 list_for_each_entry(res, &resources->ioport, list) { apei_resources_request()
542 if (res == res_bak) apei_resources_request()
544 release_region(res->start, res->end - res->start); apei_resources_request()
548 list_for_each_entry(res, &resources->iomem, list) { apei_resources_request()
549 if (res == res_bak) apei_resources_request()
551 release_mem_region(res->start, res->end - res->start); apei_resources_request()
564 struct apei_res *res; apei_resources_release() local
566 list_for_each_entry(res, &resources->iomem, list) apei_resources_release()
567 release_mem_region(res->start, res->end - res->start); apei_resources_release()
568 list_for_each_entry(res, &resources->ioport, list) apei_resources_release()
569 release_region(res->start, res->end - res->start); apei_resources_release()
/linux-4.4.14/drivers/hwmon/
H A Di5k_amb.c267 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 Dacpi_power_meter.c160 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.4.14/arch/avr32/kernel/
H A Dsetup.c80 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.4.14/include/linux/
H A Dpnp.h36 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.4.14/drivers/usb/host/
H A Dehci-pmcmsp.c101 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 Dxhci-mvebu.c46 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.4.14/drivers/clk/
H A Dclk-devres.c12 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.4.14/scripts/
H A Dsetlocalversion120 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.4.14/drivers/mtd/onenand/
H A Dgeneric.c41 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()
82 release_mem_region(res->start, size); generic_onenand_probe()
92 struct resource *res = pdev->resource; generic_onenand_remove() local
93 unsigned long size = resource_size(res); generic_onenand_remove()
97 release_mem_region(res->start, size); generic_onenand_remove()
/linux-4.4.14/drivers/nvdimm/
H A Dnamespace_devs.c46 kfree(nsblk->res); namespace_blk_release()
271 struct resource *res; nd_namespace_blk_size() local
276 for_each_dpa_resource(ndd, res) nd_namespace_blk_size()
277 if (strcmp(res->name, label_id.id) == 0) nd_namespace_blk_size()
278 size += resource_size(res); nd_namespace_blk_size()
288 struct resource *res; __nd_namespace_blk_validate() local
296 for_each_dpa_resource(ndd, res) { for_each_dpa_resource()
297 if (strcmp(res->name, label_id.id) != 0) for_each_dpa_resource()
303 if (res->flags & DPA_RESOURCE_ADJUSTED) for_each_dpa_resource()
315 for_each_dpa_resource(ndd, res) for_each_dpa_resource()
316 if (res == nsblk->res[i]) { for_each_dpa_resource()
317 found = res; for_each_dpa_resource()
355 resource_size_t size = resource_size(&nspm->nsio.res); nd_namespace_label_update()
425 struct resource *res, *last; scan_free() local
429 for_each_dpa_resource(ndd, res) scan_free()
430 if (strcmp(res->name, label_id->id) == 0) scan_free()
431 last = res; scan_free()
432 res = last; scan_free()
433 if (!res) scan_free()
436 if (n >= resource_size(res)) { scan_free()
437 n -= resource_size(res); scan_free()
438 nd_dbg_dpa(nd_region, ndd, res, "delete %d\n", rc); scan_free()
439 nvdimm_free_dpa(ndd, res); scan_free()
449 new_start = res->start + n; scan_free()
451 new_start = res->start; scan_free()
453 rc = adjust_resource(res, new_start, resource_size(res) - n); scan_free()
455 res->flags |= DPA_RESOURCE_ADJUSTED; scan_free()
456 nd_dbg_dpa(nd_region, ndd, res, "shrink %d\n", rc); scan_free()
498 struct resource *res; init_dpa_allocation() local
508 res = nvdimm_allocate_dpa(ndd, label_id, first_dpa, n); init_dpa_allocation()
509 if (!res) init_dpa_allocation()
512 nd_dbg_dpa(nd_region, ndd, res, "init %d\n", rc); init_dpa_allocation()
517 struct nd_label_id *label_id, struct resource *res) space_valid()
526 if (!res || strcmp(res->name, label_id->id) == 0) space_valid()
544 struct resource *res; scan_allocate() local
549 for_each_dpa_resource(ndd, res) { for_each_dpa_resource()
551 struct resource *next = res->sibling, *new_res = NULL; for_each_dpa_resource()
557 if (res->start > mapping_end) for_each_dpa_resource()
559 if (res->end < nd_mapping->start) for_each_dpa_resource()
563 if (!first++ && res->start > nd_mapping->start) { for_each_dpa_resource()
565 available = res->start - free_start; for_each_dpa_resource()
572 free_start = res->start + resource_size(res); for_each_dpa_resource()
574 if (space_valid(is_pmem, is_reserve, label_id, res) for_each_dpa_resource()
583 free_start = res->start + resource_size(res); for_each_dpa_resource()
585 if (space_valid(is_pmem, is_reserve, label_id, res) for_each_dpa_resource()
597 if (strcmp(res->name, label_id->id) == 0) { for_each_dpa_resource()
601 rc = adjust_resource(res, res->start - allocate, for_each_dpa_resource()
602 resource_size(res) + allocate); for_each_dpa_resource()
617 } else if (strcmp(res->name, label_id->id) == 0) { for_each_dpa_resource()
623 if (strcmp(res->name, label_id->id) == 0) for_each_dpa_resource()
645 rc = adjust_resource(res, res->start, resource_size(res) for_each_dpa_resource()
648 res->flags |= DPA_RESOURCE_ADJUSTED; for_each_dpa_resource()
652 new_res = res; for_each_dpa_resource()
688 struct resource *res; merge_dpa() local
693 for_each_dpa_resource(ndd, res) { for_each_dpa_resource()
695 struct resource *next = res->sibling; for_each_dpa_resource()
696 resource_size_t end = res->start + resource_size(res); for_each_dpa_resource()
698 if (!next || strcmp(res->name, label_id->id) != 0 for_each_dpa_resource()
704 rc = adjust_resource(res, res->start, end - res->start); for_each_dpa_resource()
705 nd_dbg_dpa(nd_region, ndd, res, "merge %d\n", rc); for_each_dpa_resource()
708 res->flags |= DPA_RESOURCE_ADJUSTED; for_each_dpa_resource()
756 struct resource *res, *_res; release_free_pmem() local
758 for_each_dpa_resource_safe(ndd, res, _res) release_free_pmem()
759 if (strcmp(res->name, "pmem-reserve") == 0) release_free_pmem()
760 nvdimm_free_dpa(ndd, res); release_free_pmem()
841 struct resource *res = &nspm->nsio.res; nd_namespace_pmem_set_size() local
843 res->start = nd_region->ndr_start; nd_namespace_pmem_set_size()
844 res->end = nd_region->ndr_start + size - 1; nd_namespace_pmem_set_size()
992 return resource_size(&nspm->nsio.res); __nvdimm_namespace_capacity()
998 return resource_size(&nsio->res); __nvdimm_namespace_capacity()
1091 struct resource *res; namespace_update_uuid() local
1093 for_each_dpa_resource(ndd, res) namespace_update_uuid()
1094 if (strcmp(res->name, old_label_id.id) == 0) namespace_update_uuid()
1095 sprintf((void *) res->name, "%s", namespace_update_uuid()
1148 struct resource *res; resource_show() local
1153 res = &nspm->nsio.res; resource_show()
1157 res = &nsio->res; resource_show()
1162 if (resource_size(res) == 0) resource_show()
1164 return sprintf(buf, "%#llx\n", (unsigned long long) res->start); resource_show()
1240 struct resource *res; dpa_extents_show() local
1242 for_each_dpa_resource(ndd, res) dpa_extents_show()
1243 if (strcmp(res->name, label_id.id) == 0) dpa_extents_show()
1419 struct resource *res; create_namespace_io() local
1434 res = &nsio->res; create_namespace_io()
1435 res->name = dev_name(&nd_region->dev); create_namespace_io()
1436 res->flags = IORESOURCE_MEM; create_namespace_io()
1437 res->start = nd_region->ndr_start; create_namespace_io()
1438 res->end = res->start + nd_region->ndr_size - 1; create_namespace_io()
1638 struct resource *res; create_namespace_pmem() local
1648 res = &nspm->nsio.res; create_namespace_pmem()
1649 res->name = dev_name(&nd_region->dev); create_namespace_pmem()
1650 res->flags = IORESOURCE_MEM; create_namespace_pmem()
1687 struct resource *res; nsblk_add_resource() local
1690 res = krealloc(nsblk->res, nsblk_add_resource()
1693 if (!res) nsblk_add_resource()
1695 nsblk->res = (struct resource **) res; for_each_dpa_resource()
1696 for_each_dpa_resource(ndd, res) for_each_dpa_resource()
1697 if (strcmp(res->name, label_id.id) == 0 for_each_dpa_resource()
1698 && res->start == start) { for_each_dpa_resource()
1699 nsblk->res[nsblk->num_resources++] = res; for_each_dpa_resource()
1700 return res; for_each_dpa_resource()
1765 struct resource *res; create_namespace_blk() local
1785 res = nsblk_add_resource(nd_region, ndd, nsblk, create_namespace_blk()
1787 if (!res) create_namespace_blk()
1789 nd_dbg_dpa(nd_region, ndd, res, "%s assign\n", create_namespace_blk()
1821 res = nsblk_add_resource(nd_region, ndd, nsblk, create_namespace_blk()
1823 if (!res) create_namespace_blk()
1825 nd_dbg_dpa(nd_region, ndd, res, "%s assign\n", create_namespace_blk()
516 space_valid(bool is_pmem, bool is_reserve, struct nd_label_id *label_id, struct resource *res) space_valid() argument
H A Ddimm_devs.c235 struct resource *res, *_r; nvdimm_drvdata_release() local
240 for_each_dpa_resource_safe(ndd, res, _r) nvdimm_drvdata_release()
241 nvdimm_free_dpa(ndd, res); nvdimm_drvdata_release()
382 struct resource *res; nd_blk_available_dpa() local
388 for_each_dpa_resource(ndd, res) for_each_dpa_resource()
389 if (res->start >= nd_mapping->start && res->start < map_end) { for_each_dpa_resource()
390 resource_size_t end = min(map_end, res->end); for_each_dpa_resource()
392 busy += end - res->start + 1; for_each_dpa_resource()
393 } else if (res->end >= nd_mapping->start
394 && res->end <= map_end) {
395 busy += res->end - nd_mapping->start;
396 } else if (nd_mapping->start > res->start
397 && nd_mapping->start < res->end) {
428 struct resource *res; nd_pmem_available_dpa() local
437 for_each_dpa_resource(ndd, res) for_each_dpa_resource()
438 if (res->start >= map_start && res->start < map_end) { for_each_dpa_resource()
439 if (strncmp(res->name, "blk", 3) == 0) for_each_dpa_resource()
440 blk_start = min(blk_start, res->start); for_each_dpa_resource()
441 else if (res->start != map_start) { for_each_dpa_resource()
449 busy += resource_size(res); for_each_dpa_resource()
452 } else if (res->end >= map_start && res->end <= map_end) {
453 if (strncmp(res->name, "blk", 3) == 0) {
464 } else if (map_start > res->start && map_start < res->end) {
481 nd_dbg_dpa(nd_region, ndd, res, "%s\n", reason);
485 void nvdimm_free_dpa(struct nvdimm_drvdata *ndd, struct resource *res) nvdimm_free_dpa() argument
488 kfree(res->name); nvdimm_free_dpa()
489 __release_region(&ndd->dpa, res->start, resource_size(res)); nvdimm_free_dpa()
497 struct resource *res; nvdimm_allocate_dpa() local
503 res = __request_region(&ndd->dpa, start, n, name, 0); nvdimm_allocate_dpa()
504 if (!res) nvdimm_allocate_dpa()
506 return res; nvdimm_allocate_dpa()
518 struct resource *res; nvdimm_allocated_dpa() local
520 for_each_dpa_resource(ndd, res) nvdimm_allocated_dpa()
521 if (strcmp(res->name, label_id->id) == 0) nvdimm_allocated_dpa()
522 allocated += resource_size(res); nvdimm_allocated_dpa()
H A Dnd.h77 #define nd_dbg_dpa(r, d, res, fmt, arg...) \
79 (r) ? dev_name((d)->dev) : "", res ? res->name : "null", \
80 (unsigned long long) (res ? resource_size(res) : 0), \
81 (unsigned long long) (res ? res->start : 0), ##arg)
86 #define for_each_dpa_resource(ndd, res) \
87 for (res = (ndd)->dpa.child; res; res = res->sibling)
89 #define for_each_dpa_resource_safe(ndd, res, next) \
90 for (res = (ndd)->dpa.child, next = res ? res->sibling : NULL; \
91 res; res = next, next = next ? next->sibling : NULL)
255 void nvdimm_free_dpa(struct nvdimm_drvdata *ndd, struct resource *res);
/linux-4.4.14/arch/xtensa/include/asm/
H A Dpci-bridge.h66 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.4.14/arch/arm/include/asm/
H A Dsmp_twd.h24 struct resource res[2]; member in struct:twd_local_timer
29 .res = { \
/linux-4.4.14/drivers/staging/rtl8188eu/core/
H A Drtw_cmd.c118 int res = _FAIL; rtw_enqueue_cmd() local
127 res = rtw_cmd_filter(pcmdpriv, cmd_obj); rtw_enqueue_cmd()
128 if (res == _FAIL) { 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.4.14/tools/testing/selftests/futex/functional/
H A Dfutex_wait_wouldblock.c46 int res, ret = RET_PASS; main() local
70 res = futex_wait(&f1, f1+1, &to, FUTEX_PRIVATE_FLAG); main()
71 if (!res || errno != EWOULDBLOCK) { main()
73 res ? errno : res, res ? strerror(errno) : ""); main()
/linux-4.4.14/drivers/platform/x86/
H A Dintel_pmc_ipc.c484 struct resource *res; ipc_create_punit_device() local
495 res = punit_res; ipc_create_punit_device()
496 res->start = ipcdev.punit_base; ipc_create_punit_device()
497 res->end = res->start + ipcdev.punit_size - 1; ipc_create_punit_device()
499 res = punit_res + PUNIT_RESOURCE_INTER; ipc_create_punit_device()
500 res->start = ipcdev.punit_base2; ipc_create_punit_device()
501 res->end = res->start + ipcdev.punit_size2 - 1; ipc_create_punit_device()
526 struct resource *res; ipc_create_tco_device() local
537 res = tco_res + TCO_RESOURCE_ACPI_IO; ipc_create_tco_device()
538 res->start = ipcdev.acpi_io_base + TCO_BASE_OFFSET; ipc_create_tco_device()
539 res->end = res->start + TCO_REGS_SIZE - 1; ipc_create_tco_device()
541 res = tco_res + TCO_RESOURCE_SMI_EN_IO; ipc_create_tco_device()
542 res->start = ipcdev.acpi_io_base + SMI_EN_OFFSET; ipc_create_tco_device()
543 res->end = res->start + SMI_EN_SIZE - 1; ipc_create_tco_device()
545 res = tco_res + TCO_RESOURCE_GCR_MEM; ipc_create_tco_device()
546 res->start = ipcdev.gcr_base; ipc_create_tco_device()
547 res->end = res->start + ipcdev.gcr_size - 1; ipc_create_tco_device()
593 struct resource *res; ipc_plat_get_res() local
597 res = platform_get_resource(pdev, IORESOURCE_IO, ipc_plat_get_res()
599 if (!res) { ipc_plat_get_res()
603 size = resource_size(res); ipc_plat_get_res()
604 ipcdev.acpi_io_base = res->start; ipc_plat_get_res()
606 dev_info(&pdev->dev, "io res: %llx %x\n", ipc_plat_get_res()
607 (long long)res->start, (int)resource_size(res)); ipc_plat_get_res()
609 res = platform_get_resource(pdev, IORESOURCE_MEM, ipc_plat_get_res()
611 if (!res) { ipc_plat_get_res()
615 size = resource_size(res); ipc_plat_get_res()
616 ipcdev.punit_base = res->start; ipc_plat_get_res()
618 dev_info(&pdev->dev, "punit data res: %llx %x\n", ipc_plat_get_res()
619 (long long)res->start, (int)resource_size(res)); ipc_plat_get_res()
621 res = platform_get_resource(pdev, IORESOURCE_MEM, ipc_plat_get_res()
623 if (!res) { ipc_plat_get_res()
627 size = resource_size(res); ipc_plat_get_res()
628 ipcdev.punit_base2 = res->start; ipc_plat_get_res()
630 dev_info(&pdev->dev, "punit interface res: %llx %x\n", ipc_plat_get_res()
631 (long long)res->start, (int)resource_size(res)); ipc_plat_get_res()
633 res = platform_get_resource(pdev, IORESOURCE_MEM, ipc_plat_get_res()
635 if (!res) { ipc_plat_get_res()
640 if (!request_mem_region(res->start, size, pdev->name)) { ipc_plat_get_res()
644 addr = ioremap_nocache(res->start, size); ipc_plat_get_res()
647 release_mem_region(res->start, size); ipc_plat_get_res()
652 ipcdev.gcr_base = res->start + size; ipc_plat_get_res()
654 dev_info(&pdev->dev, "ipc res: %llx %x\n", ipc_plat_get_res()
655 (long long)res->start, (int)resource_size(res)); ipc_plat_get_res()
670 struct resource *res; ipc_plat_probe() local
716 res = platform_get_resource(pdev, IORESOURCE_MEM, ipc_plat_probe()
718 if (res) ipc_plat_probe()
719 release_mem_region(res->start, PLAT_RESOURCE_IPC_SIZE); ipc_plat_probe()
725 struct resource *res; ipc_plat_remove() local
732 res = platform_get_resource(pdev, IORESOURCE_MEM, ipc_plat_remove()
734 if (res) ipc_plat_remove()
735 release_mem_region(res->start, PLAT_RESOURCE_IPC_SIZE); ipc_plat_remove()
/linux-4.4.14/arch/microblaze/pci/
H A Dpci-common.c558 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.4.14/drivers/rapidio/
H A Drio-access.c46 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.4.14/drivers/media/radio/
H A Dradio-tea5777.c190 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 Dradio-miropcm20.c229 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()
/linux-4.4.14/arch/mips/ar7/
H A Dplatform.c568 int res; ar7_register_uarts() local
586 res = early_serial_setup(&uart_port); ar7_register_uarts()
587 if (res) ar7_register_uarts()
588 return res; ar7_register_uarts()
597 res = early_serial_setup(&uart_port); ar7_register_uarts()
598 if (res) ar7_register_uarts()
599 return res; ar7_register_uarts()
655 int res; ar7_register_devices() local
657 res = ar7_register_uarts(); ar7_register_devices()
658 if (res) ar7_register_devices()
659 pr_err("unable to setup uart(s): %d\n", res); ar7_register_devices()
661 res = platform_device_register(&physmap_flash); ar7_register_devices()
662 if (res) ar7_register_devices()
663 pr_warn("unable to register physmap-flash: %d\n", res); ar7_register_devices()
669 res = platform_device_register(&vlynq_low); ar7_register_devices()
670 if (res) ar7_register_devices()
671 pr_warn("unable to register vlynq-low: %d\n", res); ar7_register_devices()
675 res = platform_device_register(&vlynq_high); ar7_register_devices()
676 if (res) ar7_register_devices()
677 pr_warn("unable to register vlynq-high: %d\n", res); ar7_register_devices()
681 res = fixed_phy_add(PHY_POLL, cpmac_high.id, 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, -1); 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.4.14/drivers/staging/media/omap4iss/
H A Diss.h97 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.4.14/arch/x86/platform/olpc/
H A Dolpc_dt.c30 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.4.14/drivers/ide/
H A Dgayle.c119 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.4.14/scripts/kconfig/
H A Dnconf.gui.c205 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.4.14/drivers/staging/rtl8723au/core/
H A Drtw_cmd.c173 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()
241 res = _FAIL; rtw_enqueue_cmd23a()
243 res = _SUCCESS; rtw_enqueue_cmd23a()
246 return res; rtw_enqueue_cmd23a()
278 pcmd->res = H2C_DROPPED; rtw_cmd_work()
290 pcmd->res = cmd_hdl(pcmd->padapter, pcmd->parmbuf); rtw_cmd_work()
292 pcmd->res = H2C_DROPPED; rtw_cmd_work()
294 pcmd->res = H2C_PARAMETERS_ERROR; rtw_cmd_work()
324 int res = _FAIL; rtw_sitesurvey_cmd23a() local
383 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_sitesurvey_cmd23a()
385 if (res == _SUCCESS) { rtw_sitesurvey_cmd23a()
393 return res; rtw_sitesurvey_cmd23a()
409 u8 res = _SUCCESS; rtw_createbss_cmd23a() local
425 res = _FAIL; rtw_createbss_cmd23a()
437 res = rtw_enqueue_cmd23a(pcmdpriv, pcmd); rtw_createbss_cmd23a()
441 return res; rtw_createbss_cmd23a()
447 int res = _SUCCESS; rtw_joinbss_cmd23a() local
472 res = _FAIL; rtw_joinbss_cmd23a()
496 res = _FAIL; rtw_joinbss_cmd23a()
586 res = rtw_enqueue_cmd23a(pcmdpriv, pcmd); rtw_joinbss_cmd23a()
589 return res; rtw_joinbss_cmd23a()
598 int res = _SUCCESS; rtw_disassoc_cmd23a() local
606 res = _FAIL; rtw_disassoc_cmd23a()
615 res = _FAIL; rtw_disassoc_cmd23a()
620 res = rtw_enqueue_cmd23a(cmdpriv, cmdobj); rtw_disassoc_cmd23a()
625 res = _FAIL; rtw_disassoc_cmd23a()
630 return res; rtw_disassoc_cmd23a()
639 int res = _SUCCESS; rtw_setopmode_cmd23a() local
643 res = false; rtw_setopmode_cmd23a()
650 res = false; rtw_setopmode_cmd23a()
657 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_setopmode_cmd23a()
659 return res; rtw_setopmode_cmd23a()
671 int res = _SUCCESS; rtw_setstakey_cmd23a() local
675 res = _FAIL; rtw_setstakey_cmd23a()
682 res = _FAIL; rtw_setstakey_cmd23a()
690 res = _FAIL; rtw_setstakey_cmd23a()
720 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_setstakey_cmd23a()
724 return res; rtw_setstakey_cmd23a()
735 int res = _SUCCESS; rtw_clearstakey_cmd23a() local
742 res = _FAIL; rtw_clearstakey_cmd23a()
750 res = _FAIL; rtw_clearstakey_cmd23a()
759 res = _FAIL; rtw_clearstakey_cmd23a()
774 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_clearstakey_cmd23a()
777 return res; rtw_clearstakey_cmd23a()
785 int res = _SUCCESS; rtw_addbareq_cmd23a() local
788 res = _FAIL; rtw_addbareq_cmd23a()
794 res = _FAIL; rtw_addbareq_cmd23a()
801 res = _FAIL; rtw_addbareq_cmd23a()
811 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_addbareq_cmd23a()
813 return res; rtw_addbareq_cmd23a()
821 int res = _SUCCESS; rtw_dynamic_chk_wk_cmd23a() local
825 res = _FAIL; rtw_dynamic_chk_wk_cmd23a()
832 res = _FAIL; rtw_dynamic_chk_wk_cmd23a()
843 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_dynamic_chk_wk_cmd23a()
846 return res; rtw_dynamic_chk_wk_cmd23a()
1003 int res = _SUCCESS; rtw_lps_ctrl_wk_cmd23a() local
1008 res = _FAIL; rtw_lps_ctrl_wk_cmd23a()
1016 res = _FAIL; rtw_lps_ctrl_wk_cmd23a()
1027 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_lps_ctrl_wk_cmd23a()
1032 return res; rtw_lps_ctrl_wk_cmd23a()
1040 int res = _SUCCESS; rtw_ps_cmd23a() local
1044 res = _FAIL; rtw_ps_cmd23a()
1052 res = _FAIL; rtw_ps_cmd23a()
1061 res = rtw_enqueue_cmd23a(pcmdpriv, ppscmd); rtw_ps_cmd23a()
1064 return res; rtw_ps_cmd23a()
1110 int res = _SUCCESS; rtw_chk_hi_queue_cmd23a() local
1114 res = _FAIL; rtw_chk_hi_queue_cmd23a()
1122 res = _FAIL; rtw_chk_hi_queue_cmd23a()
1133 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_chk_hi_queue_cmd23a()
1136 return res; rtw_chk_hi_queue_cmd23a()
1145 int res = _SUCCESS; rtw_c2h_wk_cmd23a() local
1149 res = _FAIL; rtw_c2h_wk_cmd23a()
1157 res = _FAIL; rtw_c2h_wk_cmd23a()
1168 res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); rtw_c2h_wk_cmd23a()
1172 return res; rtw_c2h_wk_cmd23a()
1284 if (pcmd->res == H2C_DROPPED) { rtw_survey_cmd_callback23a()
1289 } else if (pcmd->res != H2C_SUCCESS) { rtw_survey_cmd_callback23a()
1305 if (pcmd->res != H2C_SUCCESS) { rtw_disassoc_cmd23a_callback()
1323 if (pcmd->res == H2C_DROPPED) { rtw_joinbss_cmd23a_callback()
1328 } else if (pcmd->res != H2C_SUCCESS) { rtw_joinbss_cmd23a_callback()
1348 if (pcmd->res != H2C_SUCCESS) { rtw_createbss_cmd23a_callback()
/linux-4.4.14/drivers/net/wireless/hostap/
H A Dhostap_cs.c224 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.4.14/drivers/mfd/
H A Dlpc_sch.c95 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 Ddavinci_voicecodec.c44 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 Dmfd-core.c144 struct resource *res; mfd_add_device() local
160 res = kzalloc(sizeof(*res) * cell->num_resources, GFP_KERNEL); mfd_add_device()
161 if (!res) mfd_add_device()
200 res[r].name = cell->resources[r].name; mfd_add_device()
201 res[r].flags = cell->resources[r].flags; mfd_add_device()
205 res[r].parent = mem_base; mfd_add_device()
206 res[r].start = mem_base->start + mfd_add_device()
208 res[r].end = mem_base->start + mfd_add_device()
215 res[r].start = res[r].end = irq_create_mapping( mfd_add_device()
218 res[r].start = irq_base + mfd_add_device()
220 res[r].end = irq_base + mfd_add_device()
224 res[r].parent = cell->resources[r].parent; mfd_add_device()
225 res[r].start = cell->resources[r].start; mfd_add_device()
226 res[r].end = cell->resources[r].end; mfd_add_device()
231 ret = acpi_check_resource_conflict(&res[r]); mfd_add_device()
238 ret = platform_device_add_resources(pdev, res, cell->num_resources); mfd_add_device()
249 kfree(res); mfd_add_device()
258 kfree(res); mfd_add_device()
H A Djanz-cmodio.c71 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.4.14/arch/sparc/kernel/
H A Dioport.c66 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 Dpower.c38 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.4.14/arch/m68k/atari/
H A Dstram.c152 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.4.14/arch/sh/drivers/pci/
H A Dfixups-dreamcast.c34 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, &region, &res); gapspci_fixup_resources()
67 res.start, gapspci_fixup_resources()
69 resource_size(&res), gapspci_fixup_resources()
/linux-4.4.14/arch/mips/ralink/
H A Dof.c33 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.4.14/arch/arm/lib/
H A Ddelay.c80 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.4.14/drivers/bcma/
H A Ddriver_chipcommon.c223 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.4.14/arch/arm/mach-dove/
H A Dpcie.c31 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.4.14/drivers/usb/chipidea/
H A Dci_hdrc_pci.c62 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.4.14/drivers/edac/
H A Dhighbank_l2_edac.c65 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.4.14/arch/score/kernel/
H A Dsetup.c93 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.4.14/arch/metag/kernel/
H A Dtcm.c124 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.4.14/arch/mips/vr41xx/common/
H A Dsiu.c79 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.4.14/arch/ia64/sn/kernel/
H A Dio_init.c128 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.4.14/arch/arm/plat-pxa/
H A Dssp.c117 struct resource *res; pxa_ssp_probe() local
163 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); pxa_ssp_probe()
164 if (res == NULL) { pxa_ssp_probe()
168 ssp->drcmr_rx = res->start; pxa_ssp_probe()
170 res = platform_get_resource(pdev, IORESOURCE_DMA, 1); pxa_ssp_probe()
171 if (res == NULL) { pxa_ssp_probe()
175 ssp->drcmr_tx = res->start; pxa_ssp_probe()
178 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pxa_ssp_probe()
179 if (res == NULL) { pxa_ssp_probe()
184 res = devm_request_mem_region(dev, res->start, resource_size(res), pxa_ssp_probe()
186 if (res == NULL) { pxa_ssp_probe()
191 ssp->phys_base = res->start; pxa_ssp_probe()
193 ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res)); pxa_ssp_probe()
234 struct resource *res; pxa_ssp_remove() local
243 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pxa_ssp_remove()
244 release_mem_region(res->start, resource_size(res)); pxa_ssp_remove()
/linux-4.4.14/drivers/pci/host/
H A Dpci-versatile.c72 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.4.14/kernel/power/
H A Duser.c139 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.4.14/arch/arm/kernel/
H A Dswp_emulate.c37 #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
148 __user_swpb_asm(*data, address, res, temp); emulate_swpX()
150 __user_swp_asm(*data, address, res, temp); emulate_swpX()
153 if (likely(res != -EAGAIN) || signal_pending(current)) emulate_swpX()
159 if (res == 0) { emulate_swpX()
166 return res; emulate_swpX()
177 unsigned int res = 0; swp_handler() local
181 res = arm_check_condition(instr, regs->ARM_cpsr); swp_handler()
182 switch (res) { swp_handler()
216 res = -EFAULT; swp_handler()
218 res = emulate_swpX(address, &data, type); swp_handler()
221 if (res == 0) { swp_handler()
229 } else if (res == -EFAULT) { swp_handler()
/linux-4.4.14/drivers/usb/dwc2/
H A Dpci.c78 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.4.14/drivers/usb/dwc3/
H A Ddwc3-pci.c135 struct resource res[2]; dwc3_pci_probe() local
154 memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); dwc3_pci_probe()
156 res[0].start = pci_resource_start(pci, 0); dwc3_pci_probe()
157 res[0].end = pci_resource_end(pci, 0); dwc3_pci_probe()
158 res[0].name = "dwc_usb3"; dwc3_pci_probe()
159 res[0].flags = IORESOURCE_MEM; dwc3_pci_probe()
161 res[1].start = pci->irq; dwc3_pci_probe()
162 res[1].name = "dwc_usb3"; dwc3_pci_probe()
163 res[1].flags = IORESOURCE_IRQ; dwc3_pci_probe()
165 ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); dwc3_pci_probe()
/linux-4.4.14/drivers/cpuidle/
H A Dcpuidle-clps711x.c44 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.4.14/arch/um/os-Linux/
H A Dtty.c15 int res; member in struct:grantpt_info
23 info->res = grantpt(info->fd); grantpt_cb()
43 if (info.res < 0) { get_pty()
/linux-4.4.14/arch/mips/lantiq/xway/
H A Ddcdc.c27 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.4.14/arch/mips/lib/
H A Dbitops.c93 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()

Completed in 5704 milliseconds

1234567891011>>