2020-01-05 09:00:43 +01:00
|
|
|
#include <kernel/fs/gladfs.h>
|
2020-03-30 00:40:59 +02:00
|
|
|
#include <kernel/util/kmem.h>
|
2020-02-24 00:05:27 +01:00
|
|
|
#include <kernel/util/atomic.h>
|
2020-01-05 09:00:43 +01:00
|
|
|
|
2020-01-08 10:14:11 +01:00
|
|
|
/* gladfs_destroy_fragdata() - Free'd allocated fragmented data (sync) */
|
|
|
|
/* @note: *WARNING* no verification will be done, so do not use this primitive */
|
2020-01-05 09:00:43 +01:00
|
|
|
int gladfs_destroy_fragdata(struct gladfs_fragment_data_s *fragment)
|
|
|
|
{
|
|
|
|
// Check error
|
|
|
|
if (fragment == NULL)
|
|
|
|
return (-1);
|
|
|
|
|
2020-01-08 10:14:11 +01:00
|
|
|
// Start atomic operation
|
|
|
|
atomic_start();
|
|
|
|
|
2020-01-05 09:00:43 +01:00
|
|
|
// Free'd allocated space
|
2020-03-30 00:40:59 +02:00
|
|
|
kmem_free(fragment);
|
2020-01-08 10:14:11 +01:00
|
|
|
|
|
|
|
// Stop atomic operation
|
|
|
|
atomic_stop();
|
2020-01-05 09:00:43 +01:00
|
|
|
return (0);
|
|
|
|
}
|