lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 17 Feb 2007 11:04:12 +0100
From:	Miklos Szeredi <miklos@...redi.hu>
To:	smfltc@...ibm.com
CC:	shaggy@...ux.vnet.ibm.com, akpm@...ux-foundation.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Fwd: [PATCH] consolidate generic_writepages and mpage_writepages]

> >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 */
> }

write_cache_pages() now takes care of the 

     while (no more pages to write) {
     }

part.  All you have to do is to make the body of the loop into a
function and pass it a structure with the data you want to preserve
between invocations.

The hard part is untangling the breaks and continues.

Miklos
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ