aboutsummaryrefslogtreecommitdiffstats
path: root/mm/msync.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/msync.c')
-rw-r--r--mm/msync.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/msync.c b/mm/msync.c
index bc6c95376366..d083544df21b 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -170,8 +170,6 @@ asmlinkage long sys_msync(unsigned long start, size_t len, int flags)
170 * just ignore them, but return -ENOMEM at the end. 170 * just ignore them, but return -ENOMEM at the end.
171 */ 171 */
172 down_read(&current->mm->mmap_sem); 172 down_read(&current->mm->mmap_sem);
173 if (flags & MS_SYNC)
174 current->flags |= PF_SYNCWRITE;
175 vma = find_vma(current->mm, start); 173 vma = find_vma(current->mm, start);
176 if (!vma) { 174 if (!vma) {
177 error = -ENOMEM; 175 error = -ENOMEM;
@@ -228,7 +226,6 @@ asmlinkage long sys_msync(unsigned long start, size_t len, int flags)
228 } 226 }
229 } while (vma && !done); 227 } while (vma && !done);
230out_unlock: 228out_unlock:
231 current->flags &= ~PF_SYNCWRITE;
232 up_read(&current->mm->mmap_sem); 229 up_read(&current->mm->mmap_sem);
233out: 230out:
234 return error; 231 return error;
ass="hl kwd">read_lock_bh(&ipx_routes_lock); list_for_each_entry(r, &ipx_routes, node) if (r->ir_net == net) { ipxrtr_hold(r); goto unlock; } r = NULL; unlock: read_unlock_bh(&ipx_routes_lock); return r; } /* * Caller must hold a reference to intrfc */ int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc, unsigned char *node) { struct ipx_route *rt; int rc; /* Get a route structure; either existing or create */ rt = ipxrtr_lookup(network); if (!rt) { rt = kmalloc(sizeof(*rt), GFP_ATOMIC); rc = -EAGAIN; if (!rt) goto out; atomic_set(&rt->refcnt, 1); ipxrtr_hold(rt); write_lock_bh(&ipx_routes_lock); list_add(&rt->node, &ipx_routes); write_unlock_bh(&ipx_routes_lock); } else { rc = -EEXIST; if (intrfc == ipx_internal_net) goto out_put; } rt->ir_net = network; rt->ir_intrfc = intrfc; if (!node) { memset(rt->ir_router_node, '\0', IPX_NODE_LEN); rt->ir_routed = 0; } else { memcpy(rt->ir_router_node, node, IPX_NODE_LEN); rt->ir_routed = 1; } rc = 0; out_put: ipxrtr_put(rt); out: return rc; } void ipxrtr_del_routes(struct ipx_interface *intrfc) { struct ipx_route *r, *tmp; write_lock_bh(&ipx_routes_lock); list_for_each_entry_safe(r, tmp, &ipx_routes, node) if (r->ir_intrfc == intrfc) { list_del(&r->node); ipxrtr_put(r); } write_unlock_bh(&ipx_routes_lock); } static int ipxrtr_create(struct ipx_route_definition *rd) { struct ipx_interface *intrfc; int rc = -ENETUNREACH; /* Find the appropriate interface */ intrfc = ipxitf_find_using_net(rd->ipx_router_network); if (!intrfc) goto out; rc = ipxrtr_add_route(rd->ipx_network, intrfc, rd->ipx_router_node); ipxitf_put(intrfc); out: return rc; } static int ipxrtr_delete(__be32 net) { struct ipx_route *r, *tmp; int rc; write_lock_bh(&ipx_routes_lock); list_for_each_entry_safe(r, tmp, &ipx_routes, node) if (r->ir_net == net) { /* Directly connected; can't lose route */ rc = -EPERM; if (!r->ir_routed) goto out; list_del(&r->node); ipxrtr_put(r); rc = 0; goto out; } rc = -ENOENT; out: write_unlock_bh(&ipx_routes_lock); return rc; } /* * The skb has to be unshared, we'll end up calling ipxitf_send, that'll * modify the packet */ int ipxrtr_route_skb(struct sk_buff *skb) { struct ipxhdr *ipx = ipx_hdr(skb); struct ipx_route *r = ipxrtr_lookup(IPX_SKB_CB(skb)->ipx_dest_net); if (!r) { /* no known route */ kfree_skb(skb); return 0; } ipxitf_hold(r->ir_intrfc); ipxitf_send(r->ir_intrfc, skb, r->ir_routed ? r->ir_router_node : ipx->ipx_dest.node); ipxitf_put(r->ir_intrfc); ipxrtr_put(r); return 0; } /* * Route an outgoing frame from a socket. */ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx, struct iovec *iov, size_t len, int noblock) { struct sk_buff *skb; struct ipx_sock *ipxs = ipx_sk(sk); struct ipx_interface *intrfc; struct ipxhdr *ipx; size_t size; int ipx_offset; struct ipx_route *rt = NULL; int rc; /* Find the appropriate interface on which to send packet */ if (!usipx->sipx_network && ipx_primary_net) { usipx->sipx_network = ipx_primary_net->if_netnum; intrfc = ipx_primary_net; } else { rt = ipxrtr_lookup(usipx->sipx_network); rc = -ENETUNREACH; if (!rt) goto out; intrfc = rt->ir_intrfc; } ipxitf_hold(intrfc); ipx_offset = intrfc->if_ipx_offset; size = sizeof(struct ipxhdr) + len + ipx_offset; skb = sock_alloc_send_skb(sk, size, noblock, &rc); if (!skb) goto out_put; skb_reserve(skb, ipx_offset); skb->sk = sk; /* Fill in IPX header */ skb_reset_network_header(skb); skb_reset_transport_header(skb); skb_put(skb, sizeof(struct ipxhdr)); ipx = ipx_hdr(skb);