Lines Matching refs:rc

136 	int rc = -EINVAL;  in fs_open()  local
149 rc = fs_get_mnt_point(&mp, file_name, NULL); in fs_open()
150 if (rc < 0) { in fs_open()
152 return rc; in fs_open()
178 rc = mp->fs->open(zfp, file_name, flags); in fs_open()
179 if (rc < 0) { in fs_open()
180 LOG_ERR("file open error (%d)", rc); in fs_open()
182 return rc; in fs_open()
190 rc = mp->fs->truncate(zfp, 0); in fs_open()
191 if (rc < 0) { in fs_open()
192 LOG_ERR("file truncation failed (%d)", rc); in fs_open()
194 return rc; in fs_open()
198 return rc; in fs_open()
203 int rc = -EINVAL; in fs_close() local
213 rc = zfp->mp->fs->close(zfp); in fs_close()
214 if (rc < 0) { in fs_close()
215 LOG_ERR("file close error (%d)", rc); in fs_close()
216 return rc; in fs_close()
221 return rc; in fs_close()
226 int rc = -EINVAL; in fs_read() local
236 rc = zfp->mp->fs->read(zfp, ptr, size); in fs_read()
237 if (rc < 0) { in fs_read()
238 LOG_ERR("file read error (%d)", rc); in fs_read()
241 return rc; in fs_read()
246 int rc = -EINVAL; in fs_write() local
256 rc = zfp->mp->fs->write(zfp, ptr, size); in fs_write()
257 if (rc < 0) { in fs_write()
258 LOG_ERR("file write error (%d)", rc); in fs_write()
261 return rc; in fs_write()
266 int rc = -ENOTSUP; in fs_seek() local
276 rc = zfp->mp->fs->lseek(zfp, offset, whence); in fs_seek()
277 if (rc < 0) { in fs_seek()
278 LOG_ERR("file seek error (%d)", rc); in fs_seek()
281 return rc; in fs_seek()
286 int rc = -ENOTSUP; in fs_tell() local
296 rc = zfp->mp->fs->tell(zfp); in fs_tell()
297 if (rc < 0) { in fs_tell()
298 LOG_ERR("file tell error (%d)", rc); in fs_tell()
301 return rc; in fs_tell()
306 int rc = -EINVAL; in fs_truncate() local
316 rc = zfp->mp->fs->truncate(zfp, length); in fs_truncate()
317 if (rc < 0) { in fs_truncate()
318 LOG_ERR("file truncate error (%d)", rc); in fs_truncate()
321 return rc; in fs_truncate()
326 int rc = -EINVAL; in fs_sync() local
336 rc = zfp->mp->fs->sync(zfp); in fs_sync()
337 if (rc < 0) { in fs_sync()
338 LOG_ERR("file sync error (%d)", rc); in fs_sync()
341 return rc; in fs_sync()
348 int rc = -EINVAL; in fs_opendir() local
373 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_opendir()
374 if (rc < 0) { in fs_opendir()
376 return rc; in fs_opendir()
384 rc = zdp->mp->fs->opendir(zdp, abs_path); in fs_opendir()
385 if (rc < 0) { in fs_opendir()
388 LOG_ERR("directory open error (%d)", rc); in fs_opendir()
391 return rc; in fs_opendir()
398 int rc = -EINVAL; in fs_readdir() local
406 rc = zdp->mp->fs->readdir(zdp, entry); in fs_readdir()
407 if (rc < 0) { in fs_readdir()
421 if (rc < 0) { in fs_readdir()
422 LOG_ERR("directory read error (%d)", rc); in fs_readdir()
425 return rc; in fs_readdir()
477 int rc = -EINVAL; in fs_closedir() local
489 rc = zdp->mp->fs->closedir(zdp); in fs_closedir()
490 if (rc < 0) { in fs_closedir()
491 LOG_ERR("directory close error (%d)", rc); in fs_closedir()
492 return rc; in fs_closedir()
497 return rc; in fs_closedir()
504 int rc = -EINVAL; in fs_mkdir() local
512 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_mkdir()
513 if (rc < 0) { in fs_mkdir()
515 return rc; in fs_mkdir()
526 rc = mp->fs->mkdir(mp, abs_path); in fs_mkdir()
527 if (rc < 0) { in fs_mkdir()
528 LOG_ERR("failed to create directory (%d)", rc); in fs_mkdir()
531 return rc; in fs_mkdir()
537 int rc = -EINVAL; in fs_unlink() local
545 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_unlink()
546 if (rc < 0) { in fs_unlink()
548 return rc; in fs_unlink()
559 rc = mp->fs->unlink(mp, abs_path); in fs_unlink()
560 if (rc < 0) { in fs_unlink()
561 LOG_ERR("failed to unlink path (%d)", rc); in fs_unlink()
564 return rc; in fs_unlink()
571 int rc = -EINVAL; in fs_rename() local
579 rc = fs_get_mnt_point(&mp, from, &match_len); in fs_rename()
580 if (rc < 0) { in fs_rename()
582 return rc; in fs_rename()
599 rc = mp->fs->rename(mp, from, to); in fs_rename()
600 if (rc < 0) { in fs_rename()
601 LOG_ERR("failed to rename file or dir (%d)", rc); in fs_rename()
604 return rc; in fs_rename()
610 int rc = -EINVAL; in fs_stat() local
618 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_stat()
619 if (rc < 0) { in fs_stat()
621 return rc; in fs_stat()
628 rc = mp->fs->stat(mp, abs_path, entry); in fs_stat()
629 if (rc == -ENOENT) { in fs_stat()
631 } else if (rc < 0) { in fs_stat()
632 LOG_ERR("failed get file or dir stat (%d)", rc); in fs_stat()
634 return rc; in fs_stat()
640 int rc; in fs_statvfs() local
648 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_statvfs()
649 if (rc < 0) { in fs_statvfs()
651 return rc; in fs_statvfs()
658 rc = mp->fs->statvfs(mp, abs_path, stat); in fs_statvfs()
659 if (rc < 0) { in fs_statvfs()
660 LOG_ERR("failed get file or dir stat (%d)", rc); in fs_statvfs()
663 return rc; in fs_statvfs()
671 int rc = -EINVAL; in fs_mount() local
706 rc = -EBUSY; in fs_mount()
712 rc = -EBUSY; in fs_mount()
721 rc = -ENOENT; in fs_mount()
727 rc = -ENOTSUP; in fs_mount()
736 rc = fs->mount(mp); in fs_mount()
737 if (rc < 0) { in fs_mount()
738 LOG_ERR("fs mount error (%d)", rc); in fs_mount()
751 return rc; in fs_mount()
758 int rc = -EINVAL; in fs_mkfs() local
768 rc = -ENOENT; in fs_mkfs()
774 rc = -ENOTSUP; in fs_mkfs()
778 rc = fs->mkfs(dev_id, cfg, flags); in fs_mkfs()
779 if (rc < 0) { in fs_mkfs()
780 LOG_ERR("mkfs error (%d)", rc); in fs_mkfs()
786 return rc; in fs_mkfs()
793 int rc = -EINVAL; in fs_unmount() local
796 return rc; in fs_unmount()
808 rc = -ENOTSUP; in fs_unmount()
812 rc = mp->fs->unmount(mp); in fs_unmount()
813 if (rc < 0) { in fs_unmount()
814 LOG_ERR("fs unmount error (%d)", rc); in fs_unmount()
824 return rc; in fs_unmount()
830 int rc = -ENOENT; in fs_readmount() local
850 rc = 0; in fs_readmount()
855 return rc; in fs_readmount()
862 int rc = 0; in fs_register() local
867 rc = -EALREADY; in fs_register()
869 rc = registry_add(type, fs); in fs_register()
874 LOG_DBG("fs register %d: %d", type, rc); in fs_register()
876 return rc; in fs_register()
882 int rc = 0; in fs_unregister() local
889 rc = -EINVAL; in fs_unregister()
896 LOG_DBG("fs unregister %d: %d", type, rc); in fs_unregister()
897 return rc; in fs_unregister()