* XFS_IOC_PATH_TO_HANDLE
* returns full handle for a path
*/
-STATIC int
+int
xfs_find_handle(
unsigned int cmd,
xfs_fsop_handlereq_t *hreq)
return 0;
}
-STATIC int
+int
xfs_open_by_handle(
xfs_mount_t *mp,
xfs_fsop_handlereq_t *hreq,
struct file *parfilp,
struct inode *parinode)
{
+ const struct cred *cred = current_cred();
int error;
int new_fd;
int permflag;
mntget(parfilp->f_path.mnt);
/* Create file pointer. */
- filp = dentry_open(dentry, parfilp->f_path.mnt, hreq->oflags);
+ filp = dentry_open(dentry, parfilp->f_path.mnt, hreq->oflags, cred);
if (IS_ERR(filp)) {
put_unused_fd(new_fd);
return -XFS_ERROR(-PTR_ERR(filp));
}
+
if (inode->i_mode & S_IFREG) {
/* invisible operation should not change atime */
filp->f_flags |= O_NOATIME;
- filp->f_op = &xfs_invis_file_operations;
+ filp->f_mode |= FMODE_NOCMTIME;
}
fd_install(new_fd, filp);
}
-STATIC int
+int
xfs_readlink_by_handle(
xfs_mount_t *mp,
xfs_fsop_handlereq_t *hreq,
return -error;
}
-STATIC int
+int
xfs_attrmulti_attr_get(
struct inode *inode,
char *name,
return error;
}
-STATIC int
+int
xfs_attrmulti_attr_set(
struct inode *inode,
char *name,
return error;
}
-STATIC int
+int
xfs_attrmulti_attr_remove(
struct inode *inode,
char *name,
return -error;
}
-STATIC int
+int
xfs_ioc_space(
struct xfs_inode *ip,
struct inode *inode,
return 0;
}
-int
-xfs_ioctl(
- xfs_inode_t *ip,
+/*
+ * Note: some of the ioctl's return positive numbers as a
+ * byte count indicating success, such as readlink_by_handle.
+ * So we don't "sign flip" like most other routines. This means
+ * true errors need to be returned as a negative value.
+ */
+long
+xfs_file_ioctl(
struct file *filp,
- int ioflags,
unsigned int cmd,
- void __user *arg)
+ unsigned long p)
{
struct inode *inode = filp->f_path.dentry->d_inode;
- xfs_mount_t *mp = ip->i_mount;
+ struct xfs_inode *ip = XFS_I(inode);
+ struct xfs_mount *mp = ip->i_mount;
+ void __user *arg = (void __user *)p;
+ int ioflags = 0;
int error;
- xfs_itrace_entry(XFS_I(inode));
- switch (cmd) {
+ if (filp->f_mode & FMODE_NOCMTIME)
+ ioflags |= IO_INVIS;
+ xfs_itrace_entry(ip);
+
+ switch (cmd) {
case XFS_IOC_ALLOCSP:
case XFS_IOC_FREESP:
case XFS_IOC_RESVSP: