/* * (C) 2001 Clemson University and The University of Chicago * * See COPYING in top-level directory. */#include"protocol.h"#include"orangefs-kernel.h"#include"orangefs-dev-proto.h"#include"orangefs-bufmap.h"__s32fsid_of_op(structorangefs_kernel_op_s*op){__s32fsid=ORANGEFS_FS_ID_NULL;if(op){switch(op->upcall.type){caseORANGEFS_VFS_OP_FILE_IO:fsid=op->upcall.req.io.refn.fs_id;break;caseORANGEFS_VFS_OP_LOOKUP:fsid=op->upcall.req.lookup.parent_refn.fs_id;break;caseORANGEFS_VFS_OP_CREATE:fsid=op->upcall.req.create.parent_refn.fs_id;break;caseORANGEFS_VFS_OP_GETATTR:fsid=op->upcall.req.getattr.refn.fs_id;break;caseORANGEFS_VFS_OP_REMOVE:fsid=op->upcall.req.remove.parent_refn.fs_id;break;caseORANGEFS_VFS_OP_MKDIR:fsid=op->upcall.req.mkdir.parent_refn.fs_id;break;caseORANGEFS_VFS_OP_READDIR:fsid=op->upcall.req.readdir.refn.fs_id;break;caseORANGEFS_VFS_OP_SETATTR:fsid=op->upcall.req.setattr.refn.fs_id;break;caseORANGEFS_VFS_OP_SYMLINK:fsid=op->upcall.req.sym.parent_refn.fs_id;break;caseORANGEFS_VFS_OP_RENAME:fsid=op->upcall.req.rename.old_parent_refn.fs_id;break;caseORANGEFS_VFS_OP_STATFS:fsid=op->upcall.req.statfs.fs_id;break;caseORANGEFS_VFS_OP_TRUNCATE:fsid=op->upcall.req.truncate.refn.fs_id;break;caseORANGEFS_VFS_OP_MMAP_RA_FLUSH:fsid=op->upcall.req.ra_cache_flush.refn.fs_id;break;caseORANGEFS_VFS_OP_FS_UMOUNT:fsid=op->upcall.req.fs_umount.fs_id;break;caseORANGEFS_VFS_OP_GETXATTR:fsid=op->upcall.req.getxattr.refn.fs_id;break;caseORANGEFS_VFS_OP_SETXATTR:fsid=op->upcall.req.setxattr.refn.fs_id;break;caseORANGEFS_VFS_OP_LISTXATTR:fsid=op->upcall.req.listxattr.refn.fs_id;break;caseORANGEFS_VFS_OP_REMOVEXATTR:fsid=op->upcall.req.removexattr.refn.fs_id;break;caseORANGEFS_VFS_OP_FSYNC:fsid=op->upcall.req.fsync.refn.fs_id;break;default:break;}}returnfsid;}staticvoidorangefs_set_inode_flags(structinode*inode,structORANGEFS_sys_attr_s*attrs){if(attrs->flags&ORANGEFS_IMMUTABLE_FL)inode->i_flags|=S_IMMUTABLE;elseinode->i_flags&=~S_IMMUTABLE;if(attrs->flags&ORANGEFS_APPEND_FL)inode->i_flags|=S_APPEND;elseinode->i_flags&=~S_APPEND;if(attrs->flags&