// CreateHardLink implements InodeOperations.CreateHardLink.
CreateHardLink implements InodeOperations.CreateHardLink.
// CreateHardLink implements InodeOperations . CreateHardLink .
func (i *inodeOperations) CreateHardLink(ctx context.Context, inode *fs.Inode, target *fs.Inode, newName string) error {
	if len(newName) > maxFilenameLen {
		return syserror.ENAMETOOLONG
	}
	targetOpts, ok := target.InodeOperations.(*inodeOperations)
	if !ok {
		return syserror.EXDEV
	}
	if err := i.fileState.file.link(ctx, &targetOpts.fileState.file, newName); err != nil {
		return err
	}
	if i.session().cachePolicy.cacheUAttrs(inode) {
		targetOpts.cachingInodeOps.IncLinks(ctx)
	}
	i.touchModificationAndStatusChangeTime(ctx, inode)
	return nil
}
func ( i * inodeOperations ) CreateHardLink ( ctx context . Context , inode * fs . Inode , target * fs . Inode , newName string ) error { if len ( newName ) > maxFilenameLen { return syserror . ENAMETOOLONG } targetOpts , ok := target . InodeOperations . ( * inodeOperations ) if ! ok { return syserror . EXDEV } if err := i . fileState . file . link ( ctx , & targetOpts . fileState . file , newName ) ; err != nil { return err } if i . session ( ) . cachePolicy . cacheUAttrs ( inode ) { targetOpts . cachingInodeOps . IncLinks ( ctx ) } i . touchModificationAndStatusChangeTime ( ctx , inode ) return nil }
CreateHardLink implements InodeOperations.CreateHardLink.
CreateHardLink implements InodeOperations . CreateHardLink .
// Increase link count.