others: minor cleanups.
static inline int mds_fs_setattr(struct mds_obd *mds, struct dentry *dentry,
void *handle, struct iattr *iattr)
{
+ /*
+ * NOTE: we probably don't need to take i_sem here when changing
+ * ATTR_SIZE because the MDS never needs to truncate a file.
+ * The ext2/ext3 code never truncates a directory, and files
+ * stored on the MDS are entirely sparse (no data blocks).
+ * If we do need to get it, we can do it here.
+ */
return mds->mds_fsops->fs_setattr(dentry, handle, iattr);
}
static inline int mds_fs_set_objid(struct mds_obd *mds, struct inode *inode,
- void *handle, __u64 id)
+ void *handle, __u64 id)
{
return mds->mds_fsops->fs_set_objid(inode, handle, id);
}
in the block pointers; this data is the object id
this will go into an extended attribute at some point.
*/
- if (iattr->ia_valid & ATTR_SIZE ) {
+ if (iattr->ia_valid & ATTR_SIZE) {
/* ATTR_SIZE would invoke truncate: clear it */
iattr->ia_valid &= ~ATTR_SIZE;
inode->i_size = iattr->ia_size;
in the block pointers; this data is the object id
this will go into an extended attribute at some point.
*/
- if ( iattr->ia_valid & ATTR_SIZE ) {
+ if (iattr->ia_valid & ATTR_SIZE) {
/* ATTR_SIZE would invoke truncate: clear it */
iattr->ia_valid &= ~ATTR_SIZE;
inode->i_size = iattr->ia_size;
out:
for (pages = 0, i = 0; i < num_oa; i++)
for (j = 0; j < oa_bufs[i]; j++, pages++)
- kunmap(buf[n]);
+ kunmap(buf[pages]);
ptlrpc_free_req(request);
return 0;
mount -t lustre_lite -o device=3 none /mnt/lustre
}
-mknod /dev/request c 10 244
+[ -c /dev/request ] || mknod /dev/request c 10 244
-sh llmount.sh
+echo | sh llmount.sh || exit -1
# GETATTR_NET - ls will hang on the getattr
test_fail 0x102 ls -l /mnt/lustre
{
int fd, rc, c, cmd = 0;
unsigned long arg;
- char *short_opts = "h", *name;
+ char *short_opts = "h", *name = argv[0];
static struct option long_opts[] = {
#define OPT_GETATTR -2
{"getattr", no_argument, NULL, OPT_GETATTR},
arg = strtoul(optarg, NULL, 0);
break;
case '?':
+ default:
usage(argv[0], 1);
- break;
}
} while (c != -1);