tag | line | file | source code |
upd | 101 | net/unix.c | struct unix_proto_data *upd; |
upd | 103 | net/unix.c | for (upd = unix_datas; upd <= last_unix_data; ++upd) { |
upd | 104 | net/unix.c | if (upd->refcnt && upd->socket && |
upd | 105 | net/unix.c | upd->sockaddr_len == sockaddr_len && |
upd | 106 | net/unix.c | memcmp(&upd->sockaddr_un, sockun, sockaddr_len) == 0) |
upd | 107 | net/unix.c | return upd; |
upd | 115 | net/unix.c | struct unix_proto_data *upd; |
upd | 118 | net/unix.c | for (upd = unix_datas; upd <= last_unix_data; ++upd) { |
upd | 119 | net/unix.c | if (!upd->refcnt) { |
upd | 120 | net/unix.c | upd->refcnt = 1; |
upd | 122 | net/unix.c | upd->socket = NULL; |
upd | 123 | net/unix.c | upd->sockaddr_len = 0; |
upd | 124 | net/unix.c | upd->buf = NULL; |
upd | 125 | net/unix.c | upd->bp_head = upd->bp_tail = 0; |
upd | 126 | net/unix.c | upd->inode = NULL; |
upd | 127 | net/unix.c | upd->peerupd = NULL; |
upd | 128 | net/unix.c | return upd; |
upd | 136 | net/unix.c | unix_data_ref(struct unix_proto_data *upd) |
upd | 138 | net/unix.c | ++upd->refcnt; |
upd | 139 | net/unix.c | PRINTK("unix_data_ref: refing data 0x%x (%d)\n", upd, upd->refcnt); |
upd | 143 | net/unix.c | unix_data_deref(struct unix_proto_data *upd) |
upd | 145 | net/unix.c | if (upd->refcnt == 1) { |
upd | 146 | net/unix.c | PRINTK("unix_data_deref: releasing data 0x%x\n", upd); |
upd | 147 | net/unix.c | if (upd->buf) { |
upd | 148 | net/unix.c | free_page((unsigned long)upd->buf); |
upd | 149 | net/unix.c | upd->buf = NULL; |
upd | 150 | net/unix.c | upd->bp_head = upd->bp_tail = 0; |
upd | 153 | net/unix.c | --upd->refcnt; |
upd | 163 | net/unix.c | struct unix_proto_data *upd; |
upd | 170 | net/unix.c | if (!(upd = unix_data_alloc())) { |
upd | 174 | net/unix.c | if (!(upd->buf = (char *)get_free_page(GFP_USER))) { |
upd | 176 | net/unix.c | unix_data_deref(upd); |
upd | 179 | net/unix.c | upd->protocol = protocol; |
upd | 180 | net/unix.c | upd->socket = sock; |
upd | 181 | net/unix.c | UN_DATA(sock) = upd; |
upd | 182 | net/unix.c | PRINTK("unix_proto_create: allocated data 0x%x\n", upd); |
upd | 189 | net/unix.c | struct unix_proto_data *upd = UN_DATA(oldsock); |
upd | 191 | net/unix.c | return unix_proto_create(newsock, upd->protocol); |
upd | 197 | net/unix.c | struct unix_proto_data *upd = UN_DATA(sock); |
upd | 200 | net/unix.c | sock, upd); |
upd | 201 | net/unix.c | if (!upd) |
upd | 203 | net/unix.c | if (upd->socket != sock) { |
upd | 207 | net/unix.c | if (upd->inode) { |
upd | 209 | net/unix.c | upd->inode); |
upd | 210 | net/unix.c | iput(upd->inode); |
upd | 211 | net/unix.c | upd->inode = NULL; |
upd | 214 | net/unix.c | upd->socket = NULL; |
upd | 215 | net/unix.c | if (upd->peerupd) |
upd | 216 | net/unix.c | unix_data_deref(upd->peerupd); |
upd | 217 | net/unix.c | unix_data_deref(upd); |
upd | 234 | net/unix.c | struct unix_proto_data *upd = UN_DATA(sock); |
upd | 246 | net/unix.c | if (upd->sockaddr_len || upd->inode) { |
upd | 251 | net/unix.c | memcpy_fromfs(&upd->sockaddr_un, umyaddr, sockaddr_len); |
upd | 252 | net/unix.c | if (upd->sockaddr_un.sun_family != AF_UNIX) { |
upd | 254 | net/unix.c | upd->sockaddr_un.sun_family, AF_UNIX); |
upd | 258 | net/unix.c | memcpy(fname, upd->sockaddr_un.sun_path, sockaddr_len-UN_PATH_OFFSET); |
upd | 264 | net/unix.c | i = open_namei(fname, 0, S_IFSOCK, &upd->inode); |
upd | 271 | net/unix.c | upd->sockaddr_len = sockaddr_len; /* now its legal */ |
upd | 274 | net/unix.c | sockaddr_un_printk(&upd->sockaddr_un, upd->sockaddr_len); |
upd | 356 | net/unix.c | struct unix_proto_data *upd; |
upd | 366 | net/unix.c | upd = UN_DATA(sock->conn); |
upd | 369 | net/unix.c | upd = UN_DATA(sock); |
upd | 373 | net/unix.c | if (len > upd->sockaddr_len) |
upd | 374 | net/unix.c | len = upd->sockaddr_len; |
upd | 377 | net/unix.c | memcpy_tofs(usockaddr, &upd->sockaddr_un, len); |
upd | 389 | net/unix.c | struct unix_proto_data *upd; |
upd | 394 | net/unix.c | upd = UN_DATA(sock); |
upd | 395 | net/unix.c | while (!(avail = UN_BUF_AVAIL(upd))) { |
upd | 429 | net/unix.c | if (cando > (part = BUF_SIZE - upd->bp_tail)) |
upd | 434 | net/unix.c | memcpy_tofs(ubuf, upd->buf + upd->bp_tail, cando); |
upd | 435 | net/unix.c | upd->bp_tail = (upd->bp_tail + cando) & (BUF_SIZE-1); |
upd | 440 | net/unix.c | avail = UN_BUF_AVAIL(upd); |
upd | 526 | net/unix.c | struct unix_proto_data *upd, *peerupd; |
upd | 529 | net/unix.c | upd = UN_DATA(sock); |
upd | 531 | net/unix.c | UN_BUF_AVAIL(upd) ? "" : " no"); |
upd | 532 | net/unix.c | if (UN_BUF_AVAIL(upd)) /* even if disconnected */ |
upd | 562 | net/unix.c | struct unix_proto_data *upd, *peerupd; |
upd | 564 | net/unix.c | upd = UN_DATA(sock); |
upd | 570 | net/unix.c | if (UN_BUF_AVAIL(upd) || peerupd) |
upd | 571 | net/unix.c | put_fs_long(UN_BUF_AVAIL(upd), (unsigned long *)arg); |
upd | 594 | net/unix.c | struct unix_proto_data *upd; |
upd | 597 | net/unix.c | for (upd = unix_datas; upd <= last_unix_data; ++upd) |
upd | 598 | net/unix.c | upd->refcnt = 0; |