aboutsummaryrefslogtreecommitdiffstats
path: root/libexfat/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexfat/node.c')
-rw-r--r--libexfat/node.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/libexfat/node.c b/libexfat/node.c
index fea371b..85d0726 100644
--- a/libexfat/node.c
+++ b/libexfat/node.c
@@ -29,7 +29,7 @@
struct iterator
{
cluster_t cluster;
- off_t offset;
+ loff_t offset;
int contiguous;
char* chunk;
};
@@ -71,7 +71,7 @@ void exfat_put_node(struct exfat* ef, struct exfat_node* node)
/**
* Cluster + offset from the beginning of the directory to absolute offset.
*/
-static off_t co2o(struct exfat* ef, cluster_t cluster, off_t offset)
+static loff_t co2o(struct exfat* ef, cluster_t cluster, loff_t offset)
{
return exfat_c2o(ef, cluster) + offset % CLUSTER_SIZE(*ef->sb);
}
@@ -545,7 +545,7 @@ void exfat_reset_cache(struct exfat* ef)
}
static void next_entry(struct exfat* ef, const struct exfat_node* parent,
- cluster_t* cluster, off_t* offset)
+ cluster_t* cluster, loff_t* offset)
{
*offset += sizeof(struct exfat_entry);
if (*offset % CLUSTER_SIZE(*ef->sb) == 0)
@@ -556,8 +556,8 @@ static void next_entry(struct exfat* ef, const struct exfat_node* parent,
int exfat_flush_node(struct exfat* ef, struct exfat_node* node)
{
cluster_t cluster;
- off_t offset;
- off_t meta1_offset, meta2_offset;
+ loff_t offset;
+ loff_t meta1_offset, meta2_offset;
struct exfat_entry_meta1 meta1;
struct exfat_entry_meta2 meta2;
@@ -622,7 +622,7 @@ int exfat_flush_node(struct exfat* ef, struct exfat_node* node)
static bool erase_entry(struct exfat* ef, struct exfat_node* node)
{
cluster_t cluster = node->entry_cluster;
- off_t offset = node->entry_offset;
+ loff_t offset = node->entry_offset;
int name_entries = DIV_ROUND_UP(utf16_length(node->name), EXFAT_ENAME_MAX);
uint8_t entry_type;
@@ -656,7 +656,7 @@ static bool erase_entry(struct exfat* ef, struct exfat_node* node)
}
static int shrink_directory(struct exfat* ef, struct exfat_node* dir,
- off_t deleted_offset)
+ loff_t deleted_offset)
{
const struct exfat_node* node;
const struct exfat_node* last_node;
@@ -707,7 +707,7 @@ static int shrink_directory(struct exfat* ef, struct exfat_node* dir,
static int delete(struct exfat* ef, struct exfat_node* node)
{
struct exfat_node* parent = node->parent;
- off_t deleted_offset = node->entry_offset;
+ loff_t deleted_offset = node->entry_offset;
int rc;
exfat_get_node(parent);
@@ -752,7 +752,7 @@ static int grow_directory(struct exfat* ef, struct exfat_node* dir,
}
static int find_slot(struct exfat* ef, struct exfat_node* dir,
- cluster_t* cluster, off_t* offset, int subentries)
+ cluster_t* cluster, loff_t* offset, int subentries)
{
struct iterator it;
int rc;
@@ -797,7 +797,7 @@ static int find_slot(struct exfat* ef, struct exfat_node* dir,
}
static int write_entry(struct exfat* ef, struct exfat_node* dir,
- const le16_t* name, cluster_t cluster, off_t offset, uint16_t attrib)
+ const le16_t* name, cluster_t cluster, loff_t offset, uint16_t attrib)
{
struct exfat_node* node;
struct exfat_entry_meta1 meta1;
@@ -873,7 +873,7 @@ static int create(struct exfat* ef, const char* path, uint16_t attrib)
struct exfat_node* dir;
struct exfat_node* existing;
cluster_t cluster = EXFAT_CLUSTER_BAD;
- off_t offset = -1;
+ loff_t offset = -1;
le16_t name[EXFAT_NAME_MAX + 1];
int rc;
@@ -929,12 +929,12 @@ int exfat_mkdir(struct exfat* ef, const char* path)
static int rename_entry(struct exfat* ef, struct exfat_node* dir,
struct exfat_node* node, const le16_t* name, cluster_t new_cluster,
- off_t new_offset)
+ loff_t new_offset)
{
struct exfat_entry_meta1 meta1;
struct exfat_entry_meta2 meta2;
cluster_t old_cluster = node->entry_cluster;
- off_t old_offset = node->entry_offset;
+ loff_t old_offset = node->entry_offset;
const size_t name_length = utf16_length(name);
const int name_entries = DIV_ROUND_UP(name_length, EXFAT_ENAME_MAX);
int i;
@@ -1003,7 +1003,7 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path)
struct exfat_node* existing;
struct exfat_node* dir;
cluster_t cluster = EXFAT_CLUSTER_BAD;
- off_t offset = -1;
+ loff_t offset = -1;
le16_t name[EXFAT_NAME_MAX + 1];
int rc;
@@ -1103,7 +1103,7 @@ const char* exfat_get_label(struct exfat* ef)
return ef->label;
}
-static int find_label(struct exfat* ef, cluster_t* cluster, off_t* offset)
+static int find_label(struct exfat* ef, cluster_t* cluster, loff_t* offset)
{
struct iterator it;
int rc;
@@ -1141,7 +1141,7 @@ int exfat_set_label(struct exfat* ef, const char* label)
le16_t label_utf16[EXFAT_ENAME_MAX + 1];
int rc;
cluster_t cluster;
- off_t offset;
+ loff_t offset;
struct exfat_entry_label entry;
memset(label_utf16, 0, sizeof(label_utf16));