Loading...
Searching...
No Matches
XrdSys::KernelBuffer Class Reference

`#include <XrdSysKernelBuffer.hh>`

Collaboration diagram for XrdSys::KernelBuffer:

## Public Member Functions

| KernelBuffer ()
| Default constructor.
| KernelBuffer (const KernelBuffer &)=delete
| Copy constructor - deleted.
| KernelBuffer (KernelBuffer &&kbuff)
| ~KernelBuffer ()
| Destructor.
bool | Empty () const
KernelBuffer & | operator= (const KernelBuffer &)=delete
| Copy assignment operator - deleted.
KernelBuffer & | operator= (KernelBuffer &&kbuff)
| Move assignment operator.

## Static Public Member Functions

static bool | IsPageAligned (const void *ptr)

## Friends

ssize_t | Move (char *&ubuff, KernelBuffer &kbuff, size_t length)
ssize_t | Move (KernelBuffer &kbuff, char *&ubuff)
ssize_t | Read (int fd, KernelBuffer &buffer, uint32_t length)
ssize_t | Read (int fd, KernelBuffer &buffer, uint32_t length, int64_t offset)
ssize_t | Send (int fd, KernelBuffer &buffer)
ssize_t | Write (int fd, KernelBuffer &buffer, int64_t offset)

## Detailed Description

A utility class for manipulating kernel space buffers

(Encapsulates the splice vmsplice & syscalls.)

Definition at line 45 of file XrdSysKernelBuffer.hh.

## Constructor & Destructor Documentation

## KernelBuffer() [1/3]

XrdSys::KernelBuffer::KernelBuffer | ( |  | ) |

inline

Default constructor.

Definition at line 64 of file XrdSysKernelBuffer.hh.

: capacity( 0 ), size( 0 )
{
}

Referenced by KernelBuffer(), KernelBuffer(), Move, Move, operator=(), operator=(), Read, Read, Send, and Write.

Here is the caller graph for this function:

## KernelBuffer() [2/3]

XrdSys::KernelBuffer::KernelBuffer | ( | const KernelBuffer & |  | ) |

delete

Copy constructor - deleted.

References KernelBuffer().

Here is the call graph for this function:

## KernelBuffer() [3/3]

XrdSys::KernelBuffer::KernelBuffer | ( | KernelBuffer && | kbuff | ) |

inline

Definition at line 76 of file XrdSysKernelBuffer.hh.

: capacity( kbuff.capacity ),
size( kbuff.size ),
pipes( std::move( kbuff.pipes ) )
{
capacity = 0;
size = 0;
}

References KernelBuffer().

Here is the call graph for this function:

## ~KernelBuffer()

XrdSys::KernelBuffer::~KernelBuffer | ( |  | ) |

inline

Destructor.

Definition at line 103 of file XrdSysKernelBuffer.hh.

{
if( capacity > 0 ) Free();
}

## Member Function Documentation

## Empty()

bool XrdSys::KernelBuffer::Empty | ( |  | ) | const

inline

Returns
  : true is buffer is empty, false otherwise

Definition at line 111 of file XrdSysKernelBuffer.hh.

{
return size == 0;
}

## IsPageAligned()

bool XrdSys::KernelBuffer::IsPageAligned | ( | const void * | ptr | ) |

inline static

Check if the user space buffer is page aligned

Parameters

  ptr | : user space buffer

Returns
  : true if the buffer is page aligned, false otherwise

Definition at line 123 of file XrdSysKernelBuffer.hh.

{
return ( ( uintptr_t ( ptr ) ) % PAGE_SZ ) == 0 ;
}

Referenced by XrdCl::FileStateHandler::Write().

Here is the caller graph for this function:

## operator=() [1/2]

KernelBuffer & XrdSys::KernelBuffer::operator= | ( | const KernelBuffer & |  | ) |

delete

Copy assignment operator - deleted.

References KernelBuffer().

Here is the call graph for this function:

## operator=() [2/2]

KernelBuffer & XrdSys::KernelBuffer::operator= | ( | KernelBuffer && | kbuff | ) |

inline

Move assignment operator.

Definition at line 92 of file XrdSysKernelBuffer.hh.

{
capacity = kbuff.capacity;
size = kbuff.size;
pipes = std::move( kbuff.pipes );
return *this;
}

References KernelBuffer().

Here is the call graph for this function:

## Friends And Related Symbol Documentation

## Move [1/2]

ssize_t Move | ( | char *& | ubuff,
|  | KernelBuffer & | kbuff,
|  | size_t | length )

friend

Utility function for moving a user space buffer to kernel space.

See also
  KernelBuffer::FromUser

Definition at line 462 of file XrdSysKernelBuffer.hh.

{
return kbuff.FromUser( ubuff, length );
}

References KernelBuffer().

## Move [2/2]

ssize_t Move | ( | KernelBuffer & | kbuff,
|  | char *& | ubuff )

friend

Utility function for moving a kernel buffer to user space.

See also
  KernelBuffer::ToUser

Definition at line 452 of file XrdSysKernelBuffer.hh.

{
return kbuff.ToUser( ubuff );
}

References KernelBuffer().

## Read [1/2]

ssize_t Read | ( | int | fd,
|  | KernelBuffer & | buffer,
|  | uint32_t | length )

friend

Utility function for reading data from a file descriptor into a kernel buffer.

See also
  KernelBuffer::ReadFromFD

Definition at line 421 of file XrdSysKernelBuffer.hh.

{
return buffer.ReadFromFD( fd, length, NULL );
}

References KernelBuffer().

## Read [2/2]

ssize_t Read | ( | int | fd,
|  | KernelBuffer & | buffer,
|  | uint32_t | length,
|  | int64_t | offset )

friend

Utility function for reading data from a file descriptor into a kernel buffer.

See also
  KernelBuffer::ReadFromFD

Definition at line 410 of file XrdSysKernelBuffer.hh.

{
return buffer.ReadFromFD( fd, length, &offset );
}

References KernelBuffer().

## Send

ssize_t Send | ( | int | fd,
|  | KernelBuffer & | buffer )

friend

Utility function for sending data from a kernel buffer into a socket.

See also
  KernelBuffer::WriteToFD

Definition at line 442 of file XrdSysKernelBuffer.hh.

{
return buffer.WriteToFD( fd, NULL );
}

References KernelBuffer().

## Write

ssize_t Write | ( | int | fd,
|  | KernelBuffer & | buffer,
|  | int64_t | offset )

friend

Utility function for writing data from a kernel buffer into a file descriptor.

See also
  KernelBuffer::WriteToFD

Definition at line 432 of file XrdSysKernelBuffer.hh.

{
return buffer.WriteToFD( fd, &offset );
}

References KernelBuffer().

The documentation for this class was generated from the following file:

- XrdSysKernelBuffer.hh