Linux-Fsdevel Archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] exfat: remove duplicate write directory entries
@ 2022-07-06  2:34 Yuezhang.Mo
  0 siblings, 0 replies; only message in thread
From: Yuezhang.Mo @ 2022-07-06  2:34 UTC (permalink / raw
  To: Namjae Jeon, sj1557.seo@samsung.com
  Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andy.Wu@sony.com, Wataru.Aoyama@sony.com

These patches simplifie the code, and removes unnecessary writes for the
following operations.

1. Write data to an empty file
  * Preparation
    ```
    mkdir /mnt/dir;touch /mnt/dir/file;sync
    ```
  * Capture the blktrace log of the following command
    ```
    dd if=/dev/zero of=/mnt/dir/file bs=${cluster_size} count=1 oflag=append conv=notrunc
    ```
  * blktrace log
    * Before
      ```
      179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]        BootArea
      179,3    2        1    30.259435003   189  C   W 2628864 + 256 [0]      /dir/file
      179,3    0        2    30.264066003    84  C   W 2627584 + 1 [0]        BitMap
      179,3    2        2    30.261749337   189  C   W 2628608 + 1 [0]        /dir/
      179,3    0        3    60.479159007    84  C   W 2628608 + 1 [0]        /dir/
      ```
    * After
      ```
      179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]        BootArea
      179,3    3        1    30.185383337    87  C   W 2629888 + 256 [0]      /dir/file
      179,3    0        2    30.246422004    84  C   W 2627584 + 1 [0]        BitMap
      179,3    0        3    60.466497674    84  C   W 2628352 + 1 [0]        /dir/
      ```

2. Allocate a new cluster for a directory
  * Preparation
    ```
    mkdir /mnt/dir
    for ((i=1; i<cluster_size/96; i++)); do > /mnt/dir/file$i; done
    mkdir /mnt/dir/dir1; sync
    ```
  * Capture the blktrace log of the following command
    ```
    > /mnt/dir/file
    ```
  * blktrace log
    - Before
      ```
      179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]        BootArea
      179,3    2        1    30.263762003   189  C   W 2629504 + 128 [0]      /dir/
      179,3    2        2    30.275596670   189  C   W 2629376 + 128 [0]      /dir/
      179,3    2        3    30.290174003   189  C   W 2629119 + 1 [0]        /dir/
      179,3    2        4    30.292362670   189  C   W 2628096 + 1 [0]        /
      179,3    2        5    30.294547337   189  C   W 2627584 + 1 [0]        BitMap
      179,3    0        2    30.296661337    84  C   W 2625536 + 1 [0]        FatArea
      179,3    0        3    60.478775007    84  C   W 2628096 + 1 [0]        /
      ```
    - After
      ```
      179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]        BootArea
      179,3    3        1    30.288114670    87  C   W 2631552 + 128 [0]      /dir/
      179,3    3        2    30.303518003    87  C   W 2631424 + 128 [0]      /dir/
      179,3    3        3    30.324212337    87  C   W 2631167 + 1 [0]        /dir/
      179,3    3        4    30.326579003    87  C   W 2627584 + 1 [0]        BitMap
      179,3    0        2    30.328892670    84  C   W 2625536 + 1 [0]        FatArea
      179,3    0        3    60.503128674    84  C   W 2628096 + 1 [0]        /
      ```

3. Truncate and release cluster from the file
  * Preparation
    ```
    mkdir /mnt/dir
    dd if=/dev/zero of=/mnt/dir/file bs=${cluster_size} count=2
    sync
    ```
  * Capture the blktrace log of the following command
    ```
    truncate -s ${cluster_size} /mnt/dir/file
    ```

  * blktrace log
    * Before
      ```
      179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]        BootArea
      179,3    1        1     5.048452334    49  C   W 2629120 + 1 [0]        /dir/
      179,3    0        2     5.062994334    84  C   W 2627584 + 1 [0]        BitMap
      179,3    0        3    10.031253002    84  C   W 2629120 + 1 [0]        /dir/
      ```

     * After
      ```
      179,3    0        1     0.000000000  9143  C  WS 2623488 + 1 [0]        BootArea
      179,3    0        2    14.839244001  9143  C   W 2629888 + 1 [0]        /dir/
      179,3    0        3    14.841562335  9143  C   W 2627584 + 1 [0]        BitMap
      ```

Yuezhang Mo (3):
  exfat: reuse __exfat_write_inode() to update directory entry
  exfat: remove duplicate write inode for truncating file
  exfat: remove duplicate write inode for extending dir/file

 fs/exfat/exfat_fs.h |  1 +
 fs/exfat/file.c     | 82 ++++++++++++++-------------------------------
 fs/exfat/inode.c    | 41 ++++++-----------------
 fs/exfat/namei.c    | 20 -----------
 4 files changed, 37 insertions(+), 107 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-06  2:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-06  2:34 [PATCH v1 0/3] exfat: remove duplicate write directory entries Yuezhang.Mo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).