In Linux v5.1-rc1~141^2~1 introduced include/linux/fs_types.h which
adds macros for manipulating file types, including S_DT() which
does what the userpsace IFTODT() macro does.
So change kernel code to use S_DT() instead of IFTODT(), and provide
definitions for kernels which don't yet have this file.
fs_types.h is included by fs.h, so we don't need to explicitly include
it anywhere.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If001f7e7a97992af690222b7524770c5e4b7003d
Reviewed-on: https://review.whamcloud.com/40641
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
s/\b[cfs_]*flock_end(\([^)]*\))\b/\1->fl_end/g
s/\b[cfs_]*flock_set_end(\([^,]*\), \([^)]*\))\b/\1->fl_end = \2/g
s/\bcfs_user_write\b/user_write/g
s/\b[cfs_]*flock_end(\([^)]*\))\b/\1->fl_end/g
s/\b[cfs_]*flock_set_end(\([^,]*\), \([^)]*\))\b/\1->fl_end = \2/g
s/\bcfs_user_write\b/user_write/g
-s/\bCFS_IFSHIFT\b/IFSHIFT/g
-s/\bCFS_IFTODT\b/IFTODT/g
-s/\bCFS_DTTOIF\b/DTTOIF/g
################################################################################
# memory operations
################################################################################
# memory operations
-#ifndef IFSHIFT
-#define IFSHIFT 12
+#ifndef S_DT_SHIFT
+#define S_DT_SHIFT 12
-#ifndef IFTODT
-#define IFTODT(type) (((type) & S_IFMT) >> IFSHIFT)
+#ifndef S_DT
+#define S_DT(type) (((type) & S_IFMT) >> S_DT_SHIFT)
-#define DTTOIF(dirtype) ((dirtype) << IFSHIFT)
+#define DTTOIF(dirtype) ((dirtype) << S_DT_SHIFT)
lhash = hash;
fid_le_to_cpu(&fid, &ent->lde_fid);
ino = cl_fid_build_ino(&fid, is_api32);
lhash = hash;
fid_le_to_cpu(&fid, &ent->lde_fid);
ino = cl_fid_build_ino(&fid, is_api32);
- type = IFTODT(lu_dirent_type_get(ent));
+ type = S_DT(lu_dirent_type_get(ent));
/* For ll_nfs_get_name_filldir(), it will try to access
* 'ent' through 'lde_name', so the parameter 'name'
* for 'filldir()' must be part of the 'ent'. */
/* For ll_nfs_get_name_filldir(), it will try to access
* 'ent' through 'lde_name', so the parameter 'name'
* for 'filldir()' must be part of the 'ent'. */
osd_fid2str(name, fid, sizeof(info->oti_str));
zde->lzd_reg.zde_dnode = obj->oo_dn->dn_object;
osd_fid2str(name, fid, sizeof(info->oti_str));
zde->lzd_reg.zde_dnode = obj->oo_dn->dn_object;
- zde->lzd_reg.zde_type = IFTODT(S_IFDIR);
+ zde->lzd_reg.zde_type = S_DT(S_IFDIR);
zde->lzd_fid = *fid;
rc = osd_zap_add(osd, osd->od_remote_parent_dir, NULL,
zde->lzd_fid = *fid;
rc = osd_zap_add(osd, osd->od_remote_parent_dir, NULL,
BUILD_BUG_ON(sizeof(*zde) % 8 != 0);
memset(&zde->lzd_reg, 0, sizeof(zde->lzd_reg));
BUILD_BUG_ON(sizeof(*zde) % 8 != 0);
memset(&zde->lzd_reg, 0, sizeof(zde->lzd_reg));
- zde->lzd_reg.zde_type = IFTODT(rec1->rec_type & S_IFMT);
+ zde->lzd_reg.zde_type = S_DT(rec1->rec_type & S_IFMT);
zde->lzd_fid = *fid;
if (idc->oic_remote) {
zde->lzd_fid = *fid;
if (idc->oic_remote) {
lu_object_fid(&it->ozi_obj->oo_dt.do_lu));
lde->lde_attrs = LUDA_FID;
/* append lustre attributes */
lu_object_fid(&it->ozi_obj->oo_dt.do_lu));
lde->lde_attrs = LUDA_FID;
/* append lustre attributes */
- osd_it_append_attrs(lde, attr, 1, IFTODT(S_IFDIR));
+ osd_it_append_attrs(lde, attr, 1, S_DT(S_IFDIR));
lde->lde_reclen = cpu_to_le16(lu_dirent_calc_size(1, attr));
it->ozi_pos = OZI_POS_DOT;
RETURN(0);
lde->lde_reclen = cpu_to_le16(lu_dirent_calc_size(1, attr));
it->ozi_pos = OZI_POS_DOT;
RETURN(0);
}
/* append lustre attributes */
}
/* append lustre attributes */
- osd_it_append_attrs(lde, attr, 2, IFTODT(S_IFDIR));
+ osd_it_append_attrs(lde, attr, 2, S_DT(S_IFDIR));
lde->lde_reclen = cpu_to_le16(lu_dirent_calc_size(2, attr));
RETURN(0);
}
lde->lde_reclen = cpu_to_le16(lu_dirent_calc_size(2, attr));
RETURN(0);
}
zde->zde_pad = 0;
zde->zde_dnode = dn->dn_object;
zde->zde_pad = 0;
zde->zde_dnode = dn->dn_object;
- zde->zde_type = IFTODT(attr->la_mode & S_IFMT);
+ zde->zde_type = S_DT(attr->la_mode & S_IFMT);
zapid = osd_get_name_n_idx(env, osd, fid, buf,
sizeof(info->oti_str), &zdn);
zapid = osd_get_name_n_idx(env, osd, fid, buf,
sizeof(info->oti_str), &zdn);
zde->zde_dnode = oid;
zde->zde_pad = 0;
zde->zde_dnode = oid;
zde->zde_pad = 0;
- zde->zde_type = IFTODT(isdir ? S_IFDIR : S_IFREG);
+ zde->zde_type = S_DT(isdir ? S_IFDIR : S_IFREG);
rc = -zap_add(o->od_os, parent, name, 8, 1, (void *)zde, tx);
GOTO(commit, rc);
rc = -zap_add(o->od_os, parent, name, 8, 1, (void *)zde, tx);
GOTO(commit, rc);