All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Shishkin <edward@redhat.com>
To: grub-devel@gnu.org
Subject: grub-0.97/VFS
Date: Wed, 22 Jul 2009 18:41:48 +0200	[thread overview]
Message-ID: <4A67414C.7080009@redhat.com> (raw)

(CC linux-btrfs mailing list)

Hello everyone.

Grub-0.97 filesystem interface (read_func, dir_func)
seems to be poor. Instead of this I would prefer to
have something like the following:

/*
*
* .init_root()           // set index of root dir
* .lookup_begin()        // get index by name
* .lookup_end()          // get inode by index
* .read_file()
* .read_dir()
* .read_symlink()
*
* so that dir_func in grub_open will look like the
* following:
*/
int path_walk()
{
    ops->init_root();
    while (1) {
        int mode;
        ops->lookup_end(&mode, ...);

        switch (type_of_file(mode)) {
        case SYMLINK_FILE:
            follow_symlink(read_symlink, ...);
            ...;
            continue;
        case REGULAR_FILE:
            /*
             * the end of path walk:
             * normally we want to exit here
             */
            ...;
            return 1;
        case DIRECTORY_FILE:
            /*
             * optionally this will
             * print possibilities
             */
            ops->lookup_begin(mode, read_dir, ...);
            ...;
            continue;
        default:
            errnum = ERR_BAD_FILETYPE;
            return 0;
        }
    }
}

Just my 2 cents in the (grub-2?) development process..

Thanks,
Edward.





             reply	other threads:[~2009-07-22 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22 16:41 Edward Shishkin [this message]
2009-07-22 17:04 ` grub-0.97/VFS Vladimir 'phcoder' Serbinenko
  -- strict thread matches above, loose matches on Subject: below --
2009-07-22 16:04 grub-0.97/VFS Edward Shishkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A67414C.7080009@redhat.com \
    --to=edward@redhat.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.