Previous section.

Protocols for Interworking: XNFS, Version 3W
Copyright © 1998 The Open Group

Name

NFSPROC3_LINK - Create Link to an Object

Call Arguments

struct LINK3args { nfs_fh3 file; diropargs3 link; };

Return Arguments

struct LINK3resok { post_op_attr file_attributes; wcc_data linkdir_wcc; };

struct LINK3resfail { post_op_attr file_attributes; wcc_data linkdir_wcc; };

union LINK3res switch (nfsstat3 status) { case NFS3_OK: LINK3resok resok; default: LINK3resfail resfail; };

RPC Procedure Description

LINK3res NFSPROC3_LINK(LINK3args) = 15;

Description

Procedure LINK creates a hard link from file to link.name, in the directory link.dir. Both file and link.dir must reside on the same file system and server.

On entry, the arguments in LINK3args are:

file
The file handle for the existing file system object.

link
The location of the link to be created:

link.dir
The file handle for the directory in which the link is to be created.

link.name
The name that is to be associated with the created link. See General File Name Requirements for more information on file names.

Upon successful return, LINK3res.status is NFS3_OK and LINK3res.resok contains:

file_attributes
The post-operation attributes of the file system object identified by file.

linkdir_wcc
Weak cache consistency data for the directory link.dir.

Otherwise, LINK3res.status contains the error on failure and LINK3res.resfail contains the following:

file_attributes

The post-operation attributes of the file system object identified by file.

linkdir_wcc
Weak cache consistency data for the directory link.dir.

Implementation Guidance

Changes to any property of the hard-linked files are reflected in all of the linked files. When a hard link is made to a file, the attributes for the file should have a value for nlink that is one greater than the value before the LINK.

The comments under RENAME regarding object and target residing on the same file system apply here as well. The comments regarding the target name applies as well. See General File Name Requirements for more information on file names.

Return Codes

NFS3ERR_IO
I/O error. Some sort of hard error occurred when the operation was in progress. This could be a disk error, for example.

NFS3ERR_ACCES
Permission denied. The caller does not have the correct permission to perform the requested operation. Contrast this with NFS3ERR_PERM, which restricts itself to owner permission failures.

NFS3ERR_EXIST
File exists. The file specified already exists.

NFS3ERR_XDEV
The caller attempted to do a cross-device hard link.

NFS3ERR_NOTDIR
Not a directory. The caller specified a non-directory in a directory operation.

NFS3ERR_INVAL
Invalid argument or unsupported argument for an operation. Two examples are attempting a READLINK on an object other than a symbolic link or attempting to SETATTR a time field on a server that does not support this operation.

NFS3ERR_NOSPC
No space left on device. The operation would have caused the server's file system to exceed its limit.

NFS3ERR_ROFS
Read-only file system. A modifying operation was attempted on a read-only file system.

NFS3ERR_MLINK
Too many hard links.

NFS3ERR_NAMETOOLONG

The filename in an operation was too long.

NFS3ERR_DQUOT
Resource (quota) hard limit exceeded. The user's resource limit on the server has been exceeded.

NFS3ERR_STALE
Invalid file handle. The file handle given in the arguments was invalid. The file referred to by that file handle no longer exists or access to it has been revoked.

NFS3ERR_BADHANDLE

Invalid NFS file handle. The file handle failed internal consistency checks.

NFS3ERR_NOTSUPP

The operation is not supported.

NFS3ERR_SERVERFAULT

An error occurred on the server, which does not map to any of the valid NFS Version 3 protocol error values. The client should translate this into an appropriate error. Clients based on an XPG system may choose to translate this to EIO.


Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index