aboutsummaryrefslogtreecommitdiff
path: root/fs/orangefs/orangefs-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/orangefs/orangefs-utils.c')
-rw-r--r--fs/orangefs/orangefs-utils.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 00fadaf0da8f..804c8a261e4b 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -183,9 +183,9 @@ static inline int copy_attributes_from_inode(struct inode *inode,
attrs->mask |= ORANGEFS_ATTR_SYS_CTIME;
/*
- * 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
+ * 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
*/
if (iattr->ia_valid & ATTR_MODE) {
@@ -200,14 +200,16 @@ static inline int copy_attributes_from_inode(struct inode *inode,
tmp_mode -= S_ISVTX;
} else {
gossip_debug(GOSSIP_UTILS_DEBUG,
- "User attempted to set sticky bit on non-root directory; returning EINVAL.\n");
+ "%s: setting sticky bit not supported.\n",
+ __func__);
return -EINVAL;
}
}
if (tmp_mode & (S_ISUID)) {
gossip_debug(GOSSIP_UTILS_DEBUG,
- "Attempting to set setuid bit (not supported); returning EINVAL.\n");
+ "%s: setting setuid bit not supported.\n",
+ __func__);
return -EINVAL;
}
@@ -275,7 +277,7 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass,
{
struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
struct orangefs_kernel_op_s *new_op;
- loff_t inode_size, rounded_up_size;
+ loff_t inode_size;
int ret, type;
gossip_debug(GOSSIP_UTILS_DEBUG, "%s: called on inode %pU\n", __func__,
@@ -330,22 +332,19 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass,
if (request_mask & STATX_SIZE || new) {
inode_size = (loff_t)new_op->
downcall.resp.getattr.attributes.size;
- rounded_up_size =
- (inode_size + (4096 - (inode_size % 4096)));
inode->i_size = inode_size;
- orangefs_inode->blksize =
- new_op->downcall.resp.getattr.attributes.blksize;
+ inode->i_blkbits = ffs(new_op->downcall.resp.getattr.
+ attributes.blksize);
spin_lock(&inode->i_lock);
inode->i_bytes = inode_size;
inode->i_blocks =
- (unsigned long)(rounded_up_size / 512);
+ (inode_size + 512 - inode_size % 512)/512;
spin_unlock(&inode->i_lock);
}
break;
case S_IFDIR:
if (request_mask & STATX_SIZE || new) {
inode->i_size = PAGE_SIZE;
- orangefs_inode->blksize = i_blocksize(inode);
spin_lock(&inode->i_lock);
inode_set_bytes(inode, inode->i_size);
spin_unlock(&inode->i_lock);
@@ -356,7 +355,6 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass,
if (new) {
inode->i_size = (loff_t)strlen(new_op->
downcall.resp.getattr.link_target);
- orangefs_inode->blksize = i_blocksize(inode);
ret = strscpy(orangefs_inode->link_target,
new_op->downcall.resp.getattr.link_target,
ORANGEFS_NAME_MAX);
@@ -525,7 +523,9 @@ int orangefs_normalize_to_errno(__s32 error_code)
error_code = -ETIMEDOUT;
} else {
/* assume a default error code */
- gossip_err("orangefs: warning: got error code without errno equivalent: %d.\n", error_code);
+ gossip_err("%s: bad error code :%d:.\n",
+ __func__,
+ error_code);
error_code = -EINVAL;
}
@@ -542,7 +542,7 @@ int orangefs_normalize_to_errno(__s32 error_code)
* there is a bug somewhere.
*/
} else {
- gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n");
+ gossip_err("%s: unknown error code.\n", __func__);
error_code = -EINVAL;
}
return error_code;