mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 05:15:23 +02:00

no_llseek had been defined to NULL two years ago, in commit 868941b144
("fs: remove no_llseek")
To quote that commit,
At -rc1 we'll need do a mechanical removal of no_llseek -
git grep -l -w no_llseek | grep -v porting.rst | while read i; do
sed -i '/\<no_llseek\>/d' $i
done
would do it.
Unfortunately, that hadn't been done. Linus, could you do that now, so
that we could finally put that thing to rest? All instances are of the
form
.llseek = no_llseek,
so it's obviously safe.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
68 lines
1.5 KiB
C
68 lines
1.5 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2004 IBM Corporation
|
|
* Authors:
|
|
* Leendert van Doorn <leendert@watson.ibm.com>
|
|
* Dave Safford <safford@watson.ibm.com>
|
|
* Reiner Sailer <sailer@watson.ibm.com>
|
|
* Kylene Hall <kjhall@us.ibm.com>
|
|
*
|
|
* Copyright (C) 2013 Obsidian Research Corp
|
|
* Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
|
|
*
|
|
* Device file system interface to the TPM
|
|
*/
|
|
#include <linux/slab.h>
|
|
#include "tpm-dev.h"
|
|
|
|
static int tpm_open(struct inode *inode, struct file *file)
|
|
{
|
|
struct tpm_chip *chip;
|
|
struct file_priv *priv;
|
|
|
|
chip = container_of(inode->i_cdev, struct tpm_chip, cdev);
|
|
|
|
/* It's assured that the chip will be opened just once,
|
|
* by the check of is_open variable, which is protected
|
|
* by driver_lock. */
|
|
if (test_and_set_bit(0, &chip->is_open)) {
|
|
dev_dbg(&chip->dev, "Another process owns this TPM\n");
|
|
return -EBUSY;
|
|
}
|
|
|
|
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
|
if (priv == NULL)
|
|
goto out;
|
|
|
|
tpm_common_open(file, chip, priv, NULL);
|
|
|
|
return 0;
|
|
|
|
out:
|
|
clear_bit(0, &chip->is_open);
|
|
return -ENOMEM;
|
|
}
|
|
|
|
/*
|
|
* Called on file close
|
|
*/
|
|
static int tpm_release(struct inode *inode, struct file *file)
|
|
{
|
|
struct file_priv *priv = file->private_data;
|
|
|
|
tpm_common_release(file, priv);
|
|
clear_bit(0, &priv->chip->is_open);
|
|
kfree(priv);
|
|
|
|
return 0;
|
|
}
|
|
|
|
const struct file_operations tpm_fops = {
|
|
.owner = THIS_MODULE,
|
|
.open = tpm_open,
|
|
.read = tpm_common_read,
|
|
.write = tpm_common_write,
|
|
.poll = tpm_common_poll,
|
|
.release = tpm_release,
|
|
};
|