aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-01-03 08:09:47 -0500
committerDavid Herrmann <dh.herrmann@gmail.com>2014-03-16 07:17:03 -0400
commit31bbe16f6d88622d6731fa2cb4ab38d57d844ac1 (patch)
tree2a123ae13d3e3a9de36f82304b74b8052545cb87 /fs/dcache.c
parent786a7828bc74b9b1466e83abb200b75f80f94121 (diff)
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>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 265e0ce9769c..66dc62cb766d 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3112,6 +3112,7 @@ char *simple_dname(struct dentry *dentry, char *buffer, int buflen)
3112 end = ERR_PTR(-ENAMETOOLONG); 3112 end = ERR_PTR(-ENAMETOOLONG);
3113 return end; 3113 return end;
3114} 3114}
3115EXPORT_SYMBOL(simple_dname);
3115 3116
3116/* 3117/*
3117 * Write full pathname from the root of the filesystem into the buffer. 3118 * Write full pathname from the root of the filesystem into the buffer.