tlink = cifs_sb_tlink(cifs_sb); if (IS_ERR(tlink)) return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink);
xid = get_xid();
page = alloc_dentry_path();
full_path = build_path_from_dentry(dentry, page); if (IS_ERR(full_path)) {
rc = PTR_ERR(full_path); goto out;
} /* return dos attributes as pseudo xattr */ /* return alt name if available as pseudo attr */
/* if proc/fs/cifs/streamstoxattr is set then searchserverforEAsorstreamsto
returns as xattrs */ if (size > MAX_EA_VALUE_SIZE) {
cifs_dbg(FYI, "size of EA value too large\n");
rc = -EOPNOTSUPP; goto out;
}
switch (handler->flags) { case XATTR_USER:
cifs_dbg(FYI, "%s:setting user xattr %s\n", __func__, name); if ((strcmp(name, CIFS_XATTR_ATTRIB) == 0) ||
(strcmp(name, SMB3_XATTR_ATTRIB) == 0)) {
rc = cifs_attrib_set(xid, pTcon, inode, full_path,
value, size); if (rc == 0) /* force revalidate of the inode */
CIFS_I(inode)->time = 0; break;
} elseif ((strcmp(name, CIFS_XATTR_CREATETIME) == 0) ||
(strcmp(name, SMB3_XATTR_CREATETIME) == 0)) {
rc = cifs_creation_time_set(xid, pTcon, inode,
full_path, value, size); if (rc == 0) /* force revalidate of the inode */
CIFS_I(inode)->time = 0; break;
}
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) goto out;
if (pTcon->ses->server->ops->set_EA) {
rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
full_path, name, value, (__u16)size,
cifs_sb->local_nls, cifs_sb); if (rc == 0)
inode_set_ctime_current(inode);
} break;
case XATTR_CIFS_ACL: case XATTR_CIFS_NTSD_SACL: case XATTR_CIFS_NTSD_OWNER: case XATTR_CIFS_NTSD: case XATTR_CIFS_NTSD_FULL: { struct smb_ntsd *pacl;
if (!value) goto out;
pacl = kmalloc(size, GFP_KERNEL); if (!pacl) {
rc = -ENOMEM;
} else {
memcpy(pacl, value, size); if (pTcon->ses->server->ops->set_acl) { int aclflags = 0;
rc = 0;
switch (handler->flags) { case XATTR_CIFS_NTSD_FULL:
aclflags = (CIFS_ACL_OWNER |
CIFS_ACL_GROUP |
CIFS_ACL_DACL |
CIFS_ACL_SACL); break; case XATTR_CIFS_NTSD:
aclflags = (CIFS_ACL_OWNER |
CIFS_ACL_GROUP |
CIFS_ACL_DACL); break; case XATTR_CIFS_NTSD_OWNER:
aclflags = (CIFS_ACL_OWNER |
CIFS_ACL_GROUP); break; case XATTR_CIFS_NTSD_SACL:
aclflags = CIFS_ACL_SACL; break; case XATTR_CIFS_ACL: default:
aclflags = CIFS_ACL_DACL;
}
rc = pTcon->ses->server->ops->set_acl(pacl,
size, inode, full_path, aclflags);
} else {
rc = -EOPNOTSUPP;
} if (rc == 0) /* force revalidate of the inode */
CIFS_I(inode)->time = 0;
kfree(pacl);
} break;
}
}
case XATTR_CIFS_ACL: case XATTR_CIFS_NTSD_SACL: case XATTR_CIFS_NTSD_OWNER: case XATTR_CIFS_NTSD: case XATTR_CIFS_NTSD_FULL: { /* *fetchowner,DACL,andSACLifaskedforfulldescriptor, *fetchownerandDACLotherwise
*/
u32 acllen, extra_info; struct smb_ntsd *pacl;
if (unlikely(cifs_forced_shutdown(cifs_sb))) return -EIO;
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) return -EOPNOTSUPP;
tlink = cifs_sb_tlink(cifs_sb); if (IS_ERR(tlink)) return PTR_ERR(tlink);
pTcon = tlink_tcon(tlink);
xid = get_xid();
page = alloc_dentry_path();
full_path = build_path_from_dentry(direntry, page); if (IS_ERR(full_path)) {
rc = PTR_ERR(full_path); goto list_ea_exit;
} /* return dos attributes as pseudo xattr */ /* return alt name if available as pseudo attr */
/* if proc/fs/cifs/streamstoxattr is set then searchserverforEAsorstreamsto
returns as xattrs */
conststruct xattr_handler * const cifs_xattr_handlers[] = {
&cifs_user_xattr_handler,
&cifs_os2_xattr_handler,
&cifs_cifs_acl_xattr_handler,
&smb3_acl_xattr_handler, /* alias for above since avoiding "cifs" */
&smb3_ntsd_sacl_xattr_handler,
&smb3_ntsd_owner_xattr_handler,
&cifs_cifs_ntsd_xattr_handler,
&smb3_ntsd_xattr_handler, /* alias for above since avoiding "cifs" */
&cifs_cifs_ntsd_full_xattr_handler,
&smb3_ntsd_full_xattr_handler, /* alias for above since avoiding "cifs" */
NULL
};
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-30)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.