X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, J_CHICKENPOX_24,J_CHICKENPOX_25,J_CHICKENPOX_43,J_CHICKENPOX_44, J_CHICKENPOX_46,J_CHICKENPOX_73,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.4.0-r929098 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q4BEVNLC035922 for ; Fri, 11 May 2012 09:31:24 -0500 X-ASG-Debug-ID: 1336746681-04bdf034ef4062a0001-w1Z2WR Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by cuda.sgi.com with ESMTP id 5gzpQEFIAGXj5imS (version=TLSv1 cipher=RC4-SHA bits=128 verify=NO) for ; Fri, 11 May 2012 07:31:22 -0700 (PDT) X-Barracuda-Envelope-From: mujeeb.adil@gmail.com X-Barracuda-Apparent-Source-IP: 74.125.83.53 Received: by eekc41 with SMTP id c41so1355857eek.26 for ; Fri, 11 May 2012 07:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Fb2d81gRTSzKSkUqosgMe/EG5Mz03ywPZbIV8YgFNiM=; b=Lljdqr/UE0hpyJ9QsW3HZahZAVi4E9btsfRaVd30gsoujNf5m4L1ICmE4WJ2ey+Z6l AZ8yYly3pL/hBNv6pz0yn6VVrkNIPxaRP14A22P8S1rAutoJFtG8TneYr3zMpyLTD4iY FtV5Qrp3ONIHY8mDODFAGr8iCWoQyj/d+VHoHdzgsmEMr0FIqWh6cu+4DGr1hGFH3/WH okWvrH9xdD/IwIB0oVSZfxUqwlZVmRBkfKbezEE43pf0XxLea/elHjGsCgLbJYr30HY0 0GbufVlGqEUKh+X0FWsr0NGdKCGa/7ThLrTMjypjWUniIUuRzqCBsg4LWarec9S00KhH fIyw== MIME-Version: 1.0 Received: by 10.213.19.17 with SMTP id y17mr2591219eba.104.1336746680991; Fri, 11 May 2012 07:31:20 -0700 (PDT) Received: by 10.14.213.1 with HTTP; Fri, 11 May 2012 07:31:20 -0700 (PDT) Date: Fri, 11 May 2012 20:01:20 +0530 Message-ID: Subject: Blocks deallocation routine when file is deleted From: Adil Mujeeb X-ASG-Orig-Subj: Blocks deallocation routine when file is deleted To: linux-xfs@oss.sgi.com Content-Type: text/plain; charset=ISO-8859-1 X-Barracuda-Connect: mail-ee0-f53.google.com[74.125.83.53] X-Barracuda-Start-Time: 1336746682 X-Barracuda-Encrypted: RC4-SHA X-Barracuda-URL: http://192.48.157.11:80/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1.3 tests=DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.96643 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Hi list, I wanted to understand the routine of block deallocation when a file is deleted from XFS. Suppose initial state of the XFS partition is: -----------------8<------------------------ localhost:/home/adil # df /mnt/test/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/vg_lv_test 67055628 5280 67050348 1% /mnt/test -----------------8<------------------------ The Used value is 5280. What it (5280) signifies? Number of FSB? Now a 1MB size file is being created named xyz. After file creation checked the filesystem usage: -----------------8<------------------------ localhost:/home/adil # df /mnt/test/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/vg_lv_test 67055628 6304 67049324 1% /mnt/test localhost:/mnt/test # xfs_io xyz xfs_io> stat fd.path = "xyz" fd.flags = non-sync,non-direct,read-write stat.ino = 132 stat.type = regular file stat.size = 1048576 stat.blocks = 2048 fsxattr.xflags = 0x0 [--------------] fsxattr.projid = 0 fsxattr.extsize = 0 fsxattr.nextents = 1 fsxattr.naextents = 0 dioattr.mem = 0x200 dioattr.miniosz = 512 dioattr.maxiosz = 2147483136 -----------------8<------------------------ The used count has increased from 5280 to 6304 i.e. by 1024. What it (1024) signifies? Now deleted the file and checked the blocks and other information whether the blocks allocated returned back or not: -----------------8<------------------------ localhost:/mnt/test # rm xyz localhost:/home/adil # df /mnt/test/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/vg_lv_test 67055628 5280 67050348 1% /mnt/test -----------------8<------------------------ So here we see that the used count is decreased to original value (5280). I would like to know where this deallocation is being done in the code. I appreciate if anyone can help me in giving the code flow hint. Thanks and Best Regards, Adil