From: "Steve French (smfltc)" <smfltc@us.ibm.com>
To: miklos@szeredi.hu
Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [Fwd: [PATCH] consolidate generic_writepages and mpage_writepages]
Date: Fri, 16 Feb 2007 17:15:39 -0600 [thread overview]
Message-ID: <45D63B1B.4000503@us.ibm.com> (raw)
In-Reply-To: <1171647615.8468.14.camel@kleikamp.austin.ibm.com>
>From: Miklos Szeredi <miklos@szeredi.hu>
>To: akpm@linux-foundation.org
>Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
>Subject: [PATCH] consolidate generic_writepages and mpage_writepages
>Date: Fri, 16 Feb 2007 17:23:25 +0100
>
>From: Miklos Szeredi <mszeredi@suse.cz>
>
>Clean up massive code duplication between mpage_writepages() and
>generic_writepages().
>
>The new generic function, write_cache_pages() takes a function pointer
>argument, which will be called for each page to be written.
>
>Maybe cifs_writepages() too can use this infrastructure, but I'm not
>touching that with a ten-foot pole.
>
>
The cifs case ought to be one of the simpler ones, pseudo-code is pretty
easy, the hard part is all of the stuff unrelated to cifs:
Ideally if there were generic functions to help out, cifs writepages
would look roughly like the following
cifs_writepages(struct address_space *mapping, struct writeback_control
*wbc)
{
while (no more pages to write) {
/* find writeable file handle for this inode */
/* find the biggest set of contiguous pages that total less than
wsize */
if (packet signing is enabled)
/* write lock pages so they can not be changed under us
while we are calculating the checksum */
CIFSSMBWrite2(tree_connection, network_file_handle, array of
iovecs, number of iovecs);
if(packet signing was enabled)
/* unlock pages */
if(error) {
set page errors
if (mounted "hard" )
continue; /* retry */
else /* if no retry possible */
return error to caller;
}
update bytes written statistics
update index to point to next set of pages
} /* end while loop */
}
If it were even better, CIFSSMBWrite2 could be called async - so that it
did not have to wait for a network response from Samba (just an ack from
TCP), before issuing the next write onto the wire - but this would
require that we could queue a pointer to a completion routine to the mpx
entry.
next parent reply other threads:[~2007-02-16 23:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1171647615.8468.14.camel@kleikamp.austin.ibm.com>
2007-02-16 23:15 ` Steve French (smfltc) [this message]
2007-02-17 10:04 ` [Fwd: [PATCH] consolidate generic_writepages and mpage_writepages] Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45D63B1B.4000503@us.ibm.com \
--to=smfltc@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=shaggy@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox