aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-10 14:35:36 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-10 14:35:36 -0500
commit4ba24fef3eb3b142197135223b90ced2f319cd53 (patch)
treea20c125b27740ec7b4c761b11d801108e1b316b2 /fs/xfs/xfs_ioctl.c
parent47c1ffb2b6b630894e9a16442611c056ab21c057 (diff)
parent98a4a59ee31a12105a2b84f5b8b515ac2cb208ef (diff)
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.20.
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 3799695b9249..a1831980a68e 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -21,8 +21,6 @@
21#include "xfs_format.h" 21#include "xfs_format.h"
22#include "xfs_log_format.h" 22#include "xfs_log_format.h"
23#include "xfs_trans_resv.h" 23#include "xfs_trans_resv.h"
24#include "xfs_sb.h"
25#include "xfs_ag.h"
26#include "xfs_mount.h" 24#include "xfs_mount.h"
27#include "xfs_inode.h" 25#include "xfs_inode.h"
28#include "xfs_ioctl.h" 26#include "xfs_ioctl.h"
@@ -40,7 +38,6 @@
40#include "xfs_trace.h" 38#include "xfs_trace.h"
41#include "xfs_icache.h" 39#include "xfs_icache.h"
42#include "xfs_symlink.h" 40#include "xfs_symlink.h"
43#include "xfs_dinode.h"
44#include "xfs_trans.h" 41#include "xfs_trans.h"
45 42
46#include <linux/capability.h> 43#include <linux/capability.h>
@@ -968,8 +965,6 @@ xfs_set_diflags(
968 di_flags |= XFS_DIFLAG_NOATIME; 965 di_flags |= XFS_DIFLAG_NOATIME;
969 if (xflags & XFS_XFLAG_NODUMP) 966 if (xflags & XFS_XFLAG_NODUMP)
970 di_flags |= XFS_DIFLAG_NODUMP; 967 di_flags |= XFS_DIFLAG_NODUMP;
971 if (xflags & XFS_XFLAG_PROJINHERIT)
972 di_flags |= XFS_DIFLAG_PROJINHERIT;
973 if (xflags & XFS_XFLAG_NODEFRAG) 968 if (xflags & XFS_XFLAG_NODEFRAG)
974 di_flags |= XFS_DIFLAG_NODEFRAG; 969 di_flags |= XFS_DIFLAG_NODEFRAG;
975 if (xflags & XFS_XFLAG_FILESTREAM) 970 if (xflags & XFS_XFLAG_FILESTREAM)
@@ -981,6 +976,8 @@ xfs_set_diflags(
981 di_flags |= XFS_DIFLAG_NOSYMLINKS; 976 di_flags |= XFS_DIFLAG_NOSYMLINKS;
982 if (xflags & XFS_XFLAG_EXTSZINHERIT) 977 if (xflags & XFS_XFLAG_EXTSZINHERIT)
983 di_flags |= XFS_DIFLAG_EXTSZINHERIT; 978 di_flags |= XFS_DIFLAG_EXTSZINHERIT;
979 if (xflags & XFS_XFLAG_PROJINHERIT)
980 di_flags |= XFS_DIFLAG_PROJINHERIT;
984 } else if (S_ISREG(ip->i_d.di_mode)) { 981 } else if (S_ISREG(ip->i_d.di_mode)) {
985 if (xflags & XFS_XFLAG_REALTIME) 982 if (xflags & XFS_XFLAG_REALTIME)
986 di_flags |= XFS_DIFLAG_REALTIME; 983 di_flags |= XFS_DIFLAG_REALTIME;
@@ -1231,13 +1228,25 @@ xfs_ioctl_setattr(
1231 1228
1232 } 1229 }
1233 1230
1234 if (mask & FSX_EXTSIZE)
1235 ip->i_d.di_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog;
1236 if (mask & FSX_XFLAGS) { 1231 if (mask & FSX_XFLAGS) {
1237 xfs_set_diflags(ip, fa->fsx_xflags); 1232 xfs_set_diflags(ip, fa->fsx_xflags);
1238 xfs_diflags_to_linux(ip); 1233 xfs_diflags_to_linux(ip);
1239 } 1234 }
1240 1235
1236 /*
1237 * Only set the extent size hint if we've already determined that the
1238 * extent size hint should be set on the inode. If no extent size flags
1239 * are set on the inode then unconditionally clear the extent size hint.
1240 */
1241 if (mask & FSX_EXTSIZE) {
1242 int extsize = 0;
1243
1244 if (ip->i_d.di_flags &
1245 (XFS_DIFLAG_EXTSIZE | XFS_DIFLAG_EXTSZINHERIT))
1246 extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog;
1247 ip->i_d.di_extsize = extsize;
1248 }
1249
1241 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); 1250 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG);
1242 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 1251 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1243 1252
@@ -1349,7 +1358,7 @@ xfs_ioc_setxflags(
1349STATIC int 1358STATIC int
1350xfs_getbmap_format(void **ap, struct getbmapx *bmv, int *full) 1359xfs_getbmap_format(void **ap, struct getbmapx *bmv, int *full)
1351{ 1360{
1352 struct getbmap __user *base = *ap; 1361 struct getbmap __user *base = (struct getbmap __user *)*ap;
1353 1362
1354 /* copy only getbmap portion (not getbmapx) */ 1363 /* copy only getbmap portion (not getbmapx) */
1355 if (copy_to_user(base, bmv, sizeof(struct getbmap))) 1364 if (copy_to_user(base, bmv, sizeof(struct getbmap)))
@@ -1380,7 +1389,7 @@ xfs_ioc_getbmap(
1380 bmx.bmv_iflags |= BMV_IF_NO_DMAPI_READ; 1389 bmx.bmv_iflags |= BMV_IF_NO_DMAPI_READ;
1381 1390
1382 error = xfs_getbmap(ip, &bmx, xfs_getbmap_format, 1391 error = xfs_getbmap(ip, &bmx, xfs_getbmap_format,
1383 (struct getbmap *)arg+1); 1392 (__force struct getbmap *)arg+1);
1384 if (error) 1393 if (error)
1385 return error; 1394 return error;
1386 1395
@@ -1393,7 +1402,7 @@ xfs_ioc_getbmap(
1393STATIC int 1402STATIC int
1394xfs_getbmapx_format(void **ap, struct getbmapx *bmv, int *full) 1403xfs_getbmapx_format(void **ap, struct getbmapx *bmv, int *full)
1395{ 1404{
1396 struct getbmapx __user *base = *ap; 1405 struct getbmapx __user *base = (struct getbmapx __user *)*ap;
1397 1406
1398 if (copy_to_user(base, bmv, sizeof(struct getbmapx))) 1407 if (copy_to_user(base, bmv, sizeof(struct getbmapx)))
1399 return -EFAULT; 1408 return -EFAULT;
@@ -1420,7 +1429,7 @@ xfs_ioc_getbmapx(
1420 return -EINVAL; 1429 return -EINVAL;
1421 1430
1422 error = xfs_getbmap(ip, &bmx, xfs_getbmapx_format, 1431 error = xfs_getbmap(ip, &bmx, xfs_getbmapx_format,
1423 (struct getbmapx *)arg+1); 1432 (__force struct getbmapx *)arg+1);
1424 if (error) 1433 if (error)
1425 return error; 1434 return error;
1426 1435