Re: [Yaffs] Kenrel 2.6.28-rc8 removes prepare_write/commit_w…

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Charles Manning
日付:  
To: yaffs
CC: Wookey
新しいトピック: Re: [Yaffs] Kenrel 2.6.28-rc8 removes prepare_write/commit_write...->> checkin
題目: Re: [Yaffs] Kenrel 2.6.28-rc8 removes prepare_write/commit_write...
Correction below

On Thursday 22 January 2009 09:13:40 Charles Manning wrote:
> Hi Wookey
>
> I'm trying to sort through the three available patches and try to make sure
> that what goes forwards considers the best of all of these.
>
> In your patch you have:
>
>
> +       if (nWritten == len)
> +               SetPageUptodate(pg);

>
> -       if (nWritten != nBytes) {
> +       if (nWritten != copied) {

>
> which boils down to:
>
> if( nWritten == len)
>     SetPageUptodate(pg);
> if(nWritten != copied){
>     SetPageError(pg);
>         ClearPageUptodate(pg);
> }

>
> Looks a bit odd: shouldn't you use just len or copied?
>
> I notice too that you don't read the data in write_begin. I guess this OK
> so long as pos is always page aligned which might be a valid assumption.
>
> Does your file_ops also have
> .lseek = generic_file_lseek.


        .llseek = generic_file_llseek,


>
> Without that it looks like lseek won't work in 2.6.28.


The default behaviour is to use default_lseek which does not seem to handle 
negative offsets. ie won't work properly for negative offsets. eg.
     newpos = lseek(h,-5,SEEK_CUR);
     newpos = lseek(h,-4,SEEK_END);

> -- Charles