• Hugh Dickins's avatar
    tmpfs: support SEEK_DATA and SEEK_HOLE · 4fb5ef08
    Hugh Dickins authored
    It's quite easy for tmpfs to scan the radix_tree to support llseek's new
    SEEK_DATA and SEEK_HOLE options: so add them while the minutiae are still
    on my mind (in particular, the !PageUptodate-ness of pages fallocated but
    still unwritten).
    
    But I don't know who actually uses SEEK_DATA or SEEK_HOLE, and whether it
    would be of any use to them on tmpfs.  This code adds 92 lines and 752
    bytes on x86_64 - is that bloat or worthwhile?
    
    [akpm@linux-foundation.org: fix warning with CONFIG_TMPFS=n]
    Signed-off-by: default avatarHugh Dickins <hughd@google.com>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Josef Bacik <josef@redhat.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Andreas Dilger <adilger@dilger.ca>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Marco Stornelli <marco.stornelli@gmail.com>
    Cc: Jeff liu <jeff.liu@oracle.com>
    Cc: Chris Mason <chris.mason@oracle.com>
    Cc: Sunil Mushran <sunil.mushran@oracle.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    4fb5ef08
shmem.c 77.6 KB