#else
#include <sys/file.h>
#include <sys/time.h>
+#include <unistd.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
+#include <afs/dir.h>
#include <rx/xdr.h>
#include <afs/afsint.h>
-#include "nfs.h"
-#include "lwp.h"
-#include "lock.h"
+#include <afs/nfs.h>
+#include <lwp.h>
+#include <lock.h>
#include <afs/afssyscalls.h>
-#include "ihandle.h"
-#include "vnode.h"
-#include "volume.h"
-#include "partition.h"
-#include "viceinode.h"
+#include <afs/ihandle.h>
+#include <afs/vnode.h>
+#include <afs/volume.h>
+#include <afs/partition.h>
+#include <afs/viceinode.h>
#include "vol.h"
#include "volint.h"
#include "volser.h"
#include "physio.h"
-#include "volser_prototypes.h"
+#include "volser_internal.h"
#ifdef AFS_RXOSD_SUPPORT
#include "rxosd.h"
#include "vol_osd.h"
static afs_int32
ExtractVnodes(struct Msg *m, Volume *vol, afs_int32 class,
struct VnodeExtract **list,
- afs_int32 *length, afs_uint32 where,
+ afs_uint32 *length, afs_uint32 where,
struct VnodeDiskObject *vd,
- afs_int32 *parent, struct VnodeDiskObject *parentvd)
+ afs_uint32 *parent, struct VnodeDiskObject *parentvd)
{
afs_int32 code = 0;
char buf[SIZEOF_LARGEDISKVNODE];
FindVnodes(struct Msg *m, afs_uint32 where,
struct VnodeExtract *list, afs_int32 length,
struct VnodeExtract *dlist, afs_int32 dlength,
- afs_int32 *needed, afs_int32 class)
+ afs_uint32 *needed, afs_int32 class)
{
afs_int32 i, j, found = 0;
afs_int32 parent = 0;
FDH_SEEK(outfdP, 0, 0);
size = FDH_SIZE(infdP);
while (size) {
- afs_int32 tlen;
+ size_t tlen;
tlen = size > 2048 ? 2048 : size;
if (FDH_READ(infdP, tbuf, tlen) != tlen) {
sprintf(m->line, "Couldn't read directory %u.%u.%u\n",
offset = (e->vN + 1 - class) << (vcp->logSize -1);
if (FDH_SEEK(fdP, offset, 0) != offset
|| FDH_READ(fdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("Couldn't read in %s Index of volume %u at offset\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't read in %s Index of volume %u at offset %"
+ AFS_UINT64_FMT "\n", class ? "small":"large",
+ V_id(vol), offset);
code = EIO;
goto Bad_Copy;
}
vnode->cloned = 0;
if (FDH_SEEK(fdP, offset, 0) != offset
|| FDH_WRITE(fdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("Couldn't write in %s Index of volume %u at offset\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't write in %s Index of volume %u at offset %"
+ AFS_UINT64_FMT "\n", class ? "small":"large",
+ V_id(vol), offset);
code = EIO;
goto Bad_Copy;
}
vnode->cloned = 0;
if (FDH_SEEK(newfdP, offset, 0) != offset
|| FDH_WRITE(newfdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("Couldn't write in %s Index of volume %u to offset\n",
- class ? "small":"large", V_id(newvol),
- offset);
+ Log("Couldn't write in %s Index of volume %u to offset %"
+ AFS_UINT64_FMT "\n", class ? "small":"large",
+ V_id(newvol), offset);
code = EIO;
goto Bad_Copy;
}
offset = (where + 1 - class) << (vcp->logSize -1);
if (FDH_SEEK(fdP, offset, 0) != offset
|| FDH_READ(fdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("Couldn't read in large Index of old volume %u at offset\n",
- V_id(vol), offset);
+ Log("Couldn't read in large Index of old volume %u at offset %"
+ AFS_UINT64_FMT "\n", V_id(vol), offset);
code = EIO;
goto Bad_Copy;
}
IH_INIT(newh, newvol->device, V_parentId(newvol), newino);
code = copyDir(m, h, newh);
if (code) {
- Log("splitvolume: copyDir failed for new root from %u.u.u to %u.1.1\n",
- V_id(vol), where, vnode->uniquifier, V_id(newvol));
+ Log("splitvolume: copyDir failed for new root from "
+ "%u.%u.%u to %u.1.1\n",
+ V_id(vol), where, vnode->uniquifier, V_id(newvol));
code = EIO;
goto Bad_Copy;
}
IHandle_t *h;
struct VnodeDiskObject vnode;
FdHandle_t *fdP, *fdP2;
- afs_uint64 offset, size;
+ afs_uint64 size;
+ afs_foff_t offset;
afs_int32 class = vSmall;
struct VnodeClassInfo *vcp = &VnodeClassInfo[class];
#if defined(NEARINODE_HINT) && !defined(AFS_NAMEI_ENV)
afs_uint64 size;
offset = (e->vN + 1 - class) << (vcp->logSize -1);
if (FDH_SEEK(fdP, offset, 0) != offset) {
- Log("Couldn't seek in %s Index of volume %u to offset\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't seek in %s Index of volume %u to offset %"
+ AFS_UINT64_FMT "\n", class ? "small":"large", V_id(vol),
+ offset);
code = EIO;
goto Bad_Delete;
}
if (FDH_READ(fdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("Couldn't read in %s Index of volume %u at offset\n",
- class ? "small":"large", V_id(vol), offset);
+ Log("Couldn't read in %s Index of volume %u at offset %"
+ AFS_UINT64_FMT "\n", class ? "small":"large", V_id(vol),
+ offset);
code = EIO;
goto Bad_Delete;
}
vnode->type = vNull;
if (FDH_SEEK(fdP, offset, 0) != offset
|| FDH_WRITE(fdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("Couldn't write in %s Index of volume %u to offset\n",
- class ? "small":"large", V_id(vol),
- offset);
+ Log("Couldn't write in %s Index of volume %u to offset %"
+ AFS_UINT64_FMT "\n", class ? "small":"large",
+ V_id(vol), offset);
}
}
}