+int vc_get_dlimit(uint32_t id, void __user *data)
+{
+ struct vcmd_ctx_dlimit_v0 vc_data;
+ int ret;
+
+ if (!vx_check(0, VX_ADMIN))
+ return -ENOSYS;
+ if (copy_from_user (&vc_data, data, sizeof(vc_data)))
+ return -EFAULT;
+
+ ret = do_get_dlimit(id, vc_data.name,
+ &vc_data.space_used, &vc_data.space_total,
+ &vc_data.inodes_used, &vc_data.inodes_total,
+ &vc_data.reserved, &vc_data.flags);
+ if (ret)
+ return ret;
+
+ if (copy_to_user(data, &vc_data, sizeof(vc_data)))
+ return -EFAULT;
+ return 0;
+}
+
+#ifdef CONFIG_COMPAT
+
+int vc_get_dlimit_x32(uint32_t id, void __user *data)
+{
+ struct vcmd_ctx_dlimit_v0_x32 vc_data;
+ int ret;
+
+ if (!vx_check(0, VX_ADMIN))
+ return -ENOSYS;
+ if (copy_from_user (&vc_data, data, sizeof(vc_data)))
+ return -EFAULT;
+
+ ret = do_get_dlimit(id, compat_ptr(vc_data.name_ptr),
+ &vc_data.space_used, &vc_data.space_total,
+ &vc_data.inodes_used, &vc_data.inodes_total,
+ &vc_data.reserved, &vc_data.flags);
+ if (ret)
+ return ret;
+
+ if (copy_to_user(data, &vc_data, sizeof(vc_data)))
+ return -EFAULT;
+ return 0;
+}
+
+#endif /* CONFIG_COMPAT */
+
+