1. 15 9月, 2011 4 次提交
  2. 26 7月, 2011 6 次提交
  3. 25 5月, 2011 2 次提交
  4. 10 4月, 2011 1 次提交
  5. 23 3月, 2011 1 次提交
  6. 14 3月, 2011 1 次提交
    • A
      open-style analog of vfs_path_lookup() · 73d049a4
      Al Viro 提交于
      new function: file_open_root(dentry, mnt, name, flags) opens the file
      vfs_path_lookup would arrive to.
      
      Note that name can be empty; in that case the usual requirement that
      dentry should be a directory is lifted.
      
      open-coded equivalents switched to it, may_open() got down exactly
      one caller and became static.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      73d049a4
  7. 27 1月, 2011 1 次提交
  8. 14 1月, 2011 3 次提交
  9. 25 11月, 2010 1 次提交
    • W
      uml: disable winch irq before freeing handler data · 69e83dad
      Will Newton 提交于
      Disable the winch irq early to make sure we don't take an interrupt part
      way through the freeing of the handler data, resulting in a crash on
      shutdown:
      
        winch_interrupt : read failed, errno = 9
        fd 13 is losing SIGWINCH support
        ------------[ cut here ]------------
        WARNING: at lib/list_debug.c:48 list_del+0xc6/0x100()
        list_del corruption, next is LIST_POISON1 (00100100)
        082578c8:  [<081fd77f>] dump_stack+0x22/0x24
        082578e0:  [<0807a18a>] warn_slowpath_common+0x5a/0x80
        08257908:  [<0807a23e>] warn_slowpath_fmt+0x2e/0x30
        08257920:  [<08172196>] list_del+0xc6/0x100
        08257940:  [<08060244>] free_winch+0x14/0x80
        08257958:  [<080606fb>] winch_interrupt+0xdb/0xe0
        08257978:  [<080a65b5>] handle_IRQ_event+0x35/0xe0
        08257998:  [<080a8717>] handle_edge_irq+0xb7/0x170
        082579bc:  [<08059bc4>] do_IRQ+0x34/0x50
        082579d4:  [<08059e1b>] sigio_handler+0x5b/0x80
        082579ec:  [<0806a374>] sig_handler_common+0x44/0xb0
        08257a68:  [<0806a538>] sig_handler+0x38/0x50
        08257a78:  [<0806a77c>] handle_signal+0x5c/0xa0
        08257a9c:  [<0806be28>] hard_handler+0x18/0x20
        08257aac:  [<00c14400>] 0xc14400
      Signed-off-by: NWill Newton <will.newton@gmail.com>
      Acked-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      69e83dad
  10. 19 10月, 2010 1 次提交
    • A
      uml: kill big kernel lock · 9a181c58
      Arnd Bergmann 提交于
      Three uml device drivers still use the big kernel lock,
      but all of them can be safely converted to using
      a per-driver mutex instead. Most likely this is not
      even necessary, so after further review these can
      and should be removed as well.
      
      The exec system call no longer requires the BKL either,
      so remove it from there, too.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: user-mode-linux-devel@lists.sourceforge.net
      9a181c58
  11. 16 10月, 2010 1 次提交
    • F
      uml: fix build · e3c6cf61
      FUJITA Tomonori 提交于
      Fix a build error introduced by d6d1b650 ("param: simple
      locking for sysfs-writable charp parameters").
      
          CC      arch/um/kernel/trap.o
        arch/um/drivers/hostaudio_kern.c: In function 'hostaudio_open':
        arch/um/drivers/hostaudio_kern.c:204: error: '__param_dsp' undeclared (first use in this function)
        arch/um/drivers/hostaudio_kern.c:204: error: (Each undeclared identifier is reported only once
        arch/um/drivers/hostaudio_kern.c:204: error: for each function it appears in.)
        arch/um/drivers/hostaudio_kern.c: In function 'hostmixer_open_mixdev':
        arch/um/drivers/hostaudio_kern.c:265: error: '__param_mixer' undeclared (first use in this function)
        arch/um/drivers/hostaudio_kern.c:272: error: '__param_dsp' undeclared (first use in this function)
      Reported-by: NToralf Förster <toralf.foerster@gmx.de>
      Tested-by: NToralf Förster <toralf.foerster@gmx.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e3c6cf61
  12. 15 10月, 2010 2 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
    • T
      ubd: fix incorrect sector handling during request restart · 47526903
      Tejun Heo 提交于
      Commit f81f2f7c (ubd: drop unnecessary rq->sector manipulation)
      dropped request->sector manipulation in preparation for global request
      handling cleanup; unfortunately, it incorrectly assumed that the
      updated sector wasn't being used.
      
      ubd tries to issue as many requests as possible to io_thread.  When
      issuing fails due to memory pressure or other reasons, the device is
      put on the restart list and issuing stops.  On IO completion, devices
      on the restart list are scanned and IO issuing is restarted.
      
      ubd issues IOs sg-by-sg and issuing can be stopped in the middle of a
      request, so each device on the restart queue needs to remember where
      to restart in its current request.  ubd needs to keep track of the
      issue position itself because,
      
      * blk_rq_pos(req) is now updated by the block layer to keep track of
        _completion_ position.
      
      * Multiple io_req's for the current request may be in flight, so it's
        difficult to tell where blk_rq_pos(req) currently is.
      
      Add ubd->rq_pos to keep track of the issue position and use it to
      correctly restart io_req issue.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NRichard Weinberger <richard@nod.at>
      Tested-by: NRichard Weinberger <richard@nod.at>
      Tested-by: NChris Frey <cdfrey@foursquare.net>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      47526903
  13. 30 9月, 2010 1 次提交
    • B
      um: Proper Fix for f25c80a4: remove duplicate structure field initialization · 9337057d
      Boaz Harrosh 提交于
      uml_net_set_mac() was broken and luckily it was never used, before.
      What it was trying to do is spin_lock before memcopy the mac address.
      Linus attempted to fix it in assumption that someone decided the
      lock was needed. But since it was never ever used at all, and was
      just dead code, I think we can assume that it is not needed, after
      all.
      
      On the other hand patch [f25c80a4] was trying to use eth_mac_addr()
      in eth_configure(), *which was the real fallout*. Because of state
      checks done inside eth_mac_addr() the address was never set. I have
      not reintroduced the memcpy wrapper, but I've put a comment for future
      cats.
      
      The code now is back to exactly as it was before [f25c80a4]. With
      the cleanup applied. If the spin_lock is indeed needed then a contender
      should supply a test case that fails, then fix it with the proper
      locking, as a separate unrelated patch.
      
      CC: Julia Lawall <julia@diku.dk>
      CC: David S. Miller <davem@davemloft.net>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Al Viro <viro@ZenIV.linux.org.uk>
      Tested-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9337057d
  14. 21 8月, 2010 1 次提交
  15. 11 8月, 2010 1 次提交
    • R
      param: simple locking for sysfs-writable charp parameters · d6d1b650
      Rusty Russell 提交于
      Since the writing to sysfs can free the old one, we need to block that
      when we access the charp variables.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Dan Williams <dcbw@redhat.com>
      Cc: John W. Linville <linville@tuxdriver.com>
      Cc: Jing Huang <huangj@brocade.com>
      Cc: James E.J. Bottomley <James.Bottomley@suse.de>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: libertas-dev@lists.infradead.org
      Cc: linux-wireless@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Cc: linux-usb@vger.kernel.org
      d6d1b650
  16. 10 8月, 2010 1 次提交
    • R
      um: call free_irq() only on enabled channels · 47562277
      Richard Weinberger 提交于
      When I use OpenSUSE-11.2 on UML (> 2.6.25)
      I get lots of such errors:
      
      Registering fd 1 twice
      Irqs : 3, 3
      Ids : 0x09cb41a0, 0x09cb4120
      ------------[ cut here ]------------
      WARNING: at kernel/irq/manage.c:896 __free_irq+0x79/0x11a()
      Trying to free already-free IRQ 3
      Modules linked in:
      09dadc6c:  [<081b2edb>] dump_stack+0x1c/0x20
      09dadc84:  [<080716da>] warn_slowpath_common+0x49/0x77
      09dadc9c:  [<08071772>] warn_slowpath_fmt+0x26/0x2a
      09dadcb4:  [<08094e08>] __free_irq+0x79/0x11a
      09dadce4:  [<08094ed6>] free_irq+0x2d/0x49
      09dadcf4:  [<0805b4bc>] close_one_chan+0x70/0x9c
      09dadd0c:  [<0805b833>] close_chan+0x17/0x22
      09dadd1c:  [<0805bdda>] enable_chan+0x70/0x7c
      09dadd3c:  [<0805cbb7>] line_open+0x34/0x9f
      09dadd54:  [<0805b21e>] con_open+0x13/0x35
      09dadd6c:  [<0814dc89>] tty_open+0x285/0x384
      09dadda0:  [<080b754e>] chrdev_open+0xe0/0xf9
      09daddc0:  [<080b3fb2>] __dentry_open+0xf3/0x1e2
      09dadde4:  [<080b4142>] nameidata_to_filp+0x35/0x49
      09daddfc:  [<080bd270>] do_last+0x409/0x50e
      09dade28:  [<080bea04>] do_filp_open+0x175/0x446
      09dadecc:  [<080b3d89>] do_sys_open+0x4a/0x128
      09dadf04:  [<080b3ea2>] sys_open+0x19/0x21
      09dadf28:  [<0805ab5a>] handle_syscall+0x7a/0x98
      09dadf78:  [<08068441>] userspace+0x2c9/0x370
      09dadfe0:  [<08058bb3>] fork_handler+0x53/0x5b
      09dadffc:  [<00766564>] 0x766564
      
      ---[ end trace 9ebc1094aaf4bded ]---
      
      This patch fixes the issue.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      47562277
  17. 08 8月, 2010 1 次提交
    • A
      block: push down BKL into .open and .release · 6e9624b8
      Arnd Bergmann 提交于
      The open and release block_device_operations are currently
      called with the BKL held. In order to change that, we must
      first make sure that all drivers that currently rely
      on this have no regressions.
      
      This blindly pushes the BKL into all .open and .release
      operations for all block drivers to prepare for the
      next step. The drivers can subsequently replace the BKL
      with their own locks or remove it completely when it can
      be shown that it is not needed.
      
      The functions blkdev_get and blkdev_put are the only
      remaining users of the big kernel lock in the block
      layer, besides a few uses in the ioctl code, none
      of which need to serialize with blkdev_{get,put}.
      
      Most of these two functions is also under the protection
      of bdev->bd_mutex, including the actual calls to
      ->open and ->release, and the common code does not
      access any global data structures that need the BKL.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      6e9624b8
  18. 22 7月, 2010 1 次提交
    • J
      arch/um/drivers: remove duplicate structure field initialization · f25c80a4
      Julia Lawall 提交于
      There are two initializations of ndo_set_mac_address, one to a local
      function that is not used otherwise and one to a function that is defined
      elsewhere.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      identifier I, s, fld;
      position p0,p;
      expression E;
      @@
      
      struct I s =@p0 { ... .fld@p = E, ...};
      
      @s@
      identifier I, s, r.fld;
      position r.p0,p;
      expression E;
      @@
      
      struct I s =@p0 { ... .fld@p = E, ...};
      
      @script:python@
      p0 << r.p0;
      fld << r.fld;
      ps << s.p;
      pr << r.p;
      @@
      
      if int(ps[0].line)<int(pr[0].line) or int(ps[0].column)<int(pr[0].column):
        cocci.print_main(fld,p0)
      // </smpl>
      
      akpm:
      
      - Use the standard eth_mac_addr() in uml_net_set_mac()
      
      - Remove unneeded and racy local set_ether_mac()
      
      - Remove duplicated (and incorrect)
        uml_netdev_ops.ndo_set_mac_address initializer.
      
      Fixes 8bb95b39 ("uml: convert network
      device to netdevice ops").
      
      [akpm@linux-foundation.org: rework as above]
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f25c80a4
  19. 12 7月, 2010 1 次提交
    • A
      sound: push BKL into open functions · 90dc763f
      Arnd Bergmann 提交于
      This moves the lock_kernel() call from soundcore_open
      to the individual OSS device drivers, where we can deal
      with it one driver at a time if needed, or just kill
      off the drivers.
      
      All core components in ALSA already provide
      adequate locking in their open()-functions
      and do not require the big kernel lock, so
      there is no need to add the BKL there.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      90dc763f
  20. 22 5月, 2010 1 次提交
  21. 17 5月, 2010 2 次提交
  22. 20 4月, 2010 1 次提交
  23. 19 4月, 2010 1 次提交
  24. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  25. 07 3月, 2010 1 次提交
  26. 04 3月, 2010 1 次提交
  27. 26 2月, 2010 1 次提交