aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-01-19 18:38:58 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-01-19 18:38:58 +0000
commit1c07d69bc22d7176d38cdb71201f282578fc7391 (patch)
tree94247d2b0877a05910f5bcf3b144887a0557b569 /sys/fs
parentf515174b94e286f66250772858f10ddfd88a3ba4 (diff)
downloadsrc-1c07d69bc22d7176d38cdb71201f282578fc7391.tar.gz
src-1c07d69bc22d7176d38cdb71201f282578fc7391.zip
Make tmpfs directory cursor available outside tmpfs_subr.c.
Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
Notes
Notes: svn path=/head/; revision=312425
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/tmpfs/tmpfs.h9
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c9
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h
index d12dfaa42c50..5dd2fb580eab 100644
--- a/sys/fs/tmpfs/tmpfs.h
+++ b/sys/fs/tmpfs/tmpfs.h
@@ -394,6 +394,11 @@ struct tmpfs_fid {
unsigned long tf_gen;
};
+struct tmpfs_dir_cursor {
+ struct tmpfs_dirent *tdc_current;
+ struct tmpfs_dirent *tdc_tree;
+};
+
#ifdef _KERNEL
/*
* Prototypes for tmpfs_subr.c.
@@ -438,6 +443,10 @@ void tmpfs_itimes(struct vnode *, const struct timespec *,
void tmpfs_set_status(struct tmpfs_node *node, int status);
void tmpfs_update(struct vnode *);
int tmpfs_truncate(struct vnode *, off_t);
+struct tmpfs_dirent *tmpfs_dir_first(struct tmpfs_node *dnode,
+ struct tmpfs_dir_cursor *dc);
+struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node *dnode,
+ struct tmpfs_dir_cursor *dc);
/*
* Convenience macros to simplify some logical expressions.
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 0cbedeffc291..e7f9fe527038 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -62,11 +62,6 @@ __FBSDID("$FreeBSD$");
#include <fs/tmpfs/tmpfs_fifoops.h>
#include <fs/tmpfs/tmpfs_vnops.h>
-struct tmpfs_dir_cursor {
- struct tmpfs_dirent *tdc_current;
- struct tmpfs_dirent *tdc_tree;
-};
-
SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system");
static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED;
@@ -724,7 +719,7 @@ tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap,
return (0);
}
-static struct tmpfs_dirent *
+struct tmpfs_dirent *
tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc)
{
struct tmpfs_dirent *de;
@@ -738,7 +733,7 @@ tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc)
return (dc->tdc_current);
}
-static struct tmpfs_dirent *
+struct tmpfs_dirent *
tmpfs_dir_next(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc)
{
struct tmpfs_dirent *de;