Um are you suggesting compression buffers to be per mounted volume? That
would be more wasteful than the current approach of one buffer per CPU
globally for all of ntfs driver.
> newbuf = vmalloc(NTFS_DECOMPR_BUFFER_SIZE);
>
> /* Re-check the buffer case we slept in vmalloc() and
> * someone else already allocated a buffer for "this" CPU.
> */
> if (likely(NTFS_SB(sb)->s_compr_array[cpunum] == NULL)) {
> NTFS_SB(sb)->s_compr_array[cpunum] = newbuf;
> newbuf = NULL;
> }
> cpunum = this_cpu();
> }
> /* Hmm, we slept in vmalloc and we don't need the new buffer */
> if (unlikely(newbuf != NULL))
> vfree(newbuf);
vfree() at a guess (I may be completely wrong on that one in which case I
appologize!) can also sleep so that breaks that scheme.
> > >3) Any allocated buffers are freed in the same manner they are now -
> > > when the last compressed volume is unmounted. There may be some or
> > > all entries that are still NULL.
> > >
> > >This also avoids allocating buffers when there are no files which are
> > >actually compressed.
> >
> > True it does, but unfortunately it doesn't work. )-:
>
>Now it does... ;-).
Perhaps. But if doing something like that I might as well use the present
approach and just allocate all buffers at once if they haven't been
allocated yet and be done with it. Then no vfree()s are needed either and
then it really does work. (-;
Anton
-- "I've not lost my mind. It's backed up on tape somewhere." - Unknown-- Anton Altaparmakov <aia21 at cantab.net> (replace at with @) Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/