1. 09 9月, 2010 20 次提交
  2. 07 9月, 2010 5 次提交
  3. 24 8月, 2010 4 次提交
  4. 22 8月, 2010 2 次提交
  5. 21 8月, 2010 1 次提交
  6. 20 8月, 2010 1 次提交
  7. 18 8月, 2010 2 次提交
    • N
      tty: fix fu_list abuse · d996b62a
      Nick Piggin 提交于
      tty: fix fu_list abuse
      
      tty code abuses fu_list, which causes a bug in remount,ro handling.
      
      If a tty device node is opened on a filesystem, then the last link to the inode
      removed, the filesystem will be allowed to be remounted readonly. This is
      because fs_may_remount_ro does not find the 0 link tty inode on the file sb
      list (because the tty code incorrectly removed it to use for its own purpose).
      This can result in a filesystem with errors after it is marked "clean".
      
      Taking idea from Christoph's initial patch, allocate a tty private struct
      at file->private_data and put our required list fields in there, linking
      file and tty. This makes tty nodes behave the same way as other device nodes
      and avoid meddling with the vfs, and avoids this bug.
      
      The error handling is not trivial in the tty code, so for this bugfix, I take
      the simple approach of using __GFP_NOFAIL and don't worry about memory errors.
      This is not a problem because our allocator doesn't fail small allocs as a rule
      anyway. So proper error handling is left as an exercise for tty hackers.
      
      [ Arguably filesystem's device inode would ideally be divorced from the
      driver's pseudo inode when it is opened, but in practice it's not clear whether
      that will ever be worth implementing. ]
      
      Cc: linux-kernel@vger.kernel.org
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d996b62a
    • N
      fs: cleanup files_lock locking · ee2ffa0d
      Nick Piggin 提交于
      fs: cleanup files_lock locking
      
      Lock tty_files with a new spinlock, tty_files_lock; provide helpers to
      manipulate the per-sb files list; unexport the files_lock spinlock.
      
      Cc: linux-kernel@vger.kernel.org
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ee2ffa0d
  8. 17 8月, 2010 3 次提交
    • G
      of: Fix missing includes · f1ca09b2
      Grant Likely 提交于
      This patch fixes missing includes from a number of .c files because
      the code (wrongfully) depended on prom.h including them.  The include
      of linux/of_address.h was removed in microblaze prom.h in commit
      "of/address: Clean up function declarations" (sha1 id 22ae782f), but
      not fixed in some callers.  This patch fixes them up.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NMichal Simek <monstr@monstr.eu>
      f1ca09b2
    • J
      vt,console,kdb: preserve console_blanked while in kdb · beed5336
      Jason Wessel 提交于
      Commit b45cfba4 (vt,console,kdb:
      implement atomic console enter/leave functions) introduced the ability
      to atomically change the console mode with kernel mode setting but did
      not preserve the state of the console_blanked variable.
      
      The console_blanked variable must be restored when executing the
      con_debug_leave() or further kernel mode set changes (such as using
      chvt X) will fail to correctly set the state of console.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      CC: Andrew Morton <akpm@linux-foundation.org>
      beed5336
    • J
      vt: fix regression warnings from KMS merge · fed891c8
      Jason Wessel 提交于
      Fix the following new sparse warnings in vt.c introduced by the commit
      b45cfba4 (vt,console,kdb: implement
      atomic console enter/leave functions):
      
      drivers/char/vt.c:197:5: warning: symbol 'saved_fg_console' was not declared. Should it be static?
      drivers/char/vt.c:198:5: warning: symbol 'saved_last_console' was not declared. Should it be static?
      drivers/char/vt.c:199:5: warning: symbol 'saved_want_console' was not declared. Should it be static?
      drivers/char/vt.c:200:5: warning: symbol 'saved_vc_mode' was not declared. Should it be static?
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      CC: Andrew Morton <akpm@linux-foundation.org>
      fed891c8
  9. 12 8月, 2010 1 次提交
  10. 11 8月, 2010 1 次提交
    • S
      kfifo: fix kfifo miss use of nozami.c · 4457d984
      Stefani Seibold 提交于
      There are different types of a fifo which can not handled in C without a
      lot of overhead.  So i decided to write the API as a set of macros, which
      is the only way to do a kind of template meta programming without C++.
      This macros handles the different types of fifos in a transparent way.
      
      There are a lot of benefits:
      
      - Compile time handling of the different fifo types
      - Better performance (a save put or get of an integer does only generate
        9 assembly instructions on a x86)
      - Type save
      - Cleaner interface, the additional kfifo_..._rec() functions are gone
      - Easier to use
      - Less error prone
      - Different types of fifos: it is now possible to define a int fifo or
        any other type. See below for an example.
      - Smaller footprint for none byte type fifos
      - No need of creating a second hidden variable, like in the old DEFINE_KFIFO
      
      The API was not changed.
      
      There are now real in place fifos where the data space is a part of the
      structure.  The fifo needs now 20 byte plus the fifo space.  Dynamic
      assigned or allocated create a little bit more code.
      
      Most of the macros code will be optimized away and simple generate a
      function call.  Only the really small one generates inline code.
      
      Additionally you can now create fifos for any data type, not only the
      "unsigned char" byte streamed fifos.
      
      There is also a new kfifo_put and kfifo_get function, to handle a single
      element in a fifo.  This macros generates inline code, which is lit bit
      larger but faster.
      
      I know that this kind of macros are very sophisticated and not easy to
      maintain.  But i have all tested and it works as expected.  I analyzed the
      output of the compiler and for the x86 the code is as good as hand written
      assembler code.  For the byte stream fifo the generate code is exact the
      same as with the current kfifo implementation.  For all other types of
      fifos the code is smaller before, because the interface is easier to use.
      
      The main goal was to provide an API which is very intuitive, save and easy
      to use.  So linux will get now a powerful fifo API which provides all what
      a developer needs.  This will save in the future a lot of kernel space,
      since there is no need to write an own implementation.  Most of the device
      driver developers need a fifo, and also deep kernel development will gain
      benefit from this API.
      
      Here are the results of the text section usage:
      
      Example 1:
                              kfifo_put/_get  kfifo_in/out    current kfifo
      dynamic allocated       0x000002a8      0x00000291      0x00000299
      in place                0x00000291      0x0000026e      0x00000273
      
      kfifo.c                 new             old
      text section size       0x00000be5      0x000008b2
      
      As you can see, kfifo_put/kfifo_get creates a little bit more code than
      kfifo_in/kfifo_out, but it is much faster (the code is inline).
      
      The code is complete hand crafted and optimized.  The text section size is
      as small as possible.  You get all the fifo handling in only 3 kb.  This
      includes type safe fix size records, dynamic records and DMA handling.
      
      This should be the final version. All requested features are implemented.
      
      Note: Most features of this API doesn't have any users.  All functions
      which are not used in the next 9 months will be removed.  So, please adapt
      your drivers and other sources as soon as possible to the new API and post
      it.
      
      This are the features which are currently not used in the kernel:
      
      kfifo_to_user()
      kfifo_from_user()
      kfifo_dma_....() macros
      kfifo_esize()
      kfifo_recsize()
      kfifo_put()
      kfifo_get()
      
      The fixed size record elements, exclude "unsigned char" fifo's and the
      variable size records fifo's
      
      This patch:
      
      User of the kernel fifo should never bypass the API and directly access
      the fifo structure.  Otherwise it will be very hard to maintain the API.
      Signed-off-by: NStefani Seibold <stefani@seibold.net>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4457d984