summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-09-22 16:20:47 +0000
committerjhb <jhb@FreeBSD.org>2014-09-22 16:20:47 +0000
commit8f082668d04c6a91668059ff9bdebcfa153839f0 (patch)
tree1934338f5bf1e12f3ce97b74e9e403dcf5a32bc8 /sys/opencrypto
parent2a681a5c921fd16ac653be127abedd8baa3ab4a9 (diff)
downloadFreeBSD-src-8f082668d04c6a91668059ff9bdebcfa153839f0.zip
FreeBSD-src-8f082668d04c6a91668059ff9bdebcfa153839f0.tar.gz
Add a new fo_fill_kinfo fileops method to add type-specific information to
struct kinfo_file. - Move the various fill_*_info() methods out of kern_descrip.c and into the various file type implementations. - Rework the support for kinfo_ofile to generate a suitable kinfo_file object for each file and then convert that to a kinfo_ofile structure rather than keeping a second, different set of code that directly manipulates type-specific file information. - Remove the shm_path() and ksem_info() layering violations. Differential Revision: https://reviews.freebsd.org/D775 Reviewed by: kib, glebius (earlier version)
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/cryptodev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index 778a670..472a902 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -286,6 +286,8 @@ static int cryptof_ioctl(struct file *, u_long, void *,
static int cryptof_stat(struct file *, struct stat *,
struct ucred *, struct thread *);
static int cryptof_close(struct file *, struct thread *);
+static int cryptof_fill_kinfo(struct file *, struct kinfo_file *,
+ struct filedesc *);
static struct fileops cryptofops = {
.fo_read = invfo_rdwr,
@@ -299,6 +301,7 @@ static struct fileops cryptofops = {
.fo_chmod = invfo_chmod,
.fo_chown = invfo_chown,
.fo_sendfile = invfo_sendfile,
+ .fo_fill_kinfo = cryptof_fill_kinfo,
};
static struct csession *csefind(struct fcrypt *, u_int);
@@ -958,6 +961,14 @@ cryptof_close(struct file *fp, struct thread *td)
return 0;
}
+static int
+cryptof_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
+{
+
+ kif->kf_type = KF_TYPE_CRYPTO;
+ return (0);
+}
+
static struct csession *
csefind(struct fcrypt *fcr, u_int ses)
{
OpenPOWER on IntegriCloud