lkml.org 
[lkml]   [2005]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectFileSystem, "." and "..", rmdir
    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-11-06 16:06    [W:0.065 / U:118.912 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site