*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
#include <fcntl.h>
#include <unistd.h>
#include <poll.h>
+#include <sys/ioctl.h>
#include <time.h>
#include <lustre/lustreapi.h>
-#include <lustre/lustre_idl.h>
+#include <linux/lustre/lustre_idl.h>
#define ERROR(fmt, ...) \
fprintf(stderr, "%s: %s:%d: %s: " fmt "\n", \
* file/directory */
static void helper_fid2path(const char *filename, int fd)
{
- lustre_fid fid;
- lustre_fid fid2;
- lustre_fid fid3;
+ struct lu_fid fid;
+ struct lu_fid fid2;
+ struct lu_fid fid3;
char fidstr[FID_LEN + 1];
char path1[PATH_MAX];
char path2[PATH_MAX];
{
int rc;
int fd;
- lustre_fid fid;
+ struct lu_fid fid;
char fidstr[FID_LEN + 1];
char path[PATH_MAX];
long long recno;
int fd;
int fd2;
int fd3;
- lustre_fid fid;
+ struct lu_fid fid;
/* Against a volatile file */
rc = mkdir(mainpath, 0);
ASSERTF(rc == 0, "mkdir failed for '%s': %s",
mainpath, strerror(errno));
- fd = llapi_create_volatile_idx(mainpath, -1, 0600);
+ fd = llapi_create_volatile_idx(mainpath, -1, 0);
ASSERTF(fd >= 0, "creat failed for '%s': %s",
mainpath, strerror(errno));
mainpath, strerror(-rc));
/* No many ways to test, except to open by fid. */
- fd2 = llapi_open_by_fid(mainpath, &fid, 0600);
+ fd2 = llapi_open_by_fid(mainpath, &fid, O_RDONLY);
ASSERTF(fd2 >= 0, "llapi_open_by_fid for " DFID_NOBRACE ": %s",
PFID(&fid), strerror(errno));
/* Check the file can still be opened, since fd2 is not
* closed. */
- fd3 = llapi_open_by_fid(mainpath, &fid, 0600);
+ fd3 = llapi_open_by_fid(mainpath, &fid, O_RDONLY);
ASSERTF(fd3 >= 0, "llapi_open_by_fid for " DFID_NOBRACE ": %s",
PFID(&fid), strerror(errno));
close(fd3);
/* The volatile file is gone now. */
- fd = llapi_open_by_fid(mainpath, &fid, 0600);
+ fd = llapi_open_by_fid(mainpath, &fid, O_RDONLY);
ASSERTF(fd < 0, "llapi_open_by_fid for " DFID_NOBRACE ": %d",
PFID(&fid), fd);
}
} links[num_links];
char buf[PATH_MAX];
char buf2[PATH_MAX];
- lustre_fid fid;
+ struct lu_fid fid;
char fidstr[FID_LEN + 1];
int rc;
int i;
* type). mainpath must exist. */
static void help_test40(void)
{
- lustre_fid parent_fid;
- lustre_fid fid2;
+ struct lu_fid parent_fid;
+ struct lu_fid fid2;
char buf[PATH_MAX];
int rc;
const int num_links = 100;
struct {
char subdir[PATH_MAX];
- lustre_fid subdir_fid;
+ struct lu_fid subdir_fid;
char filename[PATH_MAX];
bool seen;
} links[num_links];
int i;
int fd;
int linkno;
- lustre_fid parent_fid;
+ struct lu_fid parent_fid;
/* Create the containing directory. */
rc = mkdir(mainpath, 0);