aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_auth.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-07-20 06:39:25 -0700
committerEric Anholt <eric@anholt.net>2007-07-20 13:39:45 -0700
commitc1119b1b092527fbb6950d0b5e51e076ddb00f29 (patch)
tree1d4b0f26e40d572e4c92eb4ebde88e60b9b137e5 /linux-core/drm_auth.c
parent35de4868361ce1fb515cf33f27e6be4c59b07f89 (diff)
Replace filp in ioctl arguments with drm_file *file_priv.
As a fallout, replace filp storage with file_priv storage for "unique identifier of a client" all over the DRM. There is a 1:1 mapping, so this should be a noop. This could be a minor performance improvement, as everything on Linux dereferenced filp to get file_priv anyway, while only the mmap ioctls went the other direction.
Diffstat (limited to 'linux-core/drm_auth.c')
-rw-r--r--linux-core/drm_auth.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/linux-core/drm_auth.c b/linux-core/drm_auth.c
index 4c48d872..f10a57b1 100644
--- a/linux-core/drm_auth.c
+++ b/linux-core/drm_auth.c
@@ -127,27 +127,26 @@ static int drm_remove_magic(struct drm_device * dev, drm_magic_t magic)
* Get a unique magic number (ioctl).
*
* \param inode device inode.
- * \param filp file pointer.
+ * \param file_priv DRM file private.
* \param cmd command.
* \param arg pointer to a resulting drm_auth structure.
* \return zero on success, or a negative number on failure.
*
* If there is a magic number in drm_file::magic then use it, otherwise
* searches an unique non-zero magic number and add it associating it with \p
- * filp.
+ * file_priv.
*/
-int drm_getmagic(struct inode *inode, struct file *filp,
+int drm_getmagic(struct inode *inode, struct drm_file *file_priv,
unsigned int cmd, unsigned long arg)
{
static drm_magic_t sequence = 0;
static DEFINE_SPINLOCK(lock);
- struct drm_file *priv = filp->private_data;
- struct drm_device *dev = priv->head->dev;
+ struct drm_device *dev = file_priv->head->dev;
struct drm_auth auth;
/* Find unique magic */
- if (priv->magic) {
- auth.magic = priv->magic;
+ if (file_priv->magic) {
+ auth.magic = file_priv->magic;
} else {
do {
spin_lock(&lock);
@@ -156,8 +155,8 @@ int drm_getmagic(struct inode *inode, struct file *filp,
auth.magic = sequence++;
spin_unlock(&lock);
} while (drm_find_file(dev, auth.magic));
- priv->magic = auth.magic;
- drm_add_magic(dev, priv, auth.magic);
+ file_priv->magic = auth.magic;
+ drm_add_magic(dev, file_priv, auth.magic);
}
DRM_DEBUG("%u\n", auth.magic);
@@ -170,18 +169,17 @@ int drm_getmagic(struct inode *inode, struct file *filp,
* Authenticate with a magic.
*
* \param inode device inode.
- * \param filp file pointer.
+ * \param file_priv DRM file private.
* \param cmd command.
* \param arg pointer to a drm_auth structure.
* \return zero if authentication successed, or a negative number otherwise.
*
- * Checks if \p filp is associated with the magic number passed in \arg.
+ * Checks if \p file_priv is associated with the magic number passed in \arg.
*/
-int drm_authmagic(struct inode *inode, struct file *filp,
+int drm_authmagic(struct inode *inode, struct drm_file *file_priv,
unsigned int cmd, unsigned long arg)
{
- struct drm_file *priv = filp->private_data;
- struct drm_device *dev = priv->head->dev;
+ struct drm_device *dev = file_priv->head->dev;
struct drm_auth auth;
struct drm_file *file;