* FileSystem, "." and "..", rmdir
@ 2005-11-06 15:05 unDEFER
2005-11-07 0:05 ` unDEFER
2005-11-07 7:35 ` unDEFER
0 siblings, 2 replies; 3+ messages in thread
From: unDEFER @ 2005-11-06 15:05 UTC (permalink / raw)
To: linux-kernel
Hello,
I'm newbie in kernel programming and try to write filesystem, and have two problems.
1) There are not "<mount-point>/.", "<mount-point>/..", and "<mount-point>/<any_dir>/.." entries,
for example:
# ls -a
dir link text_file
# ls -a dir/
. level_2
# ls -a dir/level_2/
. ..
I make
filldir(dirent, ".", 1, i, ino, DT_DIR) and
filldir(dirent, "..", 2, i, parent_ino(filp->f_dentry))
in readdir() for all directories.
2) Problem with removing not empty directories:
# ls -l
total 135
drwxr-xr-x 3 root root 0 Nov 6 17:48 dir
lr-xr-xr-x 1 root root 1024 Nov 2 11:13 link -> /home/undefer
-r-xr-xr-x 1 root root 274944 Nov 2 11:13 text_file
# rmdir dir
rmdir: `dir': Directory not empty
# ls -l
total 135
?--------- 0 root root 0 Jan 1 1970 dir
lr-xr-xr-x 1 root root 1024 Nov 2 11:13 link -> /home/undefer
-r-xr-xr-x 1 root root 274944 Nov 2 11:13 text_file
So anything call "delete_inode" for directory and it's entries but it is not empty! What is? Why? What I could made not so?
Thanks,
Sorry for bad english.
--
registered Linux user #360474
Don't worry, I can read OpenOffice.org
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: FileSystem, "." and "..", rmdir
2005-11-06 15:05 FileSystem, "." and "..", rmdir unDEFER
@ 2005-11-07 0:05 ` unDEFER
2005-11-07 7:35 ` unDEFER
1 sibling, 0 replies; 3+ messages in thread
From: unDEFER @ 2005-11-07 0:05 UTC (permalink / raw)
To: linux-kernel
В письме от Sun, 06 Nov 2005 18:05:03 +0300, unDEFER <undefer@gmail.com> сообщал:
> So anything call "delete_inode" for directory and it's entries but it is not empty! What is? Why? What I could made not so?
Oh! I found my big error! It is here (in struct super_operations):
.drop_inode = generic_delete_inode,
So, second problem is solved.
--
Nikolaj Krivchenkov aka unDEFER
registered Linux user #360474
Don't worry, I can read OpenOffice.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FileSystem, "." and "..", rmdir
2005-11-06 15:05 FileSystem, "." and "..", rmdir unDEFER
2005-11-07 0:05 ` unDEFER
@ 2005-11-07 7:35 ` unDEFER
1 sibling, 0 replies; 3+ messages in thread
From: unDEFER @ 2005-11-07 7:35 UTC (permalink / raw)
To: linux-kernel
В письме от Sun, 06 Nov 2005 18:05:03 +0300, unDEFER <undefer@gmail.com> сообщал:
> 1) There are not "<mount-point>/.", "<mount-point>/..", and "<mount-point>/<any_dir>/.." entries,
And the first problem was solved when I change root inode to #1 and reserve inode #0 as not allocatable.
--
registered Linux user #360474
Don't worry, I can read OpenOffice.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-07 7:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-06 15:05 FileSystem, "." and "..", rmdir unDEFER
2005-11-07 0:05 ` unDEFER
2005-11-07 7:35 ` unDEFER
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.