int ubifs_ls(const char *filename)
{
- struct ubifs_info *c = ubifs_sb->s_fs_info;
struct file *file;
struct dentry *dentry;
struct inode *dir;
unsigned long inum;
int ret = 0;
- c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
inum = ubifs_findfile(ubifs_sb, (char *)filename);
if (!inum) {
ret = -1;
free(dir);
out:
- ubi_close_volume(c->ubi);
return ret;
}
int ubifs_exists(const char *filename)
{
- struct ubifs_info *c = ubifs_sb->s_fs_info;
unsigned long inum;
- c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
inum = ubifs_findfile(ubifs_sb, (char *)filename);
- ubi_close_volume(c->ubi);
return inum != 0;
}
int ubifs_size(const char *filename, loff_t *size)
{
- struct ubifs_info *c = ubifs_sb->s_fs_info;
unsigned long inum;
struct inode *inode;
int err = 0;
- c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
-
inum = ubifs_findfile(ubifs_sb, (char *)filename);
if (!inum) {
err = -1;
ubifs_iput(inode);
out:
- ubi_close_volume(c->ubi);
return err;
}
return -1;
}
- c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
/* ubifs_findfile will resolve symlinks, so we know that we get
* the real file here */
inum = ubifs_findfile(ubifs_sb, (char *)filename);
ubifs_iput(inode);
out:
- ubi_close_volume(c->ubi);
return err;
}