summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-10-13 13:58:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-13 13:58:33 +0200
commit6c17dd42db026ff7aee6e04d95bb440e120bb052 (patch)
treea06092bca7250379025d7927815ac635dac1443c /fs
parentad8b97693ea3fbf15bc86964ba0a0707de3e0eda (diff)
parent7876018f73330338c029fa0ec32e59367354a123 (diff)
downloadbarebox-6c17dd42db026ff7aee6e04d95bb440e120bb052.tar.gz
Merge branch 'for-next/selftest'
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 95813b6089..24a3319544 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -890,6 +890,21 @@ static int fillonedir(struct dir_context *ctx, const char *name, int namlen,
return 0;
}
+int unreaddir(DIR *dir, const struct dirent *d)
+{
+ struct readdir_entry *entry;
+
+ if (d != &dir->d)
+ return -EINVAL;
+
+ entry = xzalloc(sizeof(*entry));
+ entry->d = *d;
+ list_add_tail(&entry->list, &dir->entries);
+
+ return 0;
+}
+EXPORT_SYMBOL(unreaddir);
+
struct dirent *readdir(DIR *dir)
{
struct readdir_entry *entry;