Print this page
ZoL PR 9145


 318 
 319         objid = LR_FOID_GET_OBJ(lr->lr_foid);
 320         dnodesize = LR_FOID_GET_SLOTS(lr->lr_foid) << DNODE_SHIFT;
 321 
 322         xva_init(&xva);
 323         zfs_init_vattr(&xva.xva_vattr, AT_TYPE | AT_MODE | AT_UID | AT_GID,
 324             lr->lr_mode, lr->lr_uid, lr->lr_gid, lr->lr_rdev, objid);
 325 
 326         /*
 327          * All forms of zfs create (create, mkdir, mkxattrdir, symlink)
 328          * eventually end up in zfs_mknode(), which assigns the object's
 329          * creation time, generation number, and dnode size. The generic
 330          * zfs_create() has no concept of these attributes, so we smuggle
 331          * the values inside the vattr's otherwise unused va_ctime,
 332          * va_nblocks, and va_fsid fields.
 333          */
 334         ZFS_TIME_DECODE(&xva.xva_vattr.va_ctime, lr->lr_crtime);
 335         xva.xva_vattr.va_nblocks = lr->lr_gen;
 336         xva.xva_vattr.va_fsid = dnodesize;
 337 
 338         error = dmu_object_info(zfsvfs->z_os, lr->lr_foid, NULL);
 339         if (error != ENOENT)
 340                 goto bail;
 341 
 342         if (lr->lr_common.lrc_txtype & TX_CI)
 343                 vflg |= FIGNORECASE;
 344         switch (txtype) {
 345         case TX_CREATE_ACL:
 346                 aclstart = (caddr_t)(lracl + 1);
 347                 fuidstart = (caddr_t)aclstart +
 348                     ZIL_ACE_LENGTH(lracl->lr_acl_bytes);
 349                 zfsvfs->z_fuid_replay = zfs_replay_fuids(fuidstart,
 350                     (void *)&name, lracl->lr_fuidcnt, lracl->lr_domcnt,
 351                     lr->lr_uid, lr->lr_gid);
 352                 /*FALLTHROUGH*/
 353         case TX_CREATE_ACL_ATTR:
 354                 if (name == NULL) {
 355                         lrattr = (lr_attr_t *)(caddr_t)(lracl + 1);
 356                         xvatlen = ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
 357                         xva.xva_vattr.va_mask |= AT_XVATTR;
 358                         zfs_replay_xvattr(lrattr, &xva);
 359                 }


 452 
 453         uint64_t objid = LR_FOID_GET_OBJ(lr->lr_foid);
 454         int dnodesize = LR_FOID_GET_SLOTS(lr->lr_foid) << DNODE_SHIFT;
 455 
 456         xva_init(&xva);
 457         zfs_init_vattr(&xva.xva_vattr, AT_TYPE | AT_MODE | AT_UID | AT_GID,
 458             lr->lr_mode, lr->lr_uid, lr->lr_gid, lr->lr_rdev, objid);
 459 
 460         /*
 461          * All forms of zfs create (create, mkdir, mkxattrdir, symlink)
 462          * eventually end up in zfs_mknode(), which assigns the object's
 463          * creation time, generation number, and dnode slot count. The
 464          * generic zfs_create() has no concept of these attributes, so
 465          * we smuggle the values inside the vattr's otherwise unused
 466          * va_ctime, va_nblocks and va_fsid fields.
 467          */
 468         ZFS_TIME_DECODE(&xva.xva_vattr.va_ctime, lr->lr_crtime);
 469         xva.xva_vattr.va_nblocks = lr->lr_gen;
 470         xva.xva_vattr.va_fsid = dnodesize;
 471 
 472         error = dmu_object_info(zfsvfs->z_os, objid, NULL);
 473         if (error != ENOENT)
 474                 goto out;
 475 
 476         if (lr->lr_common.lrc_txtype & TX_CI)
 477                 vflg |= FIGNORECASE;
 478 
 479         /*
 480          * Symlinks don't have fuid info, and CIFS never creates
 481          * symlinks.
 482          *
 483          * The _ATTR versions will grab the fuid info in their subcases.
 484          */
 485         if ((int)lr->lr_common.lrc_txtype != TX_SYMLINK &&
 486             (int)lr->lr_common.lrc_txtype != TX_MKDIR_ATTR &&
 487             (int)lr->lr_common.lrc_txtype != TX_CREATE_ATTR) {
 488                 start = (lr + 1);
 489                 zfsvfs->z_fuid_replay =
 490                     zfs_replay_fuid_domain(start, &start,
 491                     lr->lr_uid, lr->lr_gid);
 492         }
 493 




 318 
 319         objid = LR_FOID_GET_OBJ(lr->lr_foid);
 320         dnodesize = LR_FOID_GET_SLOTS(lr->lr_foid) << DNODE_SHIFT;
 321 
 322         xva_init(&xva);
 323         zfs_init_vattr(&xva.xva_vattr, AT_TYPE | AT_MODE | AT_UID | AT_GID,
 324             lr->lr_mode, lr->lr_uid, lr->lr_gid, lr->lr_rdev, objid);
 325 
 326         /*
 327          * All forms of zfs create (create, mkdir, mkxattrdir, symlink)
 328          * eventually end up in zfs_mknode(), which assigns the object's
 329          * creation time, generation number, and dnode size. The generic
 330          * zfs_create() has no concept of these attributes, so we smuggle
 331          * the values inside the vattr's otherwise unused va_ctime,
 332          * va_nblocks, and va_fsid fields.
 333          */
 334         ZFS_TIME_DECODE(&xva.xva_vattr.va_ctime, lr->lr_crtime);
 335         xva.xva_vattr.va_nblocks = lr->lr_gen;
 336         xva.xva_vattr.va_fsid = dnodesize;
 337 
 338         error = dnode_try_claim(zfsvfs->z_os, objid, dnodesize >> DNODE_SHIFT);
 339         if (error)
 340                 goto bail;
 341 
 342         if (lr->lr_common.lrc_txtype & TX_CI)
 343                 vflg |= FIGNORECASE;
 344         switch (txtype) {
 345         case TX_CREATE_ACL:
 346                 aclstart = (caddr_t)(lracl + 1);
 347                 fuidstart = (caddr_t)aclstart +
 348                     ZIL_ACE_LENGTH(lracl->lr_acl_bytes);
 349                 zfsvfs->z_fuid_replay = zfs_replay_fuids(fuidstart,
 350                     (void *)&name, lracl->lr_fuidcnt, lracl->lr_domcnt,
 351                     lr->lr_uid, lr->lr_gid);
 352                 /*FALLTHROUGH*/
 353         case TX_CREATE_ACL_ATTR:
 354                 if (name == NULL) {
 355                         lrattr = (lr_attr_t *)(caddr_t)(lracl + 1);
 356                         xvatlen = ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
 357                         xva.xva_vattr.va_mask |= AT_XVATTR;
 358                         zfs_replay_xvattr(lrattr, &xva);
 359                 }


 452 
 453         uint64_t objid = LR_FOID_GET_OBJ(lr->lr_foid);
 454         int dnodesize = LR_FOID_GET_SLOTS(lr->lr_foid) << DNODE_SHIFT;
 455 
 456         xva_init(&xva);
 457         zfs_init_vattr(&xva.xva_vattr, AT_TYPE | AT_MODE | AT_UID | AT_GID,
 458             lr->lr_mode, lr->lr_uid, lr->lr_gid, lr->lr_rdev, objid);
 459 
 460         /*
 461          * All forms of zfs create (create, mkdir, mkxattrdir, symlink)
 462          * eventually end up in zfs_mknode(), which assigns the object's
 463          * creation time, generation number, and dnode slot count. The
 464          * generic zfs_create() has no concept of these attributes, so
 465          * we smuggle the values inside the vattr's otherwise unused
 466          * va_ctime, va_nblocks and va_fsid fields.
 467          */
 468         ZFS_TIME_DECODE(&xva.xva_vattr.va_ctime, lr->lr_crtime);
 469         xva.xva_vattr.va_nblocks = lr->lr_gen;
 470         xva.xva_vattr.va_fsid = dnodesize;
 471 
 472         error = dnode_try_claim(zfsvfs->z_os, objid, dnodesize >> DNODE_SHIFT);
 473         if (error)
 474                 goto out;
 475 
 476         if (lr->lr_common.lrc_txtype & TX_CI)
 477                 vflg |= FIGNORECASE;
 478 
 479         /*
 480          * Symlinks don't have fuid info, and CIFS never creates
 481          * symlinks.
 482          *
 483          * The _ATTR versions will grab the fuid info in their subcases.
 484          */
 485         if ((int)lr->lr_common.lrc_txtype != TX_SYMLINK &&
 486             (int)lr->lr_common.lrc_txtype != TX_MKDIR_ATTR &&
 487             (int)lr->lr_common.lrc_txtype != TX_CREATE_ATTR) {
 488                 start = (lr + 1);
 489                 zfsvfs->z_fuid_replay =
 490                     zfs_replay_fuid_domain(start, &start,
 491                     lr->lr_uid, lr->lr_gid);
 492         }
 493