Thread (43 messages) 43 messages, 6 authors, 2012-08-01

Re: [RFC PATCH 4/7] Btrfs: introduce subvol uuids and times

From: Alexander Block <hidden>
Date: 2012-07-05 17:14:33

On Thu, Jul 5, 2012 at 7:08 PM, Zach Brown [off-list ref] wrote:
quoted
+static long btrfs_ioctl_set_received_subvol(struct file *file,
+                                           void __user *arg)
+{
+       struct btrfs_ioctl_received_subvol_args *sa = NULL;
quoted
+       ret = copy_to_user(arg, sa, sizeof(*sa));
quoted
+struct btrfs_ioctl_received_subvol_args {
+       char    uuid[BTRFS_UUID_SIZE];  /* in */
+       __u64   stransid;               /* in */
+       __u64   rtransid;               /* out */
+       struct timespec stime;          /* in */
+       struct timespec rtime;          /* out */
+       __u64   reserved[16];
+};

Careful, timespec will be different sizes in 32bit userspace and a 64bit
kernel.  I'd use btrfs_timespec to get a fixed size timespec and avoid
all the compat_timespec noise.  (I'd then also worry about padding and
might pack the struct.. I always lose track of the best practice across
all archs.)
Hmm we currently don't have ctree.h in ioctl.h. Can I include it there
or are there problems with that? As an alternative I could define my
own struct for that.
- z
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help