Commit fba08fa0 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French
Browse files

cifsd: use d_inode()



Use d_inode().

Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent e6b1059f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2890,9 +2890,9 @@ int smb2_open(struct ksmbd_work *work)
	/* Set default windows and posix acls if creating new file */
	if (created) {
		int posix_acl_rc;
		struct inode *inode = path.dentry->d_inode;
		struct inode *inode = d_inode(path.dentry);

		posix_acl_rc = ksmbd_vfs_inherit_posix_acl(inode, path.dentry->d_parent->d_inode);
		posix_acl_rc = ksmbd_vfs_inherit_posix_acl(inode, d_inode(path.dentry->d_parent));
		if (posix_acl_rc)
			ksmbd_debug(SMB, "inherit posix acl failed : %d\n", posix_acl_rc);

+3 −3
Original line number Diff line number Diff line
@@ -950,7 +950,7 @@ int smb_inherit_dacl(struct ksmbd_conn *conn, struct dentry *dentry,
	int inherited_flags = 0, flags = 0, i, ace_cnt = 0, nt_size = 0;
	int rc = -ENOENT, num_aces, dacloffset, pntsd_type, acl_len;
	char *aces_base;
	bool is_dir = S_ISDIR(dentry->d_inode->i_mode);
	bool is_dir = S_ISDIR(d_inode(dentry)->i_mode);

	acl_len = ksmbd_vfs_get_sd_xattr(conn, parent, &parent_pntsd);
	if (acl_len <= 0)
@@ -1198,7 +1198,7 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, struct dentry *dentry,
			granted = GENERIC_ALL_FLAGS;
	}

	posix_acls = ksmbd_vfs_get_acl(dentry->d_inode, ACL_TYPE_ACCESS);
	posix_acls = ksmbd_vfs_get_acl(d_inode(dentry), ACL_TYPE_ACCESS);
	if (posix_acls && !found) {
		unsigned int id = -1;

@@ -1263,7 +1263,7 @@ int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
{
	int rc;
	struct smb_fattr fattr = {{0}};
	struct inode *inode = dentry->d_inode;
	struct inode *inode = d_inode(dentry);

	fattr.cf_uid = INVALID_UID;
	fattr.cf_gid = INVALID_GID;
+5 −5
Original line number Diff line number Diff line
@@ -1461,11 +1461,11 @@ int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn, struct dentry *dentry,
	struct ndr sd_ndr = {0}, acl_ndr = {0};
	struct xattr_ntacl acl = {0};
	struct xattr_smb_acl *smb_acl, *def_smb_acl = NULL;
	struct inode *inode = dentry->d_inode;
	struct inode *inode = d_inode(dentry);

	acl.version = 4;
	acl.hash_type = XATTR_SD_HASH_TYPE_SHA256;
	acl.current_time = ksmbd_UnixTimeToNT(current_time(dentry->d_inode));
	acl.current_time = ksmbd_UnixTimeToNT(current_time(inode));

	memcpy(acl.desc, "posix_acl", 9);
	acl.desc_len = 10;
@@ -1486,9 +1486,9 @@ int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn, struct dentry *dentry,
		return rc;
	}

	smb_acl = ksmbd_vfs_make_xattr_posix_acl(dentry->d_inode, ACL_TYPE_ACCESS);
	smb_acl = ksmbd_vfs_make_xattr_posix_acl(inode, ACL_TYPE_ACCESS);
	if (S_ISDIR(inode->i_mode))
		def_smb_acl = ksmbd_vfs_make_xattr_posix_acl(dentry->d_inode,
		def_smb_acl = ksmbd_vfs_make_xattr_posix_acl(inode,
				ACL_TYPE_DEFAULT);

	rc = ndr_encode_posix_acl(&acl_ndr, inode, smb_acl, def_smb_acl);
@@ -1531,7 +1531,7 @@ int ksmbd_vfs_get_sd_xattr(struct ksmbd_conn *conn, struct dentry *dentry,

	rc = ksmbd_vfs_getxattr(dentry, XATTR_NAME_SD, &n.data);
	if (rc > 0) {
		struct inode *inode = dentry->d_inode;
		struct inode *inode = d_inode(dentry);
		struct ndr acl_ndr = {0};
		struct xattr_ntacl acl;
		struct xattr_smb_acl *smb_acl = NULL, *def_smb_acl = NULL;
+2 −2
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@
#define SMB2_NO_FID		(0xFFFFFFFFFFFFFFFFULL)

#define FP_FILENAME(fp)		fp->filp->f_path.dentry->d_name.name
#define FP_INODE(fp)		fp->filp->f_path.dentry->d_inode
#define PARENT_INODE(fp)	fp->filp->f_path.dentry->d_parent->d_inode
#define FP_INODE(fp)		d_inode(fp->filp->f_path.dentry)
#define PARENT_INODE(fp)	d_inode(fp->filp->f_path.dentry->d_parent)

#define ATTR_FP(fp) (fp->attrib_only && \
		(fp->cdoption != FILE_OVERWRITE_IF_LE && \