]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/xfs/xfs_ioctl.c
xfs: Add pquota fields where gquota is used.
[mirror_ubuntu-artful-kernel.git] / fs / xfs / xfs_ioctl.c
index d681e34c29503c3ed45c22aacf6c4abc643facd8..6e2bca5d44d67acb52a58115a6b9482fc04a5bc1 100644 (file)
@@ -248,7 +248,7 @@ xfs_open_by_handle(
                goto out_dput;
        }
 
-       fd = get_unused_fd();
+       fd = get_unused_fd_flags(0);
        if (fd < 0) {
                error = fd;
                goto out_dput;
@@ -422,9 +422,12 @@ xfs_attrlist_by_handle(
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
 
-       kbuf = kzalloc(al_hreq.buflen, GFP_KERNEL);
-       if (!kbuf)
-               goto out_dput;
+       kbuf = kmem_zalloc(al_hreq.buflen, KM_SLEEP | KM_MAYFAIL);
+       if (!kbuf) {
+               kbuf = kmem_zalloc_large(al_hreq.buflen);
+               if (!kbuf)
+                       goto out_dput;
+       }
 
        cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
        error = -xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen,
@@ -436,7 +439,10 @@ xfs_attrlist_by_handle(
                error = -EFAULT;
 
  out_kfree:
-       kfree(kbuf);
+       if (is_vmalloc_addr(kbuf))
+               kmem_free_large(kbuf);
+       else
+               kmem_free(kbuf);
  out_dput:
        dput(dentry);
        return error;
@@ -922,7 +928,7 @@ xfs_ioctl_setattr(
        struct xfs_trans        *tp;
        unsigned int            lock_flags = 0;
        struct xfs_dquot        *udqp = NULL;
-       struct xfs_dquot        *gdqp = NULL;
+       struct xfs_dquot        *pdqp = NULL;
        struct xfs_dquot        *olddquot = NULL;
        int                     code;
 
@@ -951,7 +957,7 @@ xfs_ioctl_setattr(
        if (XFS_IS_QUOTA_ON(mp) && (mask & FSX_PROJID)) {
                code = xfs_qm_vop_dqalloc(ip, ip->i_d.di_uid,
                                         ip->i_d.di_gid, fa->fsx_projid,
-                                        XFS_QMOPT_PQUOTA, &udqp, &gdqp);
+                                        XFS_QMOPT_PQUOTA, &udqp, NULL, &pdqp);
                if (code)
                        return code;
        }
@@ -988,8 +994,8 @@ xfs_ioctl_setattr(
                    XFS_IS_PQUOTA_ON(mp) &&
                    xfs_get_projid(ip) != fa->fsx_projid) {
                        ASSERT(tp);
-                       code = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp,
-                                               capable(CAP_FOWNER) ?
+                       code = xfs_qm_vop_chown_reserve(tp, ip, udqp, NULL,
+                                               pdqp, capable(CAP_FOWNER) ?
                                                XFS_QMOPT_FORCE_RES : 0);
                        if (code)       /* out of quota */
                                goto error_return;
@@ -1107,7 +1113,7 @@ xfs_ioctl_setattr(
                if (xfs_get_projid(ip) != fa->fsx_projid) {
                        if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_PQUOTA_ON(mp)) {
                                olddquot = xfs_qm_vop_chown(tp, ip,
-                                                       &ip->i_gdquot, gdqp);
+                                                       &ip->i_pdquot, pdqp);
                        }
                        xfs_set_projid(ip, fa->fsx_projid);
 
@@ -1154,13 +1160,13 @@ xfs_ioctl_setattr(
         */
        xfs_qm_dqrele(olddquot);
        xfs_qm_dqrele(udqp);
-       xfs_qm_dqrele(gdqp);
+       xfs_qm_dqrele(pdqp);
 
        return code;
 
  error_return:
        xfs_qm_dqrele(udqp);
-       xfs_qm_dqrele(gdqp);
+       xfs_qm_dqrele(pdqp);
        xfs_trans_cancel(tp, 0);
        if (lock_flags)
                xfs_iunlock(ip, lock_flags);