1. 07 11月, 2007 1 次提交
    • A
      [TTY]: Fix network driver interactions with TCGET/SET calls. · 0fc00e24
      Alan Cox 提交于
      Dave Miller noted various cases where line disciplines for things like
      ppp go poking around in termios themselves in ways that broke with the
      new termios code. Rather than have them all learning about termios
      internals provide proper methods for this
      
      - tty_mode_ioctl()
      
      	This handles all the terminal mode handling for speed/carrier
      etc and none of the methods are ldisc dependant so they can be called
      by any user
      
      - tty_perform_flush()
      
      	This extracts the flush functionality and enables pppd the ppp
      layer to share it cleanly.
      
      The existing n_tty_ioctl code is refactored in this patch to provide
      the new functions and to call them itself appropriately. This patch
      has no (intended) behaviour changes and simply prepares for the other
      fixes.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0fc00e24
  2. 17 10月, 2007 2 次提交
    • A
      tty: expose new methods needed for drivers to get termios right · 5f519d72
      Alan Cox 提交于
      This adds three new functions (or in one case to be more exact makes it
      always available)
      
      tty_termios_copy_hw
      
      Copies all the hardware settings from one termios structure to the other.
      This is intended for drivers that support little or no hardware setting
      
      tty_termios_encode_baud_rate
      
      Allows you to set the input and output baud rate in a termios structure.  A
      driver is supposed to set the resulting baud rate from a request so most
      will want to use this function to set the resulting input and output rates
      to match the hardware values.  Internally it knows about keeping Bxxx
      encoding when possible to maximise compatibility.
      
      tty_encode_baud_rate
      
      As above but for the tty's own current termios structure
      
      I suspect this will initially need some tweaking as it gets enabled by
      driver patches over the next few mm cycles so consider this lot -mm only
      for the moment so it can stabilize and end up neat before it goes to base.
      
      I've tried not to break any obscure architectures - if you get a speed you
      can't represent the code will print warnings on non updated termios systems
      but not break.
      
      Once this is merged and seems sane I've got a growing pile of driver
      updates to use it - notably for USB serial drivers.
      
      [akpm@linux-foundation.org: cleanups]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f519d72
    • A
      tty.h: remove dead define · 328dfd0f
      Alan Cox 提交于
      No longer used. TTY_FLIPBUF_SIZE will also go soon but needs a couple of
      other cleanups first
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      328dfd0f
  3. 13 10月, 2007 1 次提交
  4. 12 8月, 2007 1 次提交
    • A
      fix serial buffer memory leak · 42fd552e
      Alan Cox 提交于
      Patch c5c34d48 (tty: flush flip buffer on
      ldisc input queue flush) introduces a race condition which can lead to memory
      leaks.
      
      The problem can be triggered when tcflush() is called when data are being
      pushed to the line discipline driver by flush_to_ldisc().
      
      flush_to_ldisc() releases tty->buf.lock when calling the line discipline
      receive_buf function. At that poing tty_buffer_flush() kicks in and sets both
      tty->buf.head and tty->buf.tail to NULL. When flush_to_ldisc() finishes, it
      restores tty->buf.head but doesn't touch tty->buf.tail. This corrups the
      buffer queue, and the next call to tty_buffer_request_room() will allocate a
      new buffer and overwrite tty->buf.head. The previous buffer is then lost
      forever without being released.
      
      (Thanks to Laurent for the above text, for finding, disgnosing and reporting
      the bug)
      
      - Use tty->flags bits for the flush status.
      
      - Wait for the flag to clear again before returning
      
      - Fix the doc error noted
      
      - Fix flush of empty queue leaving stale flushpending
      
      [akpm@linux-foundation.org: cleanup]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Acked-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Laurent Pinchart <laurentp@cse-semaphore.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42fd552e
  5. 17 7月, 2007 2 次提交
    • M
      Audit: add TTY input auditing · 522ed776
      Miloslav Trmac 提交于
      Add TTY input auditing, used to audit system administrator's actions.  This is
      required by various security standards such as DCID 6/3 and PCI to provide
      non-repudiation of administrator's actions and to allow a review of past
      actions if the administrator seems to overstep their duties or if the system
      becomes misconfigured for unknown reasons.  These requirements do not make it
      necessary to audit TTY output as well.
      
      Compared to an user-space keylogger, this approach records TTY input using the
      audit subsystem, correlated with other audit events, and it is completely
      transparent to the user-space application (e.g.  the console ioctls still
      work).
      
      TTY input auditing works on a higher level than auditing all system calls
      within the session, which would produce an overwhelming amount of mostly
      useless audit events.
      
      Add an "audit_tty" attribute, inherited across fork ().  Data read from TTYs
      by process with the attribute is sent to the audit subsystem by the kernel.
      The audit netlink interface is extended to allow modifying the audit_tty
      attribute, and to allow sending explanatory audit events from user-space (for
      example, a shell might send an event containing the final command, after the
      interactive command-line editing and history expansion is performed, which
      might be difficult to decipher from the TTY input alone).
      
      Because the "audit_tty" attribute is inherited across fork (), it would be set
      e.g.  for sshd restarted within an audited session.  To prevent this, the
      audit_tty attribute is cleared when a process with no open TTY file
      descriptors (e.g.  after daemon startup) opens a TTY.
      
      See https://www.redhat.com/archives/linux-audit/2007-June/msg00000.html for a
      more detailed rationale document for an older version of this patch.
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: NMiloslav Trmac <mitr@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Cc: Casey Schaufler <casey@schaufler-ca.com>
      Cc: Steve Grubb <sgrubb@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      522ed776
    • A
      Prevent an O_NDELAY writer from blocking when a tty write is blocked by the tty atomic writer mutex · 9c1729db
      Alan Cox 提交于
      Without this a tty write could block if a previous blocking tty write was
      in progress on the same tty and blocked by a line discipline or hardware
      event.  Originally found and reported by Dave Johnson.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Acked-by: NDave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c1729db
  6. 09 5月, 2007 1 次提交
    • E
      tty: introduce no_tty and use it in selinux · 98a27ba4
      Eric W. Biederman 提交于
      While researching the tty layer pid leaks I found a weird case in selinux when
      we drop a controlling tty because of inadequate permissions we don't do the
      normal hangup processing.  Which is a problem if it happens the session leader
      has exec'd something that can no longer access the tty.
      
      We already have code in the kernel to handle this case in the form of the
      TIOCNOTTY ioctl.  So this patch factors out a helper function that is the
      essence of that ioctl and calls it from the selinux code.
      
      This removes the inconsistency in handling dropping of a controlling tty and
      who knows it might even make some part of user space happy because it received
      a SIGHUP it was expecting.
      
      In addition since this removes the last user of proc_set_tty outside of
      tty_io.c proc_set_tty is made static and removed from tty.h
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: James Morris <jmorris@namei.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      98a27ba4
  7. 13 2月, 2007 3 次提交
    • E
      [PATCH] tty: update the tty layer to work with struct pid · ab521dc0
      Eric W. Biederman 提交于
      Of kernel subsystems that work with pids the tty layer is probably the largest
      consumer.  But it has the nice virtue that the assiation with a session only
      lasts until the session leader exits.  Which means that no reference counting
      is required.  So using struct pid winds up being a simple optimization to
      avoid hash table lookups.
      
      In the long term the use of pid_nr also ensures that when we have multiple pid
      spaces mixed everything will work correctly.
      Signed-off-by: NEric W. Biederman <eric@maxwell.lnxi.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ab521dc0
    • E
      [PATCH] pid: replace is_orphaned_pgrp with is_current_pgrp_orphaned · 3e7cd6c4
      Eric W. Biederman 提交于
      Every call to is_orphaned_pgrp passed in process_group(current) which is racy
      with respect to another thread changing our process group.  It didn't bite us
      because we were dealing with integers and the worse we would get would be a
      stale answer.
      
      In switching the checks to use struct pid to be a little more efficient and
      prepare the way for pid namespaces this race became apparent.
      
      So I simplified the calls to the more specialized is_current_pgrp_orphaned so
      I didn't have to worry about making logic changes to avoid the race.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3e7cd6c4
    • E
      [PATCH] tty: make __proc_set_tty static · cdc62330
      Eric W. Biederman 提交于
      The aim of this patch set is to start wrapping up the struct pid conversions.
      As such this patchset culminates with the removal of kill_pg, kill_pg_info,
      __kill_pg_info, do_each_task_pid, and while_each_task_pid.
      
      kill_proc, daemonize, and kernel_thread are still in my sights but there is
      still work to get to them.
      
      The first three are basic cleanups around disassociate_ctty, while working on
      converting it I found several issues.  tty_old_pgrp can be a tricky concept to
      wrap your head around.
      
       1 tty: Make __proc_set_tty static.
       2 tty: Clarify disassociate_ctty
       3 tty: Fix the locking for signal->session in disassociate_ctty
      
      These just stop using the old helper functions.
      
       4 signal: Use kill_pgrp not kill_pg in the sunos compatibility code.
       5 signal: Rewrite kill_something_info so it uses newer helpers.
      
      Then the grind to convert the tty layer and all of it's helper functions to
      struct pid.
      
       6 pid: Make session_of_pgrp use struct pid instead of pid_t.
       7 pid: Use struct pid for talking about process groups in exit.c
       8 pid: Replace is_orphaned_pgrp with is_current_pgrp_orphaned
       9 tty: Update the tty layer to work with struct pid.
      
      A final helper function update.
      
      10 pid: Replace do/while_each_task_pid with do/while_each_pid_task
      
      And the removal of the functions that are now unused.
      11 pid: Remove now unused do_each_task_pid and while_each_task_pid
      12 pid: Remove the now unused kill_pg kill_pg_info and __kill_pg_info
      
      All of these should be fairly simple and to the point.
      
      This patch:
      
      Currently all users of __proc_set_tty are in tty_io.c so make the function
      static.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cdc62330
  8. 12 2月, 2007 2 次提交
    • T
      [PATCH] consolidate line discipline number definitions · 4564f9e5
      Tilman Schmidt 提交于
      The line discipline numbers N_* are currently defined for each architecture
      individually, but (except for a seeming mistake) identically, in
      asm/termios.h.  There is no obvious reason why these numbers should be
      architecture specific, nor any apparent relationship with the termios
      structure.  The total number of these, NR_LDISCS, is defined in linux/tty.h
      anyway.  So I propose the following patch which moves the definitions of
      the individual line disciplines to linux/tty.h too.
      
      Three of these numbers (N_MASC, N_PROFIBUS_FDL, and N_SMSBLOCK) are unused
      in the current kernel, but the patch still keeps the complete set in case
      there are plans to use them yet.
      Signed-off-by: NTilman Schmidt <tilman@imap.cc>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4564f9e5
    • E
      [PATCH] vt: refactor console SAK processing · 8b6312f4
      Eric W. Biederman 提交于
      This does several things.
      - It moves looking up of the current foreground console into process
        context where we can safely take the semaphore that protects this
        operation.
      - It uses the new flavor of work queue processing.
      - This generates a factor of do_SAK, __do_SAK that runs immediately.
      - This calls __do_SAK with the console semaphore held ensuring nothing
        else happens to the console while we process the SAK operation.
      - With the console SAK processing moved into process context this
        patch removes the xchg operations that I used to attempt to attomically
        update struct pid, because of the strange locking used in the SAK processing.
        With SAK using the normal console semaphore nothing special is needed.
      
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8b6312f4
  9. 09 12月, 2006 2 次提交
    • A
      [PATCH] tty: switch to ktermios and new framework · edc6afc5
      Alan Cox 提交于
      This is the core of the switch to the new framework.  I've split it from the
      driver patches which are mostly search/replace and would encourage people to
      give this one a good hard stare.
      
      The references to BOTHER and ISHIFT are the termios values that must be
      defined by a platform once it wants to turn on "new style" ioctl support.  The
      code patches here ensure that providing
      
      1. The termios overlays the ktermios in memory
      2. The only new kernel only fields are c_ispeed/c_ospeed (or none)
      
      the existing behaviour is retained.  This is true for the patches at this
      point in time.
      
      Future patches will define BOTHER, ISHIFT and enable newer termios structures
      for each architecture, and once they are all done some of the ifdefs also
      vanish.
      
      [akpm@osdl.org: warning fix]
      [akpm@osdl.org: IRDA fix]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      edc6afc5
    • P
      [PATCH] tty: ->signal->tty locking · 24ec839c
      Peter Zijlstra 提交于
      Fix the locking of signal->tty.
      
      Use ->sighand->siglock to protect ->signal->tty; this lock is already used
      by most other members of ->signal/->sighand.  And unless we are 'current'
      or the tasklist_lock is held we need ->siglock to access ->signal anyway.
      
      (NOTE: sys_unshare() is broken wrt ->sighand locking rules)
      
      Note that tty_mutex is held over tty destruction, so while holding
      tty_mutex any tty pointer remains valid.  Otherwise the lifetime of ttys
      are governed by their open file handles.  This leaves some holes for tty
      access from signal->tty (or any other non file related tty access).
      
      It solves the tty SLAB scribbles we were seeing.
      
      (NOTE: the change from group_send_sig_info to __group_send_sig_info needs to
             be examined by someone familiar with the security framework, I think
             it is safe given the SEND_SIG_PRIV from other __group_send_sig_info
             invocations)
      
      [schwidefsky@de.ibm.com: 3270 fix]
      [akpm@osdl.org: various post-viro fixes]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NAlan Cox <alan@redhat.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jan Kara <jack@ucw.cz>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      24ec839c
  10. 02 12月, 2006 1 次提交
  11. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Separate delayable and non-delayable events. · 52bad64d
      David Howells 提交于
      Separate delayable work items from non-delayable work items be splitting them
      into a separate structure (delayed_work), which incorporates a work_struct and
      the timer_list removed from work_struct.
      
      The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
      architecture it's nearly 100 bytes in size.  This reduces that by half for the
      non-delayable type of event.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      52bad64d
  12. 01 10月, 2006 1 次提交
  13. 30 9月, 2006 2 次提交
  14. 28 8月, 2006 1 次提交
  15. 11 7月, 2006 2 次提交
  16. 29 6月, 2006 2 次提交
    • P
      [PATCH] remove active field from tty buffer structure · 33b37a33
      Paul Fulghum 提交于
      Remove 'active' field from tty buffer structure.  This was added in 2.6.16
      as part of a patch to make the new tty buffering SMP safe.  This field is
      unnecessary with the more intelligently written flush_to_ldisc that adds
      receive_room handling.
      
      Removing this field reverts to simpler logic where the tail buffer is
      always the 'active' buffer, which should not be freed by flush_to_ldisc.
      (active == buffer being filled with new data)
      
      The result is simpler, smaller, and faster tty buffer code.
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      33b37a33
    • P
      [PATCH] remove TTY_DONT_FLIP · 817d6d3b
      Paul Fulghum 提交于
      Remove TTY_DONT_FLIP tty flag.  This flag was introduced in 2.1.X kernels
      to prevent the N_TTY line discipline functions read_chan() and
      n_tty_receive_buf() from running at the same time.  2.2.15 introduced
      tty->read_lock to protect access to the N_TTY read buffer, which is the
      only state requiring protection between these two functions.
      
      The current TTY_DONT_FLIP implementation is broken for SMP, and is not
      universally honored by drivers that send data directly to the line
      discipline receive_buf function.
      
      Because TTY_DONT_FLIP is not necessary, is broken in implementation, and is
      not universally honored, it is removed.
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      817d6d3b
  17. 22 6月, 2006 1 次提交
  18. 26 4月, 2006 1 次提交
  19. 23 3月, 2006 1 次提交
  20. 11 2月, 2006 1 次提交
  21. 04 2月, 2006 1 次提交
    • P
      [PATCH] new tty buffering locking fix · 808249ce
      Paul Fulghum 提交于
      Change locking in the new tty buffering facility from using tty->read_lock,
      which is currently ignored by drivers and thus ineffective.  New locking
      uses a new tty buffering specific lock enforced centrally in the tty
      buffering code.
      
      Two drivers (esp and cyclades) are updated to use the tty buffering
      functions instead of accessing tty buffering internals directly.  This is
      required for the new locking to work.
      
      Minor checks for NULL buffers added to
      tty_prepare_flip_string/tty_prepare_flip_string_flags
      Signed-off-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      808249ce
  22. 11 1月, 2006 1 次提交
    • A
      [PATCH] TTY layer buffering revamp · 33f0f88f
      Alan Cox 提交于
      The API and code have been through various bits of initial review by
      serial driver people but they definitely need to live somewhere for a
      while so the unconverted drivers can get knocked into shape, existing
      drivers that have been updated can be better tuned and bugs whacked out.
      
      This replaces the tty flip buffers with kmalloc objects in rings. In the
      normal situation for an IRQ driven serial port at typical speeds the
      behaviour is pretty much the same, two buffers end up allocated and the
      kernel cycles between them as before.
      
      When there are delays or at high speed we now behave far better as the
      buffer pool can grow a bit rather than lose characters. This also means
      that we can operate at higher speeds reliably.
      
      For drivers that receive characters in blocks (DMA based, USB and
      especially virtualisation) the layer allows a lot of driver specific
      code that works around the tty layer with private secondary queues to be
      removed. The IBM folks need this sort of layer, the smart serial port
      people do, the virtualisers do (because a virtualised tty typically
      operates at infinite speed rather than emulating 9600 baud).
      
      Finally many drivers had invalid and unsafe attempts to avoid buffer
      overflows by directly invoking tty methods extracted out of the innards
      of work queue structs. These are no longer needed and all go away. That
      fixes various random hangs with serial ports on overflow.
      
      The other change in here is to optimise the receive_room path that is
      used by some callers. It turns out that only one ldisc uses receive room
      except asa constant and it updates it far far less than the value is
      read. We thus make it a variable not a function call.
      
      I expect the code to contain bugs due to the size alone but I'll be
      watching and squashing them and feeding out new patches as it goes.
      
      Because the buffers now dynamically expand you should only run out of
      buffering when the kernel runs out of memory for real.  That means a lot of
      the horrible hacks high performance drivers used to do just aren't needed any
      more.
      
      Description:
      
      tty_insert_flip_char is an old API and continues to work as before, as does
      tty_flip_buffer_push() [this is why many drivers dont need modification].  It
      does now also return the number of chars inserted
      
      There are also
      
      tty_buffer_request_room(tty, len)
      
      which asks for a buffer block of the length requested and returns the space
      found.  This improves efficiency with hardware that knows how much to
      transfer.
      
      and tty_insert_flip_string_flags(tty, str, flags, len)
      
      to insert a string of characters and flags
      
      For a smart interface the usual code is
      
          len = tty_request_buffer_room(tty, amount_hardware_says);
          tty_insert_flip_string(tty, buffer_from_card, len);
      
      More description!
      
      At the moment tty buffers are attached directly to the tty.  This is causing a
      lot of the problems related to tty layer locking, also problems at high speed
      and also with bursty data (such as occurs in virtualised environments)
      
      I'm working on ripping out the flip buffers and replacing them with a pool of
      dynamically allocated buffers.  This allows both for old style "byte I/O"
      devices and also helps virtualisation and smart devices where large blocks of
      data suddenely materialise and need storing.
      
      So far so good.  Lots of drivers reference tty->flip.*.  Several of them also
      call directly and unsafely into function pointers it provides.  This will all
      break.  Most drivers can use tty_insert_flip_char which can be kept as an API
      but others need more.
      
      At the moment I've added the following interfaces, if people think more will
      be needed now is a good time to say
      
       int tty_buffer_request_room(tty, size)
      
      Try and ensure at least size bytes are available, returns actual room (may be
      zero).  At the moment it just uses the flipbuf space but that will change.
      Repeated calls without characters being added are not cumulative.  (ie if you
      call it with 1, 1, 1, and then 4 you'll have four characters of space.  The
      other functions will also try and grow buffers in future but this will be a
      more efficient way when you know block sizes.
      
       int tty_insert_flip_char(tty, ch, flag)
      
      As before insert a character if there is room.  Now returns 1 for success, 0
      for failure.
      
       int tty_insert_flip_string(tty, str, len)
      
      Insert a block of non error characters.  Returns the number inserted.
      
       int tty_prepare_flip_string(tty, strptr, len)
      
      Adjust the buffer to allow len characters to be added.  Returns a buffer
      pointer in strptr and the length available.  This allows for hardware that
      needs to use functions like insl or mencpy_fromio.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NJohn Hawkes <hawkes@sgi.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      33f0f88f
  23. 09 1月, 2006 1 次提交
  24. 10 9月, 2005 1 次提交
  25. 24 6月, 2005 1 次提交
  26. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4