#define LL_IOC_GETOBDCOUNT _IOR ('f', 168, long)
#define LL_IOC_LLOOP_ATTACH _IOWR('f', 169, long)
#define LL_IOC_LLOOP_DETACH _IOWR('f', 170, long)
-#define LL_IOC_LLOOP_INFO _IOWR('f', 171, long)
+#define LL_IOC_LLOOP_INFO _IOWR('f', 171, struct lu_fid)
#define LL_IOC_LLOOP_DETACH_BYDEV _IOWR('f', 172, long)
#define LL_IOC_PATH2FID _IOR ('f', 173, long)
#define LL_IOC_GET_CONNECT_FLAGS _IOWR('f', 174, __u64 *)
unsigned int cmd, unsigned long arg)
{
struct lloop_device *lo = bdev->bd_disk->private_data;
+ struct inode *inode = lo->lo_backing_file->f_dentry->d_inode;
#else
static int lo_ioctl(struct inode *inode, struct file *unused,
unsigned int cmd, unsigned long arg)
}
case LL_IOC_LLOOP_INFO: {
- __u64 ino = 0;
+ struct lu_fid fid;
if (lo->lo_state == LLOOP_BOUND)
- ino = lo->lo_backing_file->f_dentry->d_inode->i_ino;
+ fid = ll_i2info(inode)->lli_fid;
+ else
+ fid_zero(&fid);
- if (put_user(ino, (__u64 *)arg))
+ if (copy_to_user((struct lu_fid *)arg, &fid, sizeof(fid)))
err = -EFAULT;
break;
}
{
char *filename;
int rc, fd;
- __u64 ino;
+ struct lu_fid fid;
if (argc != 2)
return CMD_HELP;
return CMD_HELP;
}
- rc = ioctl(fd, LL_IOC_LLOOP_INFO, &ino);
+ rc = ioctl(fd, LL_IOC_LLOOP_INFO, &fid);
if (rc < 0) {
rc = errno;
fprintf(stderr, "error: %s\n", strerror(errno));
goto out;
}
fprintf(stdout, "lloop device info: ");
- if (ino == 0ULL)
+ if (fid_is_zero(&fid))
fprintf(stdout, "Not attached\n");
else
- fprintf(stdout, "attached to inode "LPU64"\n", ino);
+ fprintf(stdout, "attached to inode "DFID"\n", PFID(&fid));
out:
close(fd);
return -rc;