lkml.org 
[lkml]   [2021]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjecthow and when to create the "." and ".." entry in Linux file systems?
Hello,

I'm trying to learn how to implement a very simple file system in a
Linux system. I started with registering the file system, allocating
and initializing the superblock, and allocating the root inode of this
file system. Now after mount, I can "cd" into my file system root
directory - the directory where this file system is mounted.

Now my next goal is, in the root directory, if I run "ls -a", I should
see "." and "..". I think this behavior should be common among all
file systems, thus in my file system code, I likely don't need to do
anything fancy, but maybe just call some VFS function? If so, call
which function? Are these two entries (. and ..) supposed to be
created when the file system is mounted or later - like not created
until I run "ls -a"?

Thank you.

-Jidong

\
 
 \ /
  Last update: 2021-11-18 03:20    [W:0.059 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site