Message type for path related calls.

- Updated system calls VFS_ACCESS, VFS_CHDIR, VFS_CHMOD, VFS_CHROOT,
                        VFS_MKDIR, VFS_OPEN, VFS_RMDIR, VSF_UNLINK

 - Removed M3_STRING and M3_LONG_STRING, which are tied to a specific
   "generic" message, and replaced where needed with M_PATH_STRING_MAX,
   which is tied to the mess_lc_vfs_path message.

Change-Id: If287c74f5ece937b9431e5d95b5b58a3c83ebff1
This commit is contained in:
2014-05-12 16:30:43 +02:00
parent 96b3577b2c
commit cef3ce969a
12 changed files with 29 additions and 29 deletions

View File

@@ -32,7 +32,7 @@
#define LABEL_MAX 16 /* maximum label size (including '\0'). Should
* not be smaller than 16 or bigger than
* M3_LONG_STRING.
* M_PATH_STRING_MAX.
*/
#define FSTYPE_MAX VFS_NAMELEN /* maximum file system type size */

View File

@@ -42,7 +42,7 @@ int do_open(void)
int open_flags;
char fullpath[PATH_MAX];
open_flags = job_m_in.VFS_PATH_FLAGS;
open_flags = job_m_in.m_lc_vfs_path.flags;
if (open_flags & O_CREAT)
return EINVAL;
@@ -562,7 +562,7 @@ int do_mkdir(void)
if (copy_path(fullpath, sizeof(fullpath)) != OK)
return(err_code);
dirmode = (mode_t) job_m_in.VFS_PATH_MODE;
dirmode = job_m_in.m_lc_vfs_path.mode;
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
resolve.l_vmnt_lock = VMNT_WRITE;

View File

@@ -44,7 +44,7 @@ int do_chmod(void)
resolve.l_vnode_lock = VNODE_WRITE;
if (job_call_nr == VFS_CHMOD) {
new_mode = job_m_in.VFS_PATH_MODE;
new_mode = job_m_in.m_lc_vfs_path.mode;
/* Temporarily open the file */
if (copy_path(fullpath, sizeof(fullpath)) != OK)
return(err_code);
@@ -207,7 +207,7 @@ int do_access(void)
struct lookup resolve;
mode_t access;
access = job_m_in.VFS_PATH_MODE;
access = job_m_in.m_lc_vfs_path.mode;
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
resolve.l_vmnt_lock = VMNT_READ;

View File

@@ -32,8 +32,8 @@ int copy_path(char *dest, size_t size)
assert(size >= PATH_MAX);
name = (vir_bytes) job_m_in.VFS_PATH_NAME;
len = job_m_in.VFS_PATH_LEN;
name = job_m_in.m_lc_vfs_path.name;
len = job_m_in.m_lc_vfs_path.len;
if (len > size) { /* 'len' includes terminating-nul */
err_code = ENAMETOOLONG;
@@ -41,11 +41,11 @@ int copy_path(char *dest, size_t size)
}
/* Is the string contained in the message? If not, perform a normal copy. */
if (len > M3_STRING)
if (len > M_PATH_STRING_MAX)
return fetch_name(name, len, dest);
/* Just copy the path from the message */
strncpy(dest, job_m_in.VFS_PATH_BUF, len);
strncpy(dest, job_m_in.m_lc_vfs_path.buf, len);
if (dest[len - 1] != '\0') {
err_code = ENAMETOOLONG;