compat-drivers: backport usage of shmem_truncate_range() on i915
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Sat, 29 Sep 2012 05:41:21 +0000 (22:41 -0700)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Sat, 29 Sep 2012 05:42:03 +0000 (22:42 -0700)
commit8fd9250ee83a9578e37dfc2dac09ed22aadb0c9f
tree3d9efe8ccaf1066ed81c2bfc33c1a13ceb4936c0
parent4ec7081183d2a08e0264f7ea6a525284dafebc01
compat-drivers: backport usage of shmem_truncate_range() on i915

Backport e2377fe0b -- this could likely be implemented
on compat.git but I'd much prefer a better review of that.
For now this stays as a patch.

commit e2377fe0b65e3c7577ff6df1701c56ef477d336f
Author: Hugh Dickins <hughd@google.com>
Date:   Mon Jun 27 16:18:19 2011 -0700

    drm/i915: use shmem_truncate_range

    The interface to ->truncate_range is changing very slightly: once "tmpfs:
    take control of its truncate_range" has been applied, this can be applied.
     For now there is only a slight inefficiency while this remains unapplied,
    but it will soon become essential for managing shmem's use of swap.

    Change i915_gem_object_truncate() to use shmem_truncate_range() directly:
    which should also spare i915 later change if we switch from
    inode_operations->truncate_range to file_operations->fallocate.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Keith Packard <keithp@keithp.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
patches/drm/08-shmem_truncate_range.patch [new file with mode: 0644]