Commit aee20260 authored by Phoebe Buckheister's avatar Phoebe Buckheister 🦎

Merge branch 'v6-604' into 'v6'

client: don't ihold for paged mode writeback

See merge request !319
parents 0e46773f 9c8fef3d
......@@ -58,8 +58,6 @@ bool RWPagesWork_init(RWPagesWork* this, App* app, struct inode* inode,
if (unlikely(referenceRes != FhgfsOpsErr_SUCCESS) )
return false;
ihold(inode); // make sure the inode does not get evicted while we are reading/writing the file
#ifdef KERNEL_HAS_2_PARAM_INIT_WORK
INIT_WORK(&this->kernelWork, RWPagesWork_process);
#else
......@@ -176,24 +174,10 @@ void RWPagesWork_processQueue(RWPagesWork* this)
App* app = this->app;
Logger* log = App_getLogger(app);
FhgfsInode* fhgfsInode = BEEGFS_INODE(this->inode);
ssize_t rwRes;
if (this->rwType == BEEGFS_RWTYPE_WRITE)
FhgfsInode_incWriteBackCounter(fhgfsInode);
rwRes = FhgfsOpsRemoting_rwChunkPageVec(this->pageVec, &this->ioInfo, this->rwType);
if (this->rwType == BEEGFS_RWTYPE_WRITE)
{
spin_lock(&this->inode->i_lock);
FhgfsInode_setLastWriteBackOrIsizeWriteTime(fhgfsInode);
FhgfsInode_decWriteBackCounter(fhgfsInode);
FhgfsInode_unsetNoIsizeDecrease(fhgfsInode);
spin_unlock(&this->inode->i_lock);
}
if (unlikely(rwRes < 0) )
LOG_DEBUG_FORMATTED(log, 1, __func__, "error: %s", FhgfsOpsErr_toErrString(-rwRes) );
else
......
......@@ -93,8 +93,6 @@ void RWPagesWork_uninit(RWPagesWork* this)
FhgfsChunkPageVec_destroy(this->pageVec);
FhgfsInode_releaseHandle(fhgfsInode, this->handleType);
iput(this->inode);
}
void RWPagesWork_destruct(RWPagesWork* this)
......
......@@ -556,8 +556,6 @@ int _FhgfsOpsPages_writepages(struct address_space* mapping, struct writeback_co
#endif // LOG_DEBUG_MESSAGES
ihold(inode); // make sure the inode is not released
if (!page)
{ // writepages
#ifdef KERNEL_HAS_WRITE_CACHE_PAGES
......@@ -620,8 +618,6 @@ int _FhgfsOpsPages_writepages(struct address_space* mapping, struct writeback_co
FhgfsInode_releaseHandle(fhgfsInode, pageData.handleType);
outReferenceErr:
iput(inode);
#ifdef LOG_DEBUG_MESSAGES
{
App* app = FhgfsOps_getApp(inode->i_sb);
......
......@@ -1000,7 +1000,7 @@ void __FhgfsOpsCommKitVec_writefileStageHandlePages(CommKitVecHelper* commHelper
}
if (unlikely(remainingServerWriteRes < 0) )
Logger_logTopFormattedWithEntryID(inode, LogTopic_COMMKIT, Log_ERR, __func__,
Logger_logTopFormatted(commHelper->log, LogTopic_COMMKIT, Log_ERR, __func__,
"Write error detected (check server logs for details)!");
}
......@@ -1030,6 +1030,10 @@ static int64_t __FhgfsOpsCommKitVec_readfileCommunicate(CommKitVecHelper* commHe
static int64_t __FhgfsOpsCommKitVec_writefileCommunicate(CommKitVecHelper* commHelper,
FhgfsCommKitVec* comm)
{
FhgfsInode* inode = BEEGFS_INODE(comm->pageVec->inode);
FhgfsInode_incWriteBackCounter(inode);
comm->doHeader = false;
__FhgfsOpsCommKitVec_writefileStagePREPARE(commHelper, comm);
......@@ -1041,6 +1045,12 @@ static int64_t __FhgfsOpsCommKitVec_writefileCommunicate(CommKitVecHelper* commH
__FhgfsOpsCommKitVec_writefileStageSENDHEADER(commHelper, comm);
}
spin_lock(&inode->vfs_inode.i_lock);
FhgfsInode_setLastWriteBackOrIsizeWriteTime(inode);
FhgfsInode_decWriteBackCounter(inode);
FhgfsInode_unsetNoIsizeDecrease(inode);
spin_unlock(&inode->vfs_inode.i_lock);
return comm->nodeResult;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment