RemoveXattrAt implements vfs.FilesystemImpl.RemoveXattrAt.
(ctx context.Context, rp *vfs.ResolvingPath, name string)
| 1169 | |
| 1170 | // RemoveXattrAt implements vfs.FilesystemImpl.RemoveXattrAt. |
| 1171 | func (fs *Filesystem) RemoveXattrAt(ctx context.Context, rp *vfs.ResolvingPath, name string) error { |
| 1172 | fs.mu.RLock() |
| 1173 | defer fs.processDeferredDecRefs(ctx) |
| 1174 | defer fs.mu.RUnlock() |
| 1175 | d, err := fs.walkExistingLocked(ctx, rp) |
| 1176 | if err != nil { |
| 1177 | return err |
| 1178 | } |
| 1179 | if xi, ok := d.inode.(InodeWithXattrs); ok { |
| 1180 | creds := rp.Credentials() |
| 1181 | mode := d.inode.Mode() |
| 1182 | kuid := d.inode.UID() |
| 1183 | kgid := d.inode.GID() |
| 1184 | if err := vfs.GenericCheckPermissions(creds, vfs.MayWrite, mode, kuid, kgid); err != nil { |
| 1185 | return err |
| 1186 | } |
| 1187 | if err := vfs.CheckXattrPermissions(creds, vfs.MayWrite, mode, kuid, name); err != nil { |
| 1188 | return err |
| 1189 | } |
| 1190 | return xi.RemoveXattr(ctx, name) |
| 1191 | } |
| 1192 | // kernfs currently does not support extended attributes. |
| 1193 | return linuxerr.ENOTSUP |
| 1194 | } |
| 1195 | |
| 1196 | // PrependPath implements vfs.FilesystemImpl.PrependPath. |
| 1197 | func (fs *Filesystem) PrependPath(ctx context.Context, vfsroot, vd vfs.VirtualDentry, b *fspath.Builder) error { |
nothing calls this directly
no test coverage detected