}
/* get_id needs adp for reading CNID from adouble file */
- ad_init(&ad, vol->v_adouble, vol->v_ad_options);
- if ((ad_open(&ad, path->u_name, ADFLAGS_HF | ADFLAGS_DIR)) == 0) /* 1 */
+ ad_init(&ad, vol);
+ if ((ad_open(&ad, path->u_name, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_RDONLY)) == 0) /* 1 */
adp = &ad;
/* Get CNID */
}
if (adp)
- ad_close_metadata(adp);
+ ad_close(adp, ADFLAGS_HF);
/* Get macname from unixname */
if (path->m_name == NULL) {
cfrombstr(dir->d_u_name), path->u_name, err);
if (adp)
- ad_close_metadata(adp);
+ ad_close(adp, ADFLAGS_HF);
if (!cdir && fullpath)
bdestroy(fullpath);
if (cdir)
(1 << DIRPBIT_BDATE) |
(1 << DIRPBIT_FINFO)))) {
- ad_init(&ad, vol->v_adouble, vol->v_ad_options);
+ ad_init(&ad, vol);
if ( !ad_metadata( upath, ADFLAGS_DIR, &ad) ) {
isad = 1;
- if (ad.ad_md->adf_flags & O_CREAT) {
+ if (ad.ad_mdp->adf_flags & O_CREAT) {
/* We just created it */
if (s_path->m_name == NULL) {
if ((s_path->m_name = utompath(vol,
default :
if ( isad ) {
- ad_close_metadata( &ad );
+ ad_close(&ad, ADFLAGS_HF);
}
return( AFPERR_BITMAP );
}
data = set_name(vol, data, pdid, cfrombstr(dir->d_m_name), dir->d_did, utf8);
}
if ( isad ) {
- ad_close_metadata( &ad );
+ ad_close(&ad, ADFLAGS_HF);
}
*buflen = data - buf;
return( AFP_OK );
bitmap = bitmap>>1;
bit++;
}
- ad_init(&ad, vol->v_adouble, vol->v_ad_options);
+ ad_init(&ad, vol);
- if (ad_open(&ad, upath, ADFLAGS_HF | ADFLAGS_DIR, O_CREAT, 0777) != 0) {
+ if (ad_open(&ad, upath, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_CREATE | ADFLAGS_RDWR, 0777) != 0) {
/*
* Check to see what we're trying to set. If it's anything
* but ACCESS, UID, or GID, give an error. If it's any of those
ad_setid(&ad, st->st_dev, st->st_ino, dir->d_did, dir->d_pdid, vol->v_stamp);
}
}
- ad_flush( &ad);
- ad_close_metadata( &ad);
+ ad_flush(&ad);
+ ad_close(&ad, ADFLAGS_HF);
}
if (change_parent_mdate && dir->d_did != DIRDID_ROOT
return( AFPERR_PARAM );
}
- ad_init(&ad, vol->v_adouble, vol->v_ad_options);
- if (ad_open(&ad, ".", ADFLAGS_HF | ADFLAGS_DIR, O_CREAT, 0777) < 0) {
+ ad_init(&ad, vol);
+ if (ad_open(&ad, ".", ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_CREATE | ADFLAGS_RDWR, 0777) < 0) {
if (vol_noadouble(vol))
goto createdir_done;
return( AFPERR_ACCESS );
fce_register_new_dir(s_path);
- ad_flush( &ad);
- ad_close_metadata( &ad);
+ ad_flush(&ad);
+ ad_close(&ad, ADFLAGS_HF);
createdir_done:
memcpy( rbuf, &dir->d_did, sizeof( uint32_t ));
vol->vfs->vfs_renamedir(vol, dirfd, src, dst);
- ad_init(&ad, vol->v_adouble, vol->v_ad_options);
+ ad_init(&ad, vol);
- if (ad_open(&ad, dst, ADFLAGS_HF | ADFLAGS_DIR) == 0) {
+ if (ad_open(&ad, dst, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_RDWR) == 0) {
ad_setname(&ad, newname);
- ad_flush( &ad);
- ad_close_metadata( &ad);
+ ad_flush(&ad);
+ ad_close(&ad, ADFLAGS_HF);
}
return( AFP_OK );
fdir = curdir;
- ad_init(&ad, vol->v_adouble, vol->v_ad_options);
+ ad_init(&ad, vol);
/* we never want to create a resource fork here, we are going to delete it */
if ( ad_metadata( ".", ADFLAGS_DIR, &ad) == 0 ) {
ad_getattr(&ad, &ashort);
- ad_close_metadata(&ad);
+ ad_close(&ad, ADFLAGS_HF);
if ((ashort & htons(ATTRBIT_NODELETE))) {
return AFPERR_OLOCK;
}