Redesign reschedule points, allow one operation to reschedule many cpus at once
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m12s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m12s
This commit is contained in:
@@ -54,7 +54,8 @@ static size_t tar_parse (struct tarfs* tarfs, uint8_t* addr) {
|
||||
return i;
|
||||
}
|
||||
|
||||
int tarfs_mount (struct vfs_mountpoint* mountpoint, struct device_op_ctx* op_ctx) {
|
||||
int tarfs_mount (struct vfs_mountpoint* mountpoint, struct proc* proc,
|
||||
struct reschedule_ctx* rctx) {
|
||||
struct tarfs* tarfs = malloc (sizeof (*tarfs));
|
||||
|
||||
if (tarfs == NULL)
|
||||
@@ -70,7 +71,7 @@ int tarfs_mount (struct vfs_mountpoint* mountpoint, struct device_op_ctx* op_ctx
|
||||
|
||||
spin_lock (&back_device->lock);
|
||||
|
||||
ret = back_device->ops[XDRV_GET_SIZE](back_device, op_ctx, &total_size, NULL, NULL, NULL);
|
||||
ret = back_device->ops[XDRV_GET_SIZE](back_device, proc, rctx, &total_size, NULL, NULL, NULL);
|
||||
if (ret < 0) {
|
||||
spin_unlock (&back_device->lock);
|
||||
free (mountpoint->udata);
|
||||
@@ -86,7 +87,7 @@ int tarfs_mount (struct vfs_mountpoint* mountpoint, struct device_op_ctx* op_ctx
|
||||
}
|
||||
|
||||
size_t pos = 0;
|
||||
ret = back_device->ops[XDRV_READ](back_device, op_ctx, &pos, &total_size, buffer, NULL);
|
||||
ret = back_device->ops[XDRV_READ](back_device, proc, rctx, &pos, &total_size, buffer, NULL);
|
||||
|
||||
spin_unlock (&back_device->lock);
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <device/device.h>
|
||||
#include <libk/std.h>
|
||||
#include <m/fs_desc_buffer.h>
|
||||
#include <proc/proc.h>
|
||||
#include <proc/reschedule.h>
|
||||
|
||||
struct tar_header {
|
||||
char filename[100];
|
||||
@@ -31,7 +33,7 @@ struct tarfs {
|
||||
|
||||
struct vfs_mountpoint;
|
||||
|
||||
int tarfs_mount (struct vfs_mountpoint* mountpoint, struct device_op_ctx* op_ctx);
|
||||
int tarfs_mount (struct vfs_mountpoint* mountpoint, struct proc* proc, struct reschedule_ctx* rctx);
|
||||
|
||||
int tarfs_describe (struct vfs_mountpoint* mountpoint, const char* path,
|
||||
struct fs_desc_buffer* desc);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <libk/string.h>
|
||||
#include <m/status.h>
|
||||
#include <mm/liballoc.h>
|
||||
#include <proc/proc.h>
|
||||
#include <proc/procgroup.h>
|
||||
#include <sync/spin_lock.h>
|
||||
#include <sys/debug.h>
|
||||
@@ -32,7 +33,7 @@ static struct vfs_mountpoint* vfs_find_mountpoint (const char* mountpoint) {
|
||||
}
|
||||
|
||||
int vfs_create_mountpoint (const char* key, int fs_type, struct device* back_device,
|
||||
struct device_op_ctx* op_ctx) {
|
||||
struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
if (strlen_null (key) > fieldsizeof (struct vfs_mountpoint, key))
|
||||
return -ST_OOB_ERROR;
|
||||
|
||||
@@ -60,7 +61,7 @@ int vfs_create_mountpoint (const char* key, int fs_type, struct device* back_dev
|
||||
} break;
|
||||
}
|
||||
|
||||
int ret = mountpoint->driver_ops.mount (mountpoint, op_ctx);
|
||||
int ret = mountpoint->driver_ops.mount (mountpoint, proc, rctx);
|
||||
|
||||
if (ret < 0) {
|
||||
free (mountpoint);
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <libk/list.h>
|
||||
#include <libk/std.h>
|
||||
#include <m/fs_desc_buffer.h>
|
||||
#include <proc/proc.h>
|
||||
#include <proc/procgroup.h>
|
||||
#include <proc/reschedule.h>
|
||||
#include <sync/spin_lock.h>
|
||||
|
||||
#define VFS_TARFS 0
|
||||
@@ -19,9 +21,12 @@ struct vfs_mountpoint {
|
||||
bool locked;
|
||||
struct procgroup* ownerpg;
|
||||
struct {
|
||||
int (*mount) (struct vfs_mountpoint* mountpoint, struct device_op_ctx* op_ctx);
|
||||
int (*mount) (struct vfs_mountpoint* mountpoint, struct proc* proc,
|
||||
struct reschedule_ctx* rctx);
|
||||
|
||||
int (*describe) (struct vfs_mountpoint* mountpoint, const char* path,
|
||||
struct fs_desc_buffer* desc);
|
||||
|
||||
int (*read) (struct vfs_mountpoint* mountpoint, const char* path, uint8_t* buffer, size_t off,
|
||||
size_t size);
|
||||
} driver_ops;
|
||||
@@ -35,7 +40,7 @@ struct vfs_mount_table {
|
||||
};
|
||||
|
||||
int vfs_create_mountpoint (const char* key, int fs_type, struct device* back_device,
|
||||
struct device_op_ctx* op_ctx);
|
||||
struct proc* proc, struct reschedule_ctx* rctx);
|
||||
|
||||
int vfs_describe (struct procgroup* procgroup, const char* mountpoint, const char* path,
|
||||
struct fs_desc_buffer* desc);
|
||||
|
||||
Reference in New Issue
Block a user