Linux Filesystems LOC Update

I did a post last year about how lines of code for some of the primary Linux filesystems were evolving.  It seemed to spark people’s interest, so here’s an update through v3.4-rc4:

(Click to see full size).

I added regression lines this time – btrfs should catch xfs around kernel version 3.8 or so.  :)

Again, I draw no strong conclusions from this – I just think it’s interesting to see how things are moving as these filesystems evolve.

I used CLOC to count lines; the numbers on the graph reflect no blank lines & no comments.  For ext3 & ext4 I included jbd[2] and some of the peripheral files they use; code snippet from the script:

ext3lines=`cloc fs/ext3/*.[ch] include/linux/ext3*.h  fs/jbd/*.[ch] \
           include/linux/jbd.h fs/mbcache.c include/linux/mbcache.h \
           | grep SUM | awk '{print $5}'`;
ext4lines=`cloc fs/ext4/*.[ch] include/linux/ext4*.h  fs/jbd2/*.[ch] \
           include/linux/jbd2.h fs/mbcache.c include/linux/mbcache.h \
           | grep SUM | awk '{print $5}'`;
xfslines=`cloc fs/xfs/*.[ch] fs/xfs/*/*.[ch] include/linux/dqblk_xfs.h \
           | grep SUM | awk '{print $5}'`;
btrfslines=`cloc fs/btrfs/*.[ch] | grep SUM | awk '{print $5}'`;
gfs2lines=`cloc fs/gfs2/*.[ch] include/linux/gfs2* \
           | grep SUM | awk '{print $5}'`;

(Some of the files above no longer exist, but I used the same script to iterate over all the kernel versions.)

3 thoughts on “Linux Filesystems LOC Update

  1. It would be nice to see graphs of lines of whitespace and comments, too ;). Sure, one can always draw too strong a conclusion, but I still think the data is interesting.

Leave a Reply to Zach Brown Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.