/*
Copyright (c) 2012 Red Hat, Inc. <http://www.redhat.com>
This file is part of GlusterFS.
This file is licensed to you under your choice of the GNU Lesser
General Public License, version 3 or any later version (LGPLv3 or
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
#include "glfs-internal.h"
#include "glfs-mem-types.h"
#include "syncop.h"
#include "glfs.h"
#include <limits.h>
#ifdef NAME_MAX
#define GF_NAME_MAX NAME_MAX
#else
#define GF_NAME_MAX 255
#endif
#define READDIRBUF_SIZE (sizeof(struct dirent) + GF_NAME_MAX + 1)
int
glfs_loc_link (loc_t *loc, struct iatt *iatt)
{
int ret = -1;
inode_t *linked_inode = NULL;
if (!loc->inode) {
errno = EINVAL;
return -1;
}
linked_inode = inode_link (loc->inode, loc->parent, loc->name, iatt);
if (linked_inode) {
inode_lookup (linked_inode);
inode_unref (linked_inode);
|