}
buflen = *rbuflen - sizeof( bitmap ) - sizeof( appltag );
if ( getfilparams(obj, vol, bitmap, path, curdir, rbuf + sizeof( bitmap ) +
- sizeof( appltag ), &buflen ) != AFP_OK ) {
+ sizeof( appltag ), &buflen, 0) != AFP_OK ) {
*rbuflen = 0;
return( AFPERR_BITMAP );
}
}
else {
/* FIXME slow if we need the file ID, we already know it, done ? */
- ret = getfilparams (obj, vol, c1.fbitmap, path, path->d_dir, p, &tbuf);
+ ret = getfilparams (obj, vol, c1.fbitmap, path, path->d_dir, p, &tbuf, 0);
}
if ( ret != AFP_OK )
}
/* files are added to the dircache in getfilparams() -> getmetadata() */
if (AFP_OK != ( ret = getfilparams(obj, vol, fbitmap, &s_path, curdir,
- data + header , &esz )) ) {
+ data + header, &esz, 1)) ) {
return( ret );
}
}
}
/* ----------------------- */
-int getfilparams(const AFPObj *obj,
- struct vol *vol,
- uint16_t bitmap,
- struct path *path, struct dir *dir,
- char *buf, size_t *buflen )
+int getfilparams(const AFPObj *obj, struct vol *vol, uint16_t bitmap, struct path *path,
+ struct dir *dir, char *buf, size_t *buflen, int in_enumerate)
{
struct adouble ad, *adp;
int opened = 0;
if (opened) {
char *upath;
- flags = (bitmap & (1 << FILPBIT_ATTR)) ? ADFLAGS_CHECK_OF : 0;
+ /*
+ * Dont check for and resturn open fork attributes when enumerating
+ * This saves a lot of syscalls, the client will hopefully only use the result
+ * in FPGetFileParms where we return the correct value
+ */
+ flags = (!in_enumerate &&(bitmap & (1 << FILPBIT_ATTR))) ? ADFLAGS_CHECK_OF : 0;
adp = of_ad(vol, path, &ad);
upath = path->u_name;
}
path.id = cnid;
if (AFP_OK != (err = getfilparams(obj, vol, bitmap, &path , curdir,
- rbuf + sizeof(bitmap), &buflen))) {
+ rbuf + sizeof(bitmap), &buflen, 0))) {
return err;
}
*rbuflen = buflen + sizeof(bitmap);
extern struct extmap *getdefextmap (void);
extern int getfilparams (const AFPObj *obj, struct vol *, uint16_t, struct path *,
- struct dir *, char *buf, size_t *);
-
+ struct dir *, char *buf, size_t *, int);
extern int setfilparams (const AFPObj *obj, struct vol *, struct path *, uint16_t, char *);
extern int renamefile (const struct vol *, int, char *, char *, char *, struct adouble *);
extern int copyfile (const struct vol *, const struct vol *, int, char *, char *, char *, struct adouble *);
*(rbuf + 2 * sizeof( uint16_t )) = (char) FILDIRBIT_ISDIR;
} else {
if (fbitmap && AFP_OK != (ret = getfilparams(obj, vol, fbitmap, s_path, curdir,
- rbuf + 3 * sizeof( uint16_t ), &buflen )) ) {
+ rbuf + 3 * sizeof( uint16_t ), &buflen, 0)) ) {
return( ret );
}
/* this is a file */