Lines Matching refs:inode

44 extern void fill_stat_buffer(Inode* inode, struct stat& stat);
71 fill_stat_buffer(Inode* inode, struct stat& stat)
73 const bfs_inode& node = inode->Node();
75 stat.st_dev = inode->GetVolume()->ID();
76 stat.st_ino = inode->ID();
87 if (inode->IsSymLink() && (inode->Flags() & INODE_LONG_SYMLINK) == 0) {
91 stat.st_size = inode->Size();
93 stat.st_blocks = inode->AllocatedSize() / 512;
102 Inode* inode = (Inode*)cookie;
104 return file_map_translate(inode->Map(), offset, size, vecs, _count,
105 inode->GetVolume()->BlockSize());
114 Inode* inode = (Inode*)cookie;
115 rw_lock_read_unlock(&inode->Lock());
280 /*! Reads in the node from disk and creates an inode object from it.
289 // first inode may be after the log area, we don't go through
293 INFORM(("inode at %" B_PRIdINO " requested!\n", id));
300 FATAL(("could not read inode: %" B_PRIdINO ": %s\n", id,
309 INFORM(("inode at %" B_PRIdINO " is already deleted!\n", id));
311 FATAL(("inode at %" B_PRIdINO " could not be read: %s!\n", id,
317 Inode* inode = new(std::nothrow) Inode(volume, id);
318 if (inode == NULL)
321 status = inode->InitCheck(false);
323 delete inode;
326 _node->private_node = inode;
328 *_type = inode->Mode();
340 Inode* inode = (Inode*)_node->private_node;
345 && inode->NeedsTrimming()) {
346 Transaction transaction(volume, inode->BlockNumber());
348 if (inode->TrimPreallocation(transaction) == B_OK)
356 delete inode;
367 Inode* inode = (Inode*)_node->private_node;
369 // If the inode isn't in use anymore, we were called before
371 // transaction which has already deleted the inode.
372 Transaction transaction(volume, volume->ToBlock(inode->Parent()));
375 // used up by the inode from being freed - this flag is set only in
378 if ((inode->Flags() & INODE_DONT_FREE_SPACE) != 0) {
379 delete inode;
383 ASSERT((inode->Flags() & INODE_DELETED) != 0);
385 status_t status = inode->Free(transaction);
393 volume->RemovedInodes().Remove(inode);
396 delete inode;
415 Inode* inode = (Inode*)_node->private_node;
417 if (inode->FileCache() == NULL)
420 InodeReadLocker _(inode);
431 status = file_map_translate(inode->Map(), pos, bytesLeft, fileVecs,
457 Inode* inode = (Inode*)_node->private_node;
462 if (inode->FileCache() == NULL)
465 InodeReadLocker _(inode);
476 status = file_map_translate(inode->Map(), pos, bytesLeft, fileVecs,
506 Inode* inode = (Inode*)_node->private_node;
515 if (inode->FileCache() == NULL) {
523 rw_lock_read_lock(&inode->Lock());
526 iterative_io_get_vecs_hook, iterative_io_finished_hook, inode);
535 Inode* inode = (Inode*)_node->private_node;
545 status_t status = inode->FindBlockRun(offset, run, fileOffset);
556 >= (uint64)inode->Size()) {
558 > (uint64)inode->Size()) {
561 vecs[index].length = round_up(inode->Size() - offset,
618 Inode* inode;
619 status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode);
633 Inode* inode = (Inode*)_node->private_node;
635 return inode->GetName(buffer, bufferSize);
849 Inode* inode = (Inode*)_node->private_node;
850 return inode->Sync();
859 Inode* inode = (Inode*)_node->private_node;
860 fill_stat_buffer(inode, *stat);
872 Inode* inode = (Inode*)_node->private_node;
880 bfs_inode& node = inode->Node();
885 bool hasWriteAccess = inode->CheckPermissions(W_OK) == B_OK;
887 Transaction transaction(volume, inode->BlockNumber());
888 inode->WriteLockInTransaction(transaction);
890 if ((mask & B_STAT_SIZE) != 0 && inode->Size() != stat->st_size) {
892 // do it first, so that the inode state will still be consistent
894 if (inode->IsDirectory())
896 if (!inode->IsFile())
901 off_t oldSize = inode->Size();
903 status_t status = inode->SetFileSize(transaction, stat->st_size);
909 // We must not keep the inode locked during a write operation,
911 rw_lock_write_unlock(&inode->Lock());
912 inode->FillGapWithZeros(oldSize, inode->Size());
913 rw_lock_write_lock(&inode->Lock());
916 if (!inode->IsDeleted()) {
918 index.UpdateSize(transaction, inode);
963 if (!inode->InLastModifiedIndex()) {
967 } else if (!inode->IsDeleted()) {
968 // Index::UpdateLastModified() will set the new time in the inode
970 index.UpdateLastModified(transaction, inode,
988 status_t status = inode->WriteBack(transaction);
992 notify_stat_changed(volume->ID(), inode->ParentID(), inode->ID(), mask);
1015 // to remove the inode if we don't have enough free memory later...
1027 Inode* inode;
1030 S_FILE | (mode & S_IUMSK), openMode, 0, &created, _vnodeID, &inode);
1034 && inode->FileCache() != NULL) {
1035 status = file_cache_disable(inode->FileCache());
1099 // The following call will have to write the inode back, so
1107 // Inode::Create() left the inode locked in memory, and also doesn't
1196 // Get the directory's tree, and a pointer to the inode which should be
1208 Inode* inode;
1209 if (vnode.Get(&inode) != B_OK)
1215 // If we meet our inode on that way, we have to bail out.
1266 if (inode->IsDirectory() != other->IsDirectory())
1285 inode->WriteLockInTransaction(transaction);
1287 volume->UpdateLiveQueriesRenameMove(inode, oldDirectory->ID(), oldName,
1292 status = inode->SetName(transaction, newName);
1295 index.UpdateName(transaction, oldName, newName, inode);
1303 inode->Parent() = newDirectory->BlockRun();
1307 BPlusTree* movedTree = inode->Tree();
1309 && inode->IsDirectory()
1326 status = inode->WriteBack(transaction);
1355 Inode* inode = (Inode*)_node->private_node;
1359 if (inode->IsDirectory() && (openMode & O_RWMASK) != O_RDONLY)
1361 if ((openMode & O_DIRECTORY) != 0 && !inode->IsDirectory())
1364 status_t status = inode->CheckPermissions(open_mode_to_access(openMode)
1376 cookie->last_size = inode->Size();
1381 if ((openMode & O_NOCACHE) != 0 && inode->FileCache() != NULL) {
1382 status = file_cache_disable(inode->FileCache());
1385 fileCacheEnabler.SetTo(inode->FileCache());
1393 Transaction transaction(volume, inode->BlockNumber());
1394 inode->WriteLockInTransaction(transaction);
1396 status_t status = inode->SetFileSize(transaction, 0);
1398 status = inode->WriteBack(transaction);
1417 Inode* inode = (Inode*)_node->private_node;
1419 if (!inode->HasUserAccessableStream()) {
1421 return inode->IsDirectory() ? B_IS_A_DIRECTORY : B_BAD_VALUE;
1424 return inode->ReadAt(pos, (uint8*)buffer, _length);
1434 Inode* inode = (Inode*)_node->private_node;
1439 if (!inode->HasUserAccessableStream()) {
1441 return inode->IsDirectory() ? B_IS_A_DIRECTORY : B_BAD_VALUE;
1447 pos = inode->Size();
1454 status_t status = inode->WriteAt(transaction, pos, (const uint8*)buffer,
1459 InodeReadLocker locker(inode);
1463 if (!inode->IsDeleted() && cookie->last_size != inode->Size()
1466 notify_stat_changed(volume->ID(), inode->ParentID(), inode->ID(),
1468 cookie->last_size = inode->Size();
1492 Inode* inode = (Inode*)_node->private_node;
1498 InodeReadLocker locker(inode);
1499 needsTrimming = inode->NeedsTrimming();
1502 && !inode->IsDeleted()
1504 || inode->OldLastModified() != inode->LastModified()
1505 || (inode->InSizeIndex()
1508 && inode->OldSize() != inode->Size()))) {
1510 transaction.Start(volume, inode->BlockNumber());
1517 inode->WriteLockInTransaction(transaction);
1525 status = inode->TrimPreallocation(transaction);
1527 FATAL(("Could not trim preallocated blocks: inode %" B_PRIdINO
1528 ", transaction %d: %s!\n", inode->ID(),
1535 if (inode->OldSize() != inode->Size()) {
1536 if (inode->InSizeIndex())
1537 index.UpdateSize(transaction, inode);
1540 if (inode->OldLastModified() != inode->LastModified()) {
1541 if (inode->InLastModifiedIndex()) {
1542 index.UpdateLastModified(transaction, inode,
1543 inode->LastModified());
1547 // updating the index doesn't write back the inode
1548 inode->WriteBack(transaction);
1552 notify_stat_changed(volume->ID(), inode->ParentID(), inode->ID(),
1567 if ((cookie->open_mode & O_NOCACHE) != 0 && inode->FileCache() != NULL)
1568 file_cache_enable(inode->FileCache());
1583 Inode* inode = (Inode*)_node->private_node;
1584 status_t status = inode->CheckPermissions(accessMode);
1598 Inode* inode = (Inode*)_node->private_node;
1600 if (!inode->IsSymLink())
1603 if ((inode->Flags() & INODE_LONG_SYMLINK) != 0) {
1604 status_t status = inode->ReadAt(0, (uint8*)buffer, _bufferSize);
1608 *_bufferSize = inode->Size();
1612 size_t linkLength = strlen(inode->Node().short_symlink);
1618 memcpy(buffer, inode->Node().short_symlink, bytesToCopy);
1647 // Inode::Create() locks the inode if we pass the "id" parameter, but we
1707 Inode* inode = (Inode*)_node->private_node;
1708 status_t status = inode->CheckPermissions(R_OK);
1714 if (!inode->IsContainer())
1717 BPlusTree* tree = inode->Tree();
1808 Inode* inode = (Inode*)_node->private_node;
1812 AttributeIterator* iterator = new(std::nothrow) AttributeIterator(inode);
1888 Inode* inode = (Inode*)_node->private_node;
1889 Attribute attribute(inode);
1901 Inode* inode = (Inode*)_node->private_node;
1902 Attribute attribute(inode);
1930 Inode* inode = (Inode*)_file->private_node;
1932 Attribute attribute(inode, cookie);
1946 Inode* inode = (Inode*)_file->private_node;
1948 Transaction transaction(volume, inode->BlockNumber());
1949 Attribute attribute(inode, cookie);
1957 notify_attribute_changed(volume->ID(), inode->ParentID(),
1958 inode->ID(), cookie->name,
1960 notify_stat_changed(volume->ID(), inode->ParentID(), inode->ID(),
1976 Inode* inode = (Inode*)_file->private_node;
1978 Attribute attribute(inode, cookie);
2013 Inode* inode = (Inode*)_node->private_node;
2015 status_t status = inode->CheckPermissions(W_OK);
2019 Transaction transaction(volume, inode->BlockNumber());
2021 status = inode->RemoveAttribute(transaction, name);
2025 notify_attribute_changed(volume->ID(), inode->ParentID(), inode->ID(),
2064 Inode* inode;
2066 &id, &inode, subVnode ? subVnode->ops : NULL, flags);
2068 _superVnode->private_node = inode;