summaryrefslogtreecommitdiff
path: root/fs/orangefs/pvfs2-utils.c
diff options
context:
space:
mode:
authorYi Liu <yi9@clemson.edu>2015-11-24 15:12:14 -0500
committerMike Marshall <hubcap@omnibond.com>2015-12-03 14:45:44 -0500
commit8bb8aefd5afb54a25a002feb4ec70011812d06a0 (patch)
tree08ca295ca2541c889e2805f92ae0aa699b0a13df /fs/orangefs/pvfs2-utils.c
parent555fa0fa618b846c5b38406347b7d53ace320ac6 (diff)
downloadlwn-8bb8aefd5afb54a25a002feb4ec70011812d06a0.tar.gz
lwn-8bb8aefd5afb54a25a002feb4ec70011812d06a0.zip
OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.
OrangeFS was formerly known as PVFS2 and retains the name in many places. I leave the device /dev/pvfs2-req since this affects userspace. I leave the filesystem type pvfs2 since this affects userspace. Further the OrangeFS sysint library reads fstab for an entry of type pvfs2 independently of kernel mounts. I leave extended attribute keys user.pvfs2 and system.pvfs2 as the sysint library understands these. I leave references to userspace binaries still named pvfs2. I leave the filenames. Signed-off-by: Yi Liu <yi9@clemson.edu> [martin@omnibond.com: clairify above constraints and merge] Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/pvfs2-utils.c')
-rw-r--r--fs/orangefs/pvfs2-utils.c336
1 files changed, 168 insertions, 168 deletions
diff --git a/fs/orangefs/pvfs2-utils.c b/fs/orangefs/pvfs2-utils.c
index 1180a2480d2b..d132c5f712a4 100644
--- a/fs/orangefs/pvfs2-utils.c
+++ b/fs/orangefs/pvfs2-utils.c
@@ -8,67 +8,67 @@
#include "pvfs2-dev-proto.h"
#include "pvfs2-bufmap.h"
-__s32 fsid_of_op(struct pvfs2_kernel_op_s *op)
+__s32 fsid_of_op(struct orangefs_kernel_op_s *op)
{
- __s32 fsid = PVFS_FS_ID_NULL;
+ __s32 fsid = ORANGEFS_FS_ID_NULL;
if (op) {
switch (op->upcall.type) {
- case PVFS2_VFS_OP_FILE_IO:
+ case ORANGEFS_VFS_OP_FILE_IO:
fsid = op->upcall.req.io.refn.fs_id;
break;
- case PVFS2_VFS_OP_LOOKUP:
+ case ORANGEFS_VFS_OP_LOOKUP:
fsid = op->upcall.req.lookup.parent_refn.fs_id;
break;
- case PVFS2_VFS_OP_CREATE:
+ case ORANGEFS_VFS_OP_CREATE:
fsid = op->upcall.req.create.parent_refn.fs_id;
break;
- case PVFS2_VFS_OP_GETATTR:
+ case ORANGEFS_VFS_OP_GETATTR:
fsid = op->upcall.req.getattr.refn.fs_id;
break;
- case PVFS2_VFS_OP_REMOVE:
+ case ORANGEFS_VFS_OP_REMOVE:
fsid = op->upcall.req.remove.parent_refn.fs_id;
break;
- case PVFS2_VFS_OP_MKDIR:
+ case ORANGEFS_VFS_OP_MKDIR:
fsid = op->upcall.req.mkdir.parent_refn.fs_id;
break;
- case PVFS2_VFS_OP_READDIR:
+ case ORANGEFS_VFS_OP_READDIR:
fsid = op->upcall.req.readdir.refn.fs_id;
break;
- case PVFS2_VFS_OP_SETATTR:
+ case ORANGEFS_VFS_OP_SETATTR:
fsid = op->upcall.req.setattr.refn.fs_id;
break;
- case PVFS2_VFS_OP_SYMLINK:
+ case ORANGEFS_VFS_OP_SYMLINK:
fsid = op->upcall.req.sym.parent_refn.fs_id;
break;
- case PVFS2_VFS_OP_RENAME:
+ case ORANGEFS_VFS_OP_RENAME:
fsid = op->upcall.req.rename.old_parent_refn.fs_id;
break;
- case PVFS2_VFS_OP_STATFS:
+ case ORANGEFS_VFS_OP_STATFS:
fsid = op->upcall.req.statfs.fs_id;
break;
- case PVFS2_VFS_OP_TRUNCATE:
+ case ORANGEFS_VFS_OP_TRUNCATE:
fsid = op->upcall.req.truncate.refn.fs_id;
break;
- case PVFS2_VFS_OP_MMAP_RA_FLUSH:
+ case ORANGEFS_VFS_OP_MMAP_RA_FLUSH:
fsid = op->upcall.req.ra_cache_flush.refn.fs_id;
break;
- case PVFS2_VFS_OP_FS_UMOUNT:
+ case ORANGEFS_VFS_OP_FS_UMOUNT:
fsid = op->upcall.req.fs_umount.fs_id;
break;
- case PVFS2_VFS_OP_GETXATTR:
+ case ORANGEFS_VFS_OP_GETXATTR:
fsid = op->upcall.req.getxattr.refn.fs_id;
break;
- case PVFS2_VFS_OP_SETXATTR:
+ case ORANGEFS_VFS_OP_SETXATTR:
fsid = op->upcall.req.setxattr.refn.fs_id;
break;
- case PVFS2_VFS_OP_LISTXATTR:
+ case ORANGEFS_VFS_OP_LISTXATTR:
fsid = op->upcall.req.listxattr.refn.fs_id;
break;
- case PVFS2_VFS_OP_REMOVEXATTR:
+ case ORANGEFS_VFS_OP_REMOVEXATTR:
fsid = op->upcall.req.removexattr.refn.fs_id;
break;
- case PVFS2_VFS_OP_FSYNC:
+ case ORANGEFS_VFS_OP_FSYNC:
fsid = op->upcall.req.fsync.refn.fs_id;
break;
default:
@@ -78,20 +78,20 @@ __s32 fsid_of_op(struct pvfs2_kernel_op_s *op)
return fsid;
}
-static void pvfs2_set_inode_flags(struct inode *inode,
- struct PVFS_sys_attr_s *attrs)
+static void orangefs_set_inode_flags(struct inode *inode,
+ struct ORANGEFS_sys_attr_s *attrs)
{
- if (attrs->flags & PVFS_IMMUTABLE_FL)
+ if (attrs->flags & ORANGEFS_IMMUTABLE_FL)
inode->i_flags |= S_IMMUTABLE;
else
inode->i_flags &= ~S_IMMUTABLE;
- if (attrs->flags & PVFS_APPEND_FL)
+ if (attrs->flags & ORANGEFS_APPEND_FL)
inode->i_flags |= S_APPEND;
else
inode->i_flags &= ~S_APPEND;
- if (attrs->flags & PVFS_NOATIME_FL)
+ if (attrs->flags & ORANGEFS_NOATIME_FL)
inode->i_flags |= S_NOATIME;
else
inode->i_flags &= ~S_NOATIME;
@@ -100,12 +100,12 @@ static void pvfs2_set_inode_flags(struct inode *inode,
/* NOTE: symname is ignored unless the inode is a sym link */
static int copy_attributes_to_inode(struct inode *inode,
- struct PVFS_sys_attr_s *attrs,
+ struct ORANGEFS_sys_attr_s *attrs,
char *symname)
{
int ret = -1;
int perm_mode = 0;
- struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
+ struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
loff_t inode_size = 0;
loff_t rounded_up_size = 0;
@@ -127,24 +127,24 @@ static int copy_attributes_to_inode(struct inode *inode,
gossip_debug(GOSSIP_UTILS_DEBUG,
"attrs->mask = %x (objtype = %s)\n",
attrs->mask,
- attrs->objtype == PVFS_TYPE_METAFILE ? "file" :
- attrs->objtype == PVFS_TYPE_DIRECTORY ? "directory" :
- attrs->objtype == PVFS_TYPE_SYMLINK ? "symlink" :
+ attrs->objtype == ORANGEFS_TYPE_METAFILE ? "file" :
+ attrs->objtype == ORANGEFS_TYPE_DIRECTORY ? "directory" :
+ attrs->objtype == ORANGEFS_TYPE_SYMLINK ? "symlink" :
"invalid/unknown");
switch (attrs->objtype) {
- case PVFS_TYPE_METAFILE:
- pvfs2_set_inode_flags(inode, attrs);
- if (attrs->mask & PVFS_ATTR_SYS_SIZE) {
+ case ORANGEFS_TYPE_METAFILE:
+ orangefs_set_inode_flags(inode, attrs);
+ if (attrs->mask & ORANGEFS_ATTR_SYS_SIZE) {
inode_size = (loff_t) attrs->size;
rounded_up_size =
(inode_size + (4096 - (inode_size % 4096)));
- pvfs2_lock_inode(inode);
+ orangefs_lock_inode(inode);
inode->i_bytes = inode_size;
inode->i_blocks =
(unsigned long)(rounded_up_size / 512);
- pvfs2_unlock_inode(inode);
+ orangefs_unlock_inode(inode);
/*
* NOTE: make sure all the places we're called
@@ -155,7 +155,7 @@ static int copy_attributes_to_inode(struct inode *inode,
inode->i_size = inode_size;
}
break;
- case PVFS_TYPE_SYMLINK:
+ case ORANGEFS_TYPE_SYMLINK:
if (symname != NULL) {
inode->i_size = (loff_t) strlen(symname);
break;
@@ -164,9 +164,9 @@ static int copy_attributes_to_inode(struct inode *inode,
default:
inode->i_size = PAGE_CACHE_SIZE;
- pvfs2_lock_inode(inode);
+ orangefs_lock_inode(inode);
inode_set_bytes(inode, inode->i_size);
- pvfs2_unlock_inode(inode);
+ orangefs_unlock_inode(inode);
break;
}
@@ -179,30 +179,30 @@ static int copy_attributes_to_inode(struct inode *inode,
inode->i_mtime.tv_nsec = 0;
inode->i_ctime.tv_nsec = 0;
- if (attrs->perms & PVFS_O_EXECUTE)
+ if (attrs->perms & ORANGEFS_O_EXECUTE)
perm_mode |= S_IXOTH;
- if (attrs->perms & PVFS_O_WRITE)
+ if (attrs->perms & ORANGEFS_O_WRITE)
perm_mode |= S_IWOTH;
- if (attrs->perms & PVFS_O_READ)
+ if (attrs->perms & ORANGEFS_O_READ)
perm_mode |= S_IROTH;
- if (attrs->perms & PVFS_G_EXECUTE)
+ if (attrs->perms & ORANGEFS_G_EXECUTE)
perm_mode |= S_IXGRP;
- if (attrs->perms & PVFS_G_WRITE)
+ if (attrs->perms & ORANGEFS_G_WRITE)
perm_mode |= S_IWGRP;
- if (attrs->perms & PVFS_G_READ)
+ if (attrs->perms & ORANGEFS_G_READ)
perm_mode |= S_IRGRP;
- if (attrs->perms & PVFS_U_EXECUTE)
+ if (attrs->perms & ORANGEFS_U_EXECUTE)
perm_mode |= S_IXUSR;
- if (attrs->perms & PVFS_U_WRITE)
+ if (attrs->perms & ORANGEFS_U_WRITE)
perm_mode |= S_IWUSR;
- if (attrs->perms & PVFS_U_READ)
+ if (attrs->perms & ORANGEFS_U_READ)
perm_mode |= S_IRUSR;
- if (attrs->perms & PVFS_G_SGID)
+ if (attrs->perms & ORANGEFS_G_SGID)
perm_mode |= S_ISGID;
- if (attrs->perms & PVFS_U_SUID)
+ if (attrs->perms & ORANGEFS_U_SUID)
perm_mode |= S_ISUID;
inode->i_mode = perm_mode;
@@ -216,11 +216,11 @@ static int copy_attributes_to_inode(struct inode *inode,
}
switch (attrs->objtype) {
- case PVFS_TYPE_METAFILE:
+ case ORANGEFS_TYPE_METAFILE:
inode->i_mode |= S_IFREG;
ret = 0;
break;
- case PVFS_TYPE_DIRECTORY:
+ case ORANGEFS_TYPE_DIRECTORY:
inode->i_mode |= S_IFDIR;
/* NOTE: we have no good way to keep nlink consistent
* for directories across clients; keep constant at 1.
@@ -230,17 +230,17 @@ static int copy_attributes_to_inode(struct inode *inode,
set_nlink(inode, 1);
ret = 0;
break;
- case PVFS_TYPE_SYMLINK:
+ case ORANGEFS_TYPE_SYMLINK:
inode->i_mode |= S_IFLNK;
/* copy link target to inode private data */
- if (pvfs2_inode && symname) {
- strncpy(pvfs2_inode->link_target,
+ if (orangefs_inode && symname) {
+ strncpy(orangefs_inode->link_target,
symname,
- PVFS_NAME_MAX);
+ ORANGEFS_NAME_MAX);
gossip_debug(GOSSIP_UTILS_DEBUG,
"Copied attr link target %s\n",
- pvfs2_inode->link_target);
+ orangefs_inode->link_target);
}
gossip_debug(GOSSIP_UTILS_DEBUG,
"symlink mode %o\n",
@@ -248,12 +248,12 @@ static int copy_attributes_to_inode(struct inode *inode,
ret = 0;
break;
default:
- gossip_err("pvfs2: copy_attributes_to_inode: got invalid attribute type %x\n",
+ gossip_err("orangefs: copy_attributes_to_inode: got invalid attribute type %x\n",
attrs->objtype);
}
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2: copy_attributes_to_inode: setting i_mode to %o, i_size to %lu\n",
+ "orangefs: copy_attributes_to_inode: setting i_mode to %o, i_size to %lu\n",
inode->i_mode,
(unsigned long)i_size_read(inode));
@@ -265,7 +265,7 @@ static int copy_attributes_to_inode(struct inode *inode,
* anything, so don't bother copying it into the sys_attr object here.
*/
static inline int copy_attributes_from_inode(struct inode *inode,
- struct PVFS_sys_attr_s *attrs,
+ struct ORANGEFS_sys_attr_s *attrs,
struct iattr *iattr)
{
umode_t tmp_mode;
@@ -285,36 +285,36 @@ static inline int copy_attributes_from_inode(struct inode *inode,
attrs->mask = 0;
if (iattr->ia_valid & ATTR_UID) {
attrs->owner = from_kuid(current_user_ns(), iattr->ia_uid);
- attrs->mask |= PVFS_ATTR_SYS_UID;
+ attrs->mask |= ORANGEFS_ATTR_SYS_UID;
gossip_debug(GOSSIP_UTILS_DEBUG, "(UID) %d\n", attrs->owner);
}
if (iattr->ia_valid & ATTR_GID) {
attrs->group = from_kgid(current_user_ns(), iattr->ia_gid);
- attrs->mask |= PVFS_ATTR_SYS_GID;
+ attrs->mask |= ORANGEFS_ATTR_SYS_GID;
gossip_debug(GOSSIP_UTILS_DEBUG, "(GID) %d\n", attrs->group);
}
if (iattr->ia_valid & ATTR_ATIME) {
- attrs->mask |= PVFS_ATTR_SYS_ATIME;
+ attrs->mask |= ORANGEFS_ATTR_SYS_ATIME;
if (iattr->ia_valid & ATTR_ATIME_SET) {
attrs->atime =
- pvfs2_convert_time_field(&iattr->ia_atime);
- attrs->mask |= PVFS_ATTR_SYS_ATIME_SET;
+ orangefs_convert_time_field(&iattr->ia_atime);
+ attrs->mask |= ORANGEFS_ATTR_SYS_ATIME_SET;
}
}
if (iattr->ia_valid & ATTR_MTIME) {
- attrs->mask |= PVFS_ATTR_SYS_MTIME;
+ attrs->mask |= ORANGEFS_ATTR_SYS_MTIME;
if (iattr->ia_valid & ATTR_MTIME_SET) {
attrs->mtime =
- pvfs2_convert_time_field(&iattr->ia_mtime);
- attrs->mask |= PVFS_ATTR_SYS_MTIME_SET;
+ orangefs_convert_time_field(&iattr->ia_mtime);
+ attrs->mask |= ORANGEFS_ATTR_SYS_MTIME_SET;
}
}
if (iattr->ia_valid & ATTR_CTIME)
- attrs->mask |= PVFS_ATTR_SYS_CTIME;
+ attrs->mask |= ORANGEFS_ATTR_SYS_CTIME;
/*
- * PVFS2 cannot set size with a setattr operation. Probably not likely
+ * ORANGEFS cannot set size with a setattr operation. Probably not likely
* to be requested through the VFS, but just in case, don't worry about
* ATTR_SIZE
*/
@@ -342,21 +342,21 @@ static inline int copy_attributes_from_inode(struct inode *inode,
return -EINVAL;
}
- attrs->perms = PVFS_util_translate_mode(tmp_mode);
- attrs->mask |= PVFS_ATTR_SYS_PERM;
+ attrs->perms = ORANGEFS_util_translate_mode(tmp_mode);
+ attrs->mask |= ORANGEFS_ATTR_SYS_PERM;
}
return 0;
}
/*
- * issues a pvfs2 getattr request and fills in the appropriate inode
+ * issues a orangefs getattr request and fills in the appropriate inode
* attributes if successful. returns 0 on success; -errno otherwise
*/
-int pvfs2_inode_getattr(struct inode *inode, __u32 getattr_mask)
+int orangefs_inode_getattr(struct inode *inode, __u32 getattr_mask)
{
- struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
- struct pvfs2_kernel_op_s *new_op;
+ struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
+ struct orangefs_kernel_op_s *new_op;
int ret = -EINVAL;
gossip_debug(GOSSIP_UTILS_DEBUG,
@@ -364,10 +364,10 @@ int pvfs2_inode_getattr(struct inode *inode, __u32 getattr_mask)
__func__,
get_khandle_from_ino(inode));
- new_op = op_alloc(PVFS2_VFS_OP_GETATTR);
+ new_op = op_alloc(ORANGEFS_VFS_OP_GETATTR);
if (!new_op)
return -ENOMEM;
- new_op->upcall.req.getattr.refn = pvfs2_inode->refn;
+ new_op->upcall.req.getattr.refn = orangefs_inode->refn;
new_op->upcall.req.getattr.mask = getattr_mask;
ret = service_operation(new_op, __func__,
@@ -384,17 +384,17 @@ int pvfs2_inode_getattr(struct inode *inode, __u32 getattr_mask)
}
/*
- * Store blksize in pvfs2 specific part of inode structure; we are
+ * Store blksize in orangefs specific part of inode structure; we are
* only going to use this to report to stat to make sure it doesn't
* perturb any inode related code paths.
*/
if (new_op->downcall.resp.getattr.attributes.objtype ==
- PVFS_TYPE_METAFILE) {
- pvfs2_inode->blksize =
+ ORANGEFS_TYPE_METAFILE) {
+ orangefs_inode->blksize =
new_op->downcall.resp.getattr.attributes.blksize;
} else {
/* mimic behavior of generic_fillattr() for other types. */
- pvfs2_inode->blksize = (1 << inode->i_blkbits);
+ orangefs_inode->blksize = (1 << inode->i_blkbits);
}
@@ -402,8 +402,8 @@ out:
gossip_debug(GOSSIP_UTILS_DEBUG,
"Getattr on handle %pU, "
"fsid %d\n (inode ct = %d) returned %d\n",
- &pvfs2_inode->refn.khandle,
- pvfs2_inode->refn.fs_id,
+ &orangefs_inode->refn.khandle,
+ orangefs_inode->refn.fs_id,
(int)atomic_read(&inode->i_count),
ret);
@@ -412,20 +412,20 @@ out:
}
/*
- * issues a pvfs2 setattr request to make sure the new attribute values
+ * issues a orangefs setattr request to make sure the new attribute values
* take effect if successful. returns 0 on success; -errno otherwise
*/
-int pvfs2_inode_setattr(struct inode *inode, struct iattr *iattr)
+int orangefs_inode_setattr(struct inode *inode, struct iattr *iattr)
{
- struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
- struct pvfs2_kernel_op_s *new_op;
+ struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
+ struct orangefs_kernel_op_s *new_op;
int ret;
- new_op = op_alloc(PVFS2_VFS_OP_SETATTR);
+ new_op = op_alloc(ORANGEFS_VFS_OP_SETATTR);
if (!new_op)
return -ENOMEM;
- new_op->upcall.req.setattr.refn = pvfs2_inode->refn;
+ new_op->upcall.req.setattr.refn = orangefs_inode->refn;
ret = copy_attributes_from_inode(inode,
&new_op->upcall.req.setattr.attributes,
iattr);
@@ -438,7 +438,7 @@ int pvfs2_inode_setattr(struct inode *inode, struct iattr *iattr)
get_interruptible_flag(inode));
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_inode_setattr: returning %d\n",
+ "orangefs_inode_setattr: returning %d\n",
ret);
/* when request is serviced properly, free req op struct */
@@ -449,16 +449,16 @@ int pvfs2_inode_setattr(struct inode *inode, struct iattr *iattr)
* ctime flags.
*/
if (ret == 0) {
- ClearAtimeFlag(pvfs2_inode);
- ClearMtimeFlag(pvfs2_inode);
- ClearCtimeFlag(pvfs2_inode);
- ClearModeFlag(pvfs2_inode);
+ ClearAtimeFlag(orangefs_inode);
+ ClearMtimeFlag(orangefs_inode);
+ ClearCtimeFlag(orangefs_inode);
+ ClearModeFlag(orangefs_inode);
}
return ret;
}
-int pvfs2_flush_inode(struct inode *inode)
+int orangefs_flush_inode(struct inode *inode)
{
/*
* If it is a dirty inode, this function gets called.
@@ -472,7 +472,7 @@ int pvfs2_flush_inode(struct inode *inode)
int ctime_flag;
int atime_flag;
int mode_flag;
- struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
+ struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
memset(&wbattr, 0, sizeof(wbattr));
@@ -481,14 +481,14 @@ int pvfs2_flush_inode(struct inode *inode)
* will prevent multiple processes from all trying to flush the same
* inode if they call close() simultaneously
*/
- mtime_flag = MtimeFlag(pvfs2_inode);
- ClearMtimeFlag(pvfs2_inode);
- ctime_flag = CtimeFlag(pvfs2_inode);
- ClearCtimeFlag(pvfs2_inode);
- atime_flag = AtimeFlag(pvfs2_inode);
- ClearAtimeFlag(pvfs2_inode);
- mode_flag = ModeFlag(pvfs2_inode);
- ClearModeFlag(pvfs2_inode);
+ mtime_flag = MtimeFlag(orangefs_inode);
+ ClearMtimeFlag(orangefs_inode);
+ ctime_flag = CtimeFlag(orangefs_inode);
+ ClearCtimeFlag(orangefs_inode);
+ atime_flag = AtimeFlag(orangefs_inode);
+ ClearAtimeFlag(orangefs_inode);
+ mode_flag = ModeFlag(orangefs_inode);
+ ClearModeFlag(orangefs_inode);
/* -- Lazy atime,mtime and ctime update --
* Note: all times are dictated by server in the new scheme
@@ -510,56 +510,56 @@ int pvfs2_flush_inode(struct inode *inode)
}
gossip_debug(GOSSIP_UTILS_DEBUG,
- "*********** pvfs2_flush_inode: %pU "
+ "*********** orangefs_flush_inode: %pU "
"(ia_valid %d)\n",
get_khandle_from_ino(inode),
wbattr.ia_valid);
if (wbattr.ia_valid == 0) {
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_flush_inode skipping setattr()\n");
+ "orangefs_flush_inode skipping setattr()\n");
return 0;
}
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_flush_inode (%pU) writing mode %o\n",
+ "orangefs_flush_inode (%pU) writing mode %o\n",
get_khandle_from_ino(inode),
inode->i_mode);
- ret = pvfs2_inode_setattr(inode, &wbattr);
+ ret = orangefs_inode_setattr(inode, &wbattr);
return ret;
}
-int pvfs2_unmount_sb(struct super_block *sb)
+int orangefs_unmount_sb(struct super_block *sb)
{
int ret = -EINVAL;
- struct pvfs2_kernel_op_s *new_op = NULL;
+ struct orangefs_kernel_op_s *new_op = NULL;
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_unmount_sb called on sb %p\n",
+ "orangefs_unmount_sb called on sb %p\n",
sb);
- new_op = op_alloc(PVFS2_VFS_OP_FS_UMOUNT);
+ new_op = op_alloc(ORANGEFS_VFS_OP_FS_UMOUNT);
if (!new_op)
return -ENOMEM;
- new_op->upcall.req.fs_umount.id = PVFS2_SB(sb)->id;
- new_op->upcall.req.fs_umount.fs_id = PVFS2_SB(sb)->fs_id;
- strncpy(new_op->upcall.req.fs_umount.pvfs2_config_server,
- PVFS2_SB(sb)->devname,
- PVFS_MAX_SERVER_ADDR_LEN);
+ new_op->upcall.req.fs_umount.id = ORANGEFS_SB(sb)->id;
+ new_op->upcall.req.fs_umount.fs_id = ORANGEFS_SB(sb)->fs_id;
+ strncpy(new_op->upcall.req.fs_umount.orangefs_config_server,
+ ORANGEFS_SB(sb)->devname,
+ ORANGEFS_MAX_SERVER_ADDR_LEN);
gossip_debug(GOSSIP_UTILS_DEBUG,
- "Attempting PVFS2 Unmount via host %s\n",
- new_op->upcall.req.fs_umount.pvfs2_config_server);
+ "Attempting ORANGEFS Unmount via host %s\n",
+ new_op->upcall.req.fs_umount.orangefs_config_server);
- ret = service_operation(new_op, "pvfs2_fs_umount", 0);
+ ret = service_operation(new_op, "orangefs_fs_umount", 0);
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_unmount: got return value of %d\n", ret);
+ "orangefs_unmount: got return value of %d\n", ret);
if (ret)
sb = ERR_PTR(ret);
else
- PVFS2_SB(sb)->mount_pending = 1;
+ ORANGEFS_SB(sb)->mount_pending = 1;
op_release(new_op);
return ret;
@@ -569,42 +569,42 @@ int pvfs2_unmount_sb(struct super_block *sb)
* NOTE: on successful cancellation, be sure to return -EINTR, as
* that's the return value the caller expects
*/
-int pvfs2_cancel_op_in_progress(__u64 tag)
+int orangefs_cancel_op_in_progress(__u64 tag)
{
int ret = -EINVAL;
- struct pvfs2_kernel_op_s *new_op = NULL;
+ struct orangefs_kernel_op_s *new_op = NULL;
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_cancel_op_in_progress called on tag %llu\n",
+ "orangefs_cancel_op_in_progress called on tag %llu\n",
llu(tag));
- new_op = op_alloc(PVFS2_VFS_OP_CANCEL);
+ new_op = op_alloc(ORANGEFS_VFS_OP_CANCEL);
if (!new_op)
return -ENOMEM;
new_op->upcall.req.cancel.op_tag = tag;
gossip_debug(GOSSIP_UTILS_DEBUG,
- "Attempting PVFS2 operation cancellation of tag %llu\n",
+ "Attempting ORANGEFS operation cancellation of tag %llu\n",
llu(new_op->upcall.req.cancel.op_tag));
- ret = service_operation(new_op, "pvfs2_cancel", PVFS2_OP_CANCELLATION);
+ ret = service_operation(new_op, "orangefs_cancel", ORANGEFS_OP_CANCELLATION);
gossip_debug(GOSSIP_UTILS_DEBUG,
- "pvfs2_cancel_op_in_progress: got return value of %d\n",
+ "orangefs_cancel_op_in_progress: got return value of %d\n",
ret);
op_release(new_op);
return ret;
}
-void pvfs2_op_initialize(struct pvfs2_kernel_op_s *op)
+void orangefs_op_initialize(struct orangefs_kernel_op_s *op)
{
if (op) {
spin_lock(&op->lock);
op->io_completed = 0;
- op->upcall.type = PVFS2_VFS_OP_INVALID;
- op->downcall.type = PVFS2_VFS_OP_INVALID;
+ op->upcall.type = ORANGEFS_VFS_OP_INVALID;
+ op->downcall.type = ORANGEFS_VFS_OP_INVALID;
op->downcall.status = -1;
op->op_state = OP_VFS_STATE_UNKNOWN;
@@ -613,7 +613,7 @@ void pvfs2_op_initialize(struct pvfs2_kernel_op_s *op)
}
}
-void pvfs2_make_bad_inode(struct inode *inode)
+void orangefs_make_bad_inode(struct inode *inode)
{
if (is_root_handle(inode)) {
/*
@@ -655,10 +655,10 @@ void set_signals(sigset_t *sigset)
/*
* The following is a very dirty hack that is now a permanent part of the
- * PVFS2 protocol. See protocol.h for more error definitions.
+ * ORANGEFS protocol. See protocol.h for more error definitions.
*/
-/* The order matches include/pvfs2-types.h in the OrangeFS source. */
+/* The order matches include/orangefs-types.h in the OrangeFS source. */
static int PINT_errno_mapping[] = {
0, EPERM, ENOENT, EINTR, EIO, ENXIO, EBADF, EAGAIN, ENOMEM,
EFAULT, EBUSY, EEXIST, ENODEV, ENOTDIR, EISDIR, EINVAL, EMFILE,
@@ -672,7 +672,7 @@ static int PINT_errno_mapping[] = {
EACCES, ECONNRESET, ERANGE
};
-int pvfs2_normalize_to_errno(__s32 error_code)
+int orangefs_normalize_to_errno(__s32 error_code)
{
__u32 i;
@@ -684,24 +684,24 @@ int pvfs2_normalize_to_errno(__s32 error_code)
* server.
*/
} else if (error_code > 0) {
- gossip_err("pvfs2: error status receieved.\n");
- gossip_err("pvfs2: assuming error code is inverted.\n");
+ gossip_err("orangefs: error status receieved.\n");
+ gossip_err("orangefs: assuming error code is inverted.\n");
error_code = -error_code;
}
/*
- * XXX: This is very bad since error codes from PVFS2 may not be
+ * XXX: This is very bad since error codes from ORANGEFS may not be
* suitable for return into userspace.
*/
/*
- * Convert PVFS2 error values into errno values suitable for return
+ * Convert ORANGEFS error values into errno values suitable for return
* from the kernel.
*/
- if ((-error_code) & PVFS_NON_ERRNO_ERROR_BIT) {
+ if ((-error_code) & ORANGEFS_NON_ERRNO_ERROR_BIT) {
if (((-error_code) &
- (PVFS_ERROR_NUMBER_BITS|PVFS_NON_ERRNO_ERROR_BIT|
- PVFS_ERROR_BIT)) == PVFS_ECANCEL) {
+ (ORANGEFS_ERROR_NUMBER_BITS|ORANGEFS_NON_ERRNO_ERROR_BIT|
+ ORANGEFS_ERROR_BIT)) == ORANGEFS_ECANCEL) {
/*
* cancellation error codes generally correspond to
* a timeout from the client's perspective
@@ -709,30 +709,30 @@ int pvfs2_normalize_to_errno(__s32 error_code)
error_code = -ETIMEDOUT;
} else {
/* assume a default error code */
- gossip_err("pvfs2: warning: got error code without errno equivalent: %d.\n", error_code);
+ gossip_err("orangefs: warning: got error code without errno equivalent: %d.\n", error_code);
error_code = -EINVAL;
}
- /* Convert PVFS2 encoded errno values into regular errno values. */
- } else if ((-error_code) & PVFS_ERROR_BIT) {
- i = (-error_code) & ~(PVFS_ERROR_BIT|PVFS_ERROR_CLASS_BITS);
+ /* Convert ORANGEFS encoded errno values into regular errno values. */
+ } else if ((-error_code) & ORANGEFS_ERROR_BIT) {
+ i = (-error_code) & ~(ORANGEFS_ERROR_BIT|ORANGEFS_ERROR_CLASS_BITS);
if (i < sizeof(PINT_errno_mapping)/sizeof(*PINT_errno_mapping))
error_code = -PINT_errno_mapping[i];
else
error_code = -EINVAL;
/*
- * Only PVFS2 protocol error codes should ever come here. Otherwise
+ * Only ORANGEFS protocol error codes should ever come here. Otherwise
* there is a bug somewhere.
*/
} else {
- gossip_err("pvfs2: pvfs2_normalize_to_errno: got error code which is not from PVFS2.\n");
+ gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n");
}
return error_code;
}
#define NUM_MODES 11
-__s32 PVFS_util_translate_mode(int mode)
+__s32 ORANGEFS_util_translate_mode(int mode)
{
int ret = 0;
int i = 0;
@@ -742,16 +742,16 @@ __s32 PVFS_util_translate_mode(int mode)
S_IXUSR, S_IWUSR, S_IRUSR,
S_ISGID, S_ISUID
};
- static int pvfs2_modes[NUM_MODES] = {
- PVFS_O_EXECUTE, PVFS_O_WRITE, PVFS_O_READ,
- PVFS_G_EXECUTE, PVFS_G_WRITE, PVFS_G_READ,
- PVFS_U_EXECUTE, PVFS_U_WRITE, PVFS_U_READ,
- PVFS_G_SGID, PVFS_U_SUID
+ static int orangefs_modes[NUM_MODES] = {
+ ORANGEFS_O_EXECUTE, ORANGEFS_O_WRITE, ORANGEFS_O_READ,
+ ORANGEFS_G_EXECUTE, ORANGEFS_G_WRITE, ORANGEFS_G_READ,
+ ORANGEFS_U_EXECUTE, ORANGEFS_U_WRITE, ORANGEFS_U_READ,
+ ORANGEFS_G_SGID, ORANGEFS_U_SUID
};
for (i = 0; i < NUM_MODES; i++)
if (mode & modes[i])
- ret |= pvfs2_modes[i];
+ ret |= orangefs_modes[i];
return ret;
}
@@ -813,10 +813,10 @@ int orangefs_prepare_cdm_array(char *debug_array_string)
(unsigned long long *)&(cdm_array[i].mask1),
(unsigned long long *)&(cdm_array[i].mask2));
- if (!strcmp(cdm_array[i].keyword, PVFS2_VERBOSE))
+ if (!strcmp(cdm_array[i].keyword, ORANGEFS_VERBOSE))
client_verbose_index = i;
- if (!strcmp(cdm_array[i].keyword, PVFS2_ALL))
+ if (!strcmp(cdm_array[i].keyword, ORANGEFS_ALL))
client_all_index = i;
cds_head = cds_delimiter + 1;
@@ -952,7 +952,7 @@ void debug_mask_to_string(void *mask, int type)
element_count = num_kmod_keyword_mask_map;
}
- memset(debug_string, 0, PVFS2_MAX_DEBUG_STRING_LEN);
+ memset(debug_string, 0, ORANGEFS_MAX_DEBUG_STRING_LEN);
/*
* Some keywords, like "all" or "verbose", are amalgams of
@@ -998,13 +998,13 @@ void do_k_string(void *k_mask, int index)
if (*mask & s_kmod_keyword_mask_map[index].mask_val) {
if ((strlen(kernel_debug_string) +
strlen(s_kmod_keyword_mask_map[index].keyword))
- < PVFS2_MAX_DEBUG_STRING_LEN - 1) {
+ < ORANGEFS_MAX_DEBUG_STRING_LEN - 1) {
strcat(kernel_debug_string,
s_kmod_keyword_mask_map[index].keyword);
strcat(kernel_debug_string, ",");
} else {
gossip_err("%s: overflow!\n", __func__);
- strcpy(kernel_debug_string, PVFS2_ALL);
+ strcpy(kernel_debug_string, ORANGEFS_ALL);
goto out;
}
}
@@ -1025,13 +1025,13 @@ void do_c_string(void *c_mask, int index)
(mask->mask2 & cdm_array[index].mask2)) {
if ((strlen(client_debug_string) +
strlen(cdm_array[index].keyword) + 1)
- < PVFS2_MAX_DEBUG_STRING_LEN - 2) {
+ < ORANGEFS_MAX_DEBUG_STRING_LEN - 2) {
strcat(client_debug_string,
cdm_array[index].keyword);
strcat(client_debug_string, ",");
} else {
gossip_err("%s: overflow!\n", __func__);
- strcpy(client_debug_string, PVFS2_ALL);
+ strcpy(client_debug_string, ORANGEFS_ALL);
goto out;
}
}
@@ -1043,7 +1043,7 @@ int keyword_is_amalgam(char *keyword)
{
int rc = 0;
- if ((!strcmp(keyword, PVFS2_ALL)) || (!strcmp(keyword, PVFS2_VERBOSE)))
+ if ((!strcmp(keyword, ORANGEFS_ALL)) || (!strcmp(keyword, ORANGEFS_VERBOSE)))
rc = 1;
return rc;
@@ -1067,14 +1067,14 @@ int check_amalgam_keyword(void *mask, int type)
if ((c_mask->mask1 == cdm_array[client_all_index].mask1) &&
(c_mask->mask2 == cdm_array[client_all_index].mask2)) {
- strcpy(client_debug_string, PVFS2_ALL);
+ strcpy(client_debug_string, ORANGEFS_ALL);
rc = 1;
goto out;
}
if ((c_mask->mask1 == cdm_array[client_verbose_index].mask1) &&
(c_mask->mask2 == cdm_array[client_verbose_index].mask2)) {
- strcpy(client_debug_string, PVFS2_VERBOSE);
+ strcpy(client_debug_string, ORANGEFS_VERBOSE);
rc = 1;
goto out;
}
@@ -1083,7 +1083,7 @@ int check_amalgam_keyword(void *mask, int type)
k_mask = (__u64 *) mask;
if (*k_mask >= s_kmod_keyword_mask_map[k_all_index].mask_val) {
- strcpy(kernel_debug_string, PVFS2_ALL);
+ strcpy(kernel_debug_string, ORANGEFS_ALL);
rc = 1;
goto out;
}