Whamcloud - gitweb
osc/osc_request.c: replace "n" with "pages", as "n" is not defined anywhere.
authoradilger <adilger>
Tue, 9 Apr 2002 21:55:56 +0000 (21:55 +0000)
committeradilger <adilger>
Tue, 9 Apr 2002 21:55:56 +0000 (21:55 +0000)
others: minor cleanups.

lustre/include/linux/lustre_mds.h
lustre/mds/mds_ext2.c
lustre/mds/mds_ext3.c
lustre/osc/osc_request.c
lustre/tests/runfailure-net
lustre/tests/testreq.c

index f158be2..52a1d97 100644 (file)
@@ -142,11 +142,18 @@ static inline int mds_fs_commit(struct mds_obd *mds, struct inode *inode,
 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);
 }
index 85e0461..bd75fcd 100644 (file)
@@ -38,7 +38,7 @@ static int mds_ext2_setattr(struct dentry *dentry, void *handle,
            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;
index 856bf74..7ebd6a2 100644 (file)
@@ -67,7 +67,7 @@ static int mds_ext3_setattr(struct dentry *dentry, void *handle,
            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;
index b8869ba..fb2c6da 100644 (file)
@@ -530,7 +530,7 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa,
  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;
index a8e53c7..8a84b47 100755 (executable)
@@ -14,9 +14,9 @@ test_fail() {
         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
index 8580a58..351e506 100644 (file)
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
 {
         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},
@@ -111,8 +111,8 @@ int main(int argc, char **argv)
                         arg = strtoul(optarg, NULL, 0);
                         break;
                 case '?':
+                default:
                         usage(argv[0], 1);
-                        break;
                 }
         } while (c != -1);