Lines Matching refs:fp

44 #define LFS_FILEP(fp) (&((struct lfs_file_data *)(fp->filep))->file)  argument
262 static void release_file_data(struct fs_file_t *fp) in release_file_data() argument
264 struct lfs_file_data *fdp = fp->filep; in release_file_data()
270 k_mem_slab_free(&file_data_pool, fp->filep); in release_file_data()
271 fp->filep = NULL; in release_file_data()
289 static int littlefs_open(struct fs_file_t *fp, const char *path, in littlefs_open() argument
292 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_open()
295 int ret = k_mem_slab_alloc(&file_data_pool, &fp->filep, K_NO_WAIT); in littlefs_open()
301 struct lfs_file_data *fdp = fp->filep; in littlefs_open()
312 path = fs_impl_strip_prefix(path, fp->mp); in littlefs_open()
322 release_file_data(fp); in littlefs_open()
328 static int littlefs_close(struct fs_file_t *fp) in littlefs_close() argument
330 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_close()
334 int ret = lfs_file_close(&fs->lfs, LFS_FILEP(fp)); in littlefs_close()
338 release_file_data(fp); in littlefs_close()
373 static ssize_t littlefs_read(struct fs_file_t *fp, void *ptr, size_t len) in littlefs_read() argument
375 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_read()
379 ssize_t ret = lfs_file_read(&fs->lfs, LFS_FILEP(fp), ptr, len); in littlefs_read()
385 static ssize_t littlefs_write(struct fs_file_t *fp, const void *ptr, size_t len) in littlefs_write() argument
387 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_write()
391 ssize_t ret = lfs_file_write(&fs->lfs, LFS_FILEP(fp), ptr, len); in littlefs_write()
401 static int littlefs_seek(struct fs_file_t *fp, off_t off, int whence) in littlefs_seek() argument
403 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_seek()
407 off_t ret = lfs_file_seek(&fs->lfs, LFS_FILEP(fp), off, whence); in littlefs_seek()
418 static off_t littlefs_tell(struct fs_file_t *fp) in littlefs_tell() argument
420 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_tell()
424 off_t ret = lfs_file_tell(&fs->lfs, LFS_FILEP(fp)); in littlefs_tell()
430 static int littlefs_truncate(struct fs_file_t *fp, off_t length) in littlefs_truncate() argument
432 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_truncate()
436 int ret = lfs_file_truncate(&fs->lfs, LFS_FILEP(fp), length); in littlefs_truncate()
442 static int littlefs_sync(struct fs_file_t *fp) in littlefs_sync() argument
444 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_sync()
448 int ret = lfs_file_sync(&fs->lfs, LFS_FILEP(fp)); in littlefs_sync()