Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

orangefs: formatting cleanups

Signed-off-by: Mike Marshall <hubcap@omnibond.com>

+55 -39
+10 -7
fs/orangefs/devorangefs-req.c
··· 281 281 ret = copy_to_user(buf, &proto_ver, sizeof(__s32)); 282 282 if (ret != 0) 283 283 goto error; 284 - ret = copy_to_user(buf+sizeof(__s32), &magic, sizeof(__s32)); 284 + ret = copy_to_user(buf + sizeof(__s32), &magic, sizeof(__s32)); 285 285 if (ret != 0) 286 286 goto error; 287 - ret = copy_to_user(buf+2 * sizeof(__s32), &cur_op->tag, sizeof(__u64)); 287 + ret = copy_to_user(buf + 2 * sizeof(__s32), 288 + &cur_op->tag, 289 + sizeof(__u64)); 288 290 if (ret != 0) 289 291 goto error; 290 - ret = copy_to_user(buf+2*sizeof(__s32)+sizeof(__u64), &cur_op->upcall, 291 - sizeof(struct orangefs_upcall_s)); 292 + ret = copy_to_user(buf + 2 * sizeof(__s32) + sizeof(__u64), 293 + &cur_op->upcall, 294 + sizeof(struct orangefs_upcall_s)); 292 295 if (ret != 0) 293 296 goto error; 294 297 ··· 384 381 (unsigned int) MAX_DEV_REQ_DOWNSIZE); 385 382 return -EFAULT; 386 383 } 387 - 384 + 388 385 if (!copy_from_iter_full(&head, head_size, iter)) { 389 386 gossip_err("%s: failed to copy head.\n", __func__); 390 387 return -EFAULT; ··· 429 426 goto wakeup; 430 427 431 428 /* 432 - * We've successfully peeled off the head and the downcall. 429 + * We've successfully peeled off the head and the downcall. 433 430 * Something has gone awry if total doesn't equal the 434 431 * sum of head_size, downcall_size and trailer_size. 435 432 */ ··· 480 477 wakeup: 481 478 /* 482 479 * Return to vfs waitqueue, and back to service_operation 483 - * through wait_for_matching_downcall. 480 + * through wait_for_matching_downcall. 484 481 */ 485 482 spin_lock(&op->lock); 486 483 if (unlikely(op_is_cancel(op))) {
+1 -1
fs/orangefs/file.c
··· 162 162 else 163 163 ret = 0; 164 164 break; 165 - /* 165 + /* 166 166 * If the op was in progress when the interrupt 167 167 * occurred, then the client-core was able to 168 168 * trigger the write.
+26 -18
fs/orangefs/inode.c
··· 181 181 new_op->upcall.req.truncate.refn = orangefs_inode->refn; 182 182 new_op->upcall.req.truncate.size = (__s64) iattr->ia_size; 183 183 184 - ret = service_operation(new_op, __func__, 185 - get_interruptible_flag(inode)); 184 + ret = service_operation(new_op, 185 + __func__, 186 + get_interruptible_flag(inode)); 186 187 187 188 /* 188 189 * the truncate has no downcall members to retrieve, but 189 190 * the status value tells us if it went through ok or not 190 191 */ 191 - gossip_debug(GOSSIP_INODE_DEBUG, 192 - "orangefs: orangefs_truncate got return value of %d\n", 193 - ret); 192 + gossip_debug(GOSSIP_INODE_DEBUG, "%s: ret:%d:\n", __func__, ret); 194 193 195 194 op_release(new_op); 196 195 ··· 211 212 struct inode *inode = dentry->d_inode; 212 213 213 214 gossip_debug(GOSSIP_INODE_DEBUG, 214 - "orangefs_setattr: called on %pd\n", 215 - dentry); 215 + "%s: called on %pd\n", 216 + __func__, 217 + dentry); 216 218 217 219 ret = setattr_prepare(dentry, iattr); 218 220 if (ret) ··· 230 230 231 231 ret = orangefs_inode_setattr(inode, iattr); 232 232 gossip_debug(GOSSIP_INODE_DEBUG, 233 - "orangefs_setattr: inode_setattr returned %d\n", 234 - ret); 233 + "%s: orangefs_inode_setattr returned %d\n", 234 + __func__, 235 + ret); 235 236 236 237 if (!ret && (iattr->ia_valid & ATTR_MODE)) 237 238 /* change mod on a file that has ACLs */ 238 239 ret = posix_acl_chmod(inode, inode->i_mode); 239 240 240 241 out: 241 - gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_setattr: returning %d\n", ret); 242 + gossip_debug(GOSSIP_INODE_DEBUG, "%s: ret:%d:\n", __func__, ret); 242 243 return ret; 243 244 } 244 245 ··· 313 312 return orangefs_inode_setattr(inode, &iattr); 314 313 } 315 314 316 - /* ORANGEDS2 implementation of VFS inode operations for files */ 315 + /* ORANGEFS2 implementation of VFS inode operations for files */ 317 316 static const struct inode_operations orangefs_file_inode_operations = { 318 317 .get_acl = orangefs_get_acl, 319 318 .set_acl = orangefs_set_acl, ··· 351 350 } 352 351 353 352 /* 354 - * Given a ORANGEFS object identifier (fsid, handle), convert it into a ino_t type 355 - * that will be used as a hash-index from where the handle will 353 + * Given an ORANGEFS object identifier (fsid, handle), convert it into 354 + * a ino_t type that will be used as a hash-index from where the handle will 356 355 * be searched for in the VFS hash table of inodes. 357 356 */ 358 357 static inline ino_t orangefs_handle_hash(struct orangefs_object_kref *ref) ··· 382 381 struct orangefs_inode_s *orangefs_inode = NULL; 383 382 384 383 orangefs_inode = ORANGEFS_I(inode); 385 - return (!ORANGEFS_khandle_cmp(&(orangefs_inode->refn.khandle), &(ref->khandle)) 386 - && orangefs_inode->refn.fs_id == ref->fs_id); 384 + /* test handles and fs_ids... */ 385 + return (!ORANGEFS_khandle_cmp(&(orangefs_inode->refn.khandle), 386 + &(ref->khandle)) && 387 + orangefs_inode->refn.fs_id == ref->fs_id); 387 388 } 388 389 389 390 /* ··· 393 390 * file handle. 394 391 * 395 392 * @sb: the file system super block instance. 396 - * @ref: The ORANGEFS object for which we are trying to locate an inode structure. 393 + * @ref: The ORANGEFS object for which we are trying to locate an inode. 397 394 */ 398 - struct inode *orangefs_iget(struct super_block *sb, struct orangefs_object_kref *ref) 395 + struct inode *orangefs_iget(struct super_block *sb, 396 + struct orangefs_object_kref *ref) 399 397 { 400 398 struct inode *inode = NULL; 401 399 unsigned long hash; 402 400 int error; 403 401 404 402 hash = orangefs_handle_hash(ref); 405 - inode = iget5_locked(sb, hash, orangefs_test_inode, orangefs_set_inode, ref); 403 + inode = iget5_locked(sb, 404 + hash, 405 + orangefs_test_inode, 406 + orangefs_set_inode, 407 + ref); 406 408 if (!inode || !(inode->i_state & I_NEW)) 407 409 return inode; 408 410
+2 -2
fs/orangefs/orangefs-bufmap.c
··· 184 184 } 185 185 186 186 /* 187 - * XXX: Can the size and shift change while the caller gives up the 187 + * XXX: Can the size and shift change while the caller gives up the 188 188 * XXX: lock between calling this and doing something useful? 189 189 */ 190 190 ··· 496 496 } 497 497 498 498 /* 499 - * we've been handed an iovec, we need to copy it to 499 + * we've been handed an iovec, we need to copy it to 500 500 * the shared memory descriptor at "buffer_index". 501 501 */ 502 502 int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
+11 -7
fs/orangefs/orangefs-utils.c
··· 183 183 attrs->mask |= ORANGEFS_ATTR_SYS_CTIME; 184 184 185 185 /* 186 - * ORANGEFS cannot set size with a setattr operation. Probably not likely 187 - * to be requested through the VFS, but just in case, don't worry about 188 - * ATTR_SIZE 186 + * ORANGEFS cannot set size with a setattr operation. Probably not 187 + * likely to be requested through the VFS, but just in case, don't 188 + * worry about ATTR_SIZE 189 189 */ 190 190 191 191 if (iattr->ia_valid & ATTR_MODE) { ··· 200 200 tmp_mode -= S_ISVTX; 201 201 } else { 202 202 gossip_debug(GOSSIP_UTILS_DEBUG, 203 - "User attempted to set sticky bit on non-root directory; returning EINVAL.\n"); 203 + "%s: setting sticky bit not supported.\n", 204 + __func__); 204 205 return -EINVAL; 205 206 } 206 207 } 207 208 208 209 if (tmp_mode & (S_ISUID)) { 209 210 gossip_debug(GOSSIP_UTILS_DEBUG, 210 - "Attempting to set setuid bit (not supported); returning EINVAL.\n"); 211 + "%s: setting setuid bit not supported.\n", 212 + __func__); 211 213 return -EINVAL; 212 214 } 213 215 ··· 523 521 error_code = -ETIMEDOUT; 524 522 } else { 525 523 /* assume a default error code */ 526 - gossip_err("orangefs: warning: got error code without errno equivalent: %d.\n", error_code); 524 + gossip_err("%s: bad error code :%d:.\n", 525 + __func__, 526 + error_code); 527 527 error_code = -EINVAL; 528 528 } 529 529 ··· 542 538 * there is a bug somewhere. 543 539 */ 544 540 } else { 545 - gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n"); 541 + gossip_err("%s: unknown error code.\n", __func__); 546 542 error_code = -EINVAL; 547 543 } 548 544 return error_code;
+5 -4
fs/orangefs/super.c
··· 156 156 sb = dentry->d_sb; 157 157 158 158 gossip_debug(GOSSIP_SUPER_DEBUG, 159 - "orangefs_statfs: called on sb %p (fs_id is %d)\n", 160 - sb, 161 - (int)(ORANGEFS_SB(sb)->fs_id)); 159 + "%s: called on sb %p (fs_id is %d)\n", 160 + __func__, 161 + sb, 162 + (int)(ORANGEFS_SB(sb)->fs_id)); 162 163 163 164 new_op = op_alloc(ORANGEFS_VFS_OP_STATFS); 164 165 if (!new_op) ··· 199 198 200 199 out_op_release: 201 200 op_release(new_op); 202 - gossip_debug(GOSSIP_SUPER_DEBUG, "orangefs_statfs: returning %d\n", ret); 201 + gossip_debug(GOSSIP_SUPER_DEBUG, "%s: returning %d\n", __func__, ret); 203 202 return ret; 204 203 } 205 204