Ejemplo n.º 1
0
/*
 * process statfs command, display the file system status.
 */
static void rfs_getdev(struct aipc_rfs_msg *msg)
{
    struct aipc_rfs_getdev *param = (struct aipc_rfs_getdev*)msg->parameter;
    struct kstatfs statfs;
    struct pf_devinf *info;
    int ret;
    mm_segment_t oldfs = get_fs();

    info = (struct pf_devinf *) ambalink_phys_to_virt((u32)param->devinf);
    memset(info, 0x0, sizeof(struct pf_devinf));
    memset(&statfs, 0x0, sizeof(statfs));
    set_fs(KERNEL_DS);
    ret = user_statfs(param->name, &statfs);
    set_fs(oldfs);

    if(ret < 0) {
        DMSG("rfs_getdev error: %d\n", ret);
        goto done;
    }

    info->cls = statfs.f_blocks;
    info->ecl = statfs.f_bfree;
    info->bps = 512;
    info->spc = statfs.f_bsize / info->bps;
    info->cpg = 1;
    info->ecg = info->ecl / info->cpg;
    info->fmt = PF_FMT_FAT32;
done:
    param->status = ret;

}
/*
 * The following statfs calls are copies of code from fs/statfs.c and
 * should be checked against those from time to time
 */
asmlinkage long compat_sys_statfs(const char __user *pathname, struct compat_statfs __user *buf)
{
	struct kstatfs tmp;
	int error = user_statfs(pathname, &tmp);
	if (!error)
		error = put_compat_statfs(buf, &tmp);
	return error;
}
Ejemplo n.º 3
0
/*
 * The following statfs calls are copies of code from fs/statfs.c and
 * should be checked against those from time to time
 */
COMPAT_SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct compat_statfs __user *, buf)
{
	struct kstatfs tmp;
	int error = user_statfs(pathname, &tmp);
	if (!error)
		error = put_compat_statfs(buf, &tmp);
	return error;
}
Ejemplo n.º 4
0
SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf)
{
	struct kstatfs st;
	int error = user_statfs(pathname, &st);
	if (!error)
		error = do_statfs_native(&st, buf);
	return error;
}
/* hpux statfs */
asmlinkage long hpux_statfs(const char __user *pathname,
						struct hpux_statfs __user *buf)
{
	struct kstatfs st;
	int error = user_statfs(pathname, &st);
	if (!error)
		error = do_statfs_hpux(&st, buf);
	return error;
}
Ejemplo n.º 6
0
SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf)
{
	struct kstatfs st;
	int error;
	if (sz != sizeof(*buf))
		return -EINVAL;
	error = user_statfs(pathname, &st);
	if (!error)
		error = do_statfs64(&st, buf);
	return error;
}
asmlinkage long compat_sys_statfs64(const char __user *pathname, compat_size_t sz, struct compat_statfs64 __user *buf)
{
	struct kstatfs tmp;
	int error;

	if (sz != sizeof(*buf))
		return -EINVAL;

	error = user_statfs(pathname, &tmp);
	if (!error)
		error = put_compat_statfs64(buf, &tmp);
	return error;
}
Ejemplo n.º 8
0
COMPAT_SYSCALL_DEFINE3(statfs64, const char __user *, pathname, compat_size_t, sz, struct compat_statfs64 __user *, buf)
{
	struct kstatfs tmp;
	int error;

	if (sz != sizeof(*buf))
		return -EINVAL;

	error = user_statfs(pathname, &tmp);
	if (!error)
		error = put_compat_statfs64(buf, &tmp);
	return error;
}