From: Jinshan Xiong Date: Tue, 6 Mar 2018 16:54:11 +0000 (-0800) Subject: LU-10779 llite: rename FSFILT_IOC_* to system flags X-Git-Tag: 2.11.51~44 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7e3fc106d6e7581c76327dce210fd64b60998a42;hp=c0246d8878097a618efa9296d90896ac2cc2e9e4 LU-10779 llite: rename FSFILT_IOC_* to system flags Those definitions were probably created for compatibility. Now that FS_IOC_* have been existing in kernel for long time, we should use them to avoid confusion. Signed-off-by: Jinshan Xiong Change-Id: Id3b72233b619f1cf761ec5769e27b94af862cd22 Reviewed-on: https://review.whamcloud.com/31546 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Andreas Dilger --- diff --git a/lustre/include/uapi/linux/lustre/lustre_user.h b/lustre/include/uapi/linux/lustre/lustre_user.h index 5eb01f5..6ac8261 100644 --- a/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/lustre/include/uapi/linux/lustre/lustre_user.h @@ -111,14 +111,7 @@ typedef struct stat lstat_t; /* for statfs() */ #define LL_SUPER_MAGIC 0x0BD00BD0 -#ifndef FSFILT_IOC_GETFLAGS -#define FSFILT_IOC_GETFLAGS _IOR('f', 1, long) -#define FSFILT_IOC_SETFLAGS _IOW('f', 2, long) -#define FSFILT_IOC_GETVERSION _IOR('f', 3, long) -#define FSFILT_IOC_SETVERSION _IOW('f', 4, long) -#define FSFILT_IOC_GETVERSION_OLD _IOR('v', 1, long) -#define FSFILT_IOC_SETVERSION_OLD _IOW('v', 2, long) -#endif +#define FSFILT_IOC_GETVERSION _IOR('f', 3, long) /* FIEMAP flags supported by Lustre */ #define LUSTRE_FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_DEVICE_ORDER) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 5851cd8..4990b82 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -1155,46 +1155,46 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct dentry *dentry = file_dentry(file); struct inode *inode = file_inode(file); - struct ll_sb_info *sbi = ll_i2sbi(inode); - struct obd_ioctl_data *data; - int rc = 0; - ENTRY; + struct ll_sb_info *sbi = ll_i2sbi(inode); + struct obd_ioctl_data *data; + int rc = 0; + ENTRY; CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), cmd=%#x\n", PFID(ll_inode2fid(inode)), inode, cmd); - /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */ - if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */ - return -ENOTTY; - - ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_IOCTL, 1); - switch(cmd) { - case FSFILT_IOC_GETFLAGS: - case FSFILT_IOC_SETFLAGS: - RETURN(ll_iocontrol(inode, file, cmd, arg)); - case FSFILT_IOC_GETVERSION_OLD: - case FSFILT_IOC_GETVERSION: + /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */ + if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */ + return -ENOTTY; + + ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_IOCTL, 1); + switch (cmd) { + case FS_IOC_GETFLAGS: + case FS_IOC_SETFLAGS: + RETURN(ll_iocontrol(inode, file, cmd, arg)); + case FSFILT_IOC_GETVERSION: + case FS_IOC_GETVERSION: RETURN(put_user(inode->i_generation, (int __user *)arg)); - /* We need to special case any other ioctls we want to handle, - * to send them to the MDS/OST as appropriate and to properly - * network encode the arg field. - case FSFILT_IOC_SETVERSION_OLD: - case FSFILT_IOC_SETVERSION: - */ - case LL_IOC_GET_MDTIDX: { - int mdtidx; - - mdtidx = ll_get_mdt_idx(inode); - if (mdtidx < 0) - RETURN(mdtidx); + /* We need to special case any other ioctls we want to handle, + * to send them to the MDS/OST as appropriate and to properly + * network encode the arg field. */ + case FS_IOC_SETVERSION: + RETURN(-ENOTSUPP); + + case LL_IOC_GET_MDTIDX: { + int mdtidx; + + mdtidx = ll_get_mdt_idx(inode); + if (mdtidx < 0) + RETURN(mdtidx); if (put_user((int)mdtidx, (int __user *)arg)) - RETURN(-EFAULT); + RETURN(-EFAULT); - return 0; - } - case IOC_MDC_LOOKUP: { - int namelen, len = 0; + return 0; + } + case IOC_MDC_LOOKUP: { + int namelen, len = 0; char *buf = NULL; char *filename; diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 79f5b2a..77c56f4 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -3170,15 +3170,15 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), cmd=%x\n", PFID(ll_inode2fid(inode)), inode, cmd); - ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_IOCTL, 1); + ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_IOCTL, 1); - /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */ - if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */ - RETURN(-ENOTTY); + /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */ + if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */ + RETURN(-ENOTTY); - switch(cmd) { - case LL_IOC_GETFLAGS: - /* Get the current value of the file flags */ + switch (cmd) { + case LL_IOC_GETFLAGS: + /* Get the current value of the file flags */ return put_user(fd->fd_flags, (int __user *)arg); case LL_IOC_SETFLAGS: case LL_IOC_CLRFLAGS: @@ -3252,12 +3252,18 @@ out: case LL_IOC_LOV_GETSTRIPE: case LL_IOC_LOV_GETSTRIPE_NEW: RETURN(ll_file_getstripe(inode, (void __user *)arg, 0)); - case FSFILT_IOC_GETFLAGS: - case FSFILT_IOC_SETFLAGS: - RETURN(ll_iocontrol(inode, file, cmd, arg)); - case FSFILT_IOC_GETVERSION_OLD: - case FSFILT_IOC_GETVERSION: + case FS_IOC_GETFLAGS: + case FS_IOC_SETFLAGS: + RETURN(ll_iocontrol(inode, file, cmd, arg)); + case FSFILT_IOC_GETVERSION: + case FS_IOC_GETVERSION: RETURN(put_user(inode->i_generation, (int __user *)arg)); + /* We need to special case any other ioctls we want to handle, + * to send them to the MDS/OST as appropriate and to properly + * network encode the arg field. */ + case FS_IOC_SETVERSION: + RETURN(-ENOTSUPP); + case LL_IOC_GROUP_LOCK: RETURN(ll_get_grouplock(inode, file, arg)); case LL_IOC_GROUP_UNLOCK: @@ -3265,12 +3271,6 @@ out: case IOC_OBD_STATFS: RETURN(ll_obd_statfs(inode, (void __user *)arg)); - /* We need to special case any other ioctls we want to handle, - * to send them to the MDS/OST as appropriate and to properly - * network encode the arg field. - case FSFILT_IOC_SETVERSION_OLD: - case FSFILT_IOC_SETVERSION: - */ case LL_IOC_FLUSHCTX: RETURN(ll_flush_ctx(inode)); case LL_IOC_PATH2FID: { diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index ccd8863..0615e85 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -2085,13 +2085,13 @@ void ll_delete_inode(struct inode *inode) int ll_iocontrol(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - struct ll_sb_info *sbi = ll_i2sbi(inode); - struct ptlrpc_request *req = NULL; - int rc, flags = 0; - ENTRY; + struct ll_sb_info *sbi = ll_i2sbi(inode); + struct ptlrpc_request *req = NULL; + int rc, flags = 0; + ENTRY; - switch(cmd) { - case FSFILT_IOC_GETFLAGS: { + switch (cmd) { + case FS_IOC_GETFLAGS: { struct mdt_body *body; struct md_op_data *op_data; @@ -2115,11 +2115,11 @@ int ll_iocontrol(struct inode *inode, struct file *file, flags = body->mbo_flags; - ptlrpc_req_finished(req); + ptlrpc_req_finished(req); RETURN(put_user(flags, (int __user *)arg)); - } - case FSFILT_IOC_SETFLAGS: { + } + case FS_IOC_SETFLAGS: { struct iattr *attr; struct md_op_data *op_data; struct cl_object *obj;