zfs_log.c (247187) | zfs_log.c (251631) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 202 unchanged lines hidden (view full) --- 211 start = (caddr_t)start + 212 strlen(zdomain->z_domain) + 1; 213 } 214 } 215 return (start); 216} 217 218/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 202 unchanged lines hidden (view full) --- 211 start = (caddr_t)start + 212 strlen(zdomain->z_domain) + 1; 213 } 214 } 215 return (start); 216} 217 218/* |
219 * zfs_log_create() is used to handle TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, 220 * TX_MKDIR_ATTR and TX_MKXATTR 221 * transactions. | 219 * Handles TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, TX_MKDIR_ATTR and 220 * TK_MKXATTR transactions. |
222 * 223 * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID 224 * domain information appended prior to the name. In this case the 225 * uid/gid in the log record will be a log centric FUID. 226 * 227 * TX_CREATE_ACL_ATTR and TX_MKDIR_ACL_ATTR handle special creates that 228 * may contain attributes, ACL and optional fuid information. 229 * --- 110 unchanged lines hidden (view full) --- 340 * Now place file name in log record 341 */ 342 bcopy(name, end, namesize); 343 344 zil_itx_assign(zilog, itx, tx); 345} 346 347/* | 221 * 222 * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID 223 * domain information appended prior to the name. In this case the 224 * uid/gid in the log record will be a log centric FUID. 225 * 226 * TX_CREATE_ACL_ATTR and TX_MKDIR_ACL_ATTR handle special creates that 227 * may contain attributes, ACL and optional fuid information. 228 * --- 110 unchanged lines hidden (view full) --- 339 * Now place file name in log record 340 */ 341 bcopy(name, end, namesize); 342 343 zil_itx_assign(zilog, itx, tx); 344} 345 346/* |
348 * zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions. | 347 * Handles both TX_REMOVE and TX_RMDIR transactions. |
349 */ 350void 351zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 352 znode_t *dzp, char *name, uint64_t foid) 353{ 354 itx_t *itx; 355 lr_remove_t *lr; 356 size_t namesize = strlen(name) + 1; --- 7 unchanged lines hidden (view full) --- 364 bcopy(name, (char *)(lr + 1), namesize); 365 366 itx->itx_oid = foid; 367 368 zil_itx_assign(zilog, itx, tx); 369} 370 371/* | 348 */ 349void 350zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 351 znode_t *dzp, char *name, uint64_t foid) 352{ 353 itx_t *itx; 354 lr_remove_t *lr; 355 size_t namesize = strlen(name) + 1; --- 7 unchanged lines hidden (view full) --- 363 bcopy(name, (char *)(lr + 1), namesize); 364 365 itx->itx_oid = foid; 366 367 zil_itx_assign(zilog, itx, tx); 368} 369 370/* |
372 * zfs_log_link() handles TX_LINK transactions. | 371 * Handles TX_LINK transactions. |
373 */ 374void 375zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 376 znode_t *dzp, znode_t *zp, char *name) 377{ 378 itx_t *itx; 379 lr_link_t *lr; 380 size_t namesize = strlen(name) + 1; --- 6 unchanged lines hidden (view full) --- 387 lr->lr_doid = dzp->z_id; 388 lr->lr_link_obj = zp->z_id; 389 bcopy(name, (char *)(lr + 1), namesize); 390 391 zil_itx_assign(zilog, itx, tx); 392} 393 394/* | 372 */ 373void 374zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 375 znode_t *dzp, znode_t *zp, char *name) 376{ 377 itx_t *itx; 378 lr_link_t *lr; 379 size_t namesize = strlen(name) + 1; --- 6 unchanged lines hidden (view full) --- 386 lr->lr_doid = dzp->z_id; 387 lr->lr_link_obj = zp->z_id; 388 bcopy(name, (char *)(lr + 1), namesize); 389 390 zil_itx_assign(zilog, itx, tx); 391} 392 393/* |
395 * zfs_log_symlink() handles TX_SYMLINK transactions. | 394 * Handles TX_SYMLINK transactions. |
396 */ 397void 398zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 399 znode_t *dzp, znode_t *zp, char *name, char *link) 400{ 401 itx_t *itx; 402 lr_create_t *lr; 403 size_t namesize = strlen(name) + 1; --- 15 unchanged lines hidden (view full) --- 419 lr->lr_crtime, sizeof (uint64_t) * 2); 420 bcopy(name, (char *)(lr + 1), namesize); 421 bcopy(link, (char *)(lr + 1) + namesize, linksize); 422 423 zil_itx_assign(zilog, itx, tx); 424} 425 426/* | 395 */ 396void 397zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 398 znode_t *dzp, znode_t *zp, char *name, char *link) 399{ 400 itx_t *itx; 401 lr_create_t *lr; 402 size_t namesize = strlen(name) + 1; --- 15 unchanged lines hidden (view full) --- 418 lr->lr_crtime, sizeof (uint64_t) * 2); 419 bcopy(name, (char *)(lr + 1), namesize); 420 bcopy(link, (char *)(lr + 1) + namesize, linksize); 421 422 zil_itx_assign(zilog, itx, tx); 423} 424 425/* |
427 * zfs_log_rename() handles TX_RENAME transactions. | 426 * Handles TX_RENAME transactions. |
428 */ 429void 430zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 431 znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) 432{ 433 itx_t *itx; 434 lr_rename_t *lr; 435 size_t snamesize = strlen(sname) + 1; --- 9 unchanged lines hidden (view full) --- 445 bcopy(sname, (char *)(lr + 1), snamesize); 446 bcopy(dname, (char *)(lr + 1) + snamesize, dnamesize); 447 itx->itx_oid = szp->z_id; 448 449 zil_itx_assign(zilog, itx, tx); 450} 451 452/* | 427 */ 428void 429zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, 430 znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) 431{ 432 itx_t *itx; 433 lr_rename_t *lr; 434 size_t snamesize = strlen(sname) + 1; --- 9 unchanged lines hidden (view full) --- 444 bcopy(sname, (char *)(lr + 1), snamesize); 445 bcopy(dname, (char *)(lr + 1) + snamesize, dnamesize); 446 itx->itx_oid = szp->z_id; 447 448 zil_itx_assign(zilog, itx, tx); 449} 450 451/* |
453 * zfs_log_write() handles TX_WRITE transactions. | 452 * Handles TX_WRITE transactions. |
454 */ 455ssize_t zfs_immediate_write_sz = 32768; 456 457void 458zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, 459 znode_t *zp, offset_t off, ssize_t resid, int ioflag) 460{ 461 itx_wr_state_t write_state; --- 62 unchanged lines hidden (view full) --- 524 zil_itx_assign(zilog, itx, tx); 525 526 off += len; 527 resid -= len; 528 } 529} 530 531/* | 453 */ 454ssize_t zfs_immediate_write_sz = 32768; 455 456void 457zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, 458 znode_t *zp, offset_t off, ssize_t resid, int ioflag) 459{ 460 itx_wr_state_t write_state; --- 62 unchanged lines hidden (view full) --- 523 zil_itx_assign(zilog, itx, tx); 524 525 off += len; 526 resid -= len; 527 } 528} 529 530/* |
532 * zfs_log_truncate() handles TX_TRUNCATE transactions. | 531 * Handles TX_TRUNCATE transactions. |
533 */ 534void 535zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, 536 znode_t *zp, uint64_t off, uint64_t len) 537{ 538 itx_t *itx; 539 lr_truncate_t *lr; 540 --- 6 unchanged lines hidden (view full) --- 547 lr->lr_offset = off; 548 lr->lr_length = len; 549 550 itx->itx_sync = (zp->z_sync_cnt != 0); 551 zil_itx_assign(zilog, itx, tx); 552} 553 554/* | 532 */ 533void 534zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, 535 znode_t *zp, uint64_t off, uint64_t len) 536{ 537 itx_t *itx; 538 lr_truncate_t *lr; 539 --- 6 unchanged lines hidden (view full) --- 546 lr->lr_offset = off; 547 lr->lr_length = len; 548 549 itx->itx_sync = (zp->z_sync_cnt != 0); 550 zil_itx_assign(zilog, itx, tx); 551} 552 553/* |
555 * zfs_log_setattr() handles TX_SETATTR transactions. | 554 * Handles TX_SETATTR transactions. |
556 */ 557void 558zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, 559 znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp) 560{ 561 itx_t *itx; 562 lr_setattr_t *lr; 563 xvattr_t *xvap = (xvattr_t *)vap; --- 45 unchanged lines hidden (view full) --- 609 if (fuidp) 610 (void) zfs_log_fuid_domains(fuidp, start); 611 612 itx->itx_sync = (zp->z_sync_cnt != 0); 613 zil_itx_assign(zilog, itx, tx); 614} 615 616/* | 555 */ 556void 557zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, 558 znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp) 559{ 560 itx_t *itx; 561 lr_setattr_t *lr; 562 xvattr_t *xvap = (xvattr_t *)vap; --- 45 unchanged lines hidden (view full) --- 608 if (fuidp) 609 (void) zfs_log_fuid_domains(fuidp, start); 610 611 itx->itx_sync = (zp->z_sync_cnt != 0); 612 zil_itx_assign(zilog, itx, tx); 613} 614 615/* |
617 * zfs_log_acl() handles TX_ACL transactions. | 616 * Handles TX_ACL transactions. |
618 */ 619void 620zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, 621 vsecattr_t *vsecp, zfs_fuid_info_t *fuidp) 622{ 623 itx_t *itx; 624 lr_acl_v0_t *lrv0; 625 lr_acl_t *lr; --- 55 unchanged lines hidden --- | 617 */ 618void 619zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, 620 vsecattr_t *vsecp, zfs_fuid_info_t *fuidp) 621{ 622 itx_t *itx; 623 lr_acl_v0_t *lrv0; 624 lr_acl_t *lr; --- 55 unchanged lines hidden --- |