diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-01-03 14:09:47 +0100 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-12-11 10:29:50 +0900 |
commit | bf910d1753b5084dca9f8e7920c58bed2a672621 (patch) | |
tree | 1e9b3a7a8f6ef09db9d2c167772687929355dcfc /fs | |
parent | 570d34b5f554908e95e74bd6dd6f35a7c6c41c65 (diff) | |
download | renesas_kernel-bf910d1753b5084dca9f8e7920c58bed2a672621.tar.gz renesas_kernel-bf910d1753b5084dca9f8e7920c58bed2a672621.tar.bz2 renesas_kernel-bf910d1753b5084dca9f8e7920c58bed2a672621.zip |
drm: add pseudo filesystem for shared inodes
Our current DRM design uses a single address_space for all users of the
same DRM device. However, there is no way to create an anonymous
address_space without an underlying inode. Therefore, we wait for the
first ->open() callback on a registered char-dev and take-over the inode
of the char-dev. This worked well so far, but has several drawbacks:
- We screw with FS internals and rely on some non-obvious invariants like
inode->i_mapping being the same as inode->i_data for char-devs.
- We don't have any address_space prior to the first ->open() from
user-space. This leads to ugly fallback code and we cannot allocate
global objects early.
As pointed out by Al-Viro, fs/anon_inode.c is *not* supposed to be used by
drivers for anonymous inode-allocation. Therefore, this patch follows the
proposed alternative solution and adds a pseudo filesystem mount-point to
DRM. We can then allocate private inodes including a private address_space
for each DRM device at initialization time.
Note that we could use:
sysfs_get_inode(sysfs_mnt->mnt_sb, drm_device->dev->kobj.sd);
to get access to the underlying sysfs-inode of a "struct device" object.
However, most of this information is currently hidden and it's not clear
whether this address_space is suitable for driver access. Thus, unless
linux allows anonymous address_space objects or driver-core provides a
public inode per device, we're left with our own private internal mount
point.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
(cherry picked from commit 31bbe16f6d88622d6731fa2cb4ab38d57d844ac1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dcache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 43661277720..8d1c8697ebd 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3115,6 +3115,7 @@ char *simple_dname(struct dentry *dentry, char *buffer, int buflen) end = ERR_PTR(-ENAMETOOLONG); return end; } +EXPORT_SYMBOL(simple_dname); /* * Write full pathname from the root of the filesystem into the buffer. |