// SPDX-License-Identifier: GPL-2.0 /* * Inode operations for Coda filesystem * Original version: (C) 1996 P. Braam and M. Callahan * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University * * Carnegie Mellon encourages users to contribute improvements to * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
*/
/* utility functions below */
umode_t coda_inode_type(struct coda_vattr *attr)
{ switch (attr->va_type) { case C_VREG: return S_IFREG; case C_VDIR: return S_IFDIR; case C_VLNK: return S_IFLNK; case C_VNON: default: return 0;
}
}
void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr)
{ /* inode's i_flags, i_ino are set by iget * XXX: is this all we need ??
*/
umode_t inode_type = coda_inode_type(attr);
inode->i_mode |= inode_type;
if (attr->va_mode != (u_short) -1)
inode->i_mode = attr->va_mode | inode_type; if (attr->va_uid != -1)
inode->i_uid = make_kuid(&init_user_ns, (uid_t) attr->va_uid); if (attr->va_gid != -1)
inode->i_gid = make_kgid(&init_user_ns, (gid_t) attr->va_gid); if (attr->va_nlink != -1)
set_nlink(inode, attr->va_nlink); if (attr->va_size != -1)
inode->i_size = attr->va_size; if (attr->va_size != -1)
inode->i_blocks = (attr->va_size + 511) >> 9; if (attr->va_atime.tv_sec != -1)
inode_set_atime_to_ts(inode,
coda_to_timespec64(attr->va_atime)); if (attr->va_mtime.tv_sec != -1)
inode_set_mtime_to_ts(inode,
coda_to_timespec64(attr->va_mtime)); if (attr->va_ctime.tv_sec != -1)
inode_set_ctime_to_ts(inode,
coda_to_timespec64(attr->va_ctime));
}
/* * BSD sets attributes that need not be modified to -1. * Linux uses the valid field to indicate what should be * looked at. The BSD type field needs to be deduced from linux * mode. * So we have to do some translations here.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.