lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] exfat: retain 'VolumeFlags' properly
From
Date
Ping..

On 2020/07/15 19:06, Tetsuhiro Kohada wrote:
>> It looks complicated. It would be better to simply set/clear VOLUME DIRTY bit.
>
> I think exfat_set_vol_flags() gets a little complicated,
> because it needs the followings (with bit operation)
>  a) Set/Clear VOLUME_DIRTY.
>  b) Set MEDIA_FAILUR.

How about splitting these into separate functions as below?


exfat_set_volume_dirty()
exfat_set_vol_flags(sb, sbi->vol_flag | VOLUME_DIRTY);

exfat_clear_volume_dirty()
exfat_set_vol_flags(sb, sbi->vol_flag & ~VOLUME_DIRTY);

exfat_set_media_failure()
exfat_set_vol_flags(sb, sbi->vol_flag | MEDIA_FAILURE);


The implementation is essentially the same for exfat_set_vol_flags(),
but I think the intention of the operation will be easier to understand.


BR
---
Tetsuhiro Kohada <kohada.t2@gmail.com>

\
 
 \ /
  Last update: 2020-07-30 08:25    [W:0.061 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site