Ejemplo n.º 1
0
/* FsMountVol : mount the file system volume */
INT32 FsMountVol(struct super_block *sb)
{
	INT32 err, drv;

	sm_P(&z_sem);

	for (drv = 0; drv < MAX_DRIVE; drv++) {
		if (!fs_struct[drv].mounted) break;
	}

	if (drv >= MAX_DRIVE) {
		err = FFS_ERROR;
		goto ret_unlock;
	}

	sm_P(&(fs_struct[drv].v_sem));

	err = buf_init(sb);
	if (!err) {
		err = ffsMountVol(sb, drv);
	}

	sm_V(&(fs_struct[drv].v_sem));

	if (!err) {
		fs_struct[drv].mounted = TRUE;
		fs_struct[drv].sb = sb;
	} else {
		buf_shutdown(sb);
	}
ret_unlock:
	sm_V(&z_sem);

	return(err);
} /* end of FsMountVol */
Ejemplo n.º 2
0
/* FsMountVol : mount the file system volume */
int FsMountVol(struct super_block *sb)
{
	int err;

	sm_P(&z_sem);

	err = buf_init(sb);
	if (!err)
		err = ffsMountVol(sb);
	else
		buf_shutdown(sb);

	sm_V(&z_sem);

	return err;
} /* end of FsMountVol */
Ejemplo n.º 3
0
INT32 FsMountVol(struct super_block *sb)
{
	INT32 err, drv;

	sm_P(&z_sem);

	for (drv = 0; drv < MAX_DRIVE; drv++) {
		if (!fs_struct[drv].mounted) break;
	}

	if (drv >= MAX_DRIVE) {

		/*
		 * LGE_CHANGE_S
		 * Date     : 2015.03.05
		 * Author   : [email protected]
		 * Comment  : Release semaphore (z_sem) in error condition.
		 *  In case of attaching storage more than MAX_DRIVE(2),
		 *  mount fails and no more access on exFAT.
		 */
		printk(KERN_ERR "%s: drv : %d, MAX_DRIVE : %d\n",
				__func__, drv, MAX_DRIVE);
		sm_V(&z_sem);
		return FFS_ERROR;
	}

	sm_P(&(fs_struct[drv].v_sem));

	err = buf_init(sb);
	if (!err) {
		err = ffsMountVol(sb, drv);
	}

	sm_V(&(fs_struct[drv].v_sem));

	if (!err) {
		fs_struct[drv].mounted = TRUE;
		fs_struct[drv].sb = sb;
	} else {
		buf_shutdown(sb);
	}

	sm_V(&z_sem);

	return(err);
}