1. 11 3月, 2013 1 次提交
  2. 28 2月, 2013 1 次提交
    • S
      hlist: drop the node parameter from iterators · b67bfe0d
      Sasha Levin 提交于
      I'm not sure why, but the hlist for each entry iterators were conceived
      
              list_for_each_entry(pos, head, member)
      
      The hlist ones were greedy and wanted an extra parameter:
      
              hlist_for_each_entry(tpos, pos, head, member)
      
      Why did they need an extra pos parameter? I'm not quite sure. Not only
      they don't really need it, it also prevents the iterator from looking
      exactly like the list iterator, which is unfortunate.
      
      Besides the semantic patch, there was some manual work required:
      
       - Fix up the actual hlist iterators in linux/list.h
       - Fix up the declaration of other iterators based on the hlist ones.
       - A very small amount of places were using the 'node' parameter, this
       was modified to use 'obj->member' instead.
       - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
       properly, so those had to be fixed up manually.
      
      The semantic patch which is mostly the work of Peter Senna Tschudin is here:
      
      @@
      iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
      
      type T;
      expression a,c,d,e;
      identifier b;
      statement S;
      @@
      
      -T b;
          <+... when != b
      (
      hlist_for_each_entry(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue(a,
      - b,
      c) S
      |
      hlist_for_each_entry_from(a,
      - b,
      c) S
      |
      hlist_for_each_entry_rcu(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_rcu_bh(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue_rcu_bh(a,
      - b,
      c) S
      |
      for_each_busy_worker(a, c,
      - b,
      d) S
      |
      ax25_uid_for_each(a,
      - b,
      c) S
      |
      ax25_for_each(a,
      - b,
      c) S
      |
      inet_bind_bucket_for_each(a,
      - b,
      c) S
      |
      sctp_for_each_hentry(a,
      - b,
      c) S
      |
      sk_for_each(a,
      - b,
      c) S
      |
      sk_for_each_rcu(a,
      - b,
      c) S
      |
      sk_for_each_from
      -(a, b)
      +(a)
      S
      + sk_for_each_from(a) S
      |
      sk_for_each_safe(a,
      - b,
      c, d) S
      |
      sk_for_each_bound(a,
      - b,
      c) S
      |
      hlist_for_each_entry_safe(a,
      - b,
      c, d, e) S
      |
      hlist_for_each_entry_continue_rcu(a,
      - b,
      c) S
      |
      nr_neigh_for_each(a,
      - b,
      c) S
      |
      nr_neigh_for_each_safe(a,
      - b,
      c, d) S
      |
      nr_node_for_each(a,
      - b,
      c) S
      |
      nr_node_for_each_safe(a,
      - b,
      c, d) S
      |
      - for_each_gfn_sp(a, c, d, b) S
      + for_each_gfn_sp(a, c, d) S
      |
      - for_each_gfn_indirect_valid_sp(a, c, d, b) S
      + for_each_gfn_indirect_valid_sp(a, c, d) S
      |
      for_each_host(a,
      - b,
      c) S
      |
      for_each_host_safe(a,
      - b,
      c, d) S
      |
      for_each_mesh_entry(a,
      - b,
      c, d) S
      )
          ...+>
      
      [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
      [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
      [akpm@linux-foundation.org: checkpatch fixes]
      [akpm@linux-foundation.org: fix warnings]
      [akpm@linux-foudnation.org: redo intrusive kvm changes]
      Tested-by: NPeter Senna Tschudin <peter.senna@gmail.com>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b67bfe0d
  3. 09 2月, 2013 1 次提交
  4. 11 1月, 2013 2 次提交
  5. 10 1月, 2013 3 次提交
  6. 14 12月, 2012 1 次提交
  7. 29 11月, 2012 1 次提交
  8. 20 11月, 2012 4 次提交
  9. 29 10月, 2012 1 次提交
  10. 27 10月, 2012 17 次提交
  11. 05 10月, 2012 1 次提交
  12. 03 10月, 2012 1 次提交
    • L
      workqueue: avoid using deprecated functions · 916082b0
      Linus Torvalds 提交于
      The network merge brought in a few users of functions that got
      deprecated by the workqueue cleanups: the 'system_nrt_wq' is now the
      same as the regular system_wq, since all workqueues are now non-
      reentrant.
      
      Similarly, remove one use of flush_work_sync() - the regular
      flush_work() has become synchronous, and the "_sync()" version is thus
      deprecated as being superfluous.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      916082b0
  13. 27 9月, 2012 3 次提交
    • S
      NFC: Fix sleeping in atomic when releasing socket · 50b78b2a
      Szymon Janc 提交于
      nfc_llcp_socket_release is calling lock_sock/release_sock while holding
      write lock for rwlock. Use bh_lock/unlock_sock instead.
      
      BUG: sleeping function called from invalid context at net/core/sock.c:2138
      in_atomic(): 1, irqs_disabled(): 0, pid: 56, name: kworker/1:1
      4 locks held by kworker/1:1/56:
      Pid: 56, comm: kworker/1:1 Not tainted 3.5.0-999-nfc+ #7
      Call Trace:
      [<ffffffff810952c5>] __might_sleep+0x145/0x200
      [<ffffffff815d7686>] lock_sock_nested+0x36/0xa0
      [<ffffffff81731569>] ? _raw_write_lock+0x49/0x50
      [<ffffffffa04aa100>] ? nfc_llcp_socket_release+0x30/0x200 [nfc]
      [<ffffffffa04aa122>] nfc_llcp_socket_release+0x52/0x200 [nfc]
      [<ffffffffa04ab9f0>] nfc_llcp_mac_is_down+0x20/0x30 [nfc]
      [<ffffffffa04a6fea>] nfc_dep_link_down+0xaa/0xf0 [nfc]
      [<ffffffffa04a9bb5>] nfc_llcp_timeout_work+0x15/0x20 [nfc]
      [<ffffffff810825f7>] process_one_work+0x197/0x7c0
      [<ffffffff81082596>] ? process_one_work+0x136/0x7c0
      [<ffffffff8172fbc9>] ? __schedule+0x419/0x9c0
      [<ffffffffa04a9ba0>] ? nfc_llcp_build_gb+0x1b0/0x1b0 [nfc]
      [<ffffffff81083090>] worker_thread+0x190/0x4c0
      [<ffffffff81082f00>] ? rescuer_thread+0x2a0/0x2a0
      [<ffffffff81088d1e>] kthread+0xae/0xc0
      [<ffffffff810caafd>] ? trace_hardirqs_on+0xd/0x10
      [<ffffffff8173acc4>] kernel_thread_helper+0x4/0x10
      [<ffffffff81732174>] ? retint_restore_args+0x13/0x13
      [<ffffffff81088c70>] ? flush_kthread_worker+0x150/0x150
      [<ffffffff8173acc0>] ? gs_change+0x13/0x13
      Signed-off-by: NSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      50b78b2a
    • T
      NFC: LLCP raw socket support · 4463523b
      Thierry Escande 提交于
      This adds support for socket of type SOCK_RAW to LLCP.
      sk_buff are copied and sent to raw sockets with a 2 bytes extra header:
      The first byte header contains the nfc adapter index.
      The second one contains flags:
      - 0x01 - Direction (0=RX, 1=TX)
      - 0x02-0x80 - Reserved
      A raw socket has to be explicitly bound to a nfc adapter. This is achieved
      by specifying the adapter index to be bound to in the dev_idx field of the
      sockaddr_nfc_llcp struct passed to bind().
      Signed-off-by: NThierry Escande <thierry.escande@linux.intel.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      4463523b
    • S
      NFC: Use dynamic initialization for rwlocks · fe235b58
      Szymon Janc 提交于
      If rwlock is dynamically allocated but statically initialized it is
      missing proper lockdep annotation.
      
      INFO: trying to register non-static key.
      the code is fine but needs lockdep annotation.
      turning off the locking correctness validator.
      Pid: 3352, comm: neard Not tainted 3.5.0-999-nfc+ #2
      Call Trace:
      [<ffffffff810c8526>] __lock_acquire+0x8f6/0x1bf0
      [<ffffffff81739045>] ? printk+0x4d/0x4f
      [<ffffffff810c9eed>] lock_acquire+0x9d/0x220
      [<ffffffff81702bfe>] ? nfc_llcp_sock_from_sn+0x4e/0x160
      [<ffffffff81746724>] _raw_read_lock+0x44/0x60
      [<ffffffff81702bfe>] ? nfc_llcp_sock_from_sn+0x4e/0x160
      [<ffffffff81702bfe>] nfc_llcp_sock_from_sn+0x4e/0x160
      [<ffffffff817034a7>] nfc_llcp_get_sdp_ssap+0xa7/0x1b0
      [<ffffffff81706353>] llcp_sock_bind+0x173/0x210
      [<ffffffff815d9c94>] sys_bind+0xe4/0x100
      [<ffffffff8139209e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      [<ffffffff8174ea69>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      fe235b58
  14. 25 9月, 2012 3 次提交