46 #include <linux/capability.h>
51 #include <linux/slab.h>
82 inode = f.
file->f_path.dentry->d_inode;
87 inode = path.
dentry->d_inode;
160 struct file *parfilp,
161 void __user *uhandle,
181 memset(&fid, 0,
sizeof(
struct fid));
192 struct file *parfilp,
200 struct file *parfilp,
218 return PTR_ERR(dentry);
227 #if BITS_PER_LONG != 32
262 return PTR_ERR(filp);
295 if (len > (
unsigned) buflen)
306 struct file *parfilp,
319 return PTR_ERR(dentry);
354 struct file *parfilp,
372 if (IS_ERR(dentry)) {
374 return PTR_ERR(dentry);
398 struct file *parfilp,
422 return PTR_ERR(dentry);
430 al_hreq.
flags, cursor);
448 unsigned char __user *ubuf,
459 kbuf = kmem_zalloc_large(*len);
464 error =
xfs_attr_get(XFS_I(inode), name, kbuf, (
int *)len, flags);
472 if (is_vmalloc_addr(kbuf))
473 kmem_free_large(kbuf);
483 const unsigned char __user *ubuf,
497 return PTR_ERR(kbuf);
499 error =
xfs_attr_set(XFS_I(inode), name, kbuf, len, flags);
517 struct file *parfilp,
524 unsigned int i,
size;
538 return PTR_ERR(dentry);
547 error = PTR_ERR(ops);
556 for (i = 0; i < am_hreq.
opcount; i++) {
559 if (ops[i].am_error == 0 || ops[i].am_error ==
MAXNAMELEN)
561 if (ops[i].am_error < 0)
564 switch (ops[i].am_opcode) {
608 struct xfs_inode *
ip,
622 if (!xfs_sb_version_hasextflgbit(&ip->i_mount->m_sb) &&
670 if (XFS_FORCED_SHUTDOWN(mp))
679 if ((count = bulkreq.
icount) <= 0)
759 unsigned int xflags =
start;
789 unsigned int flags = 0;
816 fa.
fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
844 struct xfs_inode *
ip,
867 if (
S_ISDIR(ip->i_d.di_mode)) {
874 }
else if (
S_ISREG(ip->i_d.di_mode)) {
886 struct xfs_inode *
ip)
910 #define FSX_EXTSIZE 2
912 #define FSX_NONBLOCK 8
920 struct xfs_mount *
mp = ip->i_mount;
921 struct xfs_trans *tp;
928 trace_xfs_ioctl_setattr(ip);
930 if (mp->m_flags & XFS_MOUNT_RDONLY)
932 if (XFS_FORCED_SHUTDOWN(mp))
939 !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
967 lock_flags = XFS_ILOCK_EXCL;
985 if (mask & FSX_PROJID) {
1002 if (ip->i_d.di_nextents &&
1003 ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) !=
1031 size = mp->m_sb.sb_rextsize <<
1032 mp->m_sb.sb_blocklog;
1034 size = mp->m_sb.sb_blocksize;
1035 if (extsize_fsb > mp->m_sb.sb_agblocks / 2) {
1053 if ((ip->i_d.di_nextents || ip->i_delayed_blks) &&
1064 if ((mp->m_sb.sb_rblocks == 0) ||
1065 (mp->m_sb.sb_rextsize == 0) ||
1066 (ip->i_d.di_extsize % mp->m_sb.sb_rextsize)) {
1076 if ((ip->i_d.di_flags &
1091 if (mask & FSX_PROJID) {
1109 &ip->i_gdquot, gdqp);
1118 if (ip->i_d.di_version == 1)
1124 if (mask & FSX_EXTSIZE)
1125 ip->i_d.di_extsize = fa->
fsx_extsize >> mp->m_sb.sb_blocklog;
1126 if (mask & FSX_XFLAGS) {
1146 if (mp->m_flags & XFS_MOUNT_WSYNC)
1147 xfs_trans_set_sync(tp);
1248 *ap +=
sizeof(
struct getbmap);
1254 struct xfs_inode *
ip,
1297 struct xfs_inode *
ip,
1337 struct xfs_inode *
ip = XFS_I(inode);
1338 struct xfs_mount *
mp = ip->i_mount;
1346 trace_xfs_file_ioctl(ip);
1370 mp->m_rtdev_targp : mp->m_ddev_targp;
1492 if (mp->m_flags & XFS_MOUNT_RDONLY)