Changeset 7d04324 in mainline for uspace/srv/fs/minixfs


Ignore:
Timestamp:
2011-03-17T21:10:13Z (15 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f213ae7
Parents:
5a58ae2
Message:

Link mfs_is_directory() and mfs_is_file() functions to the libfs_ops structure

Location:
uspace/srv/fs/minixfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs.h

    r5a58ae2 r7d04324  
    101101extern void mfs_mount(ipc_callid_t rid, ipc_call_t *request);
    102102extern bool mfs_is_directory(fs_node_t *fsnode);
     103extern bool mfs_is_file(fs_node_t *fsnode);
    103104extern devmap_handle_t mfs_device_get(fs_node_t *fsnode);
    104105extern int  mfs_get_instance(devmap_handle_t handle,
  • uspace/srv/fs/minixfs/mfs_ops.c

    r5a58ae2 r7d04324  
    4646libfs_ops_t mfs_libfs_ops = {
    4747        .device_get = mfs_device_get,
    48         .is_directory = mfs_is_directory
     48        .is_directory = mfs_is_directory,
     49        .is_file = mfs_is_file
    4950};
    5051
     
    214215}
    215216
     217bool mfs_is_file(fs_node_t *fsnode)
     218{
     219        struct mfs_node *node = fsnode->data;
     220        struct mfs_sb_info *sbi = node->instance->sbi;
     221
     222        if (sbi->fs_version == MFS_VERSION_V1)
     223                return S_ISREG(node->ino->i_mode);
     224        else
     225                return S_ISREG(node->ino2->i_mode);
     226}
     227
    216228/*
    217229 * Find a filesystem instance given the devmap handle
Note: See TracChangeset for help on using the changeset viewer.